From: Kevin A. <ka...@us...> - 2004-08-23 15:07:00
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20760/tools/resourceEditor/modules Modified Files: propertyEditor.py Log Message: added autoAttributeUpdate flag and event handlers for testing updating Index: propertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/propertyEditor.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** propertyEditor.py 12 Aug 2004 19:14:23 -0000 1.49 --- propertyEditor.py 23 Aug 2004 15:06:50 -0000 1.50 *************** *** 25,28 **** --- 25,29 ---- self._comp = self._parent.components self._updatingComponent = 0 + self.autoAttributeUpdate = True ##self.components.addChangeEventListener(self) self._comp.addChangeEventListener(self) *************** *** 45,48 **** --- 46,92 ---- self.visible = True + # KEA 2004-08-23 + # support updating of attributes without the need + # for clicking the Update button + def on_wField_closeField(self, event): + if self.autoAttributeUpdate: + self.updateComponent() + + def on_wTextArea_closeField(self, event): + if self.autoAttributeUpdate: + self.updateComponent() + + def on_wChecked_mouseClick(self, event): + if self.autoAttributeUpdate: + self.updateComponent() + + def on_wPop_select(self, event): + if self.autoAttributeUpdate: + self.updateComponent() + + def on_wColor_mouseClick(self, event): + result = dialog.colorDialog(self) + if result.accepted: + self.components.wField.text = str(result.color) + if self.autoAttributeUpdate: + self.updateComponent() + + def on_wFont_mouseClick(self, event): + wName, wClass = self.components.wComponentList.stringSelection.split(" : ") + ##widget = self.components[wName] + widget = self._comp[wName] + f = widget.font + if f is None: + desc = font.fontDescription(widget.GetFont()) + f = font.Font(desc) + result = dialog.fontDialog(self, f) + if result.accepted: + #color = dlg.getColor() + f = result.font + #self.components.wField.SetValue("%s;%s" % (f, color)) + self.components.wField.text = "%s" % f + if self.autoAttributeUpdate: + self.updateComponent() + def addWidgetToComponentList(self, widget): *************** *** 125,128 **** --- 169,175 ---- def on_wUpdate_mouseClick(self, event): + self.updateComponent() + + def updateComponent(self): # make these attributes of self, since they are duplicated below in displayProperty checkItems = ['enabled', 'visible', 'editable', 'checked', 'default', 'rules', 'labels', 'ticks'] *************** *** 268,291 **** self._parent.showSizingHandles(wName) - def on_wColor_mouseClick(self, event): - result = dialog.colorDialog(self) - if result.accepted: - self.components.wField.text = str(result.color) - - def on_wFont_mouseClick(self, event): - wName, wClass = self.components.wComponentList.stringSelection.split(" : ") - ##widget = self.components[wName] - widget = self._comp[wName] - f = widget.font - if f is None: - desc = font.fontDescription(widget.GetFont()) - f = font.Font(desc) - result = dialog.fontDialog(self, f) - if result.accepted: - #color = dlg.getColor() - f = result.font - #self.components.wField.SetValue("%s;%s" % (f, color)) - self.components.wField.text = "%s" % f - def setValidProps(self, wClass): #print "setValidProps", wClass --- 315,318 ---- |