wxTst::EventSimulationHelper Class Reference

Provides methods for simulating control specific events. More...

#include <EventSimulationHelper.h>

Collaboration diagram for wxTst::EventSimulationHelper:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 EventSimulationHelper ()
 Constructor.
virtual ~EventSimulationHelper ()
 Destructor.

Static Public Member Functions

static void ClickButton (int id, wxWindow *parent)
 Click on a button.
static wxTreeItemId GetNthTreeChild (wxTreeCtrl *treeCtrl, unsigned int idx, const wxTreeItemId &id)
 Find the idx'th child of a particular tree item.
static bool IsSettingSpinCtrlValue ()
 Return if spin control value is currently being set/simulated.
static void RightClickTreeItem (const wxTreeItemId &id, wxTreeCtrl *treeCtrl)
 Right click on visible (!) tree item, i.e. tree must be expanded to show this tree item.
static void SelectAndCheckMenuItem (int id, wxMenu *menu=NULL)
 Select and check a menu item.
static void SelectAndCheckMenuItem (int id, wxWindow *window, wxMenu **menu=NULL)
 Select and check a menu item.
static void SelectChoiceItem (wxChoice *choice, unsigned int item)
 Select choice item.
static void SelectMenuItem (int id, wxEvtHandler *evtHandler)
 Select a menu item (convenience method for popup menus).
static void SelectMenuItem (int id, wxWindow *frame)
 Select a menu item.
static void SelectNotebookPage (wxNotebook *notebook, unsigned int page)
 Select notebook page.
static void SelectRadioBoxItem (wxRadioBox *radioBox, unsigned int item)
 Select radiobox item.
static void SelectTreeItem (const wxTreeItemId &id, wxTreeCtrl *treeCtrl)
 Select a tree item.
static void SetCheckboxState (wxCheckBox *checkbox, bool isChecked)
 Check or uncheck checkbox.
static void SetSliderValue (wxSlider *slider, unsigned int value)
 Set slider value.
static void SetSpinCtrlValue (wxSpinCtrl *spinCtrl, int value)
 Set spin control value.
static void SetTextCtrlValue (wxTextCtrl *textCtrl, const wxString &value)
 Set text control value.
static void ToggleTool (int id, bool enabled, wxToolBar *toolbar, wxWindow *parent)
 Toggle a tool of a toolbar.
static void ToggleToolOnlyEvent (int id, bool enabled, wxWindow *parent)
 Toggle a tool of a toolbar without GUI state changing.


Detailed Description

Provides methods for simulating control specific events.

Flushing the event queue is not part of the event simulation helper methods!

Definition at line 34 of file EventSimulationHelper.h.


Constructor & Destructor Documentation

EventSimulationHelper::EventSimulationHelper (  ) 

Constructor.

Definition at line 31 of file EventSimulationHelper.cpp.

EventSimulationHelper::~EventSimulationHelper (  )  [virtual]

Destructor.

Definition at line 37 of file EventSimulationHelper.cpp.


Member Function Documentation

void EventSimulationHelper::ClickButton ( int  id,
wxWindow parent 
) [static]

Click on a button.

Parameters:
id id of button to click
parent parent window owning the button (or button itself)

Definition at line 109 of file EventSimulationHelper.cpp.

wxTreeItemId EventSimulationHelper::GetNthTreeChild ( wxTreeCtrl *  treeCtrl,
unsigned int  idx,
const wxTreeItemId &  id 
) [static]

Find the idx'th child of a particular tree item.

Parameters:
treeCtrl The wxTreeCtrl to be searched
idx The index of the child item
id The id of the parental tree item.

Definition at line 136 of file EventSimulationHelper.cpp.

bool EventSimulationHelper::IsSettingSpinCtrlValue (  )  [static]

Return if spin control value is currently being set/simulated.

Only needed for correct capturing of standard wxSpinCtrl, as it does NOT trigger a spin control event when text, i.e. the integer value, is entered.

Based on s_isSettingSpinCtrlValue member.

Returns:
true, if spin control value is currently being set/simulated

Definition at line 274 of file EventSimulationHelper.cpp.

Referenced by wxTst::CRTextUpdateEvent::Process().

void EventSimulationHelper::RightClickTreeItem ( const wxTreeItemId &  id,
wxTreeCtrl *  treeCtrl 
) [static]

Right click on visible (!) tree item, i.e. tree must be expanded to show this tree item.

