X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e510b1e2d0270caf227c3fc0cf34ae2e7dd6794..2c17722ec8a15d93ef9ec4a4ff390a0db9a34d9d:/include/wx/dataview.h?ds=inline diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 2f6548ad36..b802aad14f 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -82,7 +82,7 @@ class WXDLLIMPEXP_ADV wxDataViewListModelNotifier: public wxObject { public: wxDataViewListModelNotifier() { } - virtual ~wxDataViewListModelNotifier() { } + virtual ~wxDataViewListModelNotifier() { m_owner = NULL; } virtual bool RowAppended() = 0; virtual bool RowPrepended() = 0; @@ -92,8 +92,6 @@ public: virtual bool ValueChanged( unsigned int col, unsigned int row ) = 0; virtual bool RowsReordered( unsigned int *new_order ) = 0; virtual bool Cleared() = 0; - virtual bool Freed() - { m_owner = NULL; return true; } void SetOwner( wxDataViewListModel *owner ) { m_owner = owner; } wxDataViewListModel *GetOwner() { return m_owner; } @@ -140,7 +138,7 @@ public: virtual void GetValue( wxVariant &variant, unsigned int col, unsigned int row ) const = 0; // set value, call ValueChanged() afterwards! - virtual bool SetValue( wxVariant &variant, unsigned int col, unsigned int row ) = 0; + virtual bool SetValue( const wxVariant &variant, unsigned int col, unsigned int row ) = 0; // delegated notifiers virtual bool RowAppended(); @@ -200,7 +198,7 @@ public: virtual void GetValue( wxVariant &variant, unsigned int col, unsigned int row ) const; // set value, call ValueChanged() afterwards! - virtual bool SetValue( wxVariant &variant, unsigned int col, unsigned int row ); + virtual bool SetValue( const wxVariant &variant, unsigned int col, unsigned int row ); // called from user virtual bool RowAppended(); @@ -223,6 +221,8 @@ public: bool ChildCleared(); virtual void Resort(); + + void DetachChild(); private: bool m_ascending; @@ -243,15 +243,18 @@ 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() @@ -308,9 +311,12 @@ public: // in-place editing virtual bool HasEditorCtrl() { return false; } - virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value ) + virtual wxControl* CreateEditorCtrl(wxWindow * WXUNUSED(parent), + wxRect WXUNUSED(labelRect), + const wxVariant& WXUNUSED(value)) { return NULL; } - virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value ) + virtual bool GetValueFromEditorCtrl(wxControl * WXUNUSED(editor), + wxVariant& WXUNUSED(value)) { return false; } virtual bool StartEditing( unsigned int row, wxRect labelRect ); @@ -487,7 +493,7 @@ public: private: wxDataViewListModel *m_model; wxList m_cols; - + protected: DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase) };