]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/slider95.cpp
A little better failure message
[wxWidgets.git] / src / msw / slider95.cpp
index 3853c604471447229b369d893339fd0deb0351a6..da8c466e9632f0ac9339b789922c957e107c4727 100644 (file)
@@ -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))
     {