]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/uiaction.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxUIActionSimulator
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
9 @class wxUIActionSimulator
11 wxUIActionSimulator is a class used to simulate user interface actions
12 such as a mouse click or a key press.
14 Common usage for this class would be to provide playback and record (aka
15 macro recording) functionality for users, or to drive unit tests by
16 simulating user sessions.
18 See the @ref page_samples_uiaction for an example of using this class.
25 class wxUIActionSimulator
31 wxUIActionSimulator();
34 Move the mouse to the specified coordinates.
37 x coordinate to move to, in screen coordinates.
40 y coordinate to move to, in screen coordinates.
42 bool MouseMove(long x
, long y
);
45 Move the mouse to the specified coordinates.
48 Point to move to, in screen coordinates.
50 bool MouseMove(const wxPoint
& point
);
56 Button to press. Valid constants are @c wxMOUSE_BTN_LEFT,
57 @c wxMOUSE_BTN_MIDDLE, and @c wxMOUSE_BTN_RIGHT.
59 bool MouseDown(int button
= wxMOUSE_BTN_LEFT
);
62 Release a mouse button.
65 Button to press. See wxUIActionSimulator::MouseDown for a list of
68 bool MouseUp(int button
= wxMOUSE_BTN_LEFT
);
73 Button to press. See wxUIActionSimulator::MouseDown for a list of
76 bool MouseClick(int button
= wxMOUSE_BTN_LEFT
);
78 Double-click a mouse button.
81 Button to press. See wxUIActionSimulator::MouseDown for a list of
84 bool MouseDblClick(int button
= wxMOUSE_BTN_LEFT
);
87 Perform a drag and drop operation.
90 x start coordinate, in screen coordinates.
93 y start coordinate, in screen coordinates.
96 x destination coordinate, in screen coordinates.
99 y destination coordinate, in screen coordinates.
102 Button to press. See wxUIActionSimulator::MouseDown for a list of
105 bool MouseDragDrop(long x1
, long y1
, long x2
, long y2
,
106 int button
= wxMOUSE_BTN_LEFT
);
111 If you are using modifiers then it needs to be paired with an identical
112 KeyUp or the modifiers will not be released (MSW and OSX).
115 Key to operate on, as an integer. It is interpreted as a wxKeyCode.
118 A combination of ::wxKeyModifier flags to be pressed with the given
121 bool KeyDown(int keycode
, int modifiers
= wxMOD_NONE
);
127 Key to operate on, as an integer. It is interpreted as a wxKeyCode.
130 A combination of ::wxKeyModifier flags to be pressed with the given
133 bool KeyUp(int keycode
, int modifiers
= wxMOD_NONE
);
136 Press and release a key.
139 Key to operate on, as an integer. It is interpreted as a wxKeyCode.
142 A combination of ::wxKeyModifier flags to be pressed with the given
145 bool Char(int keycode
, int modifiers
= wxMOD_NONE
);
148 Emulate typing in the keys representing the given string.
150 Currently only the ASCII letters, digits and characters for the definition
151 of numbers (i.e. characters @c a-z @c A-Z @c 0-9 @c + @c - @c . @c , @c 'space')
157 bool Text(const wxString
& text
);