mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
cocoa debugger: save/restore console split positions
This commit is contained in:
parent
298f379212
commit
3e60ab4a04
@ -21,6 +21,7 @@
|
||||
MAMEDebugCommandHistory *history;
|
||||
NSMutableArray *auxiliaryWindows;
|
||||
|
||||
NSSplitView *regSplit, *dasmSplit;
|
||||
MAMERegistersView *regView;
|
||||
MAMEDisassemblyView *dasmView;
|
||||
MAMEDebugView *consoleView;
|
||||
|
@ -31,7 +31,6 @@
|
||||
@implementation MAMEDebugConsole
|
||||
|
||||
- (id)initWithMachine:(running_machine &)m {
|
||||
NSSplitView *regSplit, *dasmSplit;
|
||||
NSScrollView *regScroll, *dasmScroll, *consoleScroll;
|
||||
NSView *consoleContainer;
|
||||
NSPopUpButton *actionButton;
|
||||
@ -426,12 +425,32 @@
|
||||
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
|
||||
[super saveConfigurationToNode:node];
|
||||
node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_CONSOLE);
|
||||
util::xml::data_node *const splits = node->add_child("splits", nullptr);
|
||||
if (splits)
|
||||
{
|
||||
splits->set_attribute_float("state",
|
||||
[regSplit isSubviewCollapsed:[[regSplit subviews] objectAtIndex:0]]
|
||||
? 0.0
|
||||
: NSMaxX([[[regSplit subviews] objectAtIndex:0] frame]));
|
||||
splits->set_attribute_float("disassembly",
|
||||
[dasmSplit isSubviewCollapsed:[[dasmSplit subviews] objectAtIndex:0]]
|
||||
? 0.0
|
||||
: NSMaxY([[[dasmSplit subviews] objectAtIndex:0] frame]));
|
||||
}
|
||||
[dasmView saveConfigurationToNode:node];
|
||||
}
|
||||
|
||||
|
||||
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
|
||||
[super restoreConfigurationFromNode:node];
|
||||
util::xml::data_node const *const splits = node->get_child("splits");
|
||||
if (splits)
|
||||
{
|
||||
[regSplit setPosition:splits->get_attribute_float("state", NSMaxX([[[regSplit subviews] objectAtIndex:0] frame]))
|
||||
ofDividerAtIndex:0];
|
||||
[dasmSplit setPosition:splits->get_attribute_float("disassembly", NSMaxY([[[dasmSplit subviews] objectAtIndex:0] frame]))
|
||||
ofDividerAtIndex:0];
|
||||
}
|
||||
[dasmView restoreConfigurationFromNode:node];
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,8 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
|
||||
|
||||
|
||||
- (void)adjustSizeAndRecomputeVisible {
|
||||
NSSize const clip = [[[self enclosingScrollView] contentView] bounds].size;
|
||||
NSScrollView *const scroller = [self enclosingScrollView];
|
||||
NSSize const clip = [[scroller contentView] bounds].size;
|
||||
NSSize content = NSMakeSize((fontWidth * totalWidth) + (2 * [textContainer lineFragmentPadding]),
|
||||
fontHeight * totalHeight);
|
||||
if (wholeLineScroll)
|
||||
@ -211,6 +212,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
|
||||
[self setFrameSize:NSMakeSize(ceil(std::max(clip.width, content.width)),
|
||||
ceil(std::max(clip.height, content.height)))];
|
||||
[self recomputeVisible];
|
||||
[scroller reflectScrolledClipView:[scroller contentView]];
|
||||
}
|
||||
|
||||
|
||||
@ -287,6 +289,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
|
||||
content.height += (fontHeight * 2) - 1;
|
||||
[self setFrameSize:NSMakeSize(ceil(std::max(clip.width, content.width)),
|
||||
ceil(std::max(clip.height, content.height)))];
|
||||
[scroller reflectScrolledClipView:[scroller contentView]];
|
||||
}
|
||||
totalWidth = newSize.x;
|
||||
totalHeight = newSize.y;
|
||||
|
Loading…
Reference in New Issue
Block a user