]>
Commit | Line | Data |
---|---|---|
a02a5cfc | 1 | ///////////////////////////////////////////////////////////////////////////// |
233f5738 | 2 | // Name: wx/uiaction.h |
a02a5cfc KO |
3 | // Purpose: wxUIActionSimulator interface |
4 | // Author: Kevin Ollivier | |
5 | // Modified by: | |
6 | // Created: 2010-03-06 | |
7 | // RCS-ID: $Id: menu.cpp 54129 2008-06-11 19:30:52Z SC $ | |
8 | // Copyright: (c) Kevin Ollivier | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
9b7e0226 VZ |
12 | #ifndef _WX_UIACTIONSIMULATOR_H_ |
13 | #define _WX_UIACTIONSIMULATOR_H_ | |
a02a5cfc | 14 | |
9b7e0226 VZ |
15 | #include "wx/defs.h" |
16 | ||
17 | #if wxUSE_UIACTIONSIMULATOR | |
18 | ||
19 | #include "wx/event.h" | |
20 | #include "wx/dynarray.h" | |
a02a5cfc KO |
21 | |
22 | class WXDLLIMPEXP_CORE wxUIActionSimulator | |
23 | { | |
24 | public: | |
25 | wxUIActionSimulator(); | |
26 | ~wxUIActionSimulator(); | |
9b7e0226 | 27 | |
a02a5cfc KO |
28 | // Mouse related |
29 | bool MouseMove(long x, long y); | |
30 | bool MouseDown(int button = wxMOUSE_BTN_LEFT); | |
31 | bool MouseUp(int button = wxMOUSE_BTN_LEFT); | |
32 | bool MouseClick(int button = wxMOUSE_BTN_LEFT); | |
33 | bool MouseDblClick(int button = wxMOUSE_BTN_LEFT); | |
34 | bool MouseDragDrop(long x1, long y1, long x2, long y2, int button = wxMOUSE_BTN_LEFT); | |
9b7e0226 | 35 | |
a02a5cfc KO |
36 | // Keyboard related: |
37 | ||
38 | bool KeyDown(int keycode, bool shiftDown=false, bool cmdDown=false, bool altDown=false) | |
39 | { return Key(keycode, true, shiftDown, cmdDown, altDown); } | |
9b7e0226 | 40 | |
a02a5cfc KO |
41 | bool KeyUp(int keycode, bool shiftDown=false, bool cmdDown=false, bool altDown=false) |
42 | { return Key(keycode, false, shiftDown, cmdDown, altDown); } | |
9b7e0226 | 43 | |
a02a5cfc KO |
44 | bool Char(int keycode, bool shiftDown=false, bool cmdDown=false, bool altDown=false); |
45 | ||
46 | protected: | |
47 | // Implementation-wise, since key events take more code to set up on GTK and Mac, it makes | |
48 | // sense to handle both key down and key up in one method. However, I wanted the API for pressing | |
9b7e0226 VZ |
49 | // and releasing the mouse and keyboard to be consistent, and I don't really like using a bool |
50 | // for pressed state, so I'm leaving this as an implementation detail. | |
a02a5cfc KO |
51 | bool Key(int keycode, bool isDown=true, bool shiftDown=false, bool cmdDown=false, bool altDown=false); |
52 | }; | |
53 | ||
9b7e0226 VZ |
54 | #endif // wxUSE_UIACTIONSIMULATOR |
55 | ||
56 | #endif // _WX_UIACTIONSIMULATOR_H_ |