- wxDataViewTreeNode * node = this;
- while( node->GetParent()->GetParent() != NULL )
- {
- node = node->GetParent();
- ret ++;
- }
- return ret;
+ wxDataViewTreeNode * node = this;
+ while( node->GetParent()->GetParent() != NULL )
+ {
+ node = node->GetParent();
+ ret ++;
+ }
+ return ret;
void SelectRows( unsigned int from, unsigned int to, bool on );
void ReverseRowSelection( unsigned int row );
bool IsRowSelected( unsigned int row );
void SelectRows( unsigned int from, unsigned int to, bool on );
void ReverseRowSelection( unsigned int row );
bool IsRowSelected( unsigned int row );
void RefreshRow( unsigned int row );
void RefreshRows( unsigned int from, unsigned int to );
void RefreshRow( unsigned int row );
void RefreshRows( unsigned int from, unsigned int to );
wxDataViewItem dataitem = node->GetItem();
model->GetValue( value, dataitem, col->GetModelColumn());
wxDataViewItem dataitem = node->GetItem();
model->GetValue( value, dataitem, col->GetModelColumn());
+void wxDataViewMainWindow::SendSelectionChangedEvent( const wxDataViewItem& item)
+{
+ wxWindow *parent = GetParent();
+ wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, parent->GetId());
+
+ le.SetEventObject(parent);
+ le.SetModel(GetOwner()->GetModel());
+ le.SetItem( item );
+
+ parent->GetEventHandler()->ProcessEvent(le);
+}
+
void wxDataViewMainWindow::RefreshRow( unsigned int row )
{
wxRect rect( 0, row*m_lineHeight, GetEndOfLastCol(), m_lineHeight );
void wxDataViewMainWindow::RefreshRow( unsigned int row )
{
wxRect rect( 0, row*m_lineHeight, GetEndOfLastCol(), m_lineHeight );
ret = new wxDataViewTreeNode( parent ) ;
ret->SetItem( wxDataViewItem( n ));
ret->SetHasChildren(false);
ret = new wxDataViewTreeNode( parent ) ;
ret->SetItem( wxDataViewItem( n ));
ret->SetHasChildren(false);
SelectRow( row, false );
SelectRow( row + 1, true );
ChangeCurrentRow( row + 1 );
SelectRow( row, false );
SelectRow( row + 1, true );
ChangeCurrentRow( row + 1 );
SelectRow( row, false);
SelectRow(parent , true );
ChangeCurrentRow( parent );
SelectRow( row, false);
SelectRow(parent , true );
ChangeCurrentRow( parent );
- wxDataViewTreeNode * node = GetTreeNodeByRow(current);
- if( node!=NULL && node->HasChildren() )
- {
- int indent = node->GetIndentLevel();
- indent = GetOwner()->GetIndent()*indent;
- wxRect rect( xpos + indent + EXPANDER_MARGIN, current * m_lineHeight + EXPANDER_MARGIN, m_lineHeight-2*EXPANDER_MARGIN,m_lineHeight-2*EXPANDER_MARGIN);
- if( rect.Contains( x, y) )
- {
- expander = true;
- if( node->IsOpen() )
- OnCollapsing(current);
- else
- OnExpanding( current );
- }
- }
+ wxDataViewTreeNode * node = GetTreeNodeByRow(current);
+ if( node!=NULL && node->HasChildren() )
+ {
+ int indent = node->GetIndentLevel();
+ indent = GetOwner()->GetIndent()*indent;
+ wxRect rect( xpos + indent + EXPANDER_MARGIN, current * m_lineHeight + EXPANDER_MARGIN, m_lineHeight-2*EXPANDER_MARGIN,m_lineHeight-2*EXPANDER_MARGIN);
+ if( rect.Contains( x, y) )
+ {
+ expander = true;
+ if( node->IsOpen() )
+ OnCollapsing(current);
+ else
+ OnExpanding( current );
+ }
+ }
}
//If the user click the expander, we do not do editing even if the column with expander are editable
if (m_lastOnSame && !expander )
}
//If the user click the expander, we do not do editing even if the column with expander are editable
if (m_lastOnSame && !expander )
SelectAllRows(false);
ChangeCurrentRow(current);
SelectRow(m_currentRow,true);
SelectAllRows(false);
ChangeCurrentRow(current);
SelectRow(m_currentRow,true);
+ int ret = 0, dead = 0;
+ int len = GetColumnCount();
+ for (int i=0; i<len; i++)
+ {
+ wxDataViewColumn * col = GetColumn(i);
+ if (col->IsHidden())
+ continue;
+ ret += col->GetWidth();
+ if (column==col)
+ {
+ CalcScrolledPosition( ret, dead, &ret, &dead );
+ break;
+ }
+ }
+ return ret;