]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/slider95.cpp
added automatic growing of in-place wxTextCtrls for generic wxListCtrl and wxTreeCtrl
[wxWidgets.git] / src / msw / slider95.cpp
index 10a12ac3efe3733a8cd21d80ba38f022303b2812..77cf291c9fd46be3ff56a10f75667af3e8c5f51f 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart and Markus Holzem
-// Licence:       wxWindows license
+// Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -31,8 +31,8 @@
 #include "wx/msw/slider95.h"
 #include "wx/msw/private.h"
 
-#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
-#include <commctrl.h>
+#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
+    #include <commctrl.h>
 #endif
 
 IMPLEMENT_DYNAMIC_CLASS(wxSlider95, wxControl)
@@ -58,7 +58,9 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
            const wxString& name)
 {
   SetName(name);
+#if wxUSE_VALIDATORS
   SetValidator(validator);
+#endif // wxUSE_VALIDATORS
 
   if (parent) parent->AddChild(this);
   SetBackgroundColour(parent->GetBackgroundColour()) ;
@@ -258,6 +260,7 @@ bool wxSlider95::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
     GetEventHandler()->ProcessEvent(event);
 
     wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() );
+    cevent.SetInt( newPos );
     cevent.SetEventObject( this );
 
     return GetEventHandler()->ProcessEvent( cevent );
@@ -353,9 +356,9 @@ void wxSlider95::DoSetSize(int x, int y, int width, int height, int sizeFlags)
 
   int currentX, currentY;
   GetPosition(&currentX, &currentY);
-  if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+  if (x == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
     x1 = currentX;
-  if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+  if (y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
     y1 = currentY;
 
   AdjustForParentClientOrigin(x1, y1, sizeFlags);