X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6eec70b984525aac09528c32411f19113620e284..8e77fd8bca165aab9709649d79a7cbc6a172d4e1:/include/wx/gtk/dataview.h?ds=inline diff --git a/include/wx/gtk/dataview.h b/include/wx/gtk/dataview.h index e01b0ece10..fad45a6b48 100644 --- a/include/wx/gtk/dataview.h +++ b/include/wx/gtk/dataview.h @@ -14,6 +14,8 @@ class WXDLLIMPEXP_FWD_ADV wxDataViewCtrlInternal; +struct _GtkTreePath; + // --------------------------------------------------------- // wxDataViewColumn // --------------------------------------------------------- @@ -42,9 +44,8 @@ public: virtual void SetSortable( bool sortable ); virtual void SetSortOrder( bool ascending ); - virtual void SetAsSortKey(bool sort = true); - virtual void SetResizeable( bool resizeable ); + virtual void SetResizeable( bool resizable ); virtual void SetHidden( bool hidden ); virtual void SetMinWidth( int minWidth ); @@ -74,8 +75,7 @@ public: virtual int GetFlags() const { return GetFromIndividualFlags(); } // implementation - GtkWidget* GetGtkHandle() { return m_column; } - GtkWidget* GetConstGtkHandle() const { return m_column; } + GtkWidget* GetGtkHandle() const { return m_column; } private: // holds the GTK handle @@ -111,17 +111,19 @@ public: wxDataViewCtrl( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator ) + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxDataViewCtrlNameStr ) { Init(); - Create(parent, id, pos, size, style, validator ); + Create(parent, id, pos, size, style, validator, name); } bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator ); + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxDataViewCtrlNameStr); virtual ~wxDataViewCtrl(); @@ -139,7 +141,7 @@ public: virtual wxDataViewColumn *GetSortingColumn() const; - virtual wxDataViewItem GetSelection() const; + virtual int GetSelectedItemsCount() const; virtual int GetSelections( wxDataViewItemArray & sel ) const; virtual void SetSelections( const wxDataViewItemArray & sel ); virtual void Select( const wxDataViewItem & item ); @@ -156,6 +158,10 @@ public: virtual wxRect GetItemRect( const wxDataViewItem &item, const wxDataViewColumn *column = NULL ) const; + virtual bool SetRowHeight( int rowHeight ); + + virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column); + virtual void Expand( const wxDataViewItem & item ); virtual void Collapse( const wxDataViewItem & item ); virtual bool IsExpanded( const wxDataViewItem & item ) const; @@ -163,6 +169,8 @@ public: virtual bool EnableDragSource( const wxDataFormat &format ); virtual bool EnableDropTarget( const wxDataFormat &format ); + virtual wxDataViewColumn *GetCurrentColumn() const; + static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); @@ -171,8 +179,14 @@ public: GtkWidget *GtkGetTreeView() { return m_treeview; } wxDataViewCtrlInternal* GtkGetInternal() { return m_internal; } + // Convert GTK path to our item. Returned item may be invalid if get_iter() + // failed. + wxDataViewItem GTKPathToItem(struct _GtkTreePath *path) const; + virtual void OnInternalIdle(); + int GTKGetUniformRowHeight() const { return m_uniformRowHeight; } + protected: virtual void DoSetExpanderColumn(); virtual void DoSetIndent(); @@ -182,15 +196,28 @@ protected: private: void Init(); + virtual wxDataViewItem DoGetCurrentItem() const; + virtual void DoSetCurrentItem(const wxDataViewItem& item); + + // Return wxDataViewColumn matching the given GtkTreeViewColumn. + // + // If the input argument is NULL, return NULL too. Otherwise we must find + // the matching column and assert if we didn't. + wxDataViewColumn* FromGTKColumn(GtkTreeViewColumn *gtk_col) const; + friend class wxDataViewCtrlDCImpl; friend class wxDataViewColumn; - friend class wxGtkDataViewModelNotifier; friend class wxDataViewCtrlInternal; GtkWidget *m_treeview; - wxDataViewModelNotifier *m_notifier; wxDataViewCtrlInternal *m_internal; wxDataViewColumnList m_cols; + wxDataViewItem m_ensureVisibleDefered; + + // By default this is set to -1 and the height of the rows is determined by + // GetRect() methods of the renderers but this can be set to a positive + // value to force the height of all rows to the given value. + int m_uniformRowHeight; virtual void AddChildGTK(wxWindowGTK* child); void GtkEnableSelectionEvents();