Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#16132 closed defect (fixed)

wxDataViewToggleRenderer don't always toggle

Reported by: lpoujoulat Owned by: vadz
Priority: normal Milestone:
Component: GUI-generic Version: dev-latest
Keywords: wxDataViewCtrl toggle Cc:
Blocked By: Blocking:
Patch: yes

Description

In the generic version of wxDataViewCtrl, columns defined as toggle and ACTIVATABLE don't respond normally to click: it may not toggle, or toggle once and stick.

To reproduce, build the modified dataview sample (attached as patch) and try to check/uncheck the last column items.

Activation with keyboard (space) is ok.

Attachments (2)

sample.patch download (5.3 KB) - added by lpoujoulat 14 months ago.
toggle.patch download (1.1 KB) - added by lpoujoulat 14 months ago.

Download all attachments as: .zip

Change History (8)

Changed 14 months ago by lpoujoulat

comment:1 Changed 14 months ago by lpoujoulat

  • Patch set

The problem comes from a side effect of GetLineStart() that has a side effect on the used rendered, negating the internal state of the renderer set previously.

The attached patch fixes this

Changed 14 months ago by lpoujoulat

comment:2 Changed 14 months ago by vadz

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

Thanks for finding this one! I'm going to apply it, but I wonder if we shouldn't do something about GetLineStart() spoiling the effect of PrepareForItem() instead as this is completely unexpected and AFAICS the same bug happens in other places too, e.g. in wxEVT_PAINT.

comment:3 Changed 14 months ago by VZ

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

(In [76212]) Fix clicking on activatable toggle column in generic wxDataViewCtrl.

Call PrepareForItem() after calling GetLineStart() as the latter calls
PrepareForItem() for other items internally, undoing the effects of the first
call.

Closes #16132.

comment:4 Changed 14 months ago by VZ

(In [76213]) Another PrepareForItem()-related fix in generic wxDataViewCtrl.

This fix is similar to the previous commit but more speculative, as we
currently don't have a bug scenario for it. Still, it seems to be wrong to
call PrepareForItem() just before GetLineStart() which undoes its effect, so
exchange the order of the calls.

See #16132.

comment:5 Changed 14 months ago by VZ

(In [76217]) Fix clicking on activatable toggle column in generic wxDataViewCtrl.

Call PrepareForItem() after calling GetLineStart() as the latter calls
PrepareForItem() for other items internally, undoing the effects of the first
call.

Closes #16132.

comment:6 Changed 14 months ago by VZ

(In [76218]) Another PrepareForItem()-related fix in generic wxDataViewCtrl.

This fix is similar to the previous commit but more speculative, as we
currently don't have a bug scenario for it. Still, it seems to be wrong to
call PrepareForItem() just before GetLineStart() which undoes its effect, so
exchange the order of the calls.

See #16132.

Note: See TracTickets for help on using tickets.