m_sort = false;
m_sortAscending = true;
}
-
+
void wxDataViewColumn::UpdateDisplay()
{
if (m_owner)
void ScrollWindow( int dx, int dy, const wxRect *rect = NULL );
void ScrollTo( int rows, int column );
+ unsigned GetCurrentRow() const { return m_currentRow; }
bool HasCurrentRow() { return m_currentRow != (unsigned int)-1; }
void ChangeCurrentRow( unsigned int row );
else if ( align & wxALIGN_BOTTOM )
rectItem.y += cell_rect.height - size.y;
// else: wxALIGN_TOP is the default
- }
+ }
}
wxPoint pos( event.GetPosition() );
if (column==col)
return i;
}
-
+
return wxNOT_FOUND;
#else
// This returns the position in pixels which is not what we want.
: GetColumn(m_sortingColumnIdx);
}
+wxDataViewItem wxDataViewCtrl::DoGetCurrentItem() const
+{
+ return GetItemByRow(m_clientArea->GetCurrentRow());
+}
+
+void wxDataViewCtrl::DoSetCurrentItem(const wxDataViewItem& item)
+{
+ const int row = m_clientArea->GetRowByItem(item);
+
+ const unsigned oldCurrent = m_clientArea->GetCurrentRow();
+ if ( static_cast<unsigned>(row) != oldCurrent )
+ {
+ m_clientArea->ChangeCurrentRow(row);
+ m_clientArea->RefreshRow(oldCurrent);
+ m_clientArea->RefreshRow(row);
+ }
+}
+
// Selection code with wxDataViewItem as parameters
wxDataViewItem wxDataViewCtrl::GetSelection() const
{
// Unselect all rows before select another in the single select mode
if (m_clientArea->IsSingleSel())
m_clientArea->SelectAllRows(false);
-
+
m_clientArea->SelectRow(row, true);
-
+
// Also set focus to the selected item
m_clientArea->ChangeCurrentRow( row );
}