I guess I'm a taker on this one .
(See also previous post in reply to the thread.) I already have the (working) basics of a property-based property-value-editing system. Below are some details...
Object Schema:
PropertyView (versions for single objects or multiple)
- PropertyTable (wxPyGridTable with support for accessing object properties for populating the property table)
- PropertySet (holder for a set of property definitions, you could use different property sets to provide different views of a given object. Eventually you could allow the property set's definition collection to be edited by the user, thereby re-configuring a view (think the "edit columns" functions you see in Outlook, Mozilla, etceteras))
- PropertyDefinition(s)
- property object (get/set functionality)
- ViewClass (doesn't work with wxPython 2.3.2 due to bug that's already fixed in CVS, but not yet propagated)
- EditClass
- (planned) sort/iterate functionality (click on property title to sort by property value)
- object / collection with which we're working
If Python < 2.2 compatability is a serious concern, I (or someone) could create a version that doesn't use property objects in the PropertyDefinition(s) etc. All-in-all, Python < 2.2 is not something I care about for myself, but I might be willing to work on once I've got everything else finished (whenever that might occur), but I'd really expect that I'll spend my time elsewhere for the forseeable future.
The current EditClass set is rather small:
calendar (wxCalendar control in a pop-up-like window, edits mxDateTime values),
single choice from given set of objects (drop-down list in-cell),
multiple choice from given set of objects (drag-and-drop list controls in pop-up),
colour choice from pallette (currently using wxpycolours, could use other controls with little problem, pop-up),
long-text editor (wxTextCtrl in pop-up),
time-of-day (h:m in-cell editor),
and the standard in-cell string editor.
The pop-up functionality is done with an "edit" button in the cell, other approaches didn't work well with the grid when I tried them.
Eventually I'm intending to include generic collection-editing mechanisms (add,reorder, delete) so that you can take a property collection view and use them to automatically edit nested hierarchies of objects.
General philosophy is to:
make everything object-oriented (that is, you edit Python objects, you don't translate into particular data types (which requires wrapping controls sometimes)),
provide a decent pallette of editors/viewers so that the end-developer can often just specify a standard editor for their property,
notwithstanding the last point, make creating new editors/viewers easy, so that developers can make a professional-looking UI when using the property editor classes.
If there is interest, I can check the package into a new project on SourceForge and add other developers in.
Enjoy yourselves,
Mike
Robin Dunn wrote:
are you planning on adding wxPropertyListView and the other Property
classes
to wxPython?
No definite plans but I can add it to the todo list. On the other hand,
this may be the type of thing that a better solution could be done in Python
and added to the wxPython.lib package. Any takers?
...