X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3b9f782ef3949f583e8ac53795d36787f044fc3..f51723055aa4334a355a19e87bb2b478b4204d15:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index 9691ab4df4..85e2ef3bae 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -86,7 +86,7 @@ private: bool m_hasDrawnWindow; - DECLARE_NO_COPY_CLASS(wxScrollHelperEvtHandler) + wxDECLARE_NO_COPY_CLASS(wxScrollHelperEvtHandler); }; #if wxUSE_TIMER @@ -112,7 +112,7 @@ private: int m_pos, m_orient; - DECLARE_NO_COPY_CLASS(wxAutoScrollTimer) + wxDECLARE_NO_COPY_CLASS(wxAutoScrollTimer); }; // ============================================================================ @@ -1280,20 +1280,25 @@ wxScrollHelper::DoAdjustScrollbar(int orient, // in wxSHOW_SB_NEVER case don't show the scrollbar even if it's needed, in // wxSHOW_SB_ALWAYS case show the scrollbar even if it's not needed by // passing a special range value to SetScrollbar() - int range wxDUMMY_INITIALIZE(0); + int range; switch ( visibility ) { case wxSHOW_SB_NEVER: range = 0; break; + case wxSHOW_SB_ALWAYS: + range = scrollUnits ? scrollUnits : -1; + break; + + default: + wxFAIL_MSG( wxS("unknown scrollbar visibility") ); + // fall through + case wxSHOW_SB_DEFAULT: range = scrollUnits; break; - case wxSHOW_SB_ALWAYS: - range = scrollUnits ? scrollUnits : -1; - break; } m_win->SetScrollbar(orient, scrollPosition, scrollLinesPerPage, range);