X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6977c3bf4dad710dda5f9abc7a6882a5ca9ea0d2..04e7692af163f3c6f1e58f01e7be665882d65ce9:/include/wx/dataview.h?ds=sidebyside diff --git a/include/wx/dataview.h b/include/wx/dataview.h index d7811f9513..2286965603 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -74,6 +74,7 @@ public: { m_id = item.m_id; } bool IsOk() const { return m_id != NULL; } void* GetID() const { return m_id; } + operator const void* () const { return m_id; } private: void* m_id; @@ -81,6 +82,8 @@ private: bool operator == (const wxDataViewItem &left, const wxDataViewItem &right); +WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray); + // --------------------------------------------------------- // wxDataViewModelNotifier // --------------------------------------------------------- @@ -153,7 +156,7 @@ public: // default compare function virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2, unsigned int column, bool ascending ); - + protected: // the user should not delete this class directly: he should use DecRef() instead! virtual ~wxDataViewModel() { } @@ -165,9 +168,6 @@ protected: // wxDataViewIndexListModel // --------------------------------------------------------- -// use hash map later -WX_DEFINE_ARRAY_PTR( void*, wxDataViewItemHash ); - class wxDataViewIndexListModel: public wxDataViewModel { public: @@ -211,7 +211,7 @@ public: virtual wxDataViewItem GetNextSibling( const wxDataViewItem &item ) const; private: - wxDataViewItemHash m_hash; + wxDataViewItemArray m_hash; unsigned int m_lastIndex; }; @@ -396,8 +396,6 @@ protected: // wxDataViewCtrlBase // --------------------------------------------------------- -WX_DECLARE_OBJARRAY(wxDataViewItem, wxDataViewItemArray); - #define wxDV_SINGLE 0x0000 // for convenience #define wxDV_MULTIPLE 0x0001 // can select multiple items @@ -415,43 +413,44 @@ public: wxDataViewModel* GetModel(); // short cuts - bool AppendTextColumn( const wxString &label, unsigned int model_column, + wxDataViewColumn *AppendTextColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); - bool AppendToggleColumn( const wxString &label, unsigned int model_column, + wxDataViewColumn *AppendToggleColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); - bool AppendProgressColumn( const wxString &label, unsigned int model_column, + wxDataViewColumn *AppendProgressColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); - bool AppendDateColumn( const wxString &label, unsigned int model_column, + wxDataViewColumn *AppendDateColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); - bool AppendBitmapColumn( const wxString &label, unsigned int model_column, + wxDataViewColumn *AppendBitmapColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); - bool AppendTextColumn( const wxBitmap &label, unsigned int model_column, + wxDataViewColumn *AppendTextColumn( const wxBitmap &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); - bool AppendToggleColumn( const wxBitmap &label, unsigned int model_column, + wxDataViewColumn *AppendToggleColumn( const wxBitmap &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); - bool AppendProgressColumn( const wxBitmap &label, unsigned int model_column, + wxDataViewColumn *AppendProgressColumn( const wxBitmap &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); - bool AppendDateColumn( const wxBitmap &label, unsigned int model_column, + wxDataViewColumn *AppendDateColumn( const wxBitmap &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); - bool AppendBitmapColumn( const wxBitmap &label, unsigned int model_column, + + wxDataViewColumn *AppendBitmapColumn( const wxBitmap &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); @@ -484,7 +483,13 @@ public: virtual void SelectAll() = 0; virtual void UnselectAll() = 0; - virtual void EnsureVisible( const wxDataViewItem & item ) = 0; + virtual void EnsureVisible( const wxDataViewItem & item, + wxDataViewColumn *column = NULL ) = 0; + + virtual void HitTest( const wxPoint &point, + wxDataViewItem &item, unsigned int &column ) const = 0; + virtual wxRect GetItemRect( const wxDataViewItem &item, + unsigned int column ) const = 0; protected: virtual void DoSetExpanderColumn() = 0 ;