From: Arlo B. <abe...@us...> - 2004-12-31 20:44:41
|
Update of /cvsroot/pythoncard/PythonCard/tools/experimentalResourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23169/modules Modified Files: actionBinderDialog.py propertyEditor.py Log Message: * Refactored some attributes from Widget up to Component. In particular, Component's spec called for name and command, yet the properties to hold these were specified only at Widget. This made it impossible to inherit directly from Component and still be instantiated via the resources. I also moved the actionBindings up from Widget to Component, as they make more sense there. Component is now clearly "anything that can be manipulated as a resource (and instantiated via a .rsrc.py)", while Widget is "anything with a user interface (a size and a position describing where it can draw)". All Widgets are Components - we want to be able to instantiate any GUI element from the resource file. In the experimentalResourceEditor branch, I fixed a number of bugs that prevented the resource editor from dealing with Components that are not Widgets. The experimentalResourceEditor now fully handles UI-less Components (you can edit their properties via the PropertyEditor, but they don't appear in the ResourceEditor pane). AB Index: actionBinderDialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/experimentalResourceEditor/modules/actionBinderDialog.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** actionBinderDialog.py 24 Oct 2004 19:43:43 -0000 1.1 --- actionBinderDialog.py 31 Dec 2004 20:44:29 -0000 1.2 *************** *** 13,18 **** for inst in self.resource_editor.components.keys(): ! self.components.sourceComponent.append(inst) ! self.components.destinationComponent.append(inst) # if some special setup is necessary, do it here --- 13,19 ---- for inst in self.resource_editor.components.keys(): ! if inst not in self.resource_editor.sizingHandleNames: ! self.components.sourceComponent.append(inst) ! self.components.destinationComponent.append(inst) # if some special setup is necessary, do it here Index: propertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/experimentalResourceEditor/modules/propertyEditor.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** propertyEditor.py 24 Oct 2004 19:21:46 -0000 1.1 --- propertyEditor.py 31 Dec 2004 20:44:29 -0000 1.2 *************** *** 151,155 **** self.displayProperty(wName, wClass, propName) c = self._parent.components[wName] ! self._parent.setToolTipDrag(wName, c.position, c.size) def changed(self, event): --- 151,158 ---- self.displayProperty(wName, wClass, propName) c = self._parent.components[wName] ! if hasattr(c, 'position'): ! # AB 2004-12-31 ! # Don't set a tooltip pos for components that don't have a pos - they aren't displayed. ! self._parent.setToolTipDrag(wName, c.position, c.size) def changed(self, event): *************** *** 340,344 **** # and only when displaying dialog properties if not (self._parent.editingDialog and wClass == 'Button'): ! props.remove('id') props.sort() ##print "spec props", specProps --- 343,356 ---- # and only when displaying dialog properties if not (self._parent.editingDialog and wClass == 'Button'): ! # AB 2004-12-31 ! # The id attrib is optional, and may not be present. All widgets will have ! # IDs, but Components may not. If it is not present, then we don't need to remove it. ! if 'id' in props: ! props.remove('id') ! ! # AB 2004-12-31 ! # Don't show the action bindings at all. Edit them only via the action binding dialog. ! if 'actionBindings' in props: ! props.remove('actionBindings') props.sort() ##print "spec props", specProps *************** *** 433,439 **** self.components.wPropertyList.stringSelection = "name" self.displayProperty(wName, wClass, propName) - self._parent.showSizingHandles(wName) c = self._parent.components[wName] ! self._parent.setToolTipDrag(wName, c.position, c.size) def on_wPropertyList_select(self, event): --- 445,452 ---- self.components.wPropertyList.stringSelection = "name" self.displayProperty(wName, wClass, propName) c = self._parent.components[wName] ! if hasattr(c, 'position'): ! self._parent.showSizingHandles(wName) ! self._parent.setToolTipDrag(wName, c.position, c.size) def on_wPropertyList_select(self, event): |