]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dataview.h
(blind) compilation fixes after latest changes
[wxWidgets.git] / include / wx / dataview.h
index c4953185269b2a08bae8e47ad139b819e69a4c06..f54e93fb842b79bd9318e63cef9695b8967e3939 100644 (file)
@@ -233,6 +233,33 @@ private:
     void InitStatics(); // BAD
 };
 
+//-----------------------------------------------------------------------------
+// wxDataViewEditorCtrlEvtHandler
+//-----------------------------------------------------------------------------
+
+class wxDataViewEditorCtrlEvtHandler: public wxEvtHandler
+{
+public:
+    wxDataViewEditorCtrlEvtHandler( wxControl *editor, wxDataViewRenderer *owner );
+                         
+    void AcceptChangesAndFinish();
+    void SetFocusOnIdle( bool focus = true ) { m_focusOnIdle = focus; }
+
+protected:
+    void OnChar( wxKeyEvent &event );
+    void OnKillFocus( wxFocusEvent &event );
+    void OnIdle( wxIdleEvent &event );
+
+private:
+    wxDataViewRenderer     *m_owner;
+    wxControl              *m_editorCtrl;
+    bool                    m_finished;
+    bool                    m_focusOnIdle;
+
+private:
+    DECLARE_EVENT_TABLE()
+};
+
 // ---------------------------------------------------------
 // wxDataViewRendererBase
 // ---------------------------------------------------------
@@ -280,10 +307,29 @@ public:
     //       to combine alignment flags (e.g. wxALIGN_LEFT|wxALIGN_BOTTOM)
     virtual void SetAlignment( int align ) = 0;
     virtual int GetAlignment() const = 0;
-
+    
+    // in-place editing
+    virtual bool HasEditorCtrl()
+        { return false; }
+    virtual wxControl* CreateEditorCtrl(wxWindow * WXUNUSED(parent),
+                                        wxRect WXUNUSED(labelRect),
+                                        const wxVariant& WXUNUSED(value))
+        { return NULL; }
+    virtual bool GetValueFromEditorCtrl(wxControl * WXUNUSED(editor),
+                                        wxVariant& WXUNUSED(value))
+        { return false; }
+
+    virtual bool StartEditing( unsigned int row, wxRect labelRect );
+    virtual void CancelEditing();
+    virtual bool FinishEditing();
+    
+    wxControl *GetEditorCtrl() { return m_editorCtrl; }
+    
 protected:
     wxString                m_variantType;
     wxDataViewColumn       *m_owner;
+    wxControl              *m_editorCtrl;
+    unsigned int            m_row; // for m_editorCtrl
 
     // internal utility:
     const wxDataViewCtrl* GetView() const;
@@ -447,7 +493,7 @@ public:
 private:
     wxDataViewListModel    *m_model;
     wxList                  m_cols;
-
+    
 protected:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase)
 };