wxWidgets/include/wx/uiaction.h
Vadim Zeitlin 9b7e022676 Add wxUSE_UIACTIONSIMULATOR and turn it off by default.
Disable the recently added wxUIActionSimulator class until the issues with it
mentioned at http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/119792/
are fixed.

Also use "" around wx headers instead of <> in wx code itself.

See #11801.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-22 11:40:35 +00:00

57 lines
2.1 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: include/wx/uiaction.cpp
// Purpose: wxUIActionSimulator interface
// Author: Kevin Ollivier
// Modified by:
// Created: 2010-03-06
// RCS-ID: $Id: menu.cpp 54129 2008-06-11 19:30:52Z SC $
// Copyright: (c) Kevin Ollivier
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_UIACTIONSIMULATOR_H_
#define _WX_UIACTIONSIMULATOR_H_
#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);
bool MouseUp(int button = wxMOUSE_BTN_LEFT);
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.
bool Key(int keycode, bool isDown=true, bool shiftDown=false, bool cmdDown=false, bool altDown=false);
};
#endif // wxUSE_UIACTIONSIMULATOR
#endif // _WX_UIACTIONSIMULATOR_H_