X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/371412145fdcff75d46401eb7fcffdc047f195cb..76015a6bb79156d8af1b5e8b4b8e46b4e192d18f:/src/common/uiactioncmn.cpp diff --git a/src/common/uiactioncmn.cpp b/src/common/uiactioncmn.cpp index 5afc7dae6a..0df4aea34b 100644 --- a/src/common/uiactioncmn.cpp +++ b/src/common/uiactioncmn.cpp @@ -4,7 +4,7 @@ // Author: Kevin Ollivier, Steven Lamerton, Vadim Zeitlin // Modified by: // Created: 2010-03-06 -// RCS-ID: $Id: menu.cpp 54129 2008-06-11 19:30:52Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Kevin Ollivier // (c) 2010 Steven Lamerton // (c) 2010 Vadim Zeitlin @@ -25,6 +25,8 @@ bool wxUIActionSimulator::MouseClick(int button) return true; } +#ifndef __WXOSX__ + bool wxUIActionSimulator::MouseDblClick(int button) { MouseDown(button); @@ -35,18 +37,19 @@ bool wxUIActionSimulator::MouseDblClick(int button) return true; } -bool -wxUIActionSimulator::MouseDragDrop(long x1, long y1, long x2, long y2, +bool wxUIActionSimulator::MouseDragDrop(long x1, long y1, long x2, long y2, int button) { MouseMove(x1, y1); MouseDown(button); MouseMove(x2, y2); MouseUp(button); - + return true; } +#endif + bool wxUIActionSimulator::Key(int keycode, int modifiers, bool isDown) { @@ -80,6 +83,51 @@ void wxUIActionSimulator::SimulateModifiers(int modifiers, bool isDown) bool wxUIActionSimulator::Char(int keycode, int modifiers) { + switch(keycode) + { + case '0': + keycode = '0'; + break; + case '1': + keycode = '1'; + break; + case '2': + keycode = '2'; + break; + case '3': + keycode = '3'; + break; + case '4': + keycode = '4'; + break; + case '5': + keycode = '5'; + break; + case '6': + keycode = '6'; + break; + case '7': + keycode = '7'; + break; + case '8': + keycode = '8'; + break; + case '9': + keycode = '9'; + break; + case '+': + keycode = '+'; + break; + case '-': + keycode = '-'; + break; + case '.': + keycode = '.'; + break; + default: + break; + }; + Key(keycode, modifiers, true); Key(keycode, modifiers, false); @@ -91,9 +139,6 @@ bool wxUIActionSimulator::Text(const char *s) while ( *s != '\0' ) { const char ch = *s++; - - wxASSERT_MSG( ch, "Only letters are allowed" ); - if ( !Char(ch, isupper(ch) ? wxMOD_SHIFT : 0) ) return false; }