Add wxUIActionSimulator::Select().

Add a helper to select an item in a wxChoice, wxComboBox, wxListBox or similar.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-10 16:52:01 +00:00
parent c4470b8a48
commit 1addaeaa75
6 changed files with 125 additions and 1 deletions

View File

@@ -144,6 +144,30 @@ public:
*/
bool Char(int keycode, int modifiers = wxMOD_NONE);
/**
Simulate selection of an item with the given text.
This method selects an item in the currently focused wxChoice,
wxComboBox, wxListBox and similar controls. It does it by simulating
keyboard events, so the behaviour should be the same as if the item
was really selected by the user.
Notice that the implementation of this method uses wxYield() and so
events can be dispatched from it.
@param text
The text of the item to select.
@return
@true if the item @a text was successfully selected or @false if
the currently focused window is not one of the controls allowing
item selection or if the item with the given text was not found in
it.
@since 3.1.0
*/
bool Select(const wxString& text);
/**
Emulate typing in the keys representing the given string.