Parameters:
id id of tree item to right click
treeCtrl tree control owning the tree item (= parent of tree item)

Definition at line 170 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SelectAndCheckMenuItem ( int  id,
wxMenu *  menu = NULL 
) [static]

Select and check a menu item.

Parameters:
id id of menu item to select and check
menu menu owning the menu item

Definition at line 94 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SelectAndCheckMenuItem ( int  id,
wxWindow window,
wxMenu **  menu = NULL 
) [static]

Select and check a menu item.

Parameters:
id id of menu item to select and check
window window owning the menu (bar) where the menu item is a child of (= parent of menu item)
menu menu owning the menu item; if NULL, it is assumed the window is in fact a wxFrame with a menu bar holding the menu item

Definition at line 62 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SelectChoiceItem ( wxChoice *  choice,
unsigned int  item 
) [static]

Select choice item.

Parameters:
choice choice whose selection should be manipulated
item index of item to select from choice

Definition at line 200 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SelectMenuItem ( int  id,
wxEvtHandler evtHandler 
) [static]

Select a menu item (convenience method for popup menus).

Parameters:
id id of menu item to select
evtHandler menu (= event handler) holding the menu item

Definition at line 53 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SelectMenuItem ( int  id,
wxWindow frame 
) [static]

Select a menu item.

Parameters:
id id of menu item to select
frame frame owning the menu bar where the menu item is a child of (= parent of menu item)

Definition at line 43 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SelectNotebookPage ( wxNotebook *  notebook,
unsigned int  page 
) [static]

Select notebook page.

Parameters:
notebook notebook owning the page, i.e. whose selection should be manipulated
page page of notebook to select

Definition at line 192 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SelectRadioBoxItem ( wxRadioBox *  radioBox,
unsigned int  item 
) [static]

Select radiobox item.

Parameters:
radioBox radio box whose selection should be manipulated
item index of item to select from radio box

Definition at line 227 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SelectTreeItem ( const wxTreeItemId &  id,
wxTreeCtrl *  treeCtrl 
) [static]

Select a tree item.

Note: Under M the event is fired twice!

Parameters:
id id of tree item to select
treeCtrl tree control owning the tree item (= parent of tree item)

Definition at line 152 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SetCheckboxState ( wxCheckBox *  checkbox,
bool  isChecked 
) [static]

Check or uncheck checkbox.

Parameters:
checkbox checkbox whose state should be manipulated
isChecked sets the checkbox to the given state

Definition at line 214 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SetSliderValue ( wxSlider *  slider,
unsigned int  value 
) [static]

Set slider value.

Parameters:
slider slider that needs to be changed.
value value of slider to set.

Definition at line 241 of file EventSimulationHelper.cpp.

void EventSimulationHelper::SetSpinCtrlValue ( wxSpinCtrl *  spinCtrl,
int  value 
) [static]

Set spin control value.

Parameters:
spinCtrl spinctrl that needs to be changed.
value value of spin control to set.

Definition at line 259 of file EventSimulationHelper.cpp.

Referenced by wxTst::CRTextUpdateEvent::Process().

void EventSimulationHelper::SetTextCtrlValue ( wxTextCtrl *  textCtrl,
const wxString &  value 
) [static]

Set text control value.

Parameters:
textCtrl text control to manipulate
value new value for text control

Definition at line 117 of file EventSimulationHelper.cpp.

void EventSimulationHelper::ToggleTool ( int  id,
bool  enabled,
wxToolBar *  toolbar,
wxWindow parent 
) [static]

Toggle a tool of a toolbar.

This is almost equivalent to selecting a menu item.

Parameters:
id id of tool to toggle
enabled if true, toggles on the tool
toolbar toolbar owning the tool with the given id
parent parent window owning the tool or toolbar

Definition at line 290 of file EventSimulationHelper.cpp.

void EventSimulationHelper::ToggleToolOnlyEvent ( int  id,
bool  enabled,
wxWindow parent 
) [static]

Toggle a tool of a toolbar without GUI state changing.

This is almost equivalent to selecting a menu item.

Parameters:
id id of tool to toggle
enabled if true, toggles on the tool
parent parent window owning the tool

Definition at line 280 of file EventSimulationHelper.cpp.


The documentation for this class was generated from the following files:

wxWidgets Logo Get wxGuiTesting at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Tue Mar 17 17:29:30 2009 for wxGuiTesting by doxygen 1.5.5