Opened 19 months ago

Closed 12 months ago

Last modified 12 months ago

#15152 closed defect (fixed)

wxDataViewCtrl editing is not cancelled by clicking outside of the cell

Reported by: sparkin Owned by:
Priority: normal Milestone:
Component: GUI-generic Version: 2.9.4
Keywords: wxDataViewCtrl Cc:
Blocked By: Blocking:
Patch: no

Description

Here are the steps needed to reproduce this bug...

1) Open a wx application that features a wxDataViewCtrl with at least one row filled in.
2) Begin editing a cell using F2.
3) Without finishing your editing, resize the column header of the cell you're currently editing so that you expose some screen space in the cell behind the text edit box.
4) Left click on the exposed space and then press F2 quickly.

The repro is not 100%. It's about 90%, and takes some practice to be able to get it to happen every time.

What you will find is that more than one text edit box is now active. The active one is being obscured by the original one. The original edit box remains up and there is no way to close it.

Change History (3)

comment:1 Changed 19 months ago by vadz

  • Component changed from wxMSW to GUI-generic
  • Status changed from new to confirmed
  • Summary changed from wxDataViewCtrl editing of a cell can get messed up to wxDataViewCtrl editing is not cancelled by clicking outside of the cell

I can't reproduce it but maybe I didn't try enough times. Nevertheless we already have a problem with resizing not cancelling the edit, as it's clearly supposed to. The solution is probably to capture the mouse in the in-place edit control -- and react correctly to clicks outside of it and mouse broken event.

I'm pretty surprised we don't already capture the mouse in wxDataViewRendererBase::StartEditing().

comment:2 Changed 12 months ago by VS

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [75184]) Cancel editing in generic wxDVC when clicking outside of the editor control.

wxDataViewCtrl should behave as Explorer does on Windows: when an inline
editor control is open, clicking outside of it should close the editor
(preserving changes) in most cases - as a rule of thumb, when the
subsequent action could interfere with the editor somehow.

This was implemented by watching for focus change and so ignored clicks
made on non-focusable controls outside of wxDVC's main window area. In
particular, clicks on the list's header were ignored, even though they
could result in modifications of the editor's position or size.

Don't finish editing when the user right-clicks on the header,
consistently with Explorer. Opening the menu likewise still doesn't
finish editing, it is needed for access to editing operations.

Fixes #15152.

comment:3 Changed 12 months ago by VS

(In [75185]) Cancel editing in generic wxDVC when clicking outside of the editor control.

wxDataViewCtrl should behave as Explorer does on Windows: when an inline
editor control is open, clicking outside of it should close the editor
(preserving changes) in most cases - as a rule of thumb, when the
subsequent action could interfere with the editor somehow.

This was implemented by watching for focus change and so ignored clicks
made on non-focusable controls outside of wxDVC's main window area. In
particular, clicks on the list's header were ignored, even though they
could result in modifications of the editor's position or size.

Don't finish editing when the user right-clicks on the header,
consistently with Explorer. Opening the menu likewise still doesn't
finish editing, it is needed for access to editing operations.

Fixes #15152.

Note: See TracTickets for help on using tickets.