X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6154212e512945487e19c393fa3b9119c45bd801..04e7692af163f3c6f1e58f01e7be665882d65ce9:/include/wx/dataview.h diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 6a8ede95ba..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 ); @@ -486,6 +485,11 @@ public: 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 ;