]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/uiaction.h
avoid populating the array with NULL controls during creation (SetWindowVariant calli...
[wxWidgets.git] / interface / wx / uiaction.h
CommitLineData
a02a5cfc
KO
1/////////////////////////////////////////////////////////////////////////////
2// Name: uiaction.h
3// Purpose: interface of wxUIActionSimulator
4// Author: wxWidgets team
5// RCS-ID: $Id$
526954c5 6// Licence: wxWindows licence
a02a5cfc
KO
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxUIActionSimulator
11
12 wxUIActionSimulator is a class used to simulate user interface actions
9b7e0226
VZ
13 such as a mouse click or a key press.
14
571d991b
VZ
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.
9b7e0226 18
571d991b 19 See the @ref page_samples_uiaction for an example of using this class.
9b7e0226 20
571d991b 21 @since 2.9.2
9b7e0226 22
a02a5cfc
KO
23 @library{wxcore}
24*/
25
26class wxUIActionSimulator
27{
571d991b 28public:
a02a5cfc 29 /**
571d991b 30 Default constructor.
a02a5cfc
KO
31 */
32 wxUIActionSimulator();
9b7e0226 33
a02a5cfc
KO
34 /**
35 Move the mouse to the specified coordinates.
9b7e0226 36
a02a5cfc
KO
37 @param x
38 x coordinate to move to, in screen coordinates.
9b7e0226 39
a02a5cfc
KO
40 @param y
41 y coordinate to move to, in screen coordinates.
42 */
571d991b
VZ
43 bool MouseMove(long x, long y);
44
45 /**
46 Move the mouse to the specified coordinates.
47
48 @param point
49 Point to move to, in screen coordinates.
50 */
51 bool MouseMove(const wxPoint& point);
9b7e0226 52
a02a5cfc
KO
53 /**
54 Press a mouse button.
9b7e0226 55
a02a5cfc 56 @param button
571d991b
VZ
57 Button to press. Valid constants are @c wxMOUSE_BTN_LEFT,
58 @c wxMOUSE_BTN_MIDDLE, and @c wxMOUSE_BTN_RIGHT.
a02a5cfc 59 */
571d991b 60 bool MouseDown(int button = wxMOUSE_BTN_LEFT);
9b7e0226 61
a02a5cfc
KO
62 /**
63 Release a mouse button.
9b7e0226 64
a02a5cfc 65 @param button
571d991b
VZ
66 Button to press. See wxUIActionSimulator::MouseDown for a list of
67 valid constants.
a02a5cfc 68 */
571d991b 69 bool MouseUp(int button = wxMOUSE_BTN_LEFT);
a02a5cfc
KO
70 /**
71 Click a mouse button.
9b7e0226 72
a02a5cfc 73 @param button
571d991b
VZ
74 Button to press. See wxUIActionSimulator::MouseDown for a list of
75 valid constants.
a02a5cfc 76 */
571d991b 77 bool MouseClick(int button = wxMOUSE_BTN_LEFT);
a02a5cfc
KO
78 /**
79 Double-click a mouse button.
9b7e0226 80
a02a5cfc 81 @param button
571d991b
VZ
82 Button to press. See wxUIActionSimulator::MouseDown for a list of
83 valid constants.
a02a5cfc 84 */
571d991b 85 bool MouseDblClick(int button = wxMOUSE_BTN_LEFT);
a02a5cfc
KO
86
87 /**
88 Perform a drag and drop operation.
9b7e0226 89
a02a5cfc
KO
90 @param x1
91 x start coordinate, in screen coordinates.
9b7e0226 92
a02a5cfc
KO
93 @param y1
94 y start coordinate, in screen coordinates.
9b7e0226 95
a02a5cfc
KO
96 @param x2
97 x desintation coordinate, in screen coordinates.
9b7e0226 98
a02a5cfc
KO
99 @param y2
100 y destination coordinate, in screen coordinates.
9b7e0226 101
a02a5cfc 102 @param button
571d991b
VZ
103 Button to press. See wxUIActionSimulator::MouseDown for a list of
104 valid constants.
a02a5cfc 105 */
571d991b
VZ
106 bool MouseDragDrop(long x1, long y1, long x2, long y2,
107 int button = wxMOUSE_BTN_LEFT);
9b7e0226 108
a02a5cfc 109 /**
9b7e0226
VZ
110 Press a key.
111
571d991b
VZ
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).
9b7e0226 114
571d991b
VZ
115 @param keycode
116 Key to operate on, as an integer. It is interpreted as a wxKeyCode.
9b7e0226 117
571d991b
VZ
118 @param modifiers
119 A combination of ::wxKeyModifier flags to be pressed with the given
120 keycode.
a02a5cfc 121 */
571d991b 122 bool KeyDown(int keycode, int modifiers = wxMOD_NONE);
9b7e0226 123
a02a5cfc 124 /**
9b7e0226
VZ
125 Release a key.
126
a02a5cfc 127 @param keycode
571d991b 128 Key to operate on, as an integer. It is interpreted as a wxKeyCode.
9b7e0226 129
571d991b
VZ
130 @param modifiers
131 A combination of ::wxKeyModifier flags to be pressed with the given
132 keycode.
a02a5cfc 133 */
571d991b 134 bool KeyUp(int keycode, int modifiers = wxMOD_NONE);
9b7e0226 135
a02a5cfc 136 /**
9b7e0226
VZ
137 Press and release a key.
138
a02a5cfc 139 @param keycode
571d991b 140 Key to operate on, as an integer. It is interpreted as a wxKeyCode.
9b7e0226 141
571d991b
VZ
142 @param modifiers
143 A combination of ::wxKeyModifier flags to be pressed with the given
144 keycode.
145 */
146 bool Char(int keycode, int modifiers = wxMOD_NONE);
147
148 /**
149 Emulate typing in the keys representing the given string.
9b7e0226 150
571d991b
VZ
151 Currently only the ASCII letters (i.e. characters @c a-z and @c A-Z)
152 are supported.
9b7e0226 153
571d991b
VZ
154 @param text
155 The string to type.
a02a5cfc 156 */
571d991b 157 bool Text(const wxString& text);
a02a5cfc
KO
158};
159