Opened 11 years ago

Closed 10 years ago

#11460 closed defect (fixed)

wxDataViewCtrl, Toggle, DblClick no more working to change the boolean state.

Reported by: spectrum Owned by:
Priority: normal Milestone: 2.9.1
Component: GUI-generic Version: stable-latest
Keywords: wxDataViewCtrl wxDataViewCustomRenderer regression Cc:
Blocked By: Blocking:
Patch: no

Description

Hi all,

i have seen that some changes in progress probably in the svn. Actually, double click in the checkbox don't produce any ITEM_VALUE_CHANGED, mainly for this line:

virtual wxDataViewCustomRenderer *WXGetAsCustom() { return NULL; }

So, i added this patch, take it just as a workaround for me.

datavgen.cpp
3545a3548,3552


}

else

{

model->ItemChanged(item);

regards,
Angelo Dureghello

Change History (4)

comment:1 Changed 11 years ago by rk

  • Patch unset
  • Status changed from new to confirmed

The problem can be seen in the dataview sample. Since r62589 it is no longer possible to toggle the items on the third page. Apparently only 'custum renderers' will get their Activate() method called on double-click in wxDataViewMainWindow::OnMouse(), because they override WXGetAsCustom(). wxDataViewToggleRenderer (wxDataViewDateRenderer suffers the same problem, btw) are no custom renderers and therefor don't work anymore. The fix should be easy: just derive wxDataViewToggleRenderer and wxDataViewDateRenderer from wxDataViewCustomRenderer to get the old behavior back. Or (at least for wxDataViewToggleRenderer) this could be a good opportunity to fix #11362.

comment:2 Changed 11 years ago by spectrum

many thanks,

i actually fixed this issue as you suggested:

from dvrenderers.h
92c92
< class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
---
> class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewCustomRenderer
173c173
< class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewRenderer
---
> class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewCustomRenderer


from  datavgen.cpp
778c778
<     wxDataViewRenderer( varianttype, mode, align )
---
>     wxDataViewCustomRenderer( varianttype, mode, align )
940c940
<     wxDataViewRenderer( varianttype, mode, align )
---
>     wxDataViewCustomRenderer( varianttype, mode, align )

I agree perfectly with the suggestion of bug #11362. Hope to find the time to fix it too.
Actually, still remain open the issue about the wxALIGN_LEFT no more respected (#11459), checkbox are in the middle of the colum, even if the colum is created with wxALIGN_LEFT.
I have posted a workaround.

comment:3 Changed 11 years ago by vadz

  • Keywords regression added
  • Milestone set to 2.9.1

The whole refactoring of renderer classes was done in order to avoid deriving the standard renderers from wxDataViewCustomRenderer and thus to have the same hierarchy in the generic version as in the native ones so I definitely don't want to fix it like this.

Not calling Activate() for the standard renderers is also intentional, see the comment near WXGetAsCustom() declaration in wx/generic/dvrenderer.h.

Of course, the problem still needs to be fixed somehow. Maybe by adding another virtual function (clearly marked as internal, starting with WX prefix). Or maybe by processing ITEM_ACTIVATED event in the control itself.

comment:4 Changed 10 years ago by VZ

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

(In [64654]) Fix activation handling in generic wxDataViewCtrl renderers.

Handling of activation in the generic implementation of standard renderers was
broken since r62589 which stopped calling their Activate() method. Restore it
by introducing a special WXOnActivate() replacing it (but clearly marked as
private and implementation-only) and calling it instead.

Closes #11460.

Note: See TracTickets for help on using tickets.