]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/dvrenderers.h
activating DrawRectangle optimization
[wxWidgets.git] / include / wx / generic / dvrenderers.h
index 62670c787ba3e5b95c7b32181cba8e6f25266daa..a5dc8c09b0462dacb12bdd1a9226624eb0a51a55 100644 (file)
@@ -23,7 +23,17 @@ public:
                               wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
                               int align = wxDVR_DEFAULT_ALIGNMENT );
 
                               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)
 
 private:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
@@ -49,9 +59,9 @@ public:
 
     // in-place editing
     virtual bool HasEditorCtrl() const;
 
     // 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;
 
 protected:
     wxString   m_text;
@@ -103,10 +113,11 @@ public:
     wxSize GetSize() const;
 
     // Implementation only, don't use nor override
     wxSize GetSize() const;
 
     // Implementation only, don't use nor override
-    virtual void WXOnActivate(wxDataViewModel *model,
-                              const wxVariant& valueOld,
-                              const wxDataViewItem& item,
-                              unsigned int col);
+    virtual bool WXActivateCell(const wxRect& cell,
+                                wxDataViewModel *model,
+                                const wxDataViewItem& item,
+                                unsigned int col,
+                                const wxMouseEvent *mouseEvent);
 private:
     bool    m_toggle;
 
 private:
     bool    m_toggle;
 
@@ -158,9 +169,9 @@ public:
     virtual wxSize GetSize() const;
 
     virtual bool HasEditorCtrl() const { return true; }
     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;
 
 private:
     wxDataViewIconText   m_value;
@@ -169,36 +180,5 @@ protected:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
 };
 
     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;
-
-    // Implementation only, don't use nor override
-    virtual void WXOnActivate(wxDataViewModel *model,
-                              const wxVariant& valueOld,
-                              const wxDataViewItem& item,
-                              unsigned int col);
-
-private:
-    wxDateTime    m_date;
-
-protected:
-    DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
-};
-
-
 #endif // _WX_GENERIC_DVRENDERERS_H_
 
 #endif // _WX_GENERIC_DVRENDERERS_H_