]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/tools/XRCed/xrced.py
Tweaks to work around wxMac bugs
[wxWidgets.git] / wxPython / wx / tools / XRCed / xrced.py
index f1ba7d58c841433dc8766690a8eae5bdd87dd129..033ad45ff3af57c7414d03731bbae6173767ffe9 100644 (file)
@@ -65,10 +65,10 @@ class ScrolledMessageDialog(wxDialog):
         wxDialog.__init__(self, parent, -1, caption, pos, size)
         text = wxTextCtrl(self, -1, msg, wxDefaultPosition,
                              wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY)
-        text.SetFont(modernFont)
+        text.SetFont(g.modernFont())
         dc = wxWindowDC(text)
         # !!! possible bug - GetTextExtent without font returns sysfont dims
-        w, h = dc.GetFullTextExtent(' ', modernFont)[:2]
+        w, h = dc.GetFullTextExtent(' ', g.modernFont())[:2]
         ok = wxButton(self, wxID_OK, "OK")
         text.SetConstraints(Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok)))
         text.SetSize((w * 80 + 30, h * 40))
@@ -348,7 +348,7 @@ class Frame(wxFrame):
         # Expanded container (must have children)
         elif tree.IsExpanded(selected) and tree.GetChildrenCount(selected, False):
             # Insert as first child
-            nextItem = tree.GetFirstChild(selected, 0)[0]
+            nextItem = tree.GetFirstChild(selected)[0]
             parentLeaf = selected
         else:
             # No children or unexpanded item - appendChild stays True
@@ -619,7 +619,7 @@ Homepage: http://xrced.sourceforge.net\
         # Expanded container (must have children)
         elif tree.shift and tree.IsExpanded(selected) \
            and tree.GetChildrenCount(selected, False):
-            nextItem = tree.GetFirstChild(selected, 0)[0]
+            nextItem = tree.GetFirstChild(selected)[0]
             parentLeaf = selected
         else:
             nextItem = wxTreeItemId()
@@ -701,7 +701,7 @@ Homepage: http://xrced.sourceforge.net\
         xxx = MakeXXXFromDOM(parentXXX, elem)
         # Update parent in child objects
         if tree.ItemHasChildren(selected):
-            i, cookie = tree.GetFirstChild(selected, 0)
+            i, cookie = tree.GetFirstChild(selected)
             while i.IsOk():
                 x = tree.GetPyData(i)
                 x.parent = xxx
@@ -798,13 +798,14 @@ Homepage: http://xrced.sourceforge.net\
         panel.cacheParent.Destroy()
         if not panel.GetPageCount() == 2:
             panel.page2.Destroy()
-        conf.x, conf.y = self.GetPosition()
-        conf.width, conf.height = self.GetSize()
-        if conf.embedPanel:
-            conf.sashPos = self.splitter.GetSashPosition()
-        else:
-            conf.panelX, conf.panelY = self.miniFrame.GetPosition()
-            conf.panelWidth, conf.panelHeight = self.miniFrame.GetSize()
+        if not self.IsIconized():
+            conf.x, conf.y = self.GetPosition()
+            conf.width, conf.height = self.GetSize()
+            if conf.embedPanel:
+                conf.sashPos = self.splitter.GetSashPosition()
+            else:
+                conf.panelX, conf.panelY = self.miniFrame.GetPosition()
+                conf.panelWidth, conf.panelHeight = self.miniFrame.GetSize()
         evt.Skip()
 
     def Clear(self):
@@ -931,21 +932,23 @@ class App(wxApp):
         global debug
         # Process comand-line
         try:
+            opts = args = None
             opts, args = getopt.getopt(sys.argv[1:], 'dhiv')
+            for o,a in opts:
+                if o == '-h':
+                    usage()
+                    sys.exit(0)
+                elif o == '-d':
+                    debug = True
+                elif o == '-v':
+                    print 'XRCed version', version
+                    sys.exit(0)
+            
         except getopt.GetoptError:
             if wxPlatform != '__WXMAC__': # macs have some extra parameters
                 print >> sys.stderr, 'Unknown option'
                 usage()
                 sys.exit(1)
-        for o,a in opts:
-            if o == '-h':
-                usage()
-                sys.exit(0)
-            elif o == '-d':
-                debug = True
-            elif o == '-v':
-                print 'XRCed version', version
-                sys.exit(0)
 
         self.SetAppName('xrced')
         # Settings
@@ -1004,6 +1007,7 @@ class App(wxApp):
 
 def main():
     app = App(0, useBestVisual=False)
+    #app.SetAssertMode(wxPYAPP_ASSERT_LOG)
     app.MainLoop()
     app.OnExit()
     global conf