Pause button on Main storyboard is synchronized with Debugger Window's Cointinue / Pause button

This commit is contained in:
tudnai 2022-10-28 19:46:06 -07:00
parent acb8d9cfd8
commit 3605640781
3 changed files with 26 additions and 11 deletions

View File

@ -1438,7 +1438,7 @@
<popUpButton key="view" id="Ktw-L6-kEz">
<rect key="frame" x="0.0" y="14" width="43" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="Joystick" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="A4p-LJ-svz">
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="A4p-LJ-svz">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="q8R-kX-3jc">
@ -1487,7 +1487,7 @@
<popUpButton key="view" id="MAv-S5-diZ">
<rect key="frame" x="0.0" y="14" width="43" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="Chip" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="WVW-Wo-mc9">
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="WVW-Wo-mc9">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="Gc4-Or-LMB">
@ -1751,7 +1751,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView editable="NO" selectable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" horizontallyResizable="YES" verticallyResizable="YES" baseWritingDirection="leftToRight" findStyle="bar" allowsCharacterPickerTouchBarItem="NO" textCompletion="NO" id="ccC-Wu-3za" userLabel="Display" customClass="DisplayView" customModule="Steve___" customModuleProvider="target">
<rect key="frame" x="0.0" y="-256" width="1152" height="768"/>
<rect key="frame" x="0.0" y="-320" width="1152" height="768"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" red="0.0" green="0.99143940210000003" blue="1" alpha="0.76658818490000002" colorSpace="custom" customColorSpace="sRGB"/>
@ -1887,7 +1887,7 @@
<subviews>
<popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="49f-8R-QCc" userLabel="Disk1 Button">
<rect key="frame" x="0.0" y="75" width="104" height="99"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:CNs-lh-urM:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" id="CNs-lh-urM">
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" id="CNs-lh-urM">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="N33-K0-nba">
@ -1921,7 +1921,7 @@
</popUpButton>
<popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="QDr-Cp-9QQ" userLabel="Disk2 Button">
<rect key="frame" x="0.0" y="0.0" width="104" height="99"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:CNs-lh-urM:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" selectedItem="28N-X8-n7Q" id="8FA-1D-k8p">
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" selectedItem="28N-X8-n7Q" id="8FA-1D-k8p">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="8He-mk-LVI">
@ -139029,7 +139029,7 @@ BQB9EQcAfREJAH0RCwB9ERQAfREZAH0RHwB9EScAfREpAH0RKwB9ES0AfREvAH0imwB9IqAAfSKtAH0i
sAB9Ir0AfSLCAH0iygB9Is0AfSLSAH0i2gAAAAAAAAQBAAAAAAAAAFAAAAAAAAAAAAAAAAAAfSLdA
</mutableData>
</image>
<image name="popUpButtonCell:CNs-lh-urM:image" width="1" height="1">
<image name="popUpButtonCell:A4p-LJ-svz:image" width="1" height="1">
<mutableData key="keyedArchiveRepresentation">
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05T
S2V5ZWRBcmNoaXZlctEICVRyb290gAGvEBcLDBkaIRQmKisyNTo9PkNGR0pUXF1hZFUkbnVsbNYNDg8Q

View File

@ -89,6 +89,7 @@ class DebuggerWindowController: NSWindowController, NSWindowDelegate {
@IBAction func Continue(_ sender: Any) {
ContinuePauseButtonState()
ToolBarController.current?.PauseButtonUpdate()
switch cpuState {
case cpuState_halted:

View File

@ -152,10 +152,11 @@ class ToolBarController: NSWindowController, NSWindowDelegate {
ViewController.current?.PowerOff(sender)
}
}
@IBOutlet weak var PauseToolbarItem: NSToolbarItem!
@IBOutlet weak var PauseButton: NSButton!
@IBAction func Pause(_ sender: Any) {
func PauseButtonUpdate() {
switch cpuState {
case cpuState_halted:
if let PauseButton = PauseButton {
@ -164,7 +165,6 @@ class ToolBarController: NSWindowController, NSWindowDelegate {
if let PauseToolbarItem = PauseToolbarItem {
PauseToolbarItem.label = pauseLabel
}
ViewController.current?.Pause(sender)
case cpuState_running:
if let PauseButton = PauseButton {
@ -173,8 +173,7 @@ class ToolBarController: NSWindowController, NSWindowDelegate {
if let PauseToolbarItem = PauseToolbarItem {
PauseToolbarItem.label = resumeLabel
}
ViewController.current?.Pause(sender)
default:
if let PauseToolbarItem = PauseToolbarItem {
PauseToolbarItem.isEnabled = false;
@ -185,6 +184,21 @@ class ToolBarController: NSWindowController, NSWindowDelegate {
}
break
}
}
@IBAction func Pause(_ sender: Any) {
PauseButtonUpdate()
switch cpuState {
case cpuState_halted:
ViewController.current?.Pause(sender)
case cpuState_running:
ViewController.current?.Pause(sender)
default:
break
}
DebuggerWindowController.current?.ContinuePauseButtonState()
}