]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/tools/XRCed/panel.py
It's now wx._core
[wxWidgets.git] / wxPython / wx / tools / XRCed / panel.py
index 2226921c12744969fd2bd7ad91ca29a40c1f8760..f58014800ec1cf02a2dc7acf49f1c76bdb5d51e9 100644 (file)
@@ -87,12 +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.className, xxx)
-                self.pageCache[xxx.__class__] = page
+                page = PropPage(self.page1, xxx.panelName(), xxx)
+                self.pageCache[cacheID] = page
             page.SetValues(xxx)
             self.pages.append(page)
             sizer.Add(page, 1, wxEXPAND)
@@ -101,9 +105,10 @@ class Panel(wxNotebook):
                 cacheID = (xxx.child.__class__, xxx.__class__)
                 try:
                     page = self.pageCache[cacheID]
+                    page.box.SetLabel(xxx.child.panelName())
                     page.Reparent(self.page1)
                 except KeyError:
-                    page = PropPage(self.page1, xxx.child.className, xxx.child)
+                    page = PropPage(self.page1, xxx.child.panelName(), xxx.child)
                     self.pageCache[cacheID] = page
                 page.SetValues(xxx.child)
                 self.pages.append(page)
@@ -160,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():
@@ -253,9 +260,9 @@ class ParamPage(wxPanel):
 class PropPage(ParamPage):
     def __init__(self, parent, label, xxx):
         ParamPage.__init__(self, parent, xxx)
-        box = wxStaticBox(self, -1, label)
-        box.SetFont(labelFont)
-        topSizer = wxStaticBoxSizer(box, wxVERTICAL)
+        self.box = wxStaticBox(self, -1, label)
+        self.box.SetFont(g.labelFont())
+        topSizer = wxStaticBoxSizer(self.box, wxVERTICAL)
         sizer = wxFlexGridSizer(len(xxx.allParams), 2, 1, 1)
         sizer.AddGrowableCol(1)
         if xxx.hasName:
@@ -327,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)