]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/tools/XRCed/panel.py
Respect the REUSEADDR flag to allow rebinding; bind to local port prior to connecting...
[wxWidgets.git] / wxPython / wx / tools / XRCed / panel.py
index 7c482300592534eb225dbe12a9833341749e4ddd..785cca2c87e7c2dd1d56342dc78a326624cdbc16 100644 (file)
@@ -72,7 +72,7 @@ class Panel(wxNotebook):
         # First page
         # Remove current objects and sizer
         sizer = self.ResetPage(self.page1)
-        if not xxx or (not xxx.allParams and not xxx.hasName):
+        if not xxx or (not xxx.allParams and not xxx.hasName and not xxx.hasChild):
             if g.tree.selection:
                 sizer.Add(wxStaticText(self.page1, -1, 'This item has no properties.'))
             else:                       # nothing selected
@@ -136,7 +136,8 @@ class Panel(wxNotebook):
             if not self.GetPageCount() == 2:
                 self.AddPage(self.page2, 'Style')
             self.page2.Layout()
-            self.page2.Show(True)
+            if 'wxGTK' in wx.PlatformInfo:
+                self.page2.Show(True)
             size = self.page2.GetSizer().GetMinSize()
             self.page2.SetScrollbars(1, 1, size.width, size.height, 0, 0, True)
         else:
@@ -170,8 +171,6 @@ 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():
@@ -200,7 +199,10 @@ class ParamPage(wxPanel):
                 xxx.params[param] = xxxParam(elem)
             # Find place to put new element: first present element after param
             found = False
-            paramStyles = xxx.allParams + xxx.styles
+            if xxx.hasStyle: 
+                paramStyles = xxx.allParams + xxx.styles
+            else:
+                paramStyles = xxx.allParams 
             for p in paramStyles[paramStyles.index(param) + 1:]:
                 # Content params don't have same type
                 if xxx.params.has_key(p) and p != 'content':
@@ -270,13 +272,13 @@ class PropPage(ParamPage):
         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 = wxFlexGridSizer(len(xxx.allParams), 2, 0, 1)
         sizer.AddGrowableCol(1)
         if xxx.hasName:
             label = wxStaticText(self, -1, 'XML ID:', size=(LABEL_WIDTH,-1))
             control = ParamText(self, 'XML_name', 200)
             sizer.AddMany([ (label, 0, wxALIGN_CENTER_VERTICAL),
-                            (control, 0, wxALIGN_CENTER_VERTICAL | wxBOTTOM | wxGROW, 5) ])
+                            (control, 0, wxALIGN_CENTER_VERTICAL | wxBOTTOM | wxGROW, 10) ])
             self.controlName = control
         for param in xxx.allParams:
             present = xxx.params.has_key(param)
@@ -343,7 +345,7 @@ class StylePage(ParamPage):
         box = wxStaticBox(self, -1, label)
         box.SetFont(g.labelFont())
         topSizer = wxStaticBoxSizer(box, wxVERTICAL)
-        sizer = wxFlexGridSizer(len(xxx.styles), 2, 1, 1)
+        sizer = wxFlexGridSizer(len(xxx.styles), 2, 0, 1)
         sizer.AddGrowableCol(1)
         for param in xxx.styles:
             present = xxx.params.has_key(param)