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 _WX_UIACTIONSIMULATOR_H_
13 #define _WX_UIACTIONSIMULATOR_H_
17 #if wxUSE_UIACTIONSIMULATOR
20 #include "wx/dynarray.h"
22 class WXDLLIMPEXP_CORE wxUIActionSimulator
25 wxUIActionSimulator();
26 ~wxUIActionSimulator();
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
);
38 bool KeyDown(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false)
39 { return Key(keycode
, true, shiftDown
, cmdDown
, altDown
); }
41 bool KeyUp(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false)
42 { return Key(keycode
, false, shiftDown
, cmdDown
, altDown
); }
44 bool Char(int keycode
, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);
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
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.
51 bool Key(int keycode
, bool isDown
=true, bool shiftDown
=false, bool cmdDown
=false, bool altDown
=false);
54 #endif // wxUSE_UIACTIONSIMULATOR
56 #endif // _WX_UIACTIONSIMULATOR_H_