Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15731 closed defect (fixed)

wxDataViewCtrl hit test is still beroken when toggle column is left aligned

Reported by: koichi Owned by: vadz
Priority: normal Milestone: 3.0.1
Component: GUI-generic Version: dev-latest
Keywords: datavgen Cc:
Blocked By: Blocking:
Patch: no


I think that r73854 caused this regression.
Maybe with r73835 and r73838, the column was forced center aligned, and r73854 reverted some of these changes to correctly handle the alignment.
However, now the hit test is broken again when column is left aligned.

I also noticed some inconsistency in the DataViewCtrl API.
When alignment is not passed to AppendToggleColumn() function, the default value of the base wxDataViewCtrl class is wxALIGN_CENTER, where as that of wxDataViewListCtrl is wxALIGN_LEFT. It is nice to make them consistent.

Change History (6)

comment:1 Changed 4 years ago by vadz

How can the problem be reproduced exactly?

comment:2 Changed 4 years ago by koichi

On wxMSW, execute the dataview sample, open wxDataViewListCtrl tab, and widen width of the first toggle column. If you click where the check mark is shown (left side of column), nothing is happen but if you click the center position of the column, check marks can be on/off.

comment:3 Changed 4 years ago by vadz

  • Milestone set to 3.0.1
  • Owner set to vadz
  • Status changed from new to accepted

I think the changes of r73854 are correct, they just don't use the correct alignment :-( This should be fixed in the patch I've just uploaded to, please let me know if you still see any problems with it.


P.S. Note to self: need to duplicate GetEffectiveAlignment() code in 3.0 version as changing the method access changes the ABI.

comment:4 Changed 4 years ago by koichi

Thank you for quick fix, Vadim.
It's perfect!

comment:5 Changed 4 years ago by VZ

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

(In [75329]) Use correct cell alignment in generic wxDataViewCtrl mouse handling code.

Don't fall back to wxALIGN_CENTRE, even if the renderer doesn't specify its
own alignment we still have to take the column alignment in consideration, so
use GetEffectiveAlignment() (which had to be made public for this).

This notably fixes (again) hit testing for wxDataViewToggleRenderer in the
generic version.

Closes #15731.

comment:6 Changed 4 years ago by VZ

(In [75330]) Fix clicking on checkboxes in generic wxDataViewCtrl.

Back port the fix of r75329 from the trunk but without changing
GetEffectiveAlignment() visibility to avoid changing the ABI.

See #15731.

Note: See TracTickets for help on using tickets.