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
This commit is contained in:
Vadim Zeitlin
2010-03-22 11:40:35 +00:00
parent 75738bb65b
commit 9b7e022676
19 changed files with 222 additions and 89 deletions

View File

@@ -9,8 +9,11 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include <wx/defs.h>
#include <wx/uiaction.h>
#include "wx/defs.h"
#if wxUSE_UIACTIONSIMULATOR
#include "wx/uiaction.h"
#include <ApplicationServices/ApplicationServices.h>
@@ -30,9 +33,9 @@ CGEventType CGEventTypeForMouseButton(int button, bool isDown)
return kCGEventRightMouseDown;
else
return kCGEventRightMouseUp;
// Apparently all other buttons use the constant OtherMouseDown
// Apparently all other buttons use the constant OtherMouseDown
default:
if (isDown)
return kCGEventOtherMouseDown;
@@ -55,13 +58,13 @@ bool wxUIActionSimulator::MouseDown(int button)
{
CGPoint pos;
int x, y;
wxGetMousePosition(&x, &y);
wxGetMousePosition(&x, &y);
pos.x = x;
pos.y = y;
CGEventType type = CGEventTypeForMouseButton(button, true);
CGEventRef event = CGEventCreateMouseEvent(NULL, type, pos, button);
CGEventSetType(event, type);
if (event)
{
CGEventPost(tap, event);
@@ -78,13 +81,13 @@ bool wxUIActionSimulator::MouseMove(long x, long y)
CGEventType type = kCGEventMouseMoved;
CGEventRef event = CGEventCreateMouseEvent(NULL, type, pos, kCGMouseButtonLeft);
CGEventSetType(event, type);
if (event)
{
CGEventPost(tap, event);
}
CFRelease(event);
return true;
}
@@ -92,13 +95,13 @@ bool wxUIActionSimulator::MouseUp(int button)
{
CGPoint pos;
int x, y;
wxGetMousePosition(&x, &y);
wxGetMousePosition(&x, &y);
pos.x = x;
pos.y = y;
CGEventType type = CGEventTypeForMouseButton(button, false);
CGEventRef event = CGEventCreateMouseEvent(NULL, type, pos, button);
CGEventSetType(event, type);
if (event)
{
CGEventPost(tap, event);
@@ -125,8 +128,9 @@ bool wxUIActionSimulator::Key(int keycode, bool isDown, bool shiftDown, bool cmd
SendCharCode((CGCharCode)58, false);
if (cmdDown)
SendCharCode((CGCharCode)55, false);
return true;
}
#endif // wxUSE_UIACTIONSIMULATOR