X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/94633ad9f171fefbe96b7cde1aa0a29090e627bc..e941874b17aa0393d8145c94587ad549eb127ea8:/src/univ/winuniv.cpp diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index a6dad52328..719515c231 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -73,6 +73,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowGTK) #elif defined(__WXMGL__) IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMGL) +#elif defined(__WXX11__) + IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowX11) #elif defined(__WXPM__) IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowOS2) #endif @@ -761,6 +763,12 @@ int wxWindow::GetScrollRange(int orient) const void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) { +#ifdef __WXX11__ + + wxWindowX11::ScrollWindow( dx, dy, rect ); + +#else + // before scrolling it, ensure that we don't have any unpainted areas Update(); @@ -777,6 +785,8 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) r = ScrollNoRefresh(0, dy, rect); Refresh(TRUE /* erase bkgnd */, &r); } + +#endif } wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) @@ -989,6 +999,22 @@ void wxWindow::OnKeyDown(wxKeyEvent& event) } #endif // wxUSE_MENUS + // if it wasn't in a menu, try to find a button + if ( command != -1 ) + { + wxWindow* child = win->FindWindow(command); + if ( child && wxDynamicCast(child, wxButton) ) + { + wxCommandEvent eventCmd(wxEVT_COMMAND_BUTTON_CLICKED, command); + eventCmd.SetEventObject(child); + if ( child->GetEventHandler()->ProcessEvent(eventCmd) ) + { + // skip "event.Skip()" below + return; + } + } + } + // don't propagate accels from the child frame to the parent one break; }