Fixed an unwanted behavior of collapsible pane (it shows by default a pane - fix:sized to 0x0) affecting statspane view; Added Widget Inspection Tool in menu - should help debugging UI stuff if needed

This commit is contained in:
HomeWorld
2010-09-01 17:08:56 +03:00
parent 16996f36b3
commit 4e3e3e1638
3 changed files with 20 additions and 1 deletions

View File

@@ -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)

View File

@@ -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")

View File

@@ -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)