Pending events are now deleted after being processed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4602
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Yield to other apps/messages
extern bool WXDLLEXPORT wxYield();
// Yield to other apps/messages
extern bool WXDLLEXPORT wxYield();
// Yield to other apps/messages
extern void WXDLLEXPORT wxWakeUpIdle();
// Yield to other apps/messages
extern void WXDLLEXPORT wxWakeUpIdle();
// Post a message to the given eventhandler which will be processed during the
// next event loop iteration
// Post a message to the given eventhandler which will be processed during the
// next event loop iteration
wxLEAVE_CRIT_SECT(wxPendingEventsLocker);
wxLEAVE_CRIT_SECT(wxPendingEventsLocker);
- // TODO: Wake up idle handler for the other platforms.
-#ifdef __WXGTK__
-#elif wxUSE_GUI // this works for wxMSW, but may be for others too?
- // might also send a dummy message to the top level window, this would
- // probably be cleaner?
- wxIdleEvent eventIdle;
- wxTheApp->OnIdle(eventIdle);
-#endif // platform
}
void wxEvtHandler::ProcessPendingEvents()
}
void wxEvtHandler::ProcessPendingEvents()
{
event = (wxEvent *)node->Data();
ProcessEvent(*event);
{
event = (wxEvent *)node->Data();
ProcessEvent(*event);
delete node;
node = m_pendingEvents->First();
}
delete node;
node = m_pendingEvents->First();
}
#if __option(profile)
#include <profiler.h>
#if __option(profile)
#include <profiler.h>
return wxTheApp->MacHandleAEQuit( event , reply) ;
}
return wxTheApp->MacHandleAEQuit( event , reply) ;
}
-OSErr wxApp::MacHandleAEODoc(AppleEvent *event , AppleEvent *reply)
+OSErr wxApp::MacHandleAEODoc(AppleEvent *event , AppleEvent *reply)
{
ProcessSerialNumber PSN ;
PSN.highLongOfPSN = 0 ;
{
ProcessSerialNumber PSN ;
PSN.highLongOfPSN = 0 ;
-OSErr wxApp::MacHandleAEPDoc(AppleEvent *event , AppleEvent *reply)
+OSErr wxApp::MacHandleAEPDoc(AppleEvent *event , AppleEvent *reply)
-OSErr wxApp::MacHandleAEOApp(AppleEvent *event , AppleEvent *reply)
+OSErr wxApp::MacHandleAEOApp(AppleEvent *event , AppleEvent *reply)
-OSErr wxApp::MacHandleAEQuit(AppleEvent *event , AppleEvent *reply)
+OSErr wxApp::MacHandleAEQuit(AppleEvent *event , AppleEvent *reply)
{
wxWindow* win = GetTopWindow() ;
if ( win )
{
wxWindow* win = GetTopWindow() ;
if ( win )
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
if ( c != NULL )
{
*to = StringANSI[ c - StringMac] ;
if ( c != NULL )
{
*to = StringANSI[ c - StringMac] ;
if ( c != NULL )
{
*to = StringANSI[ c - StringMac] ;
if ( c != NULL )
{
*to = StringANSI[ c - StringMac] ;
-void wxMacConvertFromPC( char * p )
+void wxMacConvertFromPC( char * p )
{
char *ptr = p ;
int len = strlen ( p ) ;
{
char *ptr = p ;
int len = strlen ( p ) ;
wxMacConvertFromPC( ptr , ptr , len ) ;
}
wxMacConvertFromPC( ptr , ptr , len ) ;
}
-void wxMacConvertFromPCForControls( char * p )
+void wxMacConvertFromPCForControls( char * p )
{
char *ptr = p ;
int len = strlen ( p ) ;
{
char *ptr = p ;
int len = strlen ( p ) ;
wxMacConvertFromPC( ptr , ptr , len ) ;
for ( int i = 0 ; i < strlen ( ptr ) ; i++ )
{
wxMacConvertFromPC( ptr , ptr , len ) ;
for ( int i = 0 ; i < strlen ( ptr ) ; i++ )
{
-void wxMacConvertFromPC( unsigned char *p )
+void wxMacConvertFromPC( unsigned char *p )
{
char *ptr = (char*) p + 1 ;
int len = p[0] ;
{
char *ptr = (char*) p + 1 ;
int len = p[0] ;
wxMacConvertFromPC( ptr , ptr , len ) ;
}
extern char *wxBuffer ;
wxMacConvertFromPC( ptr , ptr , len ) ;
}
extern char *wxBuffer ;
-wxString wxMacMakeMacStringFromPC( const char * p )
+wxString wxMacMakeMacStringFromPC( const char * p )
{
const char *ptr = p ;
int len = strlen ( p ) ;
char *buf = wxBuffer ;
{
const char *ptr = p ;
int len = strlen ( p ) ;
char *buf = wxBuffer ;
if ( len >= BUFSIZ + 512 )
{
buf = new char [len+1] ;
if ( len >= BUFSIZ + 512 )
{
buf = new char [len+1] ;
-void wxMacConvertToPC( char * p )
+void wxMacConvertToPC( char * p )
{
char *ptr = p ;
int len = strlen ( p ) ;
{
char *ptr = p ;
int len = strlen ( p ) ;
wxMacConvertToPC( ptr , ptr , len ) ;
}
wxMacConvertToPC( ptr , ptr , len ) ;
}
-void wxMacConvertToPC( unsigned char *p )
+void wxMacConvertToPC( unsigned char *p )
{
char *ptr = (char*) p + 1 ;
int len = p[0] ;
{
char *ptr = (char*) p + 1 ;
int len = p[0] ;
wxMacConvertToPC( ptr , ptr , len ) ;
}
wxMacConvertToPC( ptr , ptr , len ) ;
}
-wxString wxMacMakePCStringFromMac( const char * p )
+wxString wxMacMakePCStringFromMac( const char * p )
{
const char *ptr = p ;
int len = strlen ( p ) ;
char *buf = wxBuffer ;
{
const char *ptr = p ;
int len = strlen ( p ) ;
char *buf = wxBuffer ;
if ( len >= BUFSIZ + 512 )
{
buf = new char [len+1] ;
if ( len >= BUFSIZ + 512 )
{
buf = new char [len+1] ;
wxMacConvertToPC( ptr , buf , len ) ;
buf[len] = 0 ;
wxMacConvertToPC( ptr , buf , len ) ;
buf[len] = 0 ;
wxString result( buf ) ;
if ( buf != wxBuffer )
delete buf ;
wxString result( buf ) ;
if ( buf != wxBuffer )
delete buf ;
bool wxApp::Initialize()
{
int error = 0 ;
bool wxApp::Initialize()
{
int error = 0 ;
UMAInitToolbox( 4 ) ;
UMAShowWatchCursor() ;
UMAInitToolbox( 4 ) ;
UMAShowWatchCursor() ;
GUSISetup(GUSIwithInternetSockets);
#endif
GUSISetup(GUSIwithInternetSockets);
#endif
// test the minimal configuration necessary
long theSystem ;
// test the minimal configuration necessary
long theSystem ;
else if (Gestalt(gestaltSystemVersion, &theSystem) != noErr )
{
error = kMacSTROldSystem ;
else if (Gestalt(gestaltSystemVersion, &theSystem) != noErr )
{
error = kMacSTROldSystem ;
else if ( theSystem < 0x0750 )
{
error = kMacSTROldSystem ;
else if ( theSystem < 0x0750 )
{
error = kMacSTROldSystem ;
*/
// if we encountered any problems so far, give the error code and exit immediately
*/
// if we encountered any problems so far, give the error code and exit immediately
short itemHit;
Str255 message;
short itemHit;
Str255 message;
ParamText("\pFatal Error", message, (ConstStr255Param)"\p", (ConstStr255Param)"\p");
itemHit = Alert(128, nil);
return FALSE ;
ParamText("\pFatal Error", message, (ConstStr255Param)"\p", (ConstStr255Param)"\p");
itemHit = Alert(128, nil);
return FALSE ;
#if __option(profile)
ProfilerInit( collectDetailed, bestTimeBase , 20000 , 30 ) ;
#if __option(profile)
ProfilerInit( collectDetailed, bestTimeBase , 20000 , 30 ) ;
// now avoid exceptions thrown for new (bad_alloc)
// now avoid exceptions thrown for new (bad_alloc)
std::__throws_bad_alloc = FALSE ;
std::__throws_bad_alloc = FALSE ;
s_macCursorRgn = ::NewRgn() ;
#ifdef __WXMSW__
s_macCursorRgn = ::NewRgn() ;
#ifdef __WXMSW__
wxDebugContext::SetStream(oStr, sBuf);
#endif
*/
wxDebugContext::SetStream(oStr, sBuf);
#endif
*/
wxClassInfo::InitializeClasses();
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
wxClassInfo::InitializeClasses();
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
wxWinMacControlList = new wxList(wxKEY_INTEGER);
UMAShowArrowCursor() ;
wxWinMacControlList = new wxList(wxKEY_INTEGER);
UMAShowArrowCursor() ;
#if __option(profile)
ProfilerDump( "\papp.prof" ) ;
ProfilerTerm() ;
#if __option(profile)
ProfilerDump( "\papp.prof" ) ;
ProfilerTerm() ;
delete wxTheApp;
wxTheApp = NULL;
delete wxTheApp;
wxTheApp = NULL;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
}
// wxDebugContext::SetStream(NULL, NULL);
#endif
}
// wxDebugContext::SetStream(NULL, NULL);
#endif
// do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand();
// do it as the very last thing because everything else can log messages
// do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand();
// do it as the very last thing because everything else can log messages
printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" );
return 0;
};
printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" );
return 0;
};
wxTheApp = (wxApp*) (* wxApp::GetInitializerFunction()) ();
};
wxTheApp = (wxApp*) (* wxApp::GetInitializerFunction()) ();
};
{
printf( "wxWindows error: wxTheApp == NULL\n" );
return 0;
{
printf( "wxWindows error: wxTheApp == NULL\n" );
return 0;
// GUI-specific initialization, such as creating an app context.
wxTheApp->OnInitGui();
// GUI-specific initialization, such as creating an app context.
wxTheApp->OnInitGui();
// we could try to get the open apple events here to adjust argc and argv better
// we could try to get the open apple events here to adjust argc and argv better
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
// in OnInit().
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
// in OnInit().
if (!wxTheApp->OnInit()) return 0;
int retValue = 0;
if (!wxTheApp->OnInit()) return 0;
int retValue = 0;
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
if (wxTheApp->GetTopWindow())
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
if (wxTheApp->GetTopWindow())
delete wxTheApp->GetTopWindow();
wxTheApp->SetTopWindow(NULL);
}
delete wxTheApp->GetTopWindow();
wxTheApp->SetTopWindow(NULL);
}
-
- wxTheApp->DeletePendingObjects();
-
+
+ wxTheApp->DeletePendingObjects();
+
wxApp::CleanUp();
return retValue;
wxApp::CleanUp();
return retValue;
+void wxWakeUpIdle()
+{
+ // **** please implement me! ****
+ // Wake up the idle handler processor, even if it is in another thread...
+}
+
// Send idle event to all top-level windows
bool wxApp::SendIdleEvents()
{
// Send idle event to all top-level windows
bool wxApp::SendIdleEvents()
{
while (node)
{
wxObject *obj = (wxObject *)node->Data();
while (node)
{
wxObject *obj = (wxObject *)node->Data();
delete obj;
if (wxPendingDelete.Member(obj))
delete obj;
if (wxPendingDelete.Member(obj))
void wxApp::MacSuspend( bool convertClipboard )
{
s_lastMouseDown = 0 ;
void wxApp::MacSuspend( bool convertClipboard )
{
s_lastMouseDown = 0 ;
{
MacConvertPrivateToPublicScrap() ;
}
{
MacConvertPrivateToPublicScrap() ;
}
UMAHideFloatingWindows() ;
}
void wxApp::MacResume( bool convertClipboard )
{
s_lastMouseDown = 0 ;
UMAHideFloatingWindows() ;
}
void wxApp::MacResume( bool convertClipboard )
{
s_lastMouseDown = 0 ;
{
MacConvertPublicToPrivateScrap() ;
}
{
MacConvertPublicToPrivateScrap() ;
}
UMAShowFloatingWindows() ;
}
UMAShowFloatingWindows() ;
}
-void wxApp::MacDoOneEvent()
+void wxApp::MacDoOneEvent()
WindowPtr window = UMAFrontWindow() ;
if ( window )
UMAIdleControls( window ) ;
WindowPtr window = UMAFrontWindow() ;
if ( window )
UMAIdleControls( window ) ;
wxTheApp->ProcessIdle() ;
}
if ( event.what != kHighLevelEvent )
wxTheApp->ProcessIdle() ;
}
if ( event.what != kHighLevelEvent )
- wxMacProcessSocketEvents() ;
+ wxMacProcessSocketEvents() ;
-void wxApp::MacHandleOneEvent( EventRecord *ev )
+void wxApp::MacHandleOneEvent( EventRecord *ev )
{
m_macCurrentEvent = ev ;
{
m_macCurrentEvent = ev ;
wxApp::sm_lastMessageTime = ev->when ;
wxApp::sm_lastMessageTime = ev->when ;
switch (ev->what)
{
case mouseDown:
switch (ev->what)
{
case mouseDown:
else
{
ev->modifiers &= ~controlKey ;
else
{
ev->modifiers &= ~controlKey ;
MacHandleMouseUpEvent( ev ) ;
s_lastMouseDown = 0;
break;
MacHandleMouseUpEvent( ev ) ;
s_lastMouseDown = 0;
break;
WindowAttributes frontWindowAttributes = NULL ;
if ( frontWindow )
UMAGetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
WindowAttributes frontWindowAttributes = NULL ;
if ( frontWindow )
UMAGetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
short windowPart = ::FindWindow(ev->where, &window);
wxWindow* win = wxFindWinFromMacWindow( window ) ;
short windowPart = ::FindWindow(ev->where, &window);
wxWindow* win = wxFindWinFromMacWindow( window ) ;
switch (windowPart)
{
case inMenuBar :
switch (windowPart)
{
case inMenuBar :
- if ( s_macIsInModalLoop )
+ if ( s_macIsInModalLoop )
SetOrigin( 0 , 0 ) ;
LocalToGlobal( &pt ) ;
SetPort( port ) ;
SetOrigin( 0 , 0 ) ;
LocalToGlobal( &pt ) ;
SetPort( port ) ;
- win->SetSize( pt.h , pt.v , -1 ,
+ win->SetSize( pt.h , pt.v , -1 ,
-1 , wxSIZE_USE_EXISTING);
}
s_lastMouseDown = 0;
-1 , wxSIZE_USE_EXISTING);
}
s_lastMouseDown = 0;
int newWidth = LoWord(growResult);
int newHeight = HiWord(growResult);
int oldWidth, oldHeight;
int newWidth = LoWord(growResult);
int newHeight = HiWord(growResult);
int oldWidth, oldHeight;
win->GetSize(&oldWidth, &oldHeight);
win->GetSize(&oldWidth, &oldHeight);
if (win)
win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING);
}
if (win)
win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING);
}
// TODO setup size event
ZoomWindow( window , windowPart , false ) ;
if (win)
// TODO setup size event
ZoomWindow( window , windowPart , false ) ;
if (win)
- win->SetSize( -1, -1, window->portRect.right-window->portRect.left ,
+ win->SetSize( -1, -1, window->portRect.right-window->portRect.left ,
window->portRect.bottom-window->portRect.top, wxSIZE_USE_EXISTING);
}
s_lastMouseDown = 0;
window->portRect.bottom-window->portRect.top, wxSIZE_USE_EXISTING);
}
s_lastMouseDown = 0;
case inContent :
if ( window != frontWindow )
{
case inContent :
if ( window != frontWindow )
{
- if ( s_macIsInModalLoop )
+ if ( s_macIsInModalLoop )
win->MacMouseDown( ev , windowPart ) ;
}
break ;
win->MacMouseDown( ev , windowPart ) ;
}
break ;
void wxApp::MacHandleMouseUpEvent( EventRecord *ev )
{
WindowRef window;
void wxApp::MacHandleMouseUpEvent( EventRecord *ev )
{
WindowRef window;
short windowPart = ::FindWindow(ev->where, &window);
short windowPart = ::FindWindow(ev->where, &window);
switch (windowPart)
{
case inMenuBar :
switch (windowPart)
{
case inMenuBar :
}
long wxMacTranslateKey(char key, char code)
}
long wxMacTranslateKey(char key, char code)
{
case 0x01 :
key = WXK_HOME;
{
case 0x01 :
key = WXK_HOME;
default:
break ;
} // end switch
default:
break ;
} // end switch
short keycode ;
short keychar ;
keychar = short(ev->message & charCodeMask);
short keycode ;
short keychar ;
keychar = short(ev->message & charCodeMask);
- keycode = short(ev->message & keyCodeMask) >> 8 ;
-
+ keycode = short(ev->message & keyCodeMask) >> 8 ;
+
wxWindow* focus = wxWindow::FindFocus() ;
if ( focus )
{
wxWindow* focus = wxWindow::FindFocus() ;
if ( focus )
{
OSErr err ;
Point point ;
SetPt( &point , 100 , 100 ) ;
OSErr err ;
Point point ;
SetPt( &point , 100 , 100 ) ;
err = DIBadMount( point , ev->message ) ;
wxASSERT( err == noErr ) ;
}
err = DIBadMount( point , ev->message ) ;
wxASSERT( err == noErr ) ;
}
{
WindowRef oldFrontWindow = NULL ;
WindowRef newFrontWindow = NULL ;
{
WindowRef oldFrontWindow = NULL ;
WindowRef newFrontWindow = NULL ;
// in case we don't take care of activating ourselves, we have to synchronize
// our idea of the active window with the process manager's - which it already activated
// in case we don't take care of activating ourselves, we have to synchronize
// our idea of the active window with the process manager's - which it already activated
if ( !doesActivate )
oldFrontWindow = UMAFrontNonFloatingWindow() ;
if ( !doesActivate )
oldFrontWindow = UMAFrontNonFloatingWindow() ;
MacResume( convertClipboard ) ;
MacResume( convertClipboard ) ;
newFrontWindow = UMAFrontNonFloatingWindow() ;
newFrontWindow = UMAFrontNonFloatingWindow() ;
if ( oldFrontWindow )
{
wxWindow* win = wxFindWinFromMacWindow( oldFrontWindow ) ;
if ( oldFrontWindow )
{
wxWindow* win = wxFindWinFromMacWindow( oldFrontWindow ) ;
MacSuspend( convertClipboard ) ;
MacSuspend( convertClipboard ) ;
-
- // in case this suspending did close an active window, another one might
+
+ // in case this suspending did close an active window, another one might
// have surfaced -> lets deactivate that one
// have surfaced -> lets deactivate that one
WindowRef newActiveWindow = UMAGetActiveNonFloatingWindow() ;
if ( newActiveWindow )
{
WindowRef newActiveWindow = UMAGetActiveNonFloatingWindow() ;
if ( newActiveWindow )
{
case mouseMovedMessage :
{
WindowRef window;
case mouseMovedMessage :
{
WindowRef window;
wxWindow* currentMouseWindow = NULL ;
wxWindow* currentMouseWindow = NULL ;
-
- MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , ¤tMouseWindow ) ;
-
+
+ MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , ¤tMouseWindow ) ;
+
if ( currentMouseWindow != wxWindow::s_lastMouseWindow )
{
wxMouseEvent event ;
if ( currentMouseWindow != wxWindow::s_lastMouseWindow )
{
wxMouseEvent event ;
bool isDown = !(ev->modifiers & btnState) ; // 1 is for up
bool controlDown = ev->modifiers & controlKey ; // for simulating right mouse
bool isDown = !(ev->modifiers & btnState) ; // 1 is for up
bool controlDown = ev->modifiers & controlKey ; // for simulating right mouse
event.m_leftDown = isDown && !controlDown;
event.m_middleDown = FALSE;
event.m_leftDown = isDown && !controlDown;
event.m_middleDown = FALSE;
- event.m_rightDown = isDown && controlDown;
+ event.m_rightDown = isDown && controlDown;
event.m_shiftDown = ev->modifiers & shiftKey;
event.m_controlDown = ev->modifiers & controlKey;
event.m_altDown = ev->modifiers & optionKey;
event.m_shiftDown = ev->modifiers & shiftKey;
event.m_controlDown = ev->modifiers & controlKey;
event.m_altDown = ev->modifiers & optionKey;
- event.m_metaDown = ev->modifiers & cmdKey;
+ event.m_metaDown = ev->modifiers & cmdKey;
- event.m_y = ev->where.v;
+ event.m_y = ev->where.v;
event.m_timeStamp = ev->when;
event.SetEventObject(this);
event.m_timeStamp = ev->when;
event.SetEventObject(this);
if ( wxWindow::s_lastMouseWindow )
{
wxMouseEvent eventleave(event ) ;
if ( wxWindow::s_lastMouseWindow )
{
wxMouseEvent eventleave(event ) ;
}
wxWindow::s_lastMouseWindow = currentMouseWindow ;
}
}
wxWindow::s_lastMouseWindow = currentMouseWindow ;
}
short windowPart = ::FindWindow(ev->where, &window);
short windowPart = ::FindWindow(ev->where, &window);
switch (windowPart)
{
case inMenuBar :
switch (windowPart)
{
case inMenuBar :
case inSysWindow :
break ;
default:
case inSysWindow :
break ;
default:
if ( s_lastMouseDown == 0 )
ev->modifiers |= btnState ;
if ( s_lastMouseDown == 0 )
ev->modifiers |= btnState ;
}
}
void wxApp::MacHandleMenuSelect( int macMenuId , int macMenuItemNum )
{
}
}
void wxApp::MacHandleMenuSelect( int macMenuId , int macMenuItemNum )
{
return; // no menu item selected
return; // no menu item selected
-
- if (macMenuId == kwxMacAppleMenuId && macMenuItemNum > 1)
+
+ if (macMenuId == kwxMacAppleMenuId && macMenuItemNum > 1)
{
#if ! TARGET_CARBON
Str255 deskAccessoryName ;
GrafPtr savedPort ;
{
#if ! TARGET_CARBON
Str255 deskAccessoryName ;
GrafPtr savedPort ;
GetMenuItemText(GetMenuHandle(kwxMacAppleMenuId), macMenuItemNum, deskAccessoryName);
GetPort(&savedPort);
OpenDeskAcc(deskAccessoryName);
GetMenuItemText(GetMenuHandle(kwxMacAppleMenuId), macMenuItemNum, deskAccessoryName);
GetPort(&savedPort);
OpenDeskAcc(deskAccessoryName);
wxWindow* frontwindow = wxFindWinFromMacWindow( ::FrontWindow() ) ;
if ( frontwindow && wxMenuBar::MacGetInstalledMenuBar() )
wxMenuBar::MacGetInstalledMenuBar()->MacMenuSelect( frontwindow->GetEventHandler() , 0 , macMenuId , macMenuItemNum ) ;
wxWindow* frontwindow = wxFindWinFromMacWindow( ::FrontWindow() ) ;
if ( frontwindow && wxMenuBar::MacGetInstalledMenuBar() )
wxMenuBar::MacGetInstalledMenuBar()->MacMenuSelect( frontwindow->GetEventHandler() , 0 , macMenuId , macMenuItemNum ) ;
-*/
\ No newline at end of file
#if __option(profile)
#include <profiler.h>
#if __option(profile)
#include <profiler.h>
return wxTheApp->MacHandleAEQuit( event , reply) ;
}
return wxTheApp->MacHandleAEQuit( event , reply) ;
}
-OSErr wxApp::MacHandleAEODoc(AppleEvent *event , AppleEvent *reply)
+OSErr wxApp::MacHandleAEODoc(AppleEvent *event , AppleEvent *reply)
{
ProcessSerialNumber PSN ;
PSN.highLongOfPSN = 0 ;
{
ProcessSerialNumber PSN ;
PSN.highLongOfPSN = 0 ;
-OSErr wxApp::MacHandleAEPDoc(AppleEvent *event , AppleEvent *reply)
+OSErr wxApp::MacHandleAEPDoc(AppleEvent *event , AppleEvent *reply)
-OSErr wxApp::MacHandleAEOApp(AppleEvent *event , AppleEvent *reply)
+OSErr wxApp::MacHandleAEOApp(AppleEvent *event , AppleEvent *reply)
-OSErr wxApp::MacHandleAEQuit(AppleEvent *event , AppleEvent *reply)
+OSErr wxApp::MacHandleAEQuit(AppleEvent *event , AppleEvent *reply)
{
wxWindow* win = GetTopWindow() ;
if ( win )
{
wxWindow* win = GetTopWindow() ;
if ( win )
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
if ( c != NULL )
{
*to = StringANSI[ c - StringMac] ;
if ( c != NULL )
{
*to = StringANSI[ c - StringMac] ;
if ( c != NULL )
{
*to = StringANSI[ c - StringMac] ;
if ( c != NULL )
{
*to = StringANSI[ c - StringMac] ;
-void wxMacConvertFromPC( char * p )
+void wxMacConvertFromPC( char * p )
{
char *ptr = p ;
int len = strlen ( p ) ;
{
char *ptr = p ;
int len = strlen ( p ) ;
wxMacConvertFromPC( ptr , ptr , len ) ;
}
wxMacConvertFromPC( ptr , ptr , len ) ;
}
-void wxMacConvertFromPCForControls( char * p )
+void wxMacConvertFromPCForControls( char * p )
{
char *ptr = p ;
int len = strlen ( p ) ;
{
char *ptr = p ;
int len = strlen ( p ) ;
wxMacConvertFromPC( ptr , ptr , len ) ;
for ( int i = 0 ; i < strlen ( ptr ) ; i++ )
{
wxMacConvertFromPC( ptr , ptr , len ) ;
for ( int i = 0 ; i < strlen ( ptr ) ; i++ )
{
-void wxMacConvertFromPC( unsigned char *p )
+void wxMacConvertFromPC( unsigned char *p )
{
char *ptr = (char*) p + 1 ;
int len = p[0] ;
{
char *ptr = (char*) p + 1 ;
int len = p[0] ;
wxMacConvertFromPC( ptr , ptr , len ) ;
}
extern char *wxBuffer ;
wxMacConvertFromPC( ptr , ptr , len ) ;
}
extern char *wxBuffer ;
-wxString wxMacMakeMacStringFromPC( const char * p )
+wxString wxMacMakeMacStringFromPC( const char * p )
{
const char *ptr = p ;
int len = strlen ( p ) ;
char *buf = wxBuffer ;
{
const char *ptr = p ;
int len = strlen ( p ) ;
char *buf = wxBuffer ;
if ( len >= BUFSIZ + 512 )
{
buf = new char [len+1] ;
if ( len >= BUFSIZ + 512 )
{
buf = new char [len+1] ;
-void wxMacConvertToPC( char * p )
+void wxMacConvertToPC( char * p )
{
char *ptr = p ;
int len = strlen ( p ) ;
{
char *ptr = p ;
int len = strlen ( p ) ;
wxMacConvertToPC( ptr , ptr , len ) ;
}
wxMacConvertToPC( ptr , ptr , len ) ;
}
-void wxMacConvertToPC( unsigned char *p )
+void wxMacConvertToPC( unsigned char *p )
{
char *ptr = (char*) p + 1 ;
int len = p[0] ;
{
char *ptr = (char*) p + 1 ;
int len = p[0] ;
wxMacConvertToPC( ptr , ptr , len ) ;
}
wxMacConvertToPC( ptr , ptr , len ) ;
}
-wxString wxMacMakePCStringFromMac( const char * p )
+wxString wxMacMakePCStringFromMac( const char * p )
{
const char *ptr = p ;
int len = strlen ( p ) ;
char *buf = wxBuffer ;
{
const char *ptr = p ;
int len = strlen ( p ) ;
char *buf = wxBuffer ;
if ( len >= BUFSIZ + 512 )
{
buf = new char [len+1] ;
if ( len >= BUFSIZ + 512 )
{
buf = new char [len+1] ;
wxMacConvertToPC( ptr , buf , len ) ;
buf[len] = 0 ;
wxMacConvertToPC( ptr , buf , len ) ;
buf[len] = 0 ;
wxString result( buf ) ;
if ( buf != wxBuffer )
delete buf ;
wxString result( buf ) ;
if ( buf != wxBuffer )
delete buf ;
bool wxApp::Initialize()
{
int error = 0 ;
bool wxApp::Initialize()
{
int error = 0 ;
UMAInitToolbox( 4 ) ;
UMAShowWatchCursor() ;
UMAInitToolbox( 4 ) ;
UMAShowWatchCursor() ;
GUSISetup(GUSIwithInternetSockets);
#endif
GUSISetup(GUSIwithInternetSockets);
#endif
// test the minimal configuration necessary
long theSystem ;
// test the minimal configuration necessary
long theSystem ;
else if (Gestalt(gestaltSystemVersion, &theSystem) != noErr )
{
error = kMacSTROldSystem ;
else if (Gestalt(gestaltSystemVersion, &theSystem) != noErr )
{
error = kMacSTROldSystem ;
else if ( theSystem < 0x0750 )
{
error = kMacSTROldSystem ;
else if ( theSystem < 0x0750 )
{
error = kMacSTROldSystem ;
*/
// if we encountered any problems so far, give the error code and exit immediately
*/
// if we encountered any problems so far, give the error code and exit immediately
short itemHit;
Str255 message;
short itemHit;
Str255 message;
ParamText("\pFatal Error", message, (ConstStr255Param)"\p", (ConstStr255Param)"\p");
itemHit = Alert(128, nil);
return FALSE ;
ParamText("\pFatal Error", message, (ConstStr255Param)"\p", (ConstStr255Param)"\p");
itemHit = Alert(128, nil);
return FALSE ;
#if __option(profile)
ProfilerInit( collectDetailed, bestTimeBase , 20000 , 30 ) ;
#if __option(profile)
ProfilerInit( collectDetailed, bestTimeBase , 20000 , 30 ) ;
// now avoid exceptions thrown for new (bad_alloc)
// now avoid exceptions thrown for new (bad_alloc)
std::__throws_bad_alloc = FALSE ;
std::__throws_bad_alloc = FALSE ;
s_macCursorRgn = ::NewRgn() ;
#ifdef __WXMSW__
s_macCursorRgn = ::NewRgn() ;
#ifdef __WXMSW__
wxDebugContext::SetStream(oStr, sBuf);
#endif
*/
wxDebugContext::SetStream(oStr, sBuf);
#endif
*/
wxClassInfo::InitializeClasses();
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
wxClassInfo::InitializeClasses();
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
wxWinMacControlList = new wxList(wxKEY_INTEGER);
UMAShowArrowCursor() ;
wxWinMacControlList = new wxList(wxKEY_INTEGER);
UMAShowArrowCursor() ;
#if __option(profile)
ProfilerDump( "\papp.prof" ) ;
ProfilerTerm() ;
#if __option(profile)
ProfilerDump( "\papp.prof" ) ;
ProfilerTerm() ;
delete wxTheApp;
wxTheApp = NULL;
delete wxTheApp;
wxTheApp = NULL;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
}
// wxDebugContext::SetStream(NULL, NULL);
#endif
}
// wxDebugContext::SetStream(NULL, NULL);
#endif
// do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand();
// do it as the very last thing because everything else can log messages
// do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand();
// do it as the very last thing because everything else can log messages
printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" );
return 0;
};
printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" );
return 0;
};
wxTheApp = (wxApp*) (* wxApp::GetInitializerFunction()) ();
};
wxTheApp = (wxApp*) (* wxApp::GetInitializerFunction()) ();
};
{
printf( "wxWindows error: wxTheApp == NULL\n" );
return 0;
{
printf( "wxWindows error: wxTheApp == NULL\n" );
return 0;
// GUI-specific initialization, such as creating an app context.
wxTheApp->OnInitGui();
// GUI-specific initialization, such as creating an app context.
wxTheApp->OnInitGui();
// we could try to get the open apple events here to adjust argc and argv better
// we could try to get the open apple events here to adjust argc and argv better
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
// in OnInit().
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
// in OnInit().
if (!wxTheApp->OnInit()) return 0;
int retValue = 0;
if (!wxTheApp->OnInit()) return 0;
int retValue = 0;
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
if (wxTheApp->GetTopWindow())
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
if (wxTheApp->GetTopWindow())
delete wxTheApp->GetTopWindow();
wxTheApp->SetTopWindow(NULL);
}
delete wxTheApp->GetTopWindow();
wxTheApp->SetTopWindow(NULL);
}
-
- wxTheApp->DeletePendingObjects();
-
+
+ wxTheApp->DeletePendingObjects();
+
wxApp::CleanUp();
return retValue;
wxApp::CleanUp();
return retValue;
+void wxWakeUpIdle()
+{
+ // **** please implement me! ****
+ // Wake up the idle handler processor, even if it is in another thread...
+}
+
// Send idle event to all top-level windows
bool wxApp::SendIdleEvents()
{
// Send idle event to all top-level windows
bool wxApp::SendIdleEvents()
{
while (node)
{
wxObject *obj = (wxObject *)node->Data();
while (node)
{
wxObject *obj = (wxObject *)node->Data();
delete obj;
if (wxPendingDelete.Member(obj))
delete obj;
if (wxPendingDelete.Member(obj))
void wxApp::MacSuspend( bool convertClipboard )
{
s_lastMouseDown = 0 ;
void wxApp::MacSuspend( bool convertClipboard )
{
s_lastMouseDown = 0 ;
{
MacConvertPrivateToPublicScrap() ;
}
{
MacConvertPrivateToPublicScrap() ;
}
UMAHideFloatingWindows() ;
}
void wxApp::MacResume( bool convertClipboard )
{
s_lastMouseDown = 0 ;
UMAHideFloatingWindows() ;
}
void wxApp::MacResume( bool convertClipboard )
{
s_lastMouseDown = 0 ;
{
MacConvertPublicToPrivateScrap() ;
}
{
MacConvertPublicToPrivateScrap() ;
}
UMAShowFloatingWindows() ;
}
UMAShowFloatingWindows() ;
}
-void wxApp::MacDoOneEvent()
+void wxApp::MacDoOneEvent()
WindowPtr window = UMAFrontWindow() ;
if ( window )
UMAIdleControls( window ) ;
WindowPtr window = UMAFrontWindow() ;
if ( window )
UMAIdleControls( window ) ;
wxTheApp->ProcessIdle() ;
}
if ( event.what != kHighLevelEvent )
wxTheApp->ProcessIdle() ;
}
if ( event.what != kHighLevelEvent )
- wxMacProcessSocketEvents() ;
+ wxMacProcessSocketEvents() ;
-void wxApp::MacHandleOneEvent( EventRecord *ev )
+void wxApp::MacHandleOneEvent( EventRecord *ev )
{
m_macCurrentEvent = ev ;
{
m_macCurrentEvent = ev ;
wxApp::sm_lastMessageTime = ev->when ;
wxApp::sm_lastMessageTime = ev->when ;
switch (ev->what)
{
case mouseDown:
switch (ev->what)
{
case mouseDown:
else
{
ev->modifiers &= ~controlKey ;
else
{
ev->modifiers &= ~controlKey ;
MacHandleMouseUpEvent( ev ) ;
s_lastMouseDown = 0;
break;
MacHandleMouseUpEvent( ev ) ;
s_lastMouseDown = 0;
break;
WindowAttributes frontWindowAttributes = NULL ;
if ( frontWindow )
UMAGetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
WindowAttributes frontWindowAttributes = NULL ;
if ( frontWindow )
UMAGetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
short windowPart = ::FindWindow(ev->where, &window);
wxWindow* win = wxFindWinFromMacWindow( window ) ;
short windowPart = ::FindWindow(ev->where, &window);
wxWindow* win = wxFindWinFromMacWindow( window ) ;
switch (windowPart)
{
case inMenuBar :
switch (windowPart)
{
case inMenuBar :
- if ( s_macIsInModalLoop )
+ if ( s_macIsInModalLoop )
SetOrigin( 0 , 0 ) ;
LocalToGlobal( &pt ) ;
SetPort( port ) ;
SetOrigin( 0 , 0 ) ;
LocalToGlobal( &pt ) ;
SetPort( port ) ;
- win->SetSize( pt.h , pt.v , -1 ,
+ win->SetSize( pt.h , pt.v , -1 ,
-1 , wxSIZE_USE_EXISTING);
}
s_lastMouseDown = 0;
-1 , wxSIZE_USE_EXISTING);
}
s_lastMouseDown = 0;
int newWidth = LoWord(growResult);
int newHeight = HiWord(growResult);
int oldWidth, oldHeight;
int newWidth = LoWord(growResult);
int newHeight = HiWord(growResult);
int oldWidth, oldHeight;
win->GetSize(&oldWidth, &oldHeight);
win->GetSize(&oldWidth, &oldHeight);
if (win)
win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING);
}
if (win)
win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING);
}
// TODO setup size event
ZoomWindow( window , windowPart , false ) ;
if (win)
// TODO setup size event
ZoomWindow( window , windowPart , false ) ;
if (win)
- win->SetSize( -1, -1, window->portRect.right-window->portRect.left ,
+ win->SetSize( -1, -1, window->portRect.right-window->portRect.left ,
window->portRect.bottom-window->portRect.top, wxSIZE_USE_EXISTING);
}
s_lastMouseDown = 0;
window->portRect.bottom-window->portRect.top, wxSIZE_USE_EXISTING);
}
s_lastMouseDown = 0;
case inContent :
if ( window != frontWindow )
{
case inContent :
if ( window != frontWindow )
{
- if ( s_macIsInModalLoop )
+ if ( s_macIsInModalLoop )
win->MacMouseDown( ev , windowPart ) ;
}
break ;
win->MacMouseDown( ev , windowPart ) ;
}
break ;
void wxApp::MacHandleMouseUpEvent( EventRecord *ev )
{
WindowRef window;
void wxApp::MacHandleMouseUpEvent( EventRecord *ev )
{
WindowRef window;
short windowPart = ::FindWindow(ev->where, &window);
short windowPart = ::FindWindow(ev->where, &window);
switch (windowPart)
{
case inMenuBar :
switch (windowPart)
{
case inMenuBar :
}
long wxMacTranslateKey(char key, char code)
}
long wxMacTranslateKey(char key, char code)
{
case 0x01 :
key = WXK_HOME;
{
case 0x01 :
key = WXK_HOME;
default:
break ;
} // end switch
default:
break ;
} // end switch
short keycode ;
short keychar ;
keychar = short(ev->message & charCodeMask);
short keycode ;
short keychar ;
keychar = short(ev->message & charCodeMask);
- keycode = short(ev->message & keyCodeMask) >> 8 ;
-
+ keycode = short(ev->message & keyCodeMask) >> 8 ;
+
wxWindow* focus = wxWindow::FindFocus() ;
if ( focus )
{
wxWindow* focus = wxWindow::FindFocus() ;
if ( focus )
{
OSErr err ;
Point point ;
SetPt( &point , 100 , 100 ) ;
OSErr err ;
Point point ;
SetPt( &point , 100 , 100 ) ;
err = DIBadMount( point , ev->message ) ;
wxASSERT( err == noErr ) ;
}
err = DIBadMount( point , ev->message ) ;
wxASSERT( err == noErr ) ;
}
{
WindowRef oldFrontWindow = NULL ;
WindowRef newFrontWindow = NULL ;
{
WindowRef oldFrontWindow = NULL ;
WindowRef newFrontWindow = NULL ;
// in case we don't take care of activating ourselves, we have to synchronize
// our idea of the active window with the process manager's - which it already activated
// in case we don't take care of activating ourselves, we have to synchronize
// our idea of the active window with the process manager's - which it already activated
if ( !doesActivate )
oldFrontWindow = UMAFrontNonFloatingWindow() ;
if ( !doesActivate )
oldFrontWindow = UMAFrontNonFloatingWindow() ;
MacResume( convertClipboard ) ;
MacResume( convertClipboard ) ;
newFrontWindow = UMAFrontNonFloatingWindow() ;
newFrontWindow = UMAFrontNonFloatingWindow() ;
if ( oldFrontWindow )
{
wxWindow* win = wxFindWinFromMacWindow( oldFrontWindow ) ;
if ( oldFrontWindow )
{
wxWindow* win = wxFindWinFromMacWindow( oldFrontWindow ) ;
MacSuspend( convertClipboard ) ;
MacSuspend( convertClipboard ) ;
-
- // in case this suspending did close an active window, another one might
+
+ // in case this suspending did close an active window, another one might
// have surfaced -> lets deactivate that one
// have surfaced -> lets deactivate that one
WindowRef newActiveWindow = UMAGetActiveNonFloatingWindow() ;
if ( newActiveWindow )
{
WindowRef newActiveWindow = UMAGetActiveNonFloatingWindow() ;
if ( newActiveWindow )
{
case mouseMovedMessage :
{
WindowRef window;
case mouseMovedMessage :
{
WindowRef window;
wxWindow* currentMouseWindow = NULL ;
wxWindow* currentMouseWindow = NULL ;
-
- MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , ¤tMouseWindow ) ;
-
+
+ MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , ¤tMouseWindow ) ;
+
if ( currentMouseWindow != wxWindow::s_lastMouseWindow )
{
wxMouseEvent event ;
if ( currentMouseWindow != wxWindow::s_lastMouseWindow )
{
wxMouseEvent event ;
bool isDown = !(ev->modifiers & btnState) ; // 1 is for up
bool controlDown = ev->modifiers & controlKey ; // for simulating right mouse
bool isDown = !(ev->modifiers & btnState) ; // 1 is for up
bool controlDown = ev->modifiers & controlKey ; // for simulating right mouse
event.m_leftDown = isDown && !controlDown;
event.m_middleDown = FALSE;
event.m_leftDown = isDown && !controlDown;
event.m_middleDown = FALSE;
- event.m_rightDown = isDown && controlDown;
+ event.m_rightDown = isDown && controlDown;
event.m_shiftDown = ev->modifiers & shiftKey;
event.m_controlDown = ev->modifiers & controlKey;
event.m_altDown = ev->modifiers & optionKey;
event.m_shiftDown = ev->modifiers & shiftKey;
event.m_controlDown = ev->modifiers & controlKey;
event.m_altDown = ev->modifiers & optionKey;
- event.m_metaDown = ev->modifiers & cmdKey;
+ event.m_metaDown = ev->modifiers & cmdKey;
- event.m_y = ev->where.v;
+ event.m_y = ev->where.v;
event.m_timeStamp = ev->when;
event.SetEventObject(this);
event.m_timeStamp = ev->when;
event.SetEventObject(this);
if ( wxWindow::s_lastMouseWindow )
{
wxMouseEvent eventleave(event ) ;
if ( wxWindow::s_lastMouseWindow )
{
wxMouseEvent eventleave(event ) ;
}
wxWindow::s_lastMouseWindow = currentMouseWindow ;
}
}
wxWindow::s_lastMouseWindow = currentMouseWindow ;
}
short windowPart = ::FindWindow(ev->where, &window);
short windowPart = ::FindWindow(ev->where, &window);
switch (windowPart)
{
case inMenuBar :
switch (windowPart)
{
case inMenuBar :
case inSysWindow :
break ;
default:
case inSysWindow :
break ;
default:
if ( s_lastMouseDown == 0 )
ev->modifiers |= btnState ;
if ( s_lastMouseDown == 0 )
ev->modifiers |= btnState ;
}
}
void wxApp::MacHandleMenuSelect( int macMenuId , int macMenuItemNum )
{
}
}
void wxApp::MacHandleMenuSelect( int macMenuId , int macMenuItemNum )
{
return; // no menu item selected
return; // no menu item selected
-
- if (macMenuId == kwxMacAppleMenuId && macMenuItemNum > 1)
+
+ if (macMenuId == kwxMacAppleMenuId && macMenuItemNum > 1)
{
#if ! TARGET_CARBON
Str255 deskAccessoryName ;
GrafPtr savedPort ;
{
#if ! TARGET_CARBON
Str255 deskAccessoryName ;
GrafPtr savedPort ;
GetMenuItemText(GetMenuHandle(kwxMacAppleMenuId), macMenuItemNum, deskAccessoryName);
GetPort(&savedPort);
OpenDeskAcc(deskAccessoryName);
GetMenuItemText(GetMenuHandle(kwxMacAppleMenuId), macMenuItemNum, deskAccessoryName);
GetPort(&savedPort);
OpenDeskAcc(deskAccessoryName);
wxWindow* frontwindow = wxFindWinFromMacWindow( ::FrontWindow() ) ;
if ( frontwindow && wxMenuBar::MacGetInstalledMenuBar() )
wxMenuBar::MacGetInstalledMenuBar()->MacMenuSelect( frontwindow->GetEventHandler() , 0 , macMenuId , macMenuItemNum ) ;
wxWindow* frontwindow = wxFindWinFromMacWindow( ::FrontWindow() ) ;
if ( frontwindow && wxMenuBar::MacGetInstalledMenuBar() )
wxMenuBar::MacGetInstalledMenuBar()->MacMenuSelect( frontwindow->GetEventHandler() , 0 , macMenuId , macMenuItemNum ) ;
-*/
\ No newline at end of file
- // It seemed before that this hack was redundant and
+ // It seemed before that this hack was redundant and
// key down events were being generated by wxCanvasInputEvent.
// But no longer - why ???
//
// key down events were being generated by wxCanvasInputEvent.
// But no longer - why ???
//
// We intercepted and processed the key down event
return;
}
// We intercepted and processed the key down event
return;
}
else
{
XtDispatchEvent(event);
else
{
XtDispatchEvent(event);
+void wxWakeUpIdle()
+{
+ // **** please implement me! ****
+ // Wake up the idle handler processor, even if it is in another thread...
+}
+
+
// Send idle event to all top-level windows
bool wxApp::SendIdleEvents()
{
// Send idle event to all top-level windows
bool wxApp::SendIdleEvents()
{
+//-----------------------------------------------------------------------------
+// wxWakeUpIdle
+//-----------------------------------------------------------------------------
+
+void wxWakeUpIdle()
+{
+ // Send the top window a dummy message so idle handler processing will
+ // start up again. Doing it this way ensures that the idle handler
+ // wakes up in the right thread.
+ wxWindow *topWindow = wxTheApp->GetTopWindow();
+ if ( topWindow ) {
+ HWND hWnd = (HWND)topWindow->GetHWND();
+ ::PostMessage(hWnd, WM_NULL, 0, 0);
+ }
+}
+
+//-----------------------------------------------------------------------------
+
wxIcon
wxApp::GetStdIcon(int which) const
{
wxIcon
wxApp::GetStdIcon(int which) const
{
+void wxWakeUpIdle()
+{
+ // **** please implement me! ****
+ // Wake up the idle handler processor, even if it is in another thread...
+}
+
// Send idle event to all top-level windows
bool wxApp::SendIdleEvents()
{
// Send idle event to all top-level windows
bool wxApp::SendIdleEvents()
{