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
This commit is contained in:
Robert Roebling
2007-08-25 13:28:56 +00:00
parent 07c51ff1fa
commit 1b27b2bd2b
5 changed files with 10 additions and 8 deletions

View File

@@ -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.

View File

@@ -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:

View File

@@ -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;

View File

@@ -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()

View File

@@ -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...