]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/gauge.cpp
remove redundant initialization of base class member variables
[wxWidgets.git] / src / motif / gauge.cpp
index dbb5a2495e4a4712f6a169faf8c8cf86990dee93..f415bd14a230a70cd57108d4af4ba4dcdfd93843 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Julian Smart
 // Modified by:
 // Created:     17/09/98
-// RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 #undef XtClass
 #endif
 
-# include "wx/gauge.h"
+#include "wx/gauge.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/math.h"
+#endif
 
 #ifdef __OS2__
 #include <types.h>
@@ -40,8 +43,6 @@
 #endif
 #include "wx/motif/private.h"
 
-IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
-
 #if !wxCHECK_MOTIF_VERSION( 2, 0 ) || wxCHECK_LESSTIF()
 
 // XmGauge copyright notice:
@@ -105,6 +106,7 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
 {
     if( !CreateControl( parent, id, pos, size, style, validator, name ) )
         return false;
+    PreCreation();
 
     Widget parentWidget = (Widget) parent->GetClientWidget();
 
@@ -143,13 +145,10 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
     if( size.x != wxDefaultCoord ) best.x = size.x;
     if( size.y != wxDefaultCoord ) best.y = size.y;
 
-    ChangeFont(false);
-
+    PostCreation();
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, x, y,
                   best.x, best.y);
 
-    ChangeBackgroundColour();
-
     return true;
 }
 
@@ -673,8 +672,6 @@ GaugePick(Widget WXUNUSED(w), XEvent *WXUNUSED(e), String *WXUNUSED(args), Cardi
 #endif
 }
 
-#define round(x) ( (x) > 0 ? ((x) + 0.5) : -(-(x) + 0.5) )
-
 void
 GaugeDrag(Widget WXUNUSED(w), XEvent *WXUNUSED(e), String *WXUNUSED(args), Cardinal  *WXUNUSED(num_args))
 {
@@ -720,7 +717,7 @@ GaugeDrag(Widget WXUNUSED(w), XEvent *WXUNUSED(e), String *WXUNUSED(args), Cardi
 
     fvalue = (int)((float)THIS.maximum -
         (float)THIS.minimum) * (float)nsize / (float)max;
-    value = round(fvalue);
+    value = wxRound(fvalue);
 
     THIS.value = value;
     THIS.oldx = x;