Get rid of WXGetAsCustom().
Instead, have WXOnActivate() and WXOnLeftClick() with same signatures as their public API counterparts and just call Activate/LeftClick() from them for wxDataViewCustomRenderer. This accomplishes the same thing, but makes it easier to override behaviour in wx's internal implementations of renderers. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -23,7 +23,25 @@ public:
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
virtual wxDataViewCustomRenderer *WXGetAsCustom() { return this; }
|
||||
|
||||
// see the explanation of the following WXOnXXX() methods in wx/generic/dvrenderer.h
|
||||
|
||||
virtual bool WXOnActivate(wxRect cell,
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned int col)
|
||||
{
|
||||
return Activate(cell, model, item, col);
|
||||
}
|
||||
|
||||
virtual bool WXOnLeftClick(wxPoint cursor,
|
||||
wxRect cell,
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem &item,
|
||||
unsigned int col)
|
||||
{
|
||||
return LeftClick(cursor, cell, model, item, col);
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
|
||||
@@ -103,8 +121,8 @@ public:
|
||||
wxSize GetSize() const;
|
||||
|
||||
// Implementation only, don't use nor override
|
||||
virtual void WXOnActivate(wxDataViewModel *model,
|
||||
const wxVariant& valueOld,
|
||||
virtual bool WXOnActivate(wxRect cell,
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned int col);
|
||||
private:
|
||||
@@ -187,8 +205,8 @@ public:
|
||||
virtual wxSize GetSize() const;
|
||||
|
||||
// Implementation only, don't use nor override
|
||||
virtual void WXOnActivate(wxDataViewModel *model,
|
||||
const wxVariant& valueOld,
|
||||
virtual bool WXOnActivate(wxRect cell,
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned int col);
|
||||
|
||||
|
Reference in New Issue
Block a user