X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e39de7022c2fb33d79b4d1770fa6e3911128d2d6..09b895cb4a954494063eb17d3dc302a654fd99e5:/include/wx/dataview.h diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 6fcba0cf83..f185c94c93 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -23,6 +23,7 @@ #include "wx/dynarray.h" #include "wx/icon.h" #include "wx/imaglist.h" +#include "wx/weakref.h" class WXDLLIMPEXP_FWD_CORE wxDataFormat; @@ -60,8 +61,9 @@ extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxDataViewCtrlNameStr[]; // the default minimal width of the columns: #define wxDVC_DEFAULT_MINWIDTH 30 -// the default alignment of wxDataViewRenderers: -#define wxDVR_DEFAULT_ALIGNMENT (wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL) +// The default alignment of wxDataViewRenderers is to take +// the alignment from the column it owns. +#define wxDVR_DEFAULT_ALIGNMENT -1 // --------------------------------------------------------- @@ -113,7 +115,7 @@ public: virtual void Resort() = 0; void SetOwner( wxDataViewModel *owner ) { m_owner = owner; } - wxDataViewModel *GetOwner() { return m_owner; } + wxDataViewModel *GetOwner() const { return m_owner; } private: wxDataViewModel *m_owner; @@ -291,7 +293,6 @@ private: wxDataViewItemArray m_hash; unsigned int m_lastIndex; bool m_ordered; - bool m_useHash; }; // --------------------------------------------------------- @@ -300,7 +301,7 @@ private: #ifdef __WXMAC__ // better than nothing -typedef wxDataViewVirtualListModel wxDataViewIndexListModel +typedef wxDataViewIndexListModel wxDataViewVirtualListModel; #else class WXDLLIMPEXP_ADV wxDataViewVirtualListModel: public wxDataViewModel @@ -412,12 +413,13 @@ public: wxDataViewRendererBase( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int alignment = wxDVR_DEFAULT_ALIGNMENT ); + ~wxDataViewRendererBase(); virtual bool Validate( wxVariant& WXUNUSED(value) ) { return true; } void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; } - wxDataViewColumn* GetOwner() { return m_owner; } + wxDataViewColumn* GetOwner() const { return m_owner; } // renderer properties: @@ -455,7 +457,7 @@ public: protected: wxString m_variantType; wxDataViewColumn *m_owner; - wxControl *m_editorCtrl; + wxWeakRef m_editorCtrl; wxDataViewItem m_item; // for m_editorCtrl // internal utility: @@ -582,6 +584,7 @@ protected: #define wxDV_VERT_RULES 0x0008 // light vertical rules between columns #define wxDV_ROW_LINES 0x0010 // alternating colour in rows +#define wxDV_VARIABLE_LINE_HEIGHT 0x0020 // variable line height class WXDLLIMPEXP_ADV wxDataViewCtrlBase: public wxControl { @@ -709,7 +712,7 @@ public: { return m_expander_column; } virtual wxDataViewColumn *GetSortingColumn() const = 0; - + void SetIndent( int indent ) { m_indent = indent ; DoSetIndent(); } int GetIndent() const