00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #ifndef EVENTSIMULATIONHELPER_H
00012 #define EVENTSIMULATIONHELPER_H
00013
00014 #ifdef __GNUG__
00015 #pragma interface "EventSimulationHelper.h"
00016 #endif
00017
00018 #include <wxGuiTest/Common.h>
00019
00020 class wxTreeItemId;
00021 class wxTreeCtrl;
00022 class wxSpinCtrl;
00023 class wxNotebook;
00024
00025
00026 namespace wxTst {
00027
00028
00034 class EventSimulationHelper
00035 {
00036 public:
00040 EventSimulationHelper ();
00041
00042
00046 virtual ~EventSimulationHelper ();
00047
00048
00056 static void SelectMenuItem (int id, wxWindow *frame);
00057
00058
00065 static void SelectMenuItem (int id, wxEvtHandler *evtHandler);
00066
00067
00077 static void SelectAndCheckMenuItem (int id, wxWindow *window, wxMenu **menu = NULL);
00078
00079
00086 static void SelectAndCheckMenuItem (int id, wxMenu *menu = NULL);
00087
00088
00095 static void ClickButton (int id, wxWindow *parent);
00096
00097
00104 static void SetTextCtrlValue (wxTextCtrl *textCtrl,
00105 const wxString &value);
00106
00115 static wxTreeItemId GetNthTreeChild( wxTreeCtrl *treeCtrl, unsigned int idx,
00116 const wxTreeItemId &id);
00117
00126 static void SelectTreeItem (const wxTreeItemId &id, wxTreeCtrl *treeCtrl);
00127
00128
00136 static void RightClickTreeItem (const wxTreeItemId &id, wxTreeCtrl *treeCtrl);
00137
00138
00145 static void SelectNotebookPage (wxNotebook *notebook, unsigned int page);
00146
00147
00154 static void SelectChoiceItem (wxChoice *choice, unsigned int item);
00155
00156
00163 static void SetCheckboxState (wxCheckBox *checkbox, bool isChecked);
00164
00165
00172 static void SelectRadioBoxItem (wxRadioBox *radioBox, unsigned int item);
00173
00174
00181 static void SetSliderValue (wxSlider *slider, unsigned int value);
00182
00183
00190 static void SetSpinCtrlValue (wxSpinCtrl *spinCtrl, int value);
00191
00192
00204 static bool IsSettingSpinCtrlValue ();
00205
00206
00216 static void ToggleToolOnlyEvent (int id, bool enabled, wxWindow *parent);
00217
00218
00229 static void ToggleTool (int id, bool enabled, wxToolBar *toolbar, wxWindow *parent);
00230
00231 protected:
00232
00233 private:
00234 static bool s_isSettingSpinCtrlValue;
00235
00236 };
00237
00238 }
00239
00240 #endif // EVENTSIMULATIONHELPER_H
00241