Disass View Select / Deselect

This commit is contained in:
tudnai 2022-12-09 13:33:51 -08:00
parent bc6f00f4b1
commit bb6b239266
4 changed files with 23 additions and 6 deletions

View File

@ -1197,6 +1197,7 @@
32E3126C24AC033A00E61891 /* ToolBarController.swift */,
32C6995127C5439300D0F25D /* Debugger.swift */,
323D042F24898AB70086A901 /* PreferencesViewController.swift */,
32544194264A6C1600B7E3ED /* DisplayView.swift */,
32D089D7291E1BF800F2B486 /* DisassView.swift */,
32D08A1329219C6A00F2B486 /* HexDigitFormatter.swift */,
327B75D629064FDC00A86A71 /* DebuggerViewController.swift */,
@ -1204,7 +1205,6 @@
323D04312489BFD80086A901 /* PreferencesWindowController.swift */,
32B18435233F10BC00DBB4AB /* Shaders.metal */,
32C4532D233345420000EBA1 /* MonitorView.swift */,
32544194264A6C1600B7E3ED /* DisplayView.swift */,
32C453072331C0910000EBA1 /* NSLayoutManager-Extension.swift */,
32440BA22480D5C0000F9DA1 /* LoRes.swift */,
32DBF7632334657900DD50E7 /* HiRes.swift */,

View File

@ -378,7 +378,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="Hwx-Gd-XW1" userLabel="Disass Display" customClass="DisassView" customModule="A2MacTests" customModuleProvider="target">
<rect key="frame" x="0.0" y="-402" width="349" height="510"/>
<rect key="frame" x="0.0" y="-424" width="349" height="510"/>
<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.12549019610000001" green="0.12549019610000001" blue="0.12549019610000001" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
@ -436,7 +436,7 @@
<rect key="frame" x="-100" y="-100" width="225" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="0.076923076923076927" horizontal="NO" id="8wE-fn-MQK">
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="8wE-fn-MQK">
<rect key="frame" x="350" y="1" width="15" height="458"/>
<autoresizingMask key="autoresizingMask"/>
<connections>
@ -558,7 +558,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="BHr-Q4-rBI" userLabel="Stack Display" customClass="DisplayView" customModule="A2MacTests" customModuleProvider="target">
<rect key="frame" x="0.0" y="-295" width="334" height="165"/>
<rect key="frame" x="0.0" y="-302" width="334" height="165"/>
<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" name="windowBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -819,6 +819,7 @@
<outlet property="CPU_Display" destination="Wrs-Qt-Kmd" id="SUW-Lc-Zv4"/>
<outlet property="DisassAddressField" destination="bwO-w1-hlg" id="tBp-cc-OcF"/>
<outlet property="DisassAddressPC" destination="zov-nz-fce" id="fhe-fN-yPd"/>
<outlet property="DisassBackground" destination="uQh-oP-EwQ" id="Rtn-R5-VDA"/>
<outlet property="DisassCursor" destination="Mgy-Qm-MWH" id="6Pn-wq-woY"/>
<outlet property="DisassCursorContraint" destination="R2c-sP-wWP" id="7vt-Dc-wGf"/>
<outlet property="DisassHighlighter" destination="KwD-2D-fNp" id="bTl-R3-0bK"/>

View File

@ -39,6 +39,7 @@ class DebuggerViewController: NSViewController {
@IBOutlet weak var DisassHightlighterContriant: NSLayoutConstraint!
@IBOutlet weak var DisassCursor: NSTextField!
@IBOutlet weak var DisassCursorContraint: NSLayoutConstraint!
@IBOutlet weak var DisassBackground: NSTextField!
let textFont : NSFont = NSFont(name: "Print Char 21", size: 10.0)!
@ -531,11 +532,24 @@ N V - B D I Z C
}
}
let normalBackground = NSColor(red: 38/255, green: 38/255, blue: 38/255, alpha: 1)
let selectedBackground = NSColor(red: 38/255, green: 38/255, blue: 64/255, alpha: 1.0)
func unselectViews() {
DisassBackground.backgroundColor = normalBackground
}
func selectView(view: NSTextView) {
unselectViews()
view.backgroundColor = normalBackground
}
let leftSideSize = CGFloat(30)
// select disassembly line
override func mouseDown(with event: NSEvent) {
unselectViews()
let location = convertMouseCoordinates(scrollView: Disass_Scroll, display: Disass_Display, mouseLocation: event.locationInWindow)
if location.x < leftSideSize {

View File

@ -53,9 +53,11 @@ class DisassView: NSTextView {
override func mouseDown(with event: NSEvent) {
// print(#function + "DisassView")
DebuggerViewController.shared?.mouseDown(with: event)
if let dbgVC = DebuggerViewController.shared {
dbgVC.mouseDown(with: event)
dbgVC.DisassBackground.backgroundColor = dbgVC.selectedBackground
// debugDisplayContraints()
}
}
// override func mouseUp(with event: NSEvent) {