From: Kevin A. <ka...@us...> - 2004-10-03 19:22:58
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7256/tools/resourceEditor/modules Modified Files: propertyEditor.py Log Message: renamed cantmodify to cantModify made checkItems, popItems, cantModify attributes of self to avoid duplicate lists added userdata to list of items not to eval, userdata is just a string Index: propertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/propertyEditor.py,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** propertyEditor.py 30 Sep 2004 23:04:53 -0000 1.55 --- propertyEditor.py 3 Oct 2004 19:21:34 -0000 1.56 *************** *** 29,32 **** --- 29,38 ---- self._comp.addChangeEventListener(self) + self.checkItems = ['enabled', 'visible', 'editable', 'checked', 'default', \ + 'rules', 'labels', 'ticks', 'horizontalScrollbar'] + self.popItems = ['layout', 'border', 'style', 'alignment', 'stringSelection'] + self.cantModify = ['id', 'name', 'alignment', 'layout', 'style', 'border', \ + 'horizontalScrollbar', 'min', 'max', 'columns', 'rules', 'labels', 'ticks'] + self.editItems = [self.components.wField, self.components.wColor, self.components.wFont, self.components.wTextArea, *************** *** 183,201 **** def updateComponent(self): - # make these attributes of self, since they are duplicated below in displayProperty - checkItems = ['enabled', 'visible', 'editable', 'checked', 'default', 'rules', 'labels', 'ticks', 'horizontalScrollbar'] - popItems = ['layout', 'border', 'style', 'alignment', 'stringSelection'] - cantmodify = ['id', 'name', 'alignment', 'layout', 'style', 'border', 'horizontalScrollbar', \ - 'min', 'max', 'columns', 'rules', 'labels', 'ticks'] - wName, wClass = self.components.wComponentList.stringSelection.split(" : ") propName = self.components.wPropertyList.stringSelection ! # KEA 2002-02-23 ! ##if propName not in cantmodify: ! #print "updating", wName ! if propName in checkItems: value = self.components.wChecked.checked ! elif propName in popItems: value = self.components.wPop.stringSelection elif propName in ('items', 'userdata') or (wClass == 'TextArea' and propName == 'text'): --- 189,198 ---- def updateComponent(self): wName, wClass = self.components.wComponentList.stringSelection.split(" : ") propName = self.components.wPropertyList.stringSelection ! if propName in self.checkItems: value = self.components.wChecked.checked ! elif propName in self.popItems: value = self.components.wPop.stringSelection elif propName in ('items', 'userdata') or (wClass == 'TextArea' and propName == 'text'): *************** *** 205,209 **** value = self.components.wField.text ! if propName not in ['label', 'stringSelection', 'text', 'toolTip']: try: value = eval(value) --- 202,206 ---- value = self.components.wField.text ! if propName not in ['label', 'stringSelection', 'text', 'toolTip', 'userdata']: try: value = eval(value) *************** *** 254,258 **** #print widget.size, propName, width, height else: ! if (propName in cantmodify) or \ (propName == 'items' and wClass == 'RadioGroup'): order = self._comp.order.index(wName) --- 251,255 ---- #print widget.size, propName, width, height else: ! if (propName in self.cantModify) or \ (propName == 'items' and wClass == 'RadioGroup'): order = self._comp.order.index(wName) *************** *** 358,377 **** def displayProperty(self, wName, wClass, propName): - checkItems = ['enabled', 'visible', 'editable', 'checked', 'default', 'rules', 'labels', 'ticks', 'horizontalScrollbar'] - popItems = ['layout', 'border', 'style', 'alignment', 'stringSelection'] - self.components.wName.text = propName + ":" ##widget = self.components[wName] widget = self._comp[wName] ! if propName in ['label', 'stringSelection', 'text', 'toolTip'] or propName in checkItems: value = getattr(widget, propName) else: value = str(getattr(widget, propName)) ! if propName in checkItems: self.hideAllBut(self.components.wChecked) self.components.wChecked.visible = True self.components.wChecked.checked = value ! elif propName in popItems: self.hideAllBut(self.components.wPop) self.components.wPop.visible = True --- 355,371 ---- def displayProperty(self, wName, wClass, propName): self.components.wName.text = propName + ":" ##widget = self.components[wName] widget = self._comp[wName] ! if propName in ['label', 'stringSelection', 'text', 'toolTip'] or propName in self.checkItems: value = getattr(widget, propName) else: value = str(getattr(widget, propName)) ! if propName in self.checkItems: self.hideAllBut(self.components.wChecked) self.components.wChecked.visible = True self.components.wChecked.checked = value ! elif propName in self.popItems: self.hideAllBut(self.components.wPop) self.components.wPop.visible = True |