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:
Vadim Zeitlin
2010-08-10 12:53:03 +00:00
parent 1e18430004
commit 80ce465c64
16 changed files with 317 additions and 7 deletions

View File

@@ -913,6 +913,26 @@ public:
*/
wxDataViewColumn* GetExpanderColumn() const;
/**
Returns the currently focused item.
This is the item that the keyboard commands apply to. It may be invalid
if there is no focus currently.
This method is mostly useful for the controls with @c wxDV_MULTIPLE
style as in the case of single selection it returns the same thing as
GetSelection().
Notice that under all platforms except Mac OS X the currently focused
item may be selected or not but under OS X the current item is always
selected.
@see SetCurrentItem()
@since 2.9.2
*/
wxDataViewItem GetCurrentItem() const;
/**
Returns indentation.
*/
@@ -980,6 +1000,25 @@ public:
*/
void SetExpanderColumn(wxDataViewColumn* col);
/**
Changes the currently focused item.
The @a item parameter must be valid, there is no way to remove the
current item from the control.
In single selection mode, calling this method is the same as calling
Select() and is thus not very useful. In multiple selection mode this
method only moves the current item however without changing the
selection except under OS X where the current item is always selected,
so calling SetCurrentItem() selects @a item if it hadn't been selected
before.
@see GetCurrentItem()
@since 2.9.2
*/
void SetCurrentItem(const wxDataViewItem& item);
/**
Sets the indendation.
*/