Add wxDataViewCtrl::{Set,Get}CurrentItem().
Current item is the same as the selected item in single selection mode but in multiple selection mode there was no way to neither get this item nor change it before so add the new functions to allow doing this now. The new methods are implemented for the generic, GTK and OS X/Cocoa versions but only stubs are provided for OS X/Carbon. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2069,6 +2069,22 @@ bool wxCocoaDataViewControl::AssociateModel(wxDataViewModel* model)
|
||||
//
|
||||
// selection related methods (inherited from wxDataViewWidgetImpl)
|
||||
//
|
||||
|
||||
wxDataViewItem wxCocoaDataViewControl::GetCurrentItem() const
|
||||
{
|
||||
return wxDataViewItem([[m_OutlineView itemAtRow:[m_OutlineView selectedRow]] pointer]);
|
||||
}
|
||||
|
||||
void wxCocoaDataViewControl::SetCurrentItem(const wxDataViewItem& item)
|
||||
{
|
||||
// We can't have unselected current item in a NSTableView, as the
|
||||
// documentation of its deselectRow method explains, the control will
|
||||
// automatically change the current item to the closest still selected item
|
||||
// if the current item is deselected. So we have no choice but to select
|
||||
// the item in the same time as making it current.
|
||||
Select(item);
|
||||
}
|
||||
|
||||
int wxCocoaDataViewControl::GetSelections(wxDataViewItemArray& sel) const
|
||||
{
|
||||
NSIndexSet* selectedRowIndexes([m_OutlineView selectedRowIndexes]);
|
||||
|
Reference in New Issue
Block a user