Hi Andrea et al.,
Subject says it all really. I have a HyperTreeList with tasks. The
first column shows the task subject, other columns may show the tasks'
due date, priority, budget, etc. If the user edits an item by clicking
a date column I'd like to show a DatePickerCtrl instead of the default
text control. If the user clicks the priority column I want to show a
SpinCtrl, etc. I'd appreciate an example of how to do that. If this is
not possible at the moment I plan to work on it myself and prepare a
(big?) patch for HyperTreeList.
Thanks, Frank
Hi Frank,
2009/11/8 Frank Niessink:
Hi Andrea et al.,
Subject says it all really. I have a HyperTreeList with tasks. The
first column shows the task subject, other columns may show the tasks'
due date, priority, budget, etc. If the user edits an item by clicking
a date column I'd like to show a DatePickerCtrl instead of the default
text control. If the user clicks the priority column I want to show a
SpinCtrl, etc. I'd appreciate an example of how to do that. If this is
not possible at the moment I plan to work on it myself and prepare a
(big?) patch for HyperTreeList.
This is currently not possible with HyperTreeList (or CustomTreeCtrl,
where the actual TreeTextCtrl is defined and where this use case
should be handled too). You can use any non-toplevel widget on the
right of a tree item text, but not to edit the tree item text itself.
It would be a nice addition though, both to CustomTreeCtrl and
HyperTreeList. If you could work out a patch for it, I'll happily
apply it to SVN.
The only thing to be aware of is that you shouldn't probably add new
window styles as HyperTreeList is already hitting the limit of
wx.Window styles... in other words, adding a new style will conflict
with basic wx.Window styles like wx.NO_BORDER or wx.CLIP_CHILDREN and
so on. I always found this to be a very bad limitation of wxWidgets,
wx.Window styles should either be set at much higher values or they
should have negative values so that custom controls could define as
many custom styles as they want without interfering with them.
Thank you!
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
Hi Andrea,
The only thing to be aware of is that you shouldn't probably add new
window styles as HyperTreeList is already hitting the limit of
wx.Window styles... in other words, adding a new style will conflict
with basic wx.Window styles like wx.NO_BORDER or wx.CLIP_CHILDREN and
so on. I always found this to be a very bad limitation of wxWidgets,
wx.Window styles should either be set at much higher values or they
should have negative values so that custom controls could define as
many custom styles as they want without interfering with them.
I wasn't planning on using any Windows style. My initial thinking is
that the API would allow the programmer to pass a control class for a
specific column, e.g. :
hyperTreeList.SetEditControl(MyDatePickerCtrlClass, columnIndex=3).
That would make the hyperTreeList instance use MyDatePickerCtrlClass
for editing values in column 3, instead of the default TextCtrl.
The MyDatePickerCtrlClass would need a way to convert the items value
in column 3 (e.g. '23/11/2009') into a wx.DateTime and vice versa. I'm
not sure how to tackle that yet.
Cheers, Frank
ยทยทยท
2009/11/8 Andrea Gavana <andrea.gavana@gmail.com>: