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

12 views
Skip to first unread message

wxTrac

unread,
Nov 19, 2009, 8:17:54 AM11/19/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/11460>

#11460: wxDataViewCtrl, Toggle, DblClick no more working to change the boolean
state.
-----------------------------------------------------+----------------------
Reporter: spectrum | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: GUI-generic | Version: 2.9-svn
Keywords: wxDataViewCtrl wxDataViewCustomRenderer | Blockedby:
Patch: 1 | Blocking:
-----------------------------------------------------+----------------------
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


--
Ticket URL: <http://trac.wxwidgets.org/ticket/11460>

wxTrac

unread,
Nov 20, 2009, 3:51:34 AM11/20/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/11460#comment:1>

#11460: wxDataViewCtrl, Toggle, DblClick no more working to change the boolean
state.
-----------------------------------------------------+----------------------
Reporter: spectrum | Owner:

Type: defect | Status: confirmed


Priority: normal | Milestone:
Component: GUI-generic | Version: 2.9-svn
Keywords: wxDataViewCtrl wxDataViewCustomRenderer | Blockedby:

Patch: 0 | Blocking:
-----------------------------------------------------+----------------------
Changes (by rk):

* status: new => confirmed
* patch: 1 => 0


Comment:

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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/11460#comment:1>

wxTrac

unread,
Nov 20, 2009, 8:47:54 AM11/20/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/11460#comment:2>

#11460: wxDataViewCtrl, Toggle, DblClick no more working to change the boolean
state.
-----------------------------------------------------+----------------------
Reporter: spectrum | Owner:

Type: defect | Status: confirmed


Priority: normal | Milestone:
Component: GUI-generic | Version: 2.9-svn
Keywords: wxDataViewCtrl wxDataViewCustomRenderer | Blockedby:

Patch: 0 | Blocking:
-----------------------------------------------------+----------------------

Comment(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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/11460#comment:2>

wxTrac

unread,
Nov 24, 2009, 10:47:48 AM11/24/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/11460#comment:3>

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

----------------------------------------------------------------+-----------
Reporter: spectrum | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone: 2.9.1
Component: GUI-generic | Version: 2.9-svn
Keywords: wxDataViewCtrl wxDataViewCustomRenderer regression | Blockedby:
Patch: 0 | Blocking:
----------------------------------------------------------------+-----------
Changes (by vadz):

* keywords: wxDataViewCtrl wxDataViewCustomRenderer => wxDataViewCtrl
wxDataViewCustomRenderer regression
* milestone: => 2.9.1


Comment:

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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/11460#comment:3>

wxTrac

unread,
Jun 20, 2010, 1:43:32 PM6/20/10
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/11460#comment:4>

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

--------------------------+-------------------------------------------------
Reporter: spectrum | Owner:
Type: defect | Status: closed

Priority: normal | Milestone: 2.9.1
Component: GUI-generic | Version: 2.9-svn

Resolution: fixed | Keywords: wxDataViewCtrl wxDataViewCustomRenderer regression
Blockedby: | Patch: 0
Blocking: |
--------------------------+-------------------------------------------------
Changes (by VZ):

* status: confirmed => closed
* resolution: => fixed


Comment:

(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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/11460#comment:4>

Reply all
Reply to author
Forward
0 new messages