diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 646c2fe45..3063f8bce 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -105,7 +105,8 @@ class MainFrame(wx.Frame): def registerMenu(self): # Quit self.Bind(wx.EVT_MENU, self.ExitApp, id=wx.ID_EXIT) - + # Widgets Inspector + self.Bind(wx.EVT_MENU, self.openWXInspectTool, id=911) # About self.Bind(wx.EVT_MENU, self.ShowAboutBox, id=wx.ID_ABOUT) @@ -116,3 +117,15 @@ class MainFrame(wx.Frame): def toggleShipBrowser(self, event): self.GetToolBar().toggleShipBrowser(event) + def openWXInspectTool(self,event): + from wx.lib.inspection import InspectionTool + if not InspectionTool().initialized: + InspectionTool().Init() + + # Find a widget to be selected in the tree. Use either the + # one under the cursor, if any, or this frame. + wnd = wx.FindWindowAtPointer() + if not wnd: + wnd = self + InspectionTool().Show(wnd, True) + diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 3709aeb38..ef49c7bbe 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -58,3 +58,4 @@ class MainMenuBar(wx.MenuBar): self.Append(helpMenu, "&Help") helpMenu.Append(wx.ID_ABOUT) helpMenu.Append(wx.ID_HELP, "User manual", "User manual") + helpMenu.Append(911,"Open Widgets Inspect tool", "Open Widgets Inspect tool") diff --git a/gui/statsPane.py b/gui/statsPane.py index 38365aa47..35dbd0f9d 100644 --- a/gui/statsPane.py +++ b/gui/statsPane.py @@ -232,6 +232,11 @@ class StatsPane(wx.Panel): self.SetSizer(self.pickerSizer) collapsible = wx.CollapsiblePane(self, label="Stats") + + colPane=collapsible.GetPane() + colPane.SetMinSize(wx.Size(0,0)) + colPane.SetSize(wx.Size(0,0)) + collapsible.Expand() collapsible.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.collapseChanged)