]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/slider95.cpp
merged optimizations from 2.2
[wxWidgets.git] / src / msw / slider95.cpp
index 56abc963b7c43e6f7a549e011267b290339fa9d2..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__
 #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
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxSlider95, wxControl)
-#endif
 
 // Slider
 wxSlider95::wxSlider95()
@@ -60,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()) ;
@@ -260,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 );
@@ -355,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);