Opened 19 months ago

Closed 18 months ago

Last modified 18 months ago

#15144 closed defect (fixed)

Toggle columns in wxDataViewCtrl do not react to mouse clicks on windows

Reported by: Myrsloik Owned by:
Priority: normal Milestone:
Component: wxMSW Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

Toggling, and possibly other cells with activation, do not react to mouse clicks on windows.

How to reproduce:

  1. Compile and run the dataview sample.
  2. Go to the wxDataViewListCtrl tab.
  3. Try to toggle the Toggle column using the keyboard (space/enter) and it changes state.
  4. Try to toggle the Toggle column using the mouse and nothing happens.

Tested with svn revision 73775 on Windows 7.

Change History (3)

comment:1 Changed 18 months ago by VZ

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

(In [73835]) Fix hit testing in generic wxDataViewToggleRenderer.

Handle clicks on the checkboxes in generic wxDataViewCtrl correctly by taking
into account that the checkbox rectangle is centred inside the total cell
rectangle.

Closes #15144.

comment:2 Changed 18 months ago by VZ

(In [73838]) Really fix hit testing in the generic wxDataViewToggleRenderer.

The changes of r73835 fixed hit testing in horizontal direction but broke it
in the vertical one as the computed checkbox rectangle was not relative to the
cell rectangle as it should have been. Do fix this now.

See #15144.

comment:3 Changed 18 months ago by VZ

(In [73854]) Fix generic wxDataViewToggleRenderer hit testing with any alignment.

This change reverts the changes of r73835 and r73838 to
wxDataViewToggleRenderer::WXActivateCell() and instead fix the bug with mouse
hit testing in this function in the wxDataViewMainWindow::OnMouse() itself.
The problem there was that it offset the coordinates of the event differently
depending on whether the column alignment was set or left as default. Now
always make the coordinates relative to the item (not cell) rectangle for
compatibility with GTK+ native version, which is enough to make the original,
i.e. before the changes of r73835, code work.

See #15144.

Note: See TracTickets for help on using tickets.