X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56873923f39af96aac6bfc5776d2637b8c4623ca..2cce66352fc23859e991c2e7658dbf1cdf8c4183:/include/wx/dataview.h?ds=sidebyside diff --git a/include/wx/dataview.h b/include/wx/dataview.h index b98220ac3e..4c09225ef0 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -26,6 +26,7 @@ #include "wx/weakref.h" #if !(defined(__WXGTK20__) || defined(__WXMAC__)) || defined(__WXUNIVERSAL__) +// #if !(defined(__WXMAC__)) || defined(__WXUNIVERSAL__) #define wxHAS_GENERIC_DATAVIEWCTRL #endif @@ -508,26 +509,25 @@ enum wxDataViewColumnFlags wxDATAVIEW_COL_HIDDEN = wxCOL_HIDDEN }; -class WXDLLIMPEXP_ADV wxDataViewColumnBase : public -// native implementations of wxDataViewCtrl have their own implementations of -// wxDataViewColumnBase and so they need to only inherit from -// wxHeaderColumnBase to provide the same interface as the generic port which -// uses the platform native (if any) wxHeaderColumn -#ifdef wxHAS_GENERIC_DATAVIEWCTRL - wxHeaderColumn -#else - wxHeaderColumnBase -#endif +class WXDLLIMPEXP_ADV wxDataViewColumnBase : public wxSettableHeaderColumn { public: - wxDataViewColumnBase( const wxString &title, wxDataViewRenderer *renderer, - unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH, - wxAlignment align = wxALIGN_CENTER, - int flags = wxDATAVIEW_COL_RESIZABLE ); - wxDataViewColumnBase( const wxBitmap &bitmap, wxDataViewRenderer *renderer, - unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH, - wxAlignment align = wxALIGN_CENTER, - int flags = wxDATAVIEW_COL_RESIZABLE ); + // ctor for the text columns: takes ownership of renderer + wxDataViewColumnBase(wxDataViewRenderer *renderer, + unsigned int model_column) + { + Init(renderer, model_column); + } + + // ctor for the bitmap columns + wxDataViewColumnBase(const wxBitmap& bitmap, + wxDataViewRenderer *renderer, + unsigned int model_column) + : m_bitmap(bitmap) + { + Init(renderer, model_column); + } + virtual ~wxDataViewColumnBase(); // setters: @@ -539,23 +539,20 @@ public: wxDataViewCtrl *GetOwner() const { return m_owner; } wxDataViewRenderer* GetRenderer() const { return m_renderer; } -#ifndef wxHAS_GENERIC_DATAVIEWCTRL // implement some of base class pure virtuals (the rest is port-dependent // and done differently in generic and native versions) virtual void SetBitmap( const wxBitmap& bitmap ) { m_bitmap = bitmap; } virtual wxBitmap GetBitmap() const { return m_bitmap; } -#endif // !wxHAS_GENERIC_DATAVIEWCTRL protected: wxDataViewRenderer *m_renderer; int m_model_column; -#ifndef wxHAS_GENERIC_DATAVIEWCTRL wxBitmap m_bitmap; -#endif // !wxHAS_GENERIC_DATAVIEWCTRL wxDataViewCtrl *m_owner; -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumnBase) +private: + // common part of all ctors + void Init(wxDataViewRenderer *renderer, unsigned int model_column); }; // --------------------------------------------------------- @@ -716,7 +713,9 @@ public: virtual void UnselectAll() = 0; virtual void Expand( const wxDataViewItem & item ) = 0; + virtual void ExpandAncestors( const wxDataViewItem & item ); virtual void Collapse( const wxDataViewItem & item ) = 0; + virtual bool IsExpanded( const wxDataViewItem & item ) const = 0; virtual void EnsureVisible( const wxDataViewItem & item, const wxDataViewColumn *column = NULL ) = 0; @@ -881,7 +880,7 @@ private: long m_min,m_max; }; -#ifndef __WXGTK20__ +#if defined(wxHAS_GENERIC_DATAVIEWCTRL) || defined(__WXMAC__) // ------------------------------------- // wxDataViewChoiceRenderer