X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2481bf3cb684141768951d987a5adce365735051..d71cc120e315b27466cce577115b9bdf56b1ca55:/wxPython/wx/tools/XRCed/panel.py diff --git a/wxPython/wx/tools/XRCed/panel.py b/wxPython/wx/tools/XRCed/panel.py index 55330fa01a..11aac42cac 100644 --- a/wxPython/wx/tools/XRCed/panel.py +++ b/wxPython/wx/tools/XRCed/panel.py @@ -51,13 +51,13 @@ class Panel(wxNotebook): topSizer = page.GetSizer() sizer = topSizer.GetChildren()[0].GetSizer() for w in page.GetChildren(): - sizer.RemoveWindow(w) + sizer.Remove(w) if isinstance(w, ParamPage): # With SetParent, we wouldn't need this w.Reparent(self.cacheParent) else: w.Destroy() - topSizer.RemoveSizer(sizer) + topSizer.Remove(sizer) # Create new windows sizer = wxBoxSizer(wxVERTICAL) # Special case - resize html window @@ -87,13 +87,16 @@ class Panel(wxNotebook): sizer.Add(wxStaticText(self.page1, -1, 'Select a tree item.')) else: g.currentXXX = xxx.treeObject() + # Normal or SizerItem page + isGBSizerItem = isinstance(xxx.parent, xxxGridBagSizer) + cacheID = (xxx.__class__, isGBSizerItem) try: - page = self.pageCache[xxx.__class__] + page = self.pageCache[cacheID] page.box.SetLabel(xxx.panelName()) page.Reparent(self.page1) except KeyError: page = PropPage(self.page1, xxx.panelName(), xxx) - self.pageCache[xxx.__class__] = page + self.pageCache[cacheID] = page page.SetValues(xxx) self.pages.append(page) sizer.Add(page, 1, wxEXPAND) @@ -162,6 +165,8 @@ class Panel(wxNotebook): class ParamPage(wxPanel): def __init__(self, parent, xxx): wxPanel.__init__(self, parent, -1) + self.SetBackgroundColour(parent.GetBackgroundColour()) + self.SetForegroundColour(parent.GetForegroundColour()) self.xxx = xxx # Register event handlers for id in paramIDs.values(): @@ -256,7 +261,7 @@ class PropPage(ParamPage): def __init__(self, parent, label, xxx): ParamPage.__init__(self, parent, xxx) self.box = wxStaticBox(self, -1, label) - self.box.SetFont(labelFont) + self.box.SetFont(g.labelFont()) topSizer = wxStaticBoxSizer(self.box, wxVERTICAL) sizer = wxFlexGridSizer(len(xxx.allParams), 2, 1, 1) sizer.AddGrowableCol(1) @@ -329,7 +334,7 @@ class StylePage(ParamPage): def __init__(self, parent, label, xxx): ParamPage.__init__(self, parent, xxx) box = wxStaticBox(self, -1, label) - box.SetFont(labelFont) + box.SetFont(g.labelFont()) topSizer = wxStaticBoxSizer(box, wxVERTICAL) sizer = wxFlexGridSizer(len(xxx.styles), 2, 1, 1) sizer.AddGrowableCol(1)