X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/355b4d3de54b76db87439fa2142c7334a6e48f85..a39815bd30c62e13089f318028c9ee547940c4ad:/src/motif/gauge.cpp diff --git a/src/motif/gauge.cpp b/src/motif/gauge.cpp index 268e733f16..c63649ca06 100644 --- a/src/motif/gauge.cpp +++ b/src/motif/gauge.cpp @@ -13,7 +13,7 @@ #include "wx/wxprec.h" #ifdef __VMS -#include +#include "wx/vms_x_fix.h" #undef XtDisplay #undef XtScreen #undef XtWindow @@ -22,7 +22,11 @@ #undef XtClass #endif -# include "wx/gauge.h" +#include "wx/gauge.h" + +#ifndef WX_PRECOMP + #include "wx/math.h" +#endif #ifdef __OS2__ #include @@ -40,8 +44,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 +107,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(); @@ -140,16 +143,13 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id, int x = pos.x; int y = pos.y; wxSize best = GetBestSize(); - if( size.x != -1 ) best.x = size.x; - if( size.y != -1 ) best.y = size.y; - - ChangeFont(false); + if( size.x != wxDefaultCoord ) best.x = size.x; + if( size.y != wxDefaultCoord ) best.y = size.y; + PostCreation(); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, x, y, best.x, best.y); - ChangeBackgroundColour(); - return true; } @@ -673,8 +673,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 +718,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;