1 /////////////////////////////////////////////////////////////////////////////
2 // Name: include/wx/uiaction.cpp
3 // Purpose: wxUIActionSimulator interface
4 // Author: Kevin Ollivier
7 // RCS-ID: $Id: menu.cpp 54129 2008-06-11 19:30:52Z SC $
8 // Copyright: (c) Kevin Ollivier
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _UIACTIONSIMULATOR_H_
13 #define _UIACTIONSIMULATOR_H_
17 #include <wx/dynarray.h>
19 class WXDLLIMPEXP_CORE wxUIActionSimulator
22 wxUIActionSimulator();
23 ~wxUIActionSimulator();
26 bool MouseMove(long x
, long y
);
27 bool MouseDown(int button
= wxMOUSE_BTN_LEFT
);
28 bool MouseUp(int button
= wxMOUSE_BTN_LEFT
);
29 bool MouseClick(int button
= wxMOUSE_BTN_LEFT
);
30 bool MouseDblClick(int button
= wxMOUSE_BTN_LEFT
);
31 bool MouseDragDrop(long x1
, long y1
, long x2
, long y2
, int button
= wxMOUSE_BTN_LEFT
);
35 bool KeyDown(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false)
36 { return Key(keycode
, true, shiftDown
, cmdDown
, altDown
); }
38 bool KeyUp(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false)
39 { return Key(keycode
, false, shiftDown
, cmdDown
, altDown
); }
41 bool Char(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);
44 // Implementation-wise, since key events take more code to set up on GTK and Mac, it makes
45 // sense to handle both key down and key up in one method. However, I wanted the API for pressing
46 // and releasing the mouse and keyboard to be consistent, and I don't really like using a bool
47 // for pressed state, so I'm leaving this as an implementation detail.
48 bool Key(int keycode
, bool isDown
=true, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);