daboide Commit
Revision 403
Date: 2006-01-27 18:04:46 -0800 (Fri, 27 Jan 2006)
Author: paul

Changed:
U   trunk/DesignerPropSheet.py

Log:
I'm beginning the work of providing custom property editors for things like
colors, and needed to rearrange the calling order in a minor way, in order
for my propgrid subclass to be able to override correctly. Also, I didn't 
want to disable the grid editor just because there was a custom editor. I
briefly tested with the UI designer and don't think I broke anything.


Diff:
Modified: trunk/DesignerPropSheet.py
===================================================================
--- trunk/DesignerPropSheet.py  2006-01-27 23:53:11 UTC (rev 402)
+++ trunk/DesignerPropSheet.py  2006-01-28 02:04:46 UTC (rev 403)
@@ -284,8 +284,9 @@
                obj = objs[0]
                newVal = dabo.ui.getColor(val)
                if newVal is not None:
-                       self.app.updatePropVal(prop, newVal, "color")
                        self.propGrid.CurrentValue = newVal
+                       self.updateVal(prop, newVal, "color")
+                       self.propGrid.refresh()
        
        
        def editFont(self, objs, prop, val):
@@ -293,7 +294,7 @@
                obj = objs[0]
                newVal = dabo.ui.getFont(obj.Font)
                if newVal is not None:
-                       self.app.updatePropVal(prop, newVal, "font")
+                       self.updateVal(prop, newVal, "font")
                        self.select(self._selected)
                        
        
@@ -302,8 +303,9 @@
                obj = objs[0]
                newVal = dabo.ui.getFile("jpg", "png", "gif", "bmp", "*")
                if newVal is not None:
-                       self.app.updatePropVal(prop, newVal, str)
                        self.propGrid.CurrentValue = newVal
+                       self.updateVal(prop, newVal, str)
+                       self.propGrid.refresh()
 
 
        def editChoice(self, objs, prop, val=[]):
@@ -319,8 +321,8 @@
                dlg.show()
                if dlg.Accepted:
                        newVal = dlg.editor.Choices
-                       self.app.updatePropVal(prop, newVal, list)
                        self.propGrid.CurrentValue = newVal
+                       self.updateVal(prop, newVal, list)
                        self.propGrid.refresh()
                dlg.release()
 
@@ -348,8 +350,8 @@
                                newVal = ["All"]
                        elif "None" in newVal:
                                newVal = ["None"]
-                       self.app.updatePropVal(prop, newVal, list)
                        self.propGrid.CurrentValue = newVal
+                       self.updateVal(prop, newVal, list)
                        self.propGrid.refresh()
                dlg.release()
 
@@ -509,12 +511,14 @@
                        self.Editable = not pd["readonly"]
                else:
                        self.Editable = False
-               custEditor = None
-               try:
-                       custEditor = pd["customEditor"]
-                       self.Editable = False
-               except KeyError:
-                       custEditor = None
+
+               custEditor = pd.get("customEditor")
+               if custEditor is not None:
+                       # PKM: Perhaps we should make an overridable 
AllowDirectEditing prop
+                       #      instead, but I want to allow direct editing of 
prop values in the 
+                       #      report desginer, even though the custom editor 
is enabled.
+                       self.Editable = (pd["type"] == str)
+
                # Tell the Handler how to handle any custom edits
                self.Handler.setCustomEditor(custEditor, self.getValue(row, 0))
                if not getattr(self.Handler.app, "isClosing", False):




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to