X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1153ed60faa31147c5ff2d4cbae15f4d5376887..e733c4ce1e24cf7e4b0b0d8362fc59aaa7a7641c:/include/wx/generic/dvrenderers.h diff --git a/include/wx/generic/dvrenderers.h b/include/wx/generic/dvrenderers.h index 3ebe0d0f3e..6f80c773a5 100644 --- a/include/wx/generic/dvrenderers.h +++ b/include/wx/generic/dvrenderers.h @@ -3,7 +3,6 @@ // Purpose: All generic wxDataViewCtrl renderer classes // Author: Robert Roebling, Vadim Zeitlin // Created: 2009-11-07 (extracted from wx/generic/dataview.h) -// RCS-ID: $Id$ // Copyright: (c) 2006 Robert Roebling // (c) 2009 Vadim Zeitlin // Licence: wxWindows licence @@ -23,7 +22,17 @@ 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 WXActivateCell(const wxRect& cell, + wxDataViewModel *model, + const wxDataViewItem& item, + unsigned int col, + const wxMouseEvent *mouseEvent) + { + return ActivateCell(cell, model, item, col, mouseEvent); + } private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer) @@ -49,9 +58,9 @@ public: // in-place editing virtual bool HasEditorCtrl() const; - virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, - const wxVariant &value ); - virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value ); + virtual wxWindow* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, + const wxVariant &value ); + virtual bool GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value ); protected: wxString m_text; @@ -100,10 +109,14 @@ public: bool GetValue( wxVariant &value ) const; bool Render( wxRect cell, wxDC *dc, int state ); - bool Activate( wxRect cell, wxDataViewModel *model, const wxDataViewItem & item, - unsigned int col ); wxSize GetSize() const; + // Implementation only, don't use nor override + virtual bool WXActivateCell(const wxRect& cell, + wxDataViewModel *model, + const wxDataViewItem& item, + unsigned int col, + const wxMouseEvent *mouseEvent); private: bool m_toggle; @@ -155,9 +168,9 @@ public: virtual wxSize GetSize() const; virtual bool HasEditorCtrl() const { return true; } - virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, - const wxVariant &value ); - virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value ); + virtual wxWindow* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, + const wxVariant &value ); + virtual bool GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value ); private: wxDataViewIconText m_value; @@ -166,34 +179,5 @@ protected: DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer) }; -// --------------------------------------------------------- -// wxDataViewDateRenderer -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewRenderer -{ -public: - wxDataViewDateRenderer( const wxString &varianttype = wxT("datetime"), - wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, - int align = wxDVR_DEFAULT_ALIGNMENT ); - - bool SetValue( const wxVariant &value ); - bool GetValue( wxVariant& value ) const; - - virtual bool Render( wxRect cell, wxDC *dc, int state ); - virtual wxSize GetSize() const; - virtual bool Activate( wxRect cell, - wxDataViewModel *model, - const wxDataViewItem& item, - unsigned int col ); - -private: - wxDateTime m_date; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer) -}; - - #endif // _WX_GENERIC_DVRENDERERS_H_