diff options
author | Vas Crabb <vas@vastheman.com> | 2017-07-21 11:47:41 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2017-07-21 11:47:41 +1000 |
commit | 05e84dccc04849857ebc4460084bdafc872d5815 (patch) | |
tree | f20a0a1f88d6ee1cedec9f8b2861b09acb6c0ada /src/osd/modules/debugger | |
parent | 431879ef2b675540cc3987d90b4d069a49854897 (diff) |
* Make XML file a class of its own managed with smart poitners
* Save/restore a little more of Cocoa debugger state
Diffstat (limited to 'src/osd/modules/debugger')
-rw-r--r-- | src/osd/modules/debugger/osx/debugview.mm | 13 | ||||
-rw-r--r-- | src/osd/modules/debugger/osx/pointsviewer.h | 4 | ||||
-rw-r--r-- | src/osd/modules/debugger/osx/pointsviewer.mm | 14 |
3 files changed, 24 insertions, 7 deletions
diff --git a/src/osd/modules/debugger/osx/debugview.mm b/src/osd/modules/debugger/osx/debugview.mm index ed03d7e728c..26d84d6038d 100644 --- a/src/osd/modules/debugger/osx/debugview.mm +++ b/src/osd/modules/debugger/osx/debugview.mm @@ -844,11 +844,14 @@ static void debugwin_view_update(debug_view &view, void *osdprivate) - (void)keyUp:(NSEvent *)event { - debug_view_xy const pos = view->cursor_position(); - [self scrollRectToVisible:NSMakeRect((pos.x * fontWidth) + [textContainer lineFragmentPadding], - pos.y * fontHeight, - fontWidth, - fontHeight)]; // FIXME: metrics + if (view->cursor_supported() && view->cursor_visible()) + { + debug_view_xy const pos = view->cursor_position(); + [self scrollRectToVisible:NSMakeRect((pos.x * fontWidth) + [textContainer lineFragmentPadding], + pos.y * fontHeight, + fontWidth, + fontHeight)]; // FIXME: metrics + } } diff --git a/src/osd/modules/debugger/osx/pointsviewer.h b/src/osd/modules/debugger/osx/pointsviewer.h index fab1872d1ac..21deb79aa93 100644 --- a/src/osd/modules/debugger/osx/pointsviewer.h +++ b/src/osd/modules/debugger/osx/pointsviewer.h @@ -18,7 +18,8 @@ @interface MAMEPointsViewer : MAMEAuxiliaryDebugWindowHandler { - NSTabView *tabs; + NSTabView *tabs; + NSPopUpButton *subviewButton; } - (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c; @@ -26,5 +27,6 @@ - (IBAction)changeSubview:(id)sender; - (void)saveConfigurationToNode:(util::xml::data_node *)node; +- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node; @end diff --git a/src/osd/modules/debugger/osx/pointsviewer.mm b/src/osd/modules/debugger/osx/pointsviewer.mm index d6333514d95..8bd4dad3a1b 100644 --- a/src/osd/modules/debugger/osx/pointsviewer.mm +++ b/src/osd/modules/debugger/osx/pointsviewer.mm @@ -21,7 +21,7 @@ MAMEDebugView *breakView, *watchView; NSScrollView *breakScroll, *watchScroll; NSTabViewItem *breakTab, *watchTab; - NSPopUpButton *actionButton, *subviewButton; + NSPopUpButton *actionButton; NSRect subviewFrame; if (!(self = [super initWithMachine:m title:@"(Break|Watch)points" console:c])) @@ -147,6 +147,18 @@ - (void)saveConfigurationToNode:(util::xml::data_node *)node { [super saveConfigurationToNode:node]; node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_POINTS_VIEWER); + node->set_attribute_int("bwtype", [tabs indexOfTabViewItem:[tabs selectedTabViewItem]]); +} + + +- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node { + [super restoreConfigurationFromNode:node]; + int const tab = node->get_attribute_int("bwtype", [tabs indexOfTabViewItem:[tabs selectedTabViewItem]]); + if ((0 <= tab) && ([tabs numberOfTabViewItems] > tab)) + { + [subviewButton selectItemAtIndex:tab]; + [self changeSubview:subviewButton]; + } } @end |