]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/uiaction.h
cc8ad98e31cd58d55b03978fb6c22c5adbf4f549
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 Common usages for this class would be to provide playback and record (aka macro recording)
16 functionality for users, or to drive unit tests by simulating user sessions.
18 See the uiaction sample for example usage of this class.
20 NOTE: For keyboard operations, currently you must pass the keycode of the actual
21 key on the keyboard. To simulate, e.g. IME actions, you'd need to simulate the actual
22 keypresses needed to active the IME, then the keypresses needed to type and select
23 the desired character.
28 class wxUIActionSimulator
34 wxUIActionSimulator();
35 ~wxUIActionSimulator();
38 Move the mouse to the specified coordinates.
41 x coordinate to move to, in screen coordinates.
44 y coordinate to move to, in screen coordinates.
46 bool MouseMove(long x
, long y
);
52 Button to press. Valid constants are wxMOUSE_BTN_LEFT, wxMOUSE_BTN_MIDDLE, and wxMOUSE_BTN_RIGHT.
54 bool MouseDown(int button
= wxMOUSE_BTN_LEFT
);
57 Release a mouse button.
60 Button to press. See wxUIActionSimulator::MouseDown for a list of valid constants.
62 bool MouseUp(int button
= wxMOUSE_BTN_LEFT
);
67 Button to press. See wxUIActionSimulator::MouseDown for a list of valid constants.
69 bool MouseClick(int button
= wxMOUSE_BTN_LEFT
);
71 Double-click a mouse button.
74 Button to press. See wxUIActionSimulator::MouseDown for a list of valid constants.
76 bool MouseDblClick(int button
= wxMOUSE_BTN_LEFT
);
79 Perform a drag and drop operation.
82 x start coordinate, in screen coordinates.
85 y start coordinate, in screen coordinates.
88 x desintation coordinate, in screen coordinates.
91 y destination coordinate, in screen coordinates.
94 Button to press. See wxUIActionSimulator::MouseDown for a list of valid constants.
96 bool MouseDragDrop(long x1
, long y1
, long x2
, long y2
, int button
= wxMOUSE_BTN_LEFT
);
102 key to operate on, as an integer.
105 true if the shift key should be pressed, false otherwise.
108 true if the cmd key should be pressed, false otherwise.
111 true if the alt key should be pressed, false otherwise.
113 bool KeyDown(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);
119 key to operate on, as an integer.
122 true if the shift key should be pressed, false otherwise.
125 true if the cmd key should be pressed, false otherwise.
128 true if the alt key should be pressed, false otherwise.
130 bool KeyUp(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);
133 Press and release a key.
136 key to operate on, as an integer.
139 true if the shift key should be pressed, false otherwise.
142 true if the cmd key should be pressed, false otherwise.
145 true if the alt key should be pressed, false otherwise.
147 bool Char(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);