new event filtering mustn't apply to primitive dialogs

svn: r4625
This commit is contained in:
Matthew Flatt 2006-10-18 05:42:58 +00:00
parent a9ab05d0f5
commit 2ccf88b6db
2 changed files with 13 additions and 2 deletions

View File

@ -41,6 +41,8 @@ static void MrDequeue(MrQueueElem *q);
WindowPtr MrEdMouseWindow(Point where); WindowPtr MrEdMouseWindow(Point where);
WindowPtr MrEdKeyWindow(); WindowPtr MrEdKeyWindow();
int wx_leave_all_input_alone;
extern int wxTranslateRawKey(int key); extern int wxTranslateRawKey(int key);
extern short wxMacDisableMods; extern short wxMacDisableMods;
@ -342,6 +344,7 @@ void wxSmuggleOutEvent(EventRef ref)
UniChar *text; UniChar *text;
UInt32 actualSize; UInt32 actualSize;
EventRef kref; EventRef kref;
UInt32 val = 0;
GetEventParameter(ref, kEventParamTextInputSendKeyboardEvent, GetEventParameter(ref, kEventParamTextInputSendKeyboardEvent,
typeEventRef, NULL, sizeof(EventRef), NULL, &kref); typeEventRef, NULL, sizeof(EventRef), NULL, &kref);
@ -392,6 +395,9 @@ static OSStatus smuggle_handler(EventHandlerCallRef inHandlerCallRef,
EventRef inEvent, EventRef inEvent,
void *inUserData) void *inUserData)
{ {
if (wx_leave_all_input_alone)
return eventNotHandledErr;
wxSmuggleOutEvent(inEvent); wxSmuggleOutEvent(inEvent);
return noErr; return noErr;
} }

View File

@ -1385,10 +1385,13 @@ void wxApp::DoDefaultAboutItem(void)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern int wx_leave_all_input_alone;
void wxPrimDialogSetUp() void wxPrimDialogSetUp()
{ {
wxUnhideCursor(); wxUnhideCursor();
wxSetCursor(wxSTANDARD_CURSOR); wxSetCursor(wxSTANDARD_CURSOR);
wx_leave_all_input_alone++;
} }
void wxPrimDialogCleanUp() void wxPrimDialogCleanUp()
@ -1396,6 +1399,8 @@ void wxPrimDialogCleanUp()
WindowPtr w; WindowPtr w;
EventRecord event; EventRecord event;
--wx_leave_all_input_alone;
wxTheApp->AdjustCursor(); wxTheApp->AdjustCursor();
/* In case the front window wasn't active when we started: */ /* In case the front window wasn't active when we started: */