]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dataview.h
added conversion to and from std::string and std::wstring (if wxUSE_STD_STRING)
[wxWidgets.git] / include / wx / dataview.h
index c4953185269b2a08bae8e47ad139b819e69a4c06..2f6548ad36787665c3787216a30b3053fadf53f4 100644 (file)
@@ -233,6 +233,30 @@ private:
     void InitStatics(); // BAD
 };
 
+//-----------------------------------------------------------------------------
+// wxDataViewEditorCtrlEvtHandler
+//-----------------------------------------------------------------------------
+
+class wxDataViewEditorCtrlEvtHandler: public wxEvtHandler
+{
+public:
+    wxDataViewEditorCtrlEvtHandler( wxControl *editor, wxDataViewRenderer *owner );
+                         
+    void AcceptChangesAndFinish();
+
+protected:
+    void OnChar( wxKeyEvent &event );
+    void OnKillFocus( wxFocusEvent &event );
+
+private:
+    wxDataViewRenderer     *m_owner;
+    wxControl              *m_editorCtrl;
+    bool                    m_finished;
+
+private:
+    DECLARE_EVENT_TABLE()
+};
+
 // ---------------------------------------------------------
 // wxDataViewRendererBase
 // ---------------------------------------------------------
@@ -280,10 +304,26 @@ 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 *parent, wxRect labelRect, const wxVariant &value )
+        { return NULL; }
+    virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &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;