X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a02a5cfcf33bb2c0edae246c1b19e286bf86d422..153107b4021fe0e6c3ad2ed510d3225f138eee83:/include/wx/uiaction.h?ds=sidebyside diff --git a/include/wx/uiaction.h b/include/wx/uiaction.h index ebce484040..a11bb347eb 100644 --- a/include/wx/uiaction.h +++ b/include/wx/uiaction.h @@ -9,19 +9,22 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _UIACTIONSIMULATOR_H_ -#define _UIACTIONSIMULATOR_H_ +#ifndef _WX_UIACTIONSIMULATOR_H_ +#define _WX_UIACTIONSIMULATOR_H_ -#include -#include -#include +#include "wx/defs.h" + +#if wxUSE_UIACTIONSIMULATOR + +#include "wx/event.h" +#include "wx/dynarray.h" class WXDLLIMPEXP_CORE wxUIActionSimulator { public: wxUIActionSimulator(); ~wxUIActionSimulator(); - + // Mouse related bool MouseMove(long x, long y); bool MouseDown(int button = wxMOUSE_BTN_LEFT); @@ -29,23 +32,25 @@ public: bool MouseClick(int button = wxMOUSE_BTN_LEFT); bool MouseDblClick(int button = wxMOUSE_BTN_LEFT); bool MouseDragDrop(long x1, long y1, long x2, long y2, int button = wxMOUSE_BTN_LEFT); - + // Keyboard related: bool KeyDown(int keycode, bool shiftDown=false, bool cmdDown=false, bool altDown=false) { return Key(keycode, true, shiftDown, cmdDown, altDown); } - + bool KeyUp(int keycode, bool shiftDown=false, bool cmdDown=false, bool altDown=false) { return Key(keycode, false, shiftDown, cmdDown, altDown); } - + bool Char(int keycode, bool shiftDown=false, bool cmdDown=false, bool altDown=false); protected: // Implementation-wise, since key events take more code to set up on GTK and Mac, it makes // sense to handle both key down and key up in one method. However, I wanted the API for pressing - // and releasing the mouse and keyboard to be consistent, and I don't really like using a bool - // for pressed state, so I'm leaving this as an implementation detail. + // and releasing the mouse and keyboard to be consistent, and I don't really like using a bool + // for pressed state, so I'm leaving this as an implementation detail. bool Key(int keycode, bool isDown=true, bool shiftDown=false, bool cmdDown=false, bool altDown=false); }; -#endif +#endif // wxUSE_UIACTIONSIMULATOR + +#endif // _WX_UIACTIONSIMULATOR_H_