]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/uiaction.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxUIActionSimulator
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
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 usage for this class would be to provide playback and record (aka
16 macro recording) functionality for users, or to drive unit tests by
17 simulating user sessions.
19 See the @ref page_samples_uiaction for an example of using this class.
26 class wxUIActionSimulator
32 wxUIActionSimulator();
35 Move the mouse to the specified coordinates.
38 x coordinate to move to, in screen coordinates.
41 y coordinate to move to, in screen coordinates.
43 bool MouseMove(long x
, long y
);
46 Move the mouse to the specified coordinates.
49 Point to move to, in screen coordinates.
51 bool MouseMove(const wxPoint
& point
);
57 Button to press. Valid constants are @c wxMOUSE_BTN_LEFT,
58 @c wxMOUSE_BTN_MIDDLE, and @c wxMOUSE_BTN_RIGHT.
60 bool MouseDown(int button
= wxMOUSE_BTN_LEFT
);
63 Release a mouse button.
66 Button to press. See wxUIActionSimulator::MouseDown for a list of
69 bool MouseUp(int button
= wxMOUSE_BTN_LEFT
);
74 Button to press. See wxUIActionSimulator::MouseDown for a list of
77 bool MouseClick(int button
= wxMOUSE_BTN_LEFT
);
79 Double-click a mouse button.
82 Button to press. See wxUIActionSimulator::MouseDown for a list of
85 bool MouseDblClick(int button
= wxMOUSE_BTN_LEFT
);
88 Perform a drag and drop operation.
91 x start coordinate, in screen coordinates.
94 y start coordinate, in screen coordinates.
97 x destination coordinate, in screen coordinates.
100 y destination coordinate, in screen coordinates.
103 Button to press. See wxUIActionSimulator::MouseDown for a list of
106 bool MouseDragDrop(long x1
, long y1
, long x2
, long y2
,
107 int button
= wxMOUSE_BTN_LEFT
);
112 If you are using modifiers then it needs to be paired with an identical
113 KeyUp or the modifiers will not be released (MSW and OSX).
116 Key to operate on, as an integer. It is interpreted as a wxKeyCode.
119 A combination of ::wxKeyModifier flags to be pressed with the given
122 bool KeyDown(int keycode
, int modifiers
= wxMOD_NONE
);
128 Key to operate on, as an integer. It is interpreted as a wxKeyCode.
131 A combination of ::wxKeyModifier flags to be pressed with the given
134 bool KeyUp(int keycode
, int modifiers
= wxMOD_NONE
);
137 Press and release a key.
140 Key to operate on, as an integer. It is interpreted as a wxKeyCode.
143 A combination of ::wxKeyModifier flags to be pressed with the given
146 bool Char(int keycode
, int modifiers
= wxMOD_NONE
);
149 Emulate typing in the keys representing the given string.
151 Currently only the ASCII letters (i.e. characters @c a-z and @c A-Z)
157 bool Text(const wxString
& text
);