dabo Commit
Revision 5130
Date: 2009-03-15 10:34:13 -0700 (Sun, 15 Mar 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5130
Changed:
U trunk/dabo/lib/propertyHelperMixin.py
U trunk/dabo/ui/uiwx/dPemMixin.py
U trunk/dabo/ui/uiwx/dSpinner.py
Log:
Fixed the problem with the On* parameters not being correctly bound to
dSpinner. Also cleaned up some code in the propertyHelperMixin and dPemMixin
classes in the event dict handling.
Diff:
Modified: trunk/dabo/lib/propertyHelperMixin.py
===================================================================
--- trunk/dabo/lib/propertyHelperMixin.py 2009-03-14 20:14:02 UTC (rev
5129)
+++ trunk/dabo/lib/propertyHelperMixin.py 2009-03-15 17:34:13 UTC (rev
5130)
@@ -73,7 +73,6 @@
for kw, evtName in onKWs:
evtdict[evtName] = kwdict[kw]
del kwdict[kw]
- return evtdict
def _extractKey(self, kwdict, key, defaultVal=None):
@@ -95,7 +94,6 @@
ret = dd[key]
found = True
del dd[key]
-# break
except KeyError:
pass
return ret
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py 2009-03-14 20:14:02 UTC (rev 5129)
+++ trunk/dabo/ui/uiwx/dPemMixin.py 2009-03-15 17:34:13 UTC (rev 5130)
@@ -99,7 +99,7 @@
self._properties[k] = v
properties = self._extractKeywordProperties(kwargs,
self._properties)
- kwEvents = self._extractKeyWordEventBindings(kwargs,
self._kwEvents)
+ self._extractKeyWordEventBindings(kwargs, self._kwEvents)
# Objects created from XML files will have their props passed
# in the 'attProperties' parameter, in which all values are
strings.
# Convert these to the properties dict.
Modified: trunk/dabo/ui/uiwx/dSpinner.py
===================================================================
--- trunk/dabo/ui/uiwx/dSpinner.py 2009-03-14 20:14:02 UTC (rev 5129)
+++ trunk/dabo/ui/uiwx/dSpinner.py 2009-03-15 17:34:13 UTC (rev 5130)
@@ -68,8 +68,10 @@
# Because several properties could not be set until after the
child
# objects were created, we need to manually call
_setProperties() here.
self._properties["NameBase"] = nm
- self._setProperties(self._properties)
- self.autoBindEvents()
+
+ self._setNameAndProperties(self._properties, **kwargs)
+# self._setProperties(self._properties)
+# self.autoBindEvents()
ps = self._proxy_spinner
pt = self._proxy_textbox
# Set an essentially infinite range. We'll handle the range
ourselves.
@@ -431,70 +433,10 @@
print "Spinner event."
-
-if __name__ == '__main__':
- class TestForm(dabo.ui.dForm):
- def afterInit(self):
- pnl = dabo.ui.dPanel(self)
- self.Sizer.append1x(pnl)
- sz = pnl.Sizer = dabo.ui.dSizer("v")
-
- spn = self.spinner = _dSpinner_test(pnl)
- sz.append(spn, border=10, halign="center")
-
- lbl = dabo.ui.dLabel(pnl, Caption=_("Spinner
Properties"), FontSize=18,
- FontBold=True)
- sz.appendSpacer(10)
- sz.append(lbl, halign="center")
- sz.appendSpacer(4)
-
- gsz = dabo.ui.dGridSizer(MaxCols=2, HGap=4, VGap=6)
- lbl = dabo.ui.dLabel(pnl, Caption="Min")
- txt = dabo.ui.dTextBox(pnl, DataSource=spn,
DataField="Min", StrictNumericEntry=False)
- gsz.append(lbl, halign="right")
- gsz.append(txt)
- lbl = dabo.ui.dLabel(pnl, Caption="Max")
- txt = dabo.ui.dTextBox(pnl, DataSource=spn,
DataField="Max", StrictNumericEntry=False)
- gsz.append(lbl, halign="right")
- gsz.append(txt)
- lbl = dabo.ui.dLabel(pnl, Caption="Increment")
- txt = dabo.ui.dTextBox(pnl, DataSource=spn,
DataField="Increment", StrictNumericEntry=False)
- gsz.append(lbl, halign="right")
- gsz.append(txt)
- lbl = dabo.ui.dLabel(pnl, Caption="SpinnerWrap")
- chk = dabo.ui.dCheckBox(pnl, DataSource=spn,
DataField="SpinnerWrap")
- gsz.append(lbl, halign="right")
- gsz.append(chk)
- lbl = dabo.ui.dLabel(pnl, Caption="FontSize")
- txt = dabo.ui.dTextBox(pnl, DataSource=spn,
DataField="FontSize")
- gsz.append(lbl, halign="right")
- gsz.append(txt)
- lbl = dabo.ui.dLabel(pnl, Caption="Height")
- txt = dabo.ui.dTextBox(pnl, DataSource=spn,
DataField="Height")
- gsz.append(lbl, halign="right")
- gsz.append(txt)
- lbl = dabo.ui.dLabel(pnl, Caption="ForeColor")
- txt = dabo.ui.dTextBox(pnl, ReadOnly=True,
DataSource=spn, DataField="ForeColor")
- btn = dabo.ui.dButton(pnl, Caption="...",
OnHit=self.onColor, Width=36)
- hsz = dabo.ui.dSizer("h")
- hsz.append(txt, 1)
- hsz.append(btn)
- gsz.append(lbl, halign="right")
- gsz.append(hsz)
- lbl = dabo.ui.dLabel(pnl, Caption="Enabled")
- chk = dabo.ui.dCheckBox(pnl, DataSource=spn,
DataField="Enabled")
- gsz.append(lbl, halign="right")
- gsz.append(chk)
-
- sz.append(gsz, halign="center")
- self.update()
- self.layout()
-
- def onColor(self, evt):
- color = dabo.ui.getColor(self.spinner.ForeColor)
- if color is not None:
- self.spinner.ForeColor = color
- self.update()
-
- app = dabo.dApp(MainFormClass=TestForm)
+if __name__ == "__main__":
+ class Test(dabo.ui.dForm):
+ def OH(self, evt): print "HIT"
+ def afterInitAll(self):
+ self.spn = dabo.ui.dSpinner(self, Value=3,
OnHit=self.OH)
+ app = dabo.dApp(MainFormClass=Test)
app.start()
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]