From 862102e5a55bb7224d43ebd725062e6d35f4db3d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 2 Apr 2009 14:00:24 -0400 Subject: [PATCH] Add an item to the Window menu to allow the inspector to be shown/hidden * Source/AppDelegate.m+h: (showInspectorWindow:): New method (showBreakpointWindow:): Make this toggle window visibility rather than just always bring to front * Source/DebuggerController.m+h: Create ivar for the inspector and synth the property * English.lproj/Debugger.xib: Hook up the outlet * English.lproj/MainMenu.xib: Add menu item --- English.lproj/Debugger.xib | 31 ++++++--- English.lproj/MainMenu.xib | 135 ++++++++++++++++++++++-------------- Source/AppDelegate.h | 1 + Source/AppDelegate.m | 16 ++++- Source/DebuggerController.h | 3 + Source/DebuggerController.m | 2 +- 6 files changed, 126 insertions(+), 62 deletions(-) diff --git a/English.lproj/Debugger.xib b/English.lproj/Debugger.xib index c76f64e..16f3434 100644 --- a/English.lproj/Debugger.xib +++ b/English.lproj/Debugger.xib @@ -8,7 +8,6 @@ 353.00 YES - YES @@ -626,6 +625,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {{1, 17}, {377, 205}} + 4 @@ -658,6 +658,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {{1, 0}, {377, 17}} + 4 @@ -666,6 +667,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {379, 223} + 562 @@ -847,6 +849,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {{1, 17}, {382, 205}} + 4 @@ -879,6 +882,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {{1, 0}, {382, 17}} + 4 @@ -887,6 +891,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {{388, 0}, {384, 223}} + 562 @@ -964,8 +969,9 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ Inspector NSPanel + {3.40282e+38, 3.40282e+38} - + 256 YES @@ -1173,8 +1179,8 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 6 - {463, 1e+07} - {223, 40} + {666, 1e+07} + {223, 0} @@ -1219,7 +1225,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {331, 423} - {{0, 0}, {1440, 878}} {3.40282e+38, 3.40282e+38} @@ -1553,6 +1558,14 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 580 + + + inspector + + + + 581 + @@ -1592,7 +1605,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - Window + Debugger 8 @@ -2031,7 +2044,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 502.CustomClassName 502.IBPluginDependency 569.IBEditorWindowLastContentRect - 569.IBPluginDependency 569.IBWindowTemplateEditedContentRect 569.NSWindowTemplate.visibleAtLaunch 570.IBPluginDependency @@ -2132,7 +2144,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ BSSplitView com.apple.InterfaceBuilder.CocoaPlugin {{478, 327}, {331, 423}} - com.apple.InterfaceBuilder.CocoaPlugin {{478, 327}, {331, 423}} com.apple.InterfaceBuilder.CocoaPlugin @@ -2179,7 +2190,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 580 + 581 @@ -2239,6 +2250,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES errormsg + inspector sourceViewer stackArrayController statusmsg @@ -2248,6 +2260,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES NSTextField + NSWindow BSSourceView NSArrayController NSTextField diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 7b2973d..a5d429c 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -1,18 +1,28 @@ - + 1050 - 9F33 - 672 - 949.34 - 352.00 + 9G55 + 677 + 949.43 + 353.00 YES + YES com.apple.InterfaceBuilder.CocoaPlugin + + YES + + YES + + + YES + + YES @@ -633,6 +643,15 @@ + + + Inspector + I + 1048576 + 2147483647 + + + Breakpoints @@ -1006,6 +1025,14 @@ 302 + + + showInspectorWindow: + + + + 304 + @@ -1066,6 +1093,7 @@ + @@ -1555,6 +1583,11 @@ + + 303 + + + @@ -1563,6 +1596,7 @@ YES -1.IBPluginDependency -2.IBPluginDependency + -3.IBPluginDependency 103.IBPluginDependency 103.ImportedFromIB2 106.IBEditorWindowLastContentRect @@ -1685,6 +1719,7 @@ 294.IBPluginDependency 295.IBPluginDependency 296.IBPluginDependency + 303.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 56.IBPluginDependency @@ -1702,6 +1737,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin {{756, 778}, {174, 23}} com.apple.InterfaceBuilder.CocoaPlugin @@ -1787,7 +1823,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{821, 613}, {211, 123}} + {{821, 593}, {211, 143}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1824,6 +1860,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1856,7 +1893,7 @@ - 302 + 304 @@ -1871,6 +1908,7 @@ openHelpPage: showBreakpointWindow: showDebuggerWindow: + showInspectorWindow: showPreferences: @@ -1879,6 +1917,7 @@ id id id + id @@ -1948,6 +1987,14 @@ BSSourceView + + IBProjectSource + Source/BreakpointController.h + + + + BreakpointController + NSWindowController IBUserSource @@ -1980,30 +2027,51 @@ YES errormsg + inspector + sourceViewer + stackArrayController + statusmsg + variablesOutlineView + variablesTreeController + + + YES + NSTextField + NSWindow + BSSourceView + NSArrayController + NSTextField + NSOutlineView + NSTreeController + + + + IBProjectSource + Source/DebuggerController.h + + + + DebuggerController + NSWindowController + + YES + + YES reconnectButton runButton - sourceViewer stackController2 - statusmsg stepInButton stepOutButton stepOverButton - variablesOutlineView - variablesTreeController YES - NSTextField NSToolbarItem NSToolbarItem - BSSourceView NSArrayController - NSTextField NSToolbarItem NSToolbarItem NSToolbarItem - NSOutlineView - NSTreeController @@ -2040,41 +2108,6 @@ ../Sparkle.framework/Versions/A/Headers/SUAppcast.h - - NSObject - - IBDocumentRelativeSource - ../Sparkle.framework/Versions/A/Headers/SUAutomaticUpdateAlert.h - - - - NSObject - - IBDocumentRelativeSource - ../Sparkle.framework/Versions/A/Headers/SUInstaller.h - - - - NSObject - - IBDocumentRelativeSource - ../Sparkle.framework/Versions/A/Headers/SUUnarchiver.h - - - - NSObject - - IBDocumentRelativeSource - ../Sparkle.framework/Versions/A/Headers/SUUpdateAlert.h - - - - NSObject - - IBDocumentRelativeSource - ../Sparkle.framework/Versions/A/Headers/SUUpdatePermissionPrompt.h - - NSObject diff --git a/Source/AppDelegate.h b/Source/AppDelegate.h index 1aa92ef..0f43d76 100644 --- a/Source/AppDelegate.h +++ b/Source/AppDelegate.h @@ -30,6 +30,7 @@ @property(readonly) BreakpointController *breakpoint; - (IBAction)showDebuggerWindow:(id)sender; +- (IBAction)showInspectorWindow:(id)sender; - (IBAction)showBreakpointWindow:(id)sender; - (IBAction)showPreferences:(id)sender; diff --git a/Source/AppDelegate.m b/Source/AppDelegate.m index 709c723..c6dbe08 100644 --- a/Source/AppDelegate.m +++ b/Source/AppDelegate.m @@ -62,12 +62,26 @@ [[debugger window] makeKeyAndOrderFront:self]; } +/** + * Shows the inspector window + */ +- (IBAction)showInspectorWindow:(id)sender +{ + if (![debugger.inspector isVisible]) + [debugger.inspector makeKeyAndOrderFront:sender]; + else + [debugger.inspector orderOut:sender]; +} + /** * Shows the breakpoints window */ - (IBAction)showBreakpointWindow:(id)sender { - [[breakpoint window] makeKeyAndOrderFront:self]; + if (![[breakpoint window] isVisible]) + [[breakpoint window] makeKeyAndOrderFront:sender]; + else + [[breakpoint window] orderOut:sender]; } /** diff --git a/Source/DebuggerController.h b/Source/DebuggerController.h index ab5b124..9f7c149 100644 --- a/Source/DebuggerController.h +++ b/Source/DebuggerController.h @@ -31,6 +31,8 @@ IBOutlet NSOutlineView *variablesOutlineView; NSMutableSet *expandedVariables; + IBOutlet NSWindow *inspector; + IBOutlet NSTextField *statusmsg; IBOutlet NSTextField *errormsg; @@ -39,6 +41,7 @@ @property(readonly) GDBpConnection *connection; @property(readonly) BSSourceView *sourceViewer; +@property(readonly) NSWindow *inspector; - (void)resetDisplays; diff --git a/Source/DebuggerController.m b/Source/DebuggerController.m index 3af8421..ae5af5b 100644 --- a/Source/DebuggerController.m +++ b/Source/DebuggerController.m @@ -28,7 +28,7 @@ @implementation DebuggerController -@synthesize connection, sourceViewer; +@synthesize connection, sourceViewer, inspector; /** * Initializes the window controller and sets the connection using preference -- 2.43.5