]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/gauge.cpp
Include wx/app.h according to precompiled headers of wx/wx.h (with other minor cleaning).
[wxWidgets.git] / src / os2 / gauge.cpp
index 3ad621de7393ce08c5d3fea0de7086f024c7d79a..2bf1c242ebca162c74f4a3590bb13e7912fe9717 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        gauge.cpp
+// Name:        src/os2/gauge.cpp
 // Purpose:     wxGauge class
 // Author:      David Webster
 // Modified by:
@@ -12,9 +12,8 @@
 #include "wx/wxprec.h"
 
 #ifndef WX_PRECOMP
-#include "wx/defs.h"
-#include "wx/utils.h"
-#include "wx/scrolwin.h"
+    #include "wx/utils.h"
+    #include "wx/scrolwin.h"
 #endif
 
 #include "wx/os2/private.h"
@@ -154,8 +153,8 @@ bool wxGauge::Create(
 #endif
     if (pParent)
         pParent->AddChild(this);
-    m_backgroundColour.Set(wxString("LIGHT GREY"));
-    m_foregroundColour.Set(wxString("NAVY"));
+    m_backgroundColour.Set(wxString(wxT("LIGHT GREY")));
+    m_foregroundColour.Set(wxString(wxT("NAVY")));
 
     m_nRangeMax   = nRange;
     m_nGaugePos   = 0;
@@ -214,6 +213,8 @@ bool wxGauge::Create(
             ,nWidth
             ,nHeight
            );
+    m_nWidth  = nWidth;     // Save for GetBestSize
+    m_nHeight = nHeight;
     ::WinShowWindow((HWND)GetHWND(), TRUE);
     delete pTextFont;
     return TRUE;
@@ -239,12 +240,10 @@ int wxGauge::GetValue() const
     return m_nGaugePos;
 } // end of wxGauge::GetValue
 
-bool wxGauge::SetBackgroundColour(
-  const wxColour&                   rColour
-)
+bool wxGauge::SetBackgroundColour( const wxColour& rColour )
 {
     if (!wxControl::SetBackgroundColour(rColour))
-        return FALSE;
+        return false;
 
     LONG                            lColor = (LONG)rColour.GetPixel();
 
@@ -253,7 +252,7 @@ bool wxGauge::SetBackgroundColour(
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
-    return TRUE;
+    return true;
 } // end of wxGauge::SetBackgroundColour
 
 void wxGauge::SetBezelFace(
@@ -262,14 +261,12 @@ void wxGauge::SetBezelFace(
 {
 } // end of wxGauge::SetBezelFace
 
-bool wxGauge::SetForegroundColour(
-  const wxColour&                   rColour
-)
+bool wxGauge::SetForegroundColour( const wxColour& rColour )
 {
     if (!wxControl::SetForegroundColour(rColour))
-        return FALSE;
+        return false;
 
-    LONG                            lColor = (LONG)rColour.GetPixel();
+    LONG lColor = (LONG)rColour.GetPixel();
 
     ::WinSetPresParam( GetHwnd()
                       ,PP_FOREGROUNDCOLOR
@@ -277,7 +274,7 @@ bool wxGauge::SetForegroundColour(
                       ,(PVOID)&lColor
                      );
 
-    return TRUE;
+    return true;
 } // end of wxGauge::SetForegroundColour
 
 void wxGauge::SetRange(
@@ -304,4 +301,7 @@ void wxGauge::SetValue(
     ::WinInvalidateRect(GetHwnd(), &vRect, FALSE);
 } // end of wxGauge::SetValue
 
-
+wxSize wxGauge::DoGetBestSize() const
+{
+    return wxSize(m_nWidth,m_nHeight);
+}