X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/422a142bc258d3170cd13f4a7d0471ce52203d7d..f8405d6e6fc2a361d9710dfdaea0b158952803aa:/src/msw/slider95.cpp?ds=sidebyside diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index 3853c60447..4903872857 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -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) { @@ -479,12 +478,12 @@ void wxSlider95::DoSetSize(int x, int y, int width, int height, int sizeFlags) int min_len = 0; ::GetWindowText((HWND) m_staticMin, buf, 300); - GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & this->GetFont()); + GetTextExtent(buf, &min_len, &cyf); int max_len = 0; ::GetWindowText((HWND) m_staticMax, buf, 300); - GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & this->GetFont()); + GetTextExtent(buf, &max_len, &cyf); if (m_staticValue) { int new_width = (int)(wxMax(min_len, max_len)); @@ -553,11 +552,11 @@ void wxSlider95::DoSetSize(int x, int y, int width, int height, int sizeFlags) { int min_len; ::GetWindowText((HWND) m_staticMin, buf, 300); - GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & this->GetFont()); + GetTextExtent(buf, &min_len, &cyf); int max_len; ::GetWindowText((HWND) m_staticMax, buf, 300); - GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & this->GetFont()); + GetTextExtent(buf, &max_len, &cyf); if (m_staticValue) { @@ -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)) { @@ -643,11 +642,11 @@ wxSize wxSlider95::DoGetBestSize() const if (HasFlag(wxSL_LABELS)) // do we need to add more for the labels? { ::GetWindowText((HWND) m_staticMin, buf, 300); - GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & this->GetFont()); + GetTextExtent(buf, &min_len, &cyf); rv.x += min_len + cx; ::GetWindowText((HWND) m_staticMax, buf, 300); - GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & this->GetFont()); + GetTextExtent(buf, &max_len, &cyf); rv.x += max_len + cx; if (m_staticValue) @@ -676,11 +675,11 @@ wxSize wxSlider95::DoGetBestSize() const if (HasFlag(wxSL_LABELS)) // do we need to add more for the labels? { ::GetWindowText((HWND) m_staticMin, buf, 300); - GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & this->GetFont()); + GetTextExtent(buf, &min_len, &cyf); rv.y += cy; ::GetWindowText((HWND) m_staticMax, buf, 300); - GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & this->GetFont()); + GetTextExtent(buf, &max_len, &cyf); rv.y += cy; if (m_staticValue)