commented out an unused var

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-03-29 11:15:55 +00:00
parent 4f22f506a8
commit e2386592d3

View File

@@ -149,7 +149,7 @@ void wxApp::CleanUp()
wxTheColourDatabase = NULL; wxTheColourDatabase = NULL;
wxDeleteStockObjects(); wxDeleteStockObjects();
wxDeleteStockLists(); wxDeleteStockLists();
delete wxTheApp; delete wxTheApp;
@@ -264,11 +264,11 @@ int wxEntryStart( int& argc, char *argv[] )
{ {
XSynchronize(xdisplay, True); XSynchronize(xdisplay, True);
} }
wxApp::ms_display = (WXDisplay*) xdisplay; wxApp::ms_display = (WXDisplay*) xdisplay;
XSelectInput( xdisplay, XDefaultRootWindow(xdisplay), PropertyChangeMask); XSelectInput( xdisplay, XDefaultRootWindow(xdisplay), PropertyChangeMask);
wxSetDetectableAutoRepeat( TRUE ); wxSetDetectableAutoRepeat( TRUE );
if (!wxApp::Initialize()) if (!wxApp::Initialize())
@@ -432,22 +432,22 @@ struct wxExposeInfo
static Bool expose_predicate (Display *display, XEvent *xevent, XPointer arg) static Bool expose_predicate (Display *display, XEvent *xevent, XPointer arg)
{ {
wxExposeInfo *info = (wxExposeInfo*) arg; wxExposeInfo *info = (wxExposeInfo*) arg;
if (info->found_non_matching) if (info->found_non_matching)
return FALSE; return FALSE;
if (xevent->xany.type != Expose) if (xevent->xany.type != Expose)
{ {
info->found_non_matching = TRUE; info->found_non_matching = TRUE;
return FALSE; return FALSE;
} }
if (xevent->xexpose.window != info->window) if (xevent->xexpose.window != info->window)
{ {
info->found_non_matching = TRUE; info->found_non_matching = TRUE;
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} }
#endif #endif
@@ -463,14 +463,16 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
wxWindow* win = NULL; wxWindow* win = NULL;
Window window = XEventGetWindow(event); Window window = XEventGetWindow(event);
#if 0
Window actualWindow = window; Window actualWindow = window;
#endif
// Find the first wxWindow that corresponds to this event window // Find the first wxWindow that corresponds to this event window
// Because we're receiving events after a window // Because we're receiving events after a window
// has been destroyed, assume a 1:1 match between // has been destroyed, assume a 1:1 match between
// Window and wxWindow, so if it's not in the table, // Window and wxWindow, so if it's not in the table,
// it must have been destroyed. // it must have been destroyed.
win = wxGetWindowFromTable(window); win = wxGetWindowFromTable(window);
if (!win) if (!win)
{ {
@@ -484,7 +486,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
wxString windowClass = win->GetClassInfo()->GetClassName(); wxString windowClass = win->GetClassInfo()->GetClassName();
#endif #endif
switch (event->type) switch (event->type)
{ {
case Expose: case Expose:
@@ -519,7 +521,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
{ {
win->GetUpdateRegion().Union( tmp_event.xexpose.x, tmp_event.xexpose.y, win->GetUpdateRegion().Union( tmp_event.xexpose.x, tmp_event.xexpose.y,
tmp_event.xexpose.width, tmp_event.xexpose.height ); tmp_event.xexpose.width, tmp_event.xexpose.height );
win->GetClearRegion().Union( tmp_event.xexpose.x, tmp_event.xexpose.y, win->GetClearRegion().Union( tmp_event.xexpose.x, tmp_event.xexpose.y,
tmp_event.xexpose.width, tmp_event.xexpose.height ); tmp_event.xexpose.width, tmp_event.xexpose.height );
} }
@@ -529,9 +531,9 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
// rectangles. // rectangles.
win->GetUpdateRegion() = win->GetUpdateRegion().GetBox(); win->GetUpdateRegion() = win->GetUpdateRegion().GetBox();
win->GetClearRegion() = win->GetClearRegion().GetBox(); win->GetClearRegion() = win->GetClearRegion().GetBox();
// If we only have one X11 window, always indicate // If we only have one X11 window, always indicate
// that borders might have to be redrawn. // that borders might have to be redrawn.
if (win->GetMainWindow() == win->GetClientWindow()) if (win->GetMainWindow() == win->GetClientWindow())
win->NeedUpdateNcAreaInIdle(); win->NeedUpdateNcAreaInIdle();
@@ -542,20 +544,20 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
return TRUE; return TRUE;
} }
#if !wxUSE_NANOX #if !wxUSE_NANOX
case GraphicsExpose: case GraphicsExpose:
{ {
// wxLogDebug( "GraphicsExpose from %s", win->GetName().c_str(), // wxLogDebug( "GraphicsExpose from %s", win->GetName().c_str(),
// event->xgraphicsexpose.x, event->xgraphicsexpose.y, // event->xgraphicsexpose.x, event->xgraphicsexpose.y,
// event->xgraphicsexpose.width, event->xgraphicsexpose.height); // event->xgraphicsexpose.width, event->xgraphicsexpose.height);
win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y, win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
event->xgraphicsexpose.width, event->xgraphicsexpose.height); event->xgraphicsexpose.width, event->xgraphicsexpose.height);
win->GetClearRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y, win->GetClearRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
event->xgraphicsexpose.width, event->xgraphicsexpose.height); event->xgraphicsexpose.width, event->xgraphicsexpose.height);
if (event->xgraphicsexpose.count == 0) if (event->xgraphicsexpose.count == 0)
{ {
// Only erase background, paint in idle time. // Only erase background, paint in idle time.
@@ -574,17 +576,17 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
wxKeyEvent keyEvent(wxEVT_KEY_DOWN); wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
wxTranslateKeyEvent(keyEvent, win, window, event); wxTranslateKeyEvent(keyEvent, win, window, event);
// wxLogDebug( "OnKey from %s", win->GetName().c_str() ); // wxLogDebug( "OnKey from %s", win->GetName().c_str() );
// We didn't process wxEVT_KEY_DOWN, so send wxEVT_CHAR // We didn't process wxEVT_KEY_DOWN, so send wxEVT_CHAR
if (win->GetEventHandler()->ProcessEvent( keyEvent )) if (win->GetEventHandler()->ProcessEvent( keyEvent ))
return TRUE; return TRUE;
keyEvent.SetEventType(wxEVT_CHAR); keyEvent.SetEventType(wxEVT_CHAR);
if (win->GetEventHandler()->ProcessEvent( keyEvent )) if (win->GetEventHandler()->ProcessEvent( keyEvent ))
return TRUE; return TRUE;
if ( (keyEvent.m_keyCode == WXK_TAB) && if ( (keyEvent.m_keyCode == WXK_TAB) &&
win->GetParent() && (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) ) win->GetParent() && (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) )
{ {
@@ -607,7 +609,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
wxKeyEvent keyEvent(wxEVT_KEY_UP); wxKeyEvent keyEvent(wxEVT_KEY_UP);
wxTranslateKeyEvent(keyEvent, win, window, event); wxTranslateKeyEvent(keyEvent, win, window, event);
return win->GetEventHandler()->ProcessEvent( keyEvent ); return win->GetEventHandler()->ProcessEvent( keyEvent );
} }
case ConfigureNotify: case ConfigureNotify:
@@ -622,7 +624,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
tlw->SetConfigureGeometry( XConfigureEventGetX(event), XConfigureEventGetY(event), tlw->SetConfigureGeometry( XConfigureEventGetX(event), XConfigureEventGetY(event),
XConfigureEventGetWidth(event), XConfigureEventGetHeight(event) ); XConfigureEventGetWidth(event), XConfigureEventGetHeight(event) );
} }
if (win->IsTopLevel() && win->IsShown()) if (win->IsTopLevel() && win->IsShown())
{ {
wxTopLevelWindowX11 *tlw = (wxTopLevelWindowX11 *) win; wxTopLevelWindowX11 *tlw = (wxTopLevelWindowX11 *) win;
@@ -632,7 +634,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
{ {
wxSizeEvent sizeEvent( wxSize(XConfigureEventGetWidth(event), XConfigureEventGetHeight(event)), win->GetId() ); wxSizeEvent sizeEvent( wxSize(XConfigureEventGetWidth(event), XConfigureEventGetHeight(event)), win->GetId() );
sizeEvent.SetEventObject( win ); sizeEvent.SetEventObject( win );
return win->GetEventHandler()->ProcessEvent( sizeEvent ); return win->GetEventHandler()->ProcessEvent( sizeEvent );
} }
} }
@@ -682,14 +684,14 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
case ResizeRequest: case ResizeRequest:
{ {
printf( "resize request from %s\n", win->GetName().c_str() ); printf( "resize request from %s\n", win->GetName().c_str() );
Display *disp = (Display*) wxGetDisplay(); Display *disp = (Display*) wxGetDisplay();
XEvent report; XEvent report;
// to avoid flicker // to avoid flicker
report = * event; report = * event;
while( XCheckTypedWindowEvent (disp, actualWindow, ResizeRequest, &report)); while( XCheckTypedWindowEvent (disp, actualWindow, ResizeRequest, &report));
wxSize sz = win->GetSize(); wxSize sz = win->GetSize();
wxSizeEvent sizeEvent(sz, win->GetId()); wxSizeEvent sizeEvent(sz, win->GetId());
sizeEvent.SetEventObject(win); sizeEvent.SetEventObject(win);
@@ -718,7 +720,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
{ {
if (!win->IsEnabled()) if (!win->IsEnabled())
return FALSE; return FALSE;
// Here we check if the top level window is // Here we check if the top level window is
// disabled, which is one aspect of modality. // disabled, which is one aspect of modality.
wxWindow *tlw = win; wxWindow *tlw = win;
@@ -726,7 +728,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
tlw = tlw->GetParent(); tlw = tlw->GetParent();
if (tlw && !tlw->IsEnabled()) if (tlw && !tlw->IsEnabled())
return FALSE; return FALSE;
if (event->type == ButtonPress) if (event->type == ButtonPress)
{ {
if ((win != wxWindow::FindFocus()) && win->AcceptsFocus()) if ((win != wxWindow::FindFocus()) && win->AcceptsFocus())
@@ -735,11 +737,11 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
// and not here. TODO. // and not here. TODO.
g_prevFocus = wxWindow::FindFocus(); g_prevFocus = wxWindow::FindFocus();
g_nextFocus = win; g_nextFocus = win;
win->SetFocus(); win->SetFocus();
} }
} }
#if !wxUSE_NANOX #if !wxUSE_NANOX
if (event->type == LeaveNotify || event->type == EnterNotify) if (event->type == LeaveNotify || event->type == EnterNotify)
{ {
@@ -760,12 +762,12 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
#endif #endif
{ {
// wxLogDebug( "FocusIn from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); // wxLogDebug( "FocusIn from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
wxFocusEvent focusEvent(wxEVT_SET_FOCUS, win->GetId()); wxFocusEvent focusEvent(wxEVT_SET_FOCUS, win->GetId());
focusEvent.SetEventObject(win); focusEvent.SetEventObject(win);
focusEvent.SetWindow( g_prevFocus ); focusEvent.SetWindow( g_prevFocus );
g_prevFocus = NULL; g_prevFocus = NULL;
return win->GetEventHandler()->ProcessEvent(focusEvent); return win->GetEventHandler()->ProcessEvent(focusEvent);
} }
return FALSE; return FALSE;
@@ -779,7 +781,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
#endif #endif
{ {
// wxLogDebug( "FocusOut from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); // wxLogDebug( "FocusOut from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId()); wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId());
focusEvent.SetEventObject(win); focusEvent.SetEventObject(win);
focusEvent.SetWindow( g_nextFocus ); focusEvent.SetWindow( g_nextFocus );
@@ -916,7 +918,7 @@ bool wxApp::SendIdleEvents(wxWindow* win)
node = node->Next(); node = node->Next();
} }
return needMore; return needMore;
} }
@@ -945,10 +947,10 @@ bool wxApp::OnInitGui()
// now we don't want to try popping up a dialog // now we don't want to try popping up a dialog
// for error messages. // for error messages.
delete wxLog::SetActiveTarget(new wxLogStderr); delete wxLog::SetActiveTarget(new wxLogStderr);
if (!wxAppBase::OnInitGui()) if (!wxAppBase::OnInitGui())
return FALSE; return FALSE;
GetMainColormap( wxApp::GetDisplay() ); GetMainColormap( wxApp::GetDisplay() );
m_maxRequestSize = XMaxRequestSize( (Display*) wxApp::GetDisplay() ); m_maxRequestSize = XMaxRequestSize( (Display*) wxApp::GetDisplay() );
@@ -975,7 +977,7 @@ WXColormap wxApp::GetMainColormap(WXDisplay* display)
Window wxGetWindowParent(Window window) Window wxGetWindowParent(Window window)
{ {
wxASSERT_MSG( window, "invalid window" ); wxASSERT_MSG( window, "invalid window" );
return (Window) 0; return (Window) 0;
Window parent, root = 0; Window parent, root = 0;
@@ -1066,7 +1068,7 @@ void wxApp::OnAssert(const wxChar *file, int line, const wxChar *msg)
{ {
// While the GUI isn't working that well, just print out the // While the GUI isn't working that well, just print out the
// message. // message.
#if 0 #if 0
wxAppBase::OnAssert(file, line, msg); wxAppBase::OnAssert(file, line, msg);
#else #else
wxString msg2; wxString msg2;