]> git.saurik.com Git - wxWidgets.git/commitdiff
0.1.8-2
authorRoman Rolinsky <rolinsky@femagsoft.com>
Wed, 7 Mar 2007 14:45:12 +0000 (14:45 +0000)
committerRoman Rolinsky <rolinsky@femagsoft.com>
Wed, 7 Mar 2007 14:45:12 +0000 (14:45 +0000)
-------

Fix for dealing with empty 'growable' property, using MiniFrame
for properties panel, the panel is restored together with the
main window.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wx/tools/XRCed/CHANGES.txt
wxPython/wx/tools/XRCed/globals.py
wxPython/wx/tools/XRCed/panel.py
wxPython/wx/tools/XRCed/params.py
wxPython/wx/tools/XRCed/xrced.py
wxPython/wx/tools/XRCed/xxx.py

index 39db47d1914013de4d24a08d894bafa15db60fe3..a64e7319be1ac57ab7f195b9bb346f6b1441fc5d 100644 (file)
@@ -1,3 +1,10 @@
+0.1.8-2
+-------
+
+Fix for dealing with empty 'growable' property, using MiniFrame
+for properties panel, the panel is restored together with the
+main window.
+
 0.1.8-1
 -------
 
 0.1.8-1
 -------
 
index 031307765627b2b233f6c82ead2d2fcc4b8d3be0..ef5c7895c279788dea52a15f8ca5fbcba03a00b6 100644 (file)
@@ -15,7 +15,7 @@ import sys
 # Global constants
 
 progname = 'XRCed'
 # Global constants
 
 progname = 'XRCed'
-version = '0.1.8-1'
+version = '0.1.8-2'
 # Minimal wxWidgets version
 MinWxVersion = (2,6,0)
 if wx.VERSION[:3] < MinWxVersion:
 # Minimal wxWidgets version
 MinWxVersion = (2,6,0)
 if wx.VERSION[:3] < MinWxVersion:
index d231a933cc046ba659335a2a773e78cd6e830e6b..e238c9e3b7a21256446dad8594019af3d328490a 100644 (file)
@@ -218,7 +218,7 @@ class ParamPage(wx.Panel):
             xxx.params[param].remove()
             del xxx.params[param]
             w.SetValue('')
             xxx.params[param].remove()
             del xxx.params[param]
             w.SetValue('')
-            w.modified = False          # mark as not changed
+            w.SetModified(False)        # mark as not changed
             w.Enable(False)
         # Set modified flag (provokes undo storing is necessary)
         panel.SetModified(True)
             w.Enable(False)
         # Set modified flag (provokes undo storing is necessary)
         panel.SetModified(True)
index dfe6bd6ac6ce8f78a8b5b60f829caac46fd6aa8d..97a39e9d0d3ee33d62c97f2a5b0f57e6bd656432 100644 (file)
@@ -37,9 +37,9 @@ class PPanel(wx.Panel):
         for w in self.GetChildren():
             w.Enable(value)
         #wx.Panel.Enable(self, value)
         for w in self.GetChildren():
             w.Enable(value)
         #wx.Panel.Enable(self, value)
-    def SetModified(self):
-        self.modified = True
-        g.panel.SetModified(True)
+    def SetModified(self, state=True):
+        self.modified = state
+        if state: g.panel.SetModified(True)
     # Common method to set modified state
     def OnChange(self, evt):
         if self.freeze: return
     # Common method to set modified state
     def OnChange(self, evt):
         if self.freeze: return
@@ -320,7 +320,6 @@ class ParamFont(PPanel):
         dlg = wx.FontDialog(self, data)
         if dlg.ShowModal() == wx.ID_OK:
             font = dlg.GetFontData().GetChosenFont()
         dlg = wx.FontDialog(self, data)
         if dlg.ShowModal() == wx.ID_OK:
             font = dlg.GetFontData().GetChosenFont()
-            print font.GetEncoding()
             if font.GetEncoding() == wx.FONTENCODING_SYSTEM:
                 encName = ''
             else:
             if font.GetEncoding() == wx.FONTENCODING_SYSTEM:
                 encName = ''
             else:
@@ -421,7 +420,7 @@ class ParamUnit(PPanel):
             self.SetModified()
         except:
             # !!! Strange, if I use wx.LogWarning, event is re-generated
             self.SetModified()
         except:
             # !!! Strange, if I use wx.LogWarning, event is re-generated
-            print 'incorrect unit format'
+            print 'ERROR: incorrect unit format'
     def OnSpinUp(self, evt):
         self.Change(1)
     def OnSpinDown(self, evt):
     def OnSpinUp(self, evt):
         self.Change(1)
     def OnSpinDown(self, evt):
@@ -625,8 +624,7 @@ class ParamContent(PPanel):
         if self.textModified:           # text has newer value
             try:
                 return self.text.GetValue().split('|')
         if self.textModified:           # text has newer value
             try:
                 return self.text.GetValue().split('|')
-            except SyntaxError:
-                wx.LogError('Syntax error in parameter value: ' + self.GetName())
+            except ValueError:
                 return []
         return self.value
     def SetValue(self, value):
                 return []
         return self.value
     def SetValue(self, value):
@@ -648,6 +646,9 @@ class ParamContent(PPanel):
             self.SetModified()
             self.textModified = False
         dlg.Destroy()
             self.SetModified()
             self.textModified = False
         dlg.Destroy()
+    def SetModified(self, state=True):
+        PPanel.SetModified(self, state)
+        self.textModified = False
 
 # CheckList content
 class ParamContentCheckList(ParamContent):
 
 # CheckList content
 class ParamContentCheckList(ParamContent):
@@ -728,8 +729,7 @@ class ParamIntList(ParamContent):
         if self.textModified:           # text has newer value
             try:
                 self.value = map(int, self.text.GetValue().split('|'))
         if self.textModified:           # text has newer value
             try:
                 self.value = map(int, self.text.GetValue().split('|'))
-            except SyntaxError:
-                wx.LogError('Syntax error in parameter value: ' + self.GetName())
+            except ValueError:
                 self.value = []
         dlg = IntListDialog(self, self.value)
         if dlg.ShowModal() == wx.ID_OK:
                 self.value = []
         dlg = IntListDialog(self, self.value)
         if dlg.ShowModal() == wx.ID_OK:
index 92e855b9f23810bab4bbdf05ddc755dba9275dfb..e1b80ef94f5bfa2c2ca0cbff69fbb45f444cf20c 100644 (file)
@@ -311,11 +311,10 @@ class Frame(wx.Frame):
 
         tree.RegisterKeyEvents()
 
 
         tree.RegisterKeyEvents()
 
-        # !!! frame styles are broken
-        # Miniframe for not embedded mode
-        miniFrame = wx.Frame(self, -1, 'Properties & Style',
-                            (conf.panelX, conf.panelY),
-                            (conf.panelWidth, conf.panelHeight))
+        # Miniframe for split mode
+        miniFrame = wx.MiniFrame(self, -1, 'Properties & Style',
+                                 (conf.panelX, conf.panelY),
+                                 (conf.panelWidth, conf.panelHeight))
         self.miniFrame = miniFrame
         sizer2 = wx.BoxSizer()
         miniFrame.SetAutoLayout(True)
         self.miniFrame = miniFrame
         sizer2 = wx.BoxSizer()
         miniFrame.SetAutoLayout(True)
@@ -910,6 +909,7 @@ class Frame(wx.Frame):
             self.miniFrame.Show(True)
             self.miniFrame.SetDimensions(conf.panelX, conf.panelY,
                                          conf.panelWidth, conf.panelHeight)
             self.miniFrame.Show(True)
             self.miniFrame.SetDimensions(conf.panelX, conf.panelY,
                                          conf.panelWidth, conf.panelHeight)
+            self.miniFrame.Layout()
             # Reduce width
             self.SetDimensions(pos.x, pos.y,
                                max(size.width - sizePanel.width, self.minWidth), size.height)
             # Reduce width
             self.SetDimensions(pos.x, pos.y,
                                max(size.width - sizePanel.width, self.minWidth), size.height)
@@ -1285,14 +1285,18 @@ Homepage: http://xrced.sourceforge.net\
         return
 
     def OnIconize(self, evt):
         return
 
     def OnIconize(self, evt):
-        conf.x, conf.y = self.GetPosition()
-        conf.width, conf.height = self.GetSize()
-        if conf.embedPanel:
-            conf.sashPos = self.splitter.GetSashPosition()
+        if evt.Iconized():
+            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()
+                self.miniFrame.Iconize()
         else:
         else:
-            conf.panelX, conf.panelY = self.miniFrame.GetPosition()
-            conf.panelWidth, conf.panelHeight = self.miniFrame.GetSize()
-            self.miniFrame.Iconize()
+            if not conf.embedPanel:
+                self.miniFrame.Iconize(False)
         evt.Skip()
 
     def OnCloseWindow(self, evt):
         evt.Skip()
 
     def OnCloseWindow(self, evt):
index 4144307da09fcdc6e2d46ffa353916a4f16e57b7..9f98f0c6cb54a0194d505ba827f23d6fbb5cbcf7 100644 (file)
@@ -314,6 +314,24 @@ class xxxObject:
         else: obj = self
         obj.name = name
         obj.element.setAttribute('name', name)
         else: obj = self
         obj.name = name
         obj.element.setAttribute('name', name)
+    # Special processing for growablecols-like parameters
+    # represented by several nodes
+    def special(self, tag, node):
+        print 'special',tag
+        if not self.params.has_key(tag):
+            # Create new multi-group
+            self.params[tag] = xxxParamMulti(node)
+        self.params[tag].append(xxxParamInt(node))
+    def setSpecial(self, param, value):
+        # Straightforward implementation: remove, add again
+        self.params[param].remove()
+        del self.params[param]
+        for i in value:
+            node = g.tree.dom.createElement(param)
+            text = g.tree.dom.createTextNode(str(i))
+            node.appendChild(text)
+            self.element.appendChild(node)
+            self.special(param, node)
 
 # Imitation of FindResource/DoFindResource from xmlres.cpp
 def DoFindResource(parent, name, classname, recursive):
 
 # Imitation of FindResource/DoFindResource from xmlres.cpp
 def DoFindResource(parent, name, classname, recursive):
@@ -771,45 +789,11 @@ class xxxFlexGridSizer(xxxGridSizer):
     specials = ['growablecols', 'growablerows']
     allParams = ['cols', 'rows', 'vgap', 'hgap'] + specials
     paramDict = {'growablecols': ParamIntList, 'growablerows': ParamIntList}
     specials = ['growablecols', 'growablerows']
     allParams = ['cols', 'rows', 'vgap', 'hgap'] + specials
     paramDict = {'growablecols': ParamIntList, 'growablerows': ParamIntList}
-    # Special processing for growable* parameters
-    # (they are represented by several nodes)
-    def special(self, tag, node):
-        if not self.params.has_key(tag):
-            # Create new multi-group
-            self.params[tag] = xxxParamMulti(node)
-        self.params[tag].append(xxxParamInt(node))
-    def setSpecial(self, param, value):
-        # Straightforward implementation: remove, add again
-        self.params[param].remove()
-        del self.params[param]
-        for i in value:
-            node = g.tree.dom.createElement(param)
-            text = g.tree.dom.createTextNode(str(i))
-            node.appendChild(text)
-            self.element.appendChild(node)
-            self.special(param, node)
 
 class xxxGridBagSizer(xxxSizer):
     specials = ['growablecols', 'growablerows']
     allParams = ['vgap', 'hgap'] + specials
 
 class xxxGridBagSizer(xxxSizer):
     specials = ['growablecols', 'growablerows']
     allParams = ['vgap', 'hgap'] + specials
-    paramDict = {'growablecols':ParamIntList, 'growablerows':ParamIntList}
-    # Special processing for growable* parameters
-    # (they are represented by several nodes)
-    def special(self, tag, node):
-        if not self.params.has_key(tag):
-            # Create new multi-group
-            self.params[tag] = xxxParamMulti(node)
-        self.params[tag].append(xxxParamInt(node))
-    def setSpecial(self, param, value):
-        # Straightforward implementation: remove, add again
-        self.params[param].remove()
-        del self.params[param]
-        for i in value:
-            node = g.tree.dom.createElement(param)
-            text = g.tree.dom.createTextNode(str(i))
-            node.appendChild(text)
-            self.element.appendChild(node)
-            self.special(param, node)
+    paramDict = {'growablecols': ParamIntList, 'growablerows': ParamIntList}
 
 # Container with only one child.
 # Not shown in tree.
 
 # Container with only one child.
 # Not shown in tree.