agraeper@googlemail.com wrote:
hi,
version is 2.8.10.1.
That's very old, even for the 2.8 series.
in demo (for this version) i found that ApplyEdit is not used. and as
expected new values are written to grid / table in EndEdit
but as in most cases are examples rather simple and does not explain the
situation in full depths
Most people start with the cell editor in the GridCustEditor sample in the demo and adapt it to their needs, one step at a time until it does what they need it to do. That way if there is something you do not understand now it will most likely not be something you need to worry about right away because it came from a working sample.
what is method HandleReturn() for and how it is used ?
It is a method in the base class and it will be called when the default key event handlers are processing the Return key, in case the editor class wants to do some extra processing. The default implementation doesn't do anything except Skip() the key event.
now i bind EVT_KEY (handling Return only) to the control (DatePicker) in
Create()
If you follow the example and do PushEventHandler(evtHandler) in Create then it should already be handling the key events in the control in a grid standard way, perhaps delegating them to the grid for processing.
do i have to call EndEdit(self,row,col,grid) directly ?
therefore i have to save row,col,grid in BeginEdit() .
No, the grid code should be calling it.
EndEdit() has a new argument forceEnd=False
and if it is called from OnKey() keycode==Return with forceEnd=True i
want to force EndEdit() to return True, no matter whether new_value !=
old_value or similiar.
but the Editor does not disappear. instead the methods Show() SetSize()
Show() BeginEdit() are called.
what is to do ?
You'll probably be better off just calling the grid's DisableCellEditControl() and let it take care of it.
what is DateTimeRenderer for ? it accepts all cell-values.
if it is handling wx.DateTime objects how can i get such object instead
of getting strings, how can i set objects instead of strings ?
Renderers are what are used to draw the contents of the cell when the cell editor is not active. It uses wxDateTime internally, and if I remember correctly the renderer can be created with date format strings that specify how to parse the cell's string value into a datetime object, and also the format used for display.
···
--
Robin Dunn
Software Craftsman