X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7bdfb981a826d29e292738a27700543fa10d2bfb..90af251453884b7dab2a353280b9061a3ac02b5e:/src/msw/slider95.cpp?ds=sidebyside diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index 1c723f2f21..da8c466e96 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -121,7 +121,7 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id, int value, int minValue, int maxValue, const wxPoint& pos, const wxSize& size, long style, - const wxValidator& wxVALIDATOR_PARAM(validator), + const wxValidator& validator, const wxString& name) { // default is no border @@ -143,11 +143,6 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id, m_windowStyle = style; m_tickFreq = 0; - int x = pos.x; - int y = pos.y; - int width = size.x; - int height = size.y; - long msStyle = 0; long wstyle = 0; @@ -272,9 +267,13 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id, } } - SetSize(x, y, width, height); + SetSize(pos.x, pos.y, size.x, size.y); SetValue(value); + // SetInitialBestSize is not called since we don't call MSWCreateControl + // for this control, so call SetBestSize here instead. + SetBestSize(size); + return TRUE; } @@ -470,7 +469,7 @@ void wxSlider95::DoSetSize(int x, int y, int width, int height, int sizeFlags) int cy; int cyf; - wxGetCharSize(GetHWND(), &cx, &cy, & this->GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, this->GetFont()); if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL) { @@ -634,7 +633,7 @@ wxSize wxSlider95::DoGetBestSize() const int min_len = 0; int max_len = 0; - wxGetCharSize(GetHWND(), &cx, &cy, & this->GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, this->GetFont()); if ( !HasFlag(wxSL_VERTICAL)) {