How to get notified when user aborts editing an item in a wxDataViewCtrl

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to get notified when user aborts editing an item in a wxDataViewCtrl

Andreas Falkenhahn
How can I get notified when the user aborts editing an item in a
wxDataViewCtrl? I tried to listen to wxEVT_DATAVIEW_ITEM_EDITING_DONE
and then call IsEditCancelled() on the wxDataViewEvent but
that doesn't work because wxEVT_DATAVIEW_ITEM_EDITING_DONE
doesn't seem to be generated when the user aborts an editing operation.
Platform is MSW.

So how should this be done instead? I don't see anything else that
could be up for this job in the docs...

--
Best regards,
 Andreas Falkenhahn                          mailto:[hidden email]

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to get notified when user aborts editing an item in a wxDataViewCtrl

Vadim Zeitlin-4
On Wed, 29 Mar 2017 16:51:41 +0200 Andreas Falkenhahn wrote:

AF> How can I get notified when the user aborts editing an item in a
AF> wxDataViewCtrl? I tried to listen to wxEVT_DATAVIEW_ITEM_EDITING_DONE
AF> and then call IsEditCancelled() on the wxDataViewEvent but
AF> that doesn't work because wxEVT_DATAVIEW_ITEM_EDITING_DONE
AF> doesn't seem to be generated when the user aborts an editing operation.
AF> Platform is MSW.

 Unfortunately it looks like a bug because I don't see why would we have
IsEditCancelled() in wxDataViewEvent at all if we didn't intend to send
such event when editing is cancelled.

 Fixing this doesn't look too difficult, but I'm a bit worried by the fact
that this currently seems to be not done in _any_ of the implementations
(although I didn't have time to test the GTK and Mac ones, this is just
from reading the code), so the existing code handling ITEM_EDITING_DONE
might be surprised to be called when editing is cancelled... Maybe we need
a new ITEM_EDITING_CANCELLED?

 In any case, this clearly merits a ticket, if there is no opened one about
this yet.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to get notified when user aborts editing an item in a wxDataViewCtrl

Andreas Falkenhahn
On 29.03.2017 at 21:58 Vadim Zeitlin wrote:

> On Wed, 29 Mar 2017 16:51:41 +0200 Andreas Falkenhahn wrote:

AF>> How can I get notified when the user aborts editing an item in a
AF>> wxDataViewCtrl? I tried to listen to wxEVT_DATAVIEW_ITEM_EDITING_DONE
AF>> and then call IsEditCancelled() on the wxDataViewEvent but
AF>> that doesn't work because wxEVT_DATAVIEW_ITEM_EDITING_DONE
AF>> doesn't seem to be generated when the user aborts an editing operation.
AF>> Platform is MSW.

>  Unfortunately it looks like a bug because I don't see why would we have
> IsEditCancelled() in wxDataViewEvent at all if we didn't intend to send
> such event when editing is cancelled.

>  Fixing this doesn't look too difficult, but I'm a bit worried by the fact
> that this currently seems to be not done in _any_ of the implementations
> (although I didn't have time to test the GTK and Mac ones, this is just
> from reading the code), so the existing code handling ITEM_EDITING_DONE
> might be surprised to be called when editing is cancelled... Maybe we need
> a new ITEM_EDITING_CANCELLED?

>  In any case, this clearly merits a ticket, if there is no opened one about
> this yet.

Alright, I've just opened new ticket #17835.

--
Best regards,
 Andreas Falkenhahn                            mailto:[hidden email]

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Loading...