From: Robert Roebling Date: Sat, 25 Aug 2007 13:28:56 +0000 (+0000) Subject: Set/GetExpanderColumn() should use wxDataViewColumn, not unsigned int X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1b27b2bd2b6e290645516c180566222c6aa22149 Set/GetExpanderColumn() should use wxDataViewColumn, not unsigned int git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/latex/wx/dataviewctrl.tex b/docs/latex/wx/dataviewctrl.tex index acc6505b66..05520d13ce 100644 --- a/docs/latex/wx/dataviewctrl.tex +++ b/docs/latex/wx/dataviewctrl.tex @@ -201,7 +201,7 @@ Call this to ensure that the given item is visible. \membersection{wxDataViewCtrl::GetExpanderColumn}\label{wxdataviewctrlgetexpandercolumn} -\constfunc{unsigned int}{GetExpanderColumn}{\void} +\constfunc{wxDataViewColumn *}{GetExpanderColumn}{\void} Returns column containing the expanders. @@ -256,7 +256,7 @@ Select all items. \membersection{wxDataViewCtrl::SetExpanderColumn}\label{wxdataviewctrlsetexpandercolumn} -\func{void}{SetExpanderColumn}{\param{unsigned int }{col}} +\func{void}{SetExpanderColumn}{\param{wxDataViewColumn *}{col}} Set which column shall contain the tree-like expanders. diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 75342f2e67..a7f18c765d 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -465,9 +465,9 @@ public: virtual bool ClearColumns(); virtual wxDataViewColumn* GetColumn( unsigned int pos ) const; - void SetExpanderColumn( unsigned int col ) + void SetExpanderColumn( wxDataViewColumn *col ) { m_expander_column = col ; DoSetExpanderColumn(); } - unsigned int GetExpanderColumn() const + wxDataViewColumn *GetExpanderColumn() const { return m_expander_column; } void SetIndent( int indent ) @@ -497,7 +497,7 @@ protected: private: wxDataViewModel *m_model; wxList m_cols; - unsigned int m_expander_column; + wxDataViewColumn *m_expander_column; int m_indent ; protected: diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 099433e4c9..2d8182e377 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -2321,7 +2321,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) } wxDataViewItem dataitem = node->GetItem(); - model->GetValue( value, dataitem, col->GetModelColumn()); + model->GetValue( value, dataitem, col->GetModelColumn()); cell->SetValue( value ); // update the y offset @@ -2329,7 +2329,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) //Draw the expander here. int indent = node->GetIndentLevel(); - if( col->GetModelColumn() == GetOwner()->GetExpanderColumn() ) + if( col == GetOwner()->GetExpanderColumn() ) { //Calculate the indent first indent = cell_rect.x + GetOwner()->GetIndent() * indent; diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 6caab4aded..1886cb9a88 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -3116,6 +3116,8 @@ wxRect wxDataViewCtrl::GetItemRect( const wxDataViewItem &item, void wxDataViewCtrl::DoSetExpanderColumn() { + gtk_tree_view_set_expander_column( GTK_TREE_VIEW(m_treeview), + GTK_TREE_VIEW_COLUMN( GetExpanderColumn()->GetGtkHandle() ) ); } void wxDataViewCtrl::DoSetIndent() diff --git a/src/mac/carbon/dataview.cpp b/src/mac/carbon/dataview.cpp index e72f733345..df0e175ccf 100644 --- a/src/mac/carbon/dataview.cpp +++ b/src/mac/carbon/dataview.cpp @@ -779,7 +779,7 @@ bool wxDataViewCtrl::AppendColumn(wxDataViewColumn* dataViewColumnPtr) if (dataViewColumnPtr->IsSortable()) // if the current column is marked sortable this column will become the active sortable column, otherwise don't do anything MacDataViewListCtrlPtr->SetSortProperty(NewPropertyID); #endif - if (this->GetColumnCount()-1 == this->GetExpanderColumn()) // if the current column is marked expandable this column will become the active expandable column + if (dataViewColumnPtr == this->GetExpanderColumn()) // if the current column is marked expandable this column will become the active expandable column MacDataViewListCtrlPtr->SetDisclosureColumn(NewPropertyID,true); // make sure that the data is up-to-date...