+ CGEventCreateMouseEvent(NULL, type, GetMousePosition(), CGButtonForMouseButton(button)));
+
+ if ( !event )
+ return false;
+
+ CGEventSetType(event, type);
+ CGEventPost(tap, event);
+ wxCFEventLoop* loop = dynamic_cast<wxCFEventLoop*>(wxEventLoop::GetActive());
+ if (loop)
+ loop->SetShouldWaitForEvent(true);
+
+ return true;
+}
+
+bool wxUIActionSimulator::MouseMove(long x, long y)
+{
+ CGPoint pos;
+ pos.x = x;
+ pos.y = y;
+
+ CGEventType type = kCGEventMouseMoved;
+ wxCFRef<CGEventRef> event(
+ CGEventCreateMouseEvent(NULL, type, pos, kCGMouseButtonLeft));
+
+ if ( !event )
+ return false;
+
+ CGEventSetType(event, type);
+ CGEventPost(tap, event);
+
+ wxCFEventLoop* loop = dynamic_cast<wxCFEventLoop*>(wxEventLoop::GetActive());
+ if (loop)
+ loop->SetShouldWaitForEvent(true);
+
+ return true;
+}
+
+bool wxUIActionSimulator::MouseUp(int button)
+{
+ CGEventType type = CGEventTypeForMouseButton(button, false);
+ wxCFRef<CGEventRef> event(
+ CGEventCreateMouseEvent(NULL, type, GetMousePosition(), CGButtonForMouseButton(button)));