mirror of
https://github.com/trudnai/Steve2.git
synced 2024-06-02 14:41:30 +00:00
Resizable window
Fullscreen Mode
This commit is contained in:
parent
2e2279cc10
commit
1f473a1336
|
@ -20,7 +20,6 @@
|
|||
323E2DD1245531E600156805 /* Apple2e.rom in Resources */ = {isa = PBXBuildFile; fileRef = 323E2DCD245531E500156805 /* Apple2e.rom */; };
|
||||
32440BA32480D5C0000F9DA1 /* LoRes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32440BA22480D5C0000F9DA1 /* LoRes.swift */; };
|
||||
324D15D324ADAC71008AAFB0 /* floppy.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 324D15D224ADAC71008AAFB0 /* floppy.png */; };
|
||||
3254418B264A6A9D00B7E3ED /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32BFFB6022EACC660003B53F /* Main.storyboard */; };
|
||||
32544195264A6C1600B7E3ED /* DisplayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32544194264A6C1600B7E3ED /* DisplayView.swift */; };
|
||||
325DC40E24AC5ABC00EB8858 /* doc.on.doc.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 325DC40D24AC5ABC00EB8858 /* doc.on.doc.png */; };
|
||||
325DC41024AC691B00EB8858 /* rgb_color.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 325DC40F24AC691B00EB8858 /* rgb_color.png */; };
|
||||
|
@ -61,6 +60,8 @@
|
|||
3267641824BCC9A5000BEA11 /* COPYING in Resources */ = {isa = PBXBuildFile; fileRef = 3267641724BCC9A5000BEA11 /* COPYING */; };
|
||||
326B56E524AD8E89009BA0AC /* gobackward.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 326B56E424AD8E89009BA0AC /* gobackward.png */; };
|
||||
326B56E724AD906D009BA0AC /* doc.text.viewfinder.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 326B56E624AD906D009BA0AC /* doc.text.viewfinder.png */; };
|
||||
3277D779273AE0DA00749544 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32BFFB6022EACC660003B53F /* Main.storyboard */; };
|
||||
3277D783273AE0DC00749544 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32BFFB6022EACC660003B53F /* Main.storyboard */; };
|
||||
32799F7A264B1A5700255669 /* DisplayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32544194264A6C1600B7E3ED /* DisplayView.swift */; };
|
||||
32799F7B264B1A5700255669 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BFFB5A22EACC630003B53F /* AppDelegate.swift */; };
|
||||
32799F7C264B1A5700255669 /* ToolBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32E3126C24AC033A00E61891 /* ToolBarController.swift */; };
|
||||
|
@ -77,7 +78,6 @@
|
|||
32799F88264B1A5700255669 /* RepeatingTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32C45305232E3EEF0000EBA1 /* RepeatingTimer.swift */; };
|
||||
32799F8A264B1A5700255669 /* MonitorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32C4532D233345420000EBA1 /* MonitorView.swift */; };
|
||||
32799F8D264B1A5700255669 /* COPYING in Resources */ = {isa = PBXBuildFile; fileRef = 3267641724BCC9A5000BEA11 /* COPYING */; };
|
||||
32799F8E264B1A5700255669 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32BFFB6022EACC660003B53F /* Main.storyboard */; };
|
||||
32799F8F264B1A5700255669 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 32BFFB5E22EACC660003B53F /* Assets.xcassets */; };
|
||||
32799F90264B1A5700255669 /* Preferences.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 323D042D248980600086A901 /* Preferences.storyboard */; };
|
||||
32799F91264B1A5700255669 /* Steve2Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 320F2A8724CFD74000671B35 /* Steve2Icon.icns */; };
|
||||
|
@ -1448,8 +1448,8 @@
|
|||
files = (
|
||||
32BCCD1A2650D3B1002151C5 /* Debug-Info.plist in Resources */,
|
||||
32799F8D264B1A5700255669 /* COPYING in Resources */,
|
||||
32799F8E264B1A5700255669 /* Main.storyboard in Resources */,
|
||||
32799F8F264B1A5700255669 /* Assets.xcassets in Resources */,
|
||||
3277D783273AE0DC00749544 /* Main.storyboard in Resources */,
|
||||
32799F90264B1A5700255669 /* Preferences.storyboard in Resources */,
|
||||
32799F91264B1A5700255669 /* Steve2Icon.icns in Resources */,
|
||||
);
|
||||
|
@ -1461,8 +1461,8 @@
|
|||
files = (
|
||||
32BCCD192650D3B1002151C5 /* Debug-Info.plist in Resources */,
|
||||
3267641824BCC9A5000BEA11 /* COPYING in Resources */,
|
||||
3254418B264A6A9D00B7E3ED /* Main.storyboard in Resources */,
|
||||
32BFFB5F22EACC660003B53F /* Assets.xcassets in Resources */,
|
||||
3277D779273AE0DA00749544 /* Main.storyboard in Resources */,
|
||||
323D042E248980600086A901 /* Preferences.storyboard in Resources */,
|
||||
320F2A8824CFD74100671B35 /* Steve2Icon.icns in Resources */,
|
||||
);
|
||||
|
|
|
@ -22,10 +22,13 @@
|
|||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "ViewController.extraBuf(_:):ViewController.swift">
|
||||
contextName = "BRA:6502_instr_branch.h">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "soundGapLabel">
|
||||
value = "">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "RAM[0x346f]">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -72,7 +75,7 @@
|
|||
contextName = "closure #1 in ViewController.Update():ViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "txtArr">
|
||||
value = "MEMcfg.is_80STORE">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "self.shadowTxt">
|
||||
|
@ -84,7 +87,7 @@
|
|||
value = "MEMcfg.txt_page_2">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "MEMcfg.is_80STORE">
|
||||
value = "txtArr">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -151,6 +154,20 @@
|
|||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "HiRes.refreshChanged(blockSize:):HiRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "frame">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "bounds">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "frame.width / Float(HiRes.blockCols)">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "addr_abs:mmio.h">
|
||||
<PersistentStrings>
|
||||
|
@ -286,10 +303,10 @@
|
|||
contextName = "spkr_update:speaker.c">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "clk_6502_per_frm_max">
|
||||
value = "(uint8_t)spkr_samples[452]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(uint8_t)spkr_samples[452]">
|
||||
value = "clk_6502_per_frm_max">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "spkr_sample_idx">
|
||||
|
@ -297,15 +314,15 @@
|
|||
<PersistentString
|
||||
value = "(uint8_t)spkr_samples[451]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "clkfrm">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(uint8_t)spkr_samples[455]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "clk_6502_per_frm">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "clkfrm">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
|
@ -350,6 +367,20 @@
|
|||
<ContextState
|
||||
contextName = "set_flags_NZ:common.h">
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "MonitorView.frameDidChange(notification:):MonitorView.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "frame.size">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay.bounds">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay.frame">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "pdl_read:paddle.h">
|
||||
<PersistentStrings>
|
||||
|
@ -360,7 +391,7 @@
|
|||
value = "pdl_value[pdl]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "normalized_time >= pdl_value[pdl] ? 255 : 0">
|
||||
value = "normalized_time">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(3300 * 255/3300)">
|
||||
|
@ -372,7 +403,7 @@
|
|||
value = "1 * 512 * (1 - ( 3300 / 3300.0 ))">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "normalized_time">
|
||||
value = "normalized_time >= pdl_value[pdl] ? 255 : 0">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -386,19 +417,25 @@
|
|||
value = "y">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textLines">
|
||||
value = "hires.frame">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "hires.layer">
|
||||
value = "textDisplay.bounds">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "view">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ledingInitEdgeLabel">
|
||||
value = "hires.layer">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "hires.frame">
|
||||
value = "textDisplay.frame">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textLines">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ledingInitEdgeLabel">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -414,7 +451,7 @@
|
|||
contextName = "LoRes.Update():LoRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "blockChanged[ screenIdx ]">
|
||||
value = "UInt8( (block >> 4) & 0x0F )">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "UInt8(block)">
|
||||
|
@ -423,7 +460,7 @@
|
|||
value = "UInt8(block & 4)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "UInt8( (block >> 4) & 0x0F )">
|
||||
value = "blockChanged[ screenIdx ]">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -458,10 +495,10 @@
|
|||
contextName = "set_flags_NZC:common.h">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "(unsigned)test ">
|
||||
value = "(unsigned)0xFF">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(unsigned)0xFF">
|
||||
value = "(unsigned)test ">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -527,14 +564,6 @@
|
|||
<ContextState
|
||||
contextName = "rel_addr:Apple2_mmio.h">
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "ViewController.Reset(_:):ViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "m6502.pc">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "ViewController.setCPUClockSpeed(freq:):ViewController.swift">
|
||||
<PersistentStrings>
|
||||
|
@ -552,6 +581,14 @@
|
|||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "ViewController.Reset(_:):ViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "m6502.pc">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "ioRead:Apple2_mmio.h">
|
||||
<PersistentStrings>
|
||||
|
@ -591,16 +628,16 @@
|
|||
contextName = "spkr_toggle:speaker.c">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "( (spkr_clk + m6502.clkfrm) / ( 1024000 / spkr_sample_rate ) ) * 2">
|
||||
value = "(int16_t)28000 + (int16_t)-32768">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "spkr_level">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "spkr_sample_idx">
|
||||
value = "( (spkr_clk + m6502.clkfrm) / ( 1024000 / spkr_sample_rate ) ) * 2">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(int16_t)28000 + (int16_t)-32768">
|
||||
value = "spkr_sample_idx">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "28000 + fadeLevel">
|
||||
|
@ -614,10 +651,10 @@
|
|||
contextName = "HiRes.draw(_:):HiRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "linAddr">
|
||||
value = "ctx?.height">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bitsPerComponent">
|
||||
value = "ctx?.data">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.width">
|
||||
|
@ -640,15 +677,15 @@
|
|||
<PersistentString
|
||||
value = "(blockH7 | ( block & bitMask ))">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bitsPerComponent">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "linAddr">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "HiRes.blockCols">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.height">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.data">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
|
@ -663,13 +700,13 @@
|
|||
contextName = "HiRes.compute():HiRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "computePipelineState.maxTotalThreadsPerThreadgroup">
|
||||
value = "UnsafeRawBufferPointer(result)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "result[2]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "UnsafeRawBufferPointer(result)">
|
||||
value = "computePipelineState.maxTotalThreadsPerThreadgroup">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -717,6 +754,9 @@
|
|||
<PersistentString
|
||||
value = "m6502">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(void*)Apple2_64K_RAM">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.PC">
|
||||
</PersistentString>
|
||||
|
@ -726,9 +766,6 @@
|
|||
<PersistentString
|
||||
value = "Apple2_64K_RAM + 0x3600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(void*)Apple2_64K_RAM">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
|
@ -783,7 +820,7 @@
|
|||
value = "new">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZwrite.shift16">
|
||||
value = "WOZtmp.shift16">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZwrite.shift">
|
||||
|
@ -795,7 +832,7 @@
|
|||
value = "(1 << i) - 1">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZtmp.shift16">
|
||||
value = "WOZwrite.shift16">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -813,6 +850,17 @@
|
|||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "DisplayView.frameDidChange(notification:):DisplayView.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "frame.size">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "bounds">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "memwrite8_bank2:mmio.h">
|
||||
<PersistentStrings>
|
||||
|
@ -831,10 +879,10 @@
|
|||
value = "Apple2_64K_AUX + 0xC600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(void*)rom">
|
||||
value = "Apple2_64K_RAM + 0xC600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_RAM + 0xC600">
|
||||
value = "(void*)rom">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "strlen(fullPath)">
|
||||
|
@ -873,13 +921,21 @@
|
|||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "BRA:6502_instr_branch.h">
|
||||
contextName = "MonitorView.init(coder:):MonitorView.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "">
|
||||
value = "frame.size">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "RAM[0x346f]">
|
||||
value = "textDisplay">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "ViewController.extraBuf(_:):ViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "soundGapLabel">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -193,19 +193,19 @@ class HiRes: NSView {
|
|||
|
||||
let screenBlockMargin = 12 / blockSize
|
||||
|
||||
let blockScreenWidth = Int(frame.width) / HiRes.blockCols * blockSize
|
||||
let blockScreenHeigth = Int(frame.height) / HiRes.blockRows
|
||||
let blockScreenWidth = CGFloat(frame.width) / CGFloat(HiRes.blockCols) * CGFloat(blockSize)
|
||||
let blockScreenHeigth = CGFloat(frame.height) / CGFloat(HiRes.blockRows)
|
||||
|
||||
for blockVertIdx in 0 ..< HiRes.blockRows {
|
||||
for blockHorIdx in 0 ..< HiRes.blockCols / blockSize {
|
||||
if blockChanged[ blockVertIdx * HiRes.blockCols / blockSize + blockHorIdx ] != 0 {
|
||||
// refresh the entire screen
|
||||
let boundingBox = CGRect(
|
||||
x: blockHorIdx * blockScreenWidth - screenBlockMargin,
|
||||
y: Int(frame.height) - blockVertIdx * blockScreenHeigth - blockScreenHeigth - screenBlockMargin,
|
||||
width: blockScreenWidth + screenBlockMargin * blockSize,
|
||||
height: blockScreenHeigth + screenBlockMargin * blockSize)
|
||||
let x = CGFloat(blockHorIdx) * blockScreenWidth - CGFloat(screenBlockMargin)
|
||||
let y = frame.height - CGFloat(blockVertIdx) * blockScreenHeigth - blockScreenHeigth - CGFloat(screenBlockMargin)
|
||||
let w = blockScreenWidth + CGFloat(screenBlockMargin) * CGFloat(blockSize)
|
||||
let h = blockScreenHeigth + CGFloat(screenBlockMargin) * CGFloat(blockSize)
|
||||
|
||||
let boundingBox = CGRect(x: x, y: y, width: w, height: h)
|
||||
self.setNeedsDisplay( boundingBox )
|
||||
}
|
||||
}
|
||||
|
|
|
@ -401,19 +401,19 @@ class LoRes: NSView {
|
|||
|
||||
let screenBlockMargin = 6
|
||||
|
||||
let blockScreenWidth = Int(frame.width) / LoRes.blockCols
|
||||
let blockScreenHeigth = Int(frame.height) / LoRes.blockRows
|
||||
let blockScreenWidth = CGFloat(frame.width) / CGFloat(HiRes.blockCols)
|
||||
let blockScreenHeigth = CGFloat(frame.height) / CGFloat(HiRes.blockRows)
|
||||
|
||||
for blockVertIdx in 0 ..< LoRes.blockRows {
|
||||
for blockHorIdx in 0 ..< LoRes.blockCols {
|
||||
if blockChanged[ blockVertIdx * LoRes.blockCols + blockHorIdx ] {
|
||||
// refresh the entire screen
|
||||
let boundingBox = CGRect(
|
||||
x: blockHorIdx * blockScreenWidth - screenBlockMargin,
|
||||
y: Int(frame.height) - blockVertIdx * blockScreenHeigth - blockScreenHeigth - screenBlockMargin,
|
||||
width: blockScreenWidth + screenBlockMargin * 2,
|
||||
height: blockScreenHeigth + screenBlockMargin * 2)
|
||||
let x = CGFloat(blockHorIdx) * blockScreenWidth - CGFloat(screenBlockMargin)
|
||||
let y = frame.height - CGFloat(blockVertIdx) * blockScreenHeigth - blockScreenHeigth - CGFloat(screenBlockMargin)
|
||||
let w = blockScreenWidth + CGFloat(screenBlockMargin) * 2
|
||||
let h = blockScreenHeigth + CGFloat(screenBlockMargin) * 2
|
||||
|
||||
let boundingBox = CGRect(x: x, y: y, width: w, height: h)
|
||||
self.setNeedsDisplay( boundingBox )
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,39 @@
|
|||
import Cocoa
|
||||
|
||||
class MonitorView: NSView {
|
||||
|
||||
@IBOutlet var textDisplay: DisplayView!
|
||||
|
||||
var textDisplay_boundsSize = NSSize()
|
||||
var textDisplay_width_diff : CGFloat?
|
||||
var textDisplay_height_diff : CGFloat?
|
||||
|
||||
@objc func frameDidChange(notification: NSNotification) {
|
||||
var textFrameSize = frame.size
|
||||
|
||||
if textDisplay_width_diff == nil {
|
||||
textDisplay_width_diff = textFrameSize.width - textDisplay.frame.width
|
||||
textDisplay_height_diff = textFrameSize.height - textDisplay.frame.height
|
||||
textDisplay_boundsSize = textDisplay.bounds.size
|
||||
}
|
||||
|
||||
textFrameSize.width -= textDisplay_width_diff!
|
||||
textFrameSize.height -= textDisplay_height_diff!
|
||||
textDisplay.setFrameSize(textFrameSize)
|
||||
textDisplay.setBoundsSize(textDisplay_boundsSize)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
|
||||
postsFrameChangedNotifications = true
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(frameDidChange), name: NSView.frameDidChangeNotification, object: self)
|
||||
}
|
||||
|
||||
override func viewDidChangeEffectiveAppearance() {
|
||||
postsFrameChangedNotifications = true
|
||||
}
|
||||
|
||||
// override func performKeyEquivalent(with event: NSEvent) -> Bool {
|
||||
// return true
|
||||
// }
|
||||
|
|
Loading…
Reference in New Issue
Block a user