X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d32e78bd428286561c0db32afda4dea7e262cb84..3952889a9022dfa7ae4fa635b5f267fe13016d48:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index be7802df03..d6ace0914c 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -222,7 +222,7 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) // normally, nothing more to do here - except if it was a paint event // which wasn't really processed, then we'll try to call our // OnDraw() below (from HandleOnPaint) - if ( m_hasDrawnWindow ) + if ( m_hasDrawnWindow || event.IsCommandEvent() ) { return true; } @@ -868,7 +868,7 @@ void wxScrollHelper::Scroll( int x_pos, int y_pos ) if (((x_pos == -1) || (x_pos == m_xScrollPosition)) && ((y_pos == -1) || (y_pos == m_yScrollPosition))) return; - int w, h; + int w = 0, h = 0; GetTargetSize(&w, &h); if ((x_pos != -1) && (m_xScrollPixelsPerLine)) @@ -957,7 +957,7 @@ bool wxScrollHelper::ScrollLayout() // If we're the scroll target, take into account the // virtual size and scrolled position of the window. - int x, y, w, h; + int x = 0, y = 0, w = 0, h = 0; CalcScrolledPosition(0,0, &x,&y); m_win->GetVirtualSize(&w, &h); m_win->GetSizer()->SetDimension(x, y, w, h); @@ -1048,9 +1048,9 @@ void wxScrollHelper::HandleOnPaint(wxPaintEvent& WXUNUSED(event)) // this they always have the priority void wxScrollHelper::HandleOnChar(wxKeyEvent& event) { - int stx, sty, // view origin - szx, szy, // view size (total) - clix, cliy; // view size (on screen) + int stx = 0, sty = 0, // view origin + szx = 0, szy = 0, // view size (total) + clix = 0, cliy = 0; // view size (on screen) GetViewStart(&stx, &sty); GetTargetSize(&clix, &cliy); @@ -1084,13 +1084,11 @@ void wxScrollHelper::HandleOnChar(wxKeyEvent& event) switch ( event.GetKeyCode() ) { case WXK_PAGEUP: - case WXK_PRIOR: dsty = sty - (5 * cliy / 6); Scroll(-1, (dsty == -1) ? 0 : dsty); break; case WXK_PAGEDOWN: - case WXK_NEXT: Scroll(-1, sty + (5 * cliy / 6)); break;