]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/uiaction.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxUIActionSimulator
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxUIActionSimulator
12 wxUIActionSimulator is a class used to simulate user interface actions
13 such as a mouse click or a key press.
15 @note that this class is currently experimental and disabled by default,
16 you must set @c wxUSE_UIACTIONSIMULATOR to 1 in your setup.h file or use
17 configure @c --enable-uiactionsim option to enable it.
19 Common usages for this class would be to provide playback and record (aka macro recording)
20 functionality for users, or to drive unit tests by simulating user sessions.
22 See the uiaction sample for example usage of this class.
24 NOTE: For keyboard operations, currently you must pass the keycode of the actual
25 key on the keyboard. To simulate, e.g. IME actions, you'd need to simulate the actual
26 keypresses needed to active the IME, then the keypresses needed to type and select
27 the desired character.
32 class wxUIActionSimulator
38 wxUIActionSimulator();
39 ~wxUIActionSimulator();
42 Move the mouse to the specified coordinates.
45 x coordinate to move to, in screen coordinates.
48 y coordinate to move to, in screen coordinates.
50 bool MouseMove(long x
, long y
);
56 Button to press. Valid constants are wxMOUSE_BTN_LEFT, wxMOUSE_BTN_MIDDLE, and wxMOUSE_BTN_RIGHT.
58 bool MouseDown(int button
= wxMOUSE_BTN_LEFT
);
61 Release a mouse button.
64 Button to press. See wxUIActionSimulator::MouseDown for a list of valid constants.
66 bool MouseUp(int button
= wxMOUSE_BTN_LEFT
);
71 Button to press. See wxUIActionSimulator::MouseDown for a list of valid constants.
73 bool MouseClick(int button
= wxMOUSE_BTN_LEFT
);
75 Double-click a mouse button.
78 Button to press. See wxUIActionSimulator::MouseDown for a list of valid constants.
80 bool MouseDblClick(int button
= wxMOUSE_BTN_LEFT
);
83 Perform a drag and drop operation.
86 x start coordinate, in screen coordinates.
89 y start coordinate, in screen coordinates.
92 x desintation coordinate, in screen coordinates.
95 y destination coordinate, in screen coordinates.
98 Button to press. See wxUIActionSimulator::MouseDown for a list of valid constants.
100 bool MouseDragDrop(long x1
, long y1
, long x2
, long y2
, int button
= wxMOUSE_BTN_LEFT
);
106 key to operate on, as an integer.
109 true if the shift key should be pressed, false otherwise.
112 true if the cmd key should be pressed, false otherwise.
115 true if the alt key should be pressed, false otherwise.
117 bool KeyDown(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);
123 key to operate on, as an integer.
126 true if the shift key should be pressed, false otherwise.
129 true if the cmd key should be pressed, false otherwise.
132 true if the alt key should be pressed, false otherwise.
134 bool KeyUp(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);
137 Press and release a key.
140 key to operate on, as an integer.
143 true if the shift key should be pressed, false otherwise.
146 true if the cmd key should be pressed, false otherwise.
149 true if the alt key should be pressed, false otherwise.
151 bool Char(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);