X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..320c341a1017798148ace98f7416c8a3cc902c04:/src/gtk/gauge.cpp?ds=sidebyside diff --git a/src/gtk/gauge.cpp b/src/gtk/gauge.cpp index f180206c79..accbf86889 100644 --- a/src/gtk/gauge.cpp +++ b/src/gtk/gauge.cpp @@ -7,10 +7,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "gauge.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/gauge.h" #if wxUSE_GAUGE @@ -53,7 +56,8 @@ bool wxGauge::Create( wxWindow *parent, m_parent->DoAddChild( this ); PostCreation(); - + SetBestSize(size); + Show( TRUE ); return TRUE; @@ -68,6 +72,14 @@ void wxGauge::DoSetGauge() m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.); } +wxSize wxGauge::DoGetBestSize() const +{ + if (HasFlag(wxGA_HORIZONTAL)) + return wxSize(100, 28); + else + return wxSize(28, 100); +} + void wxGauge::SetRange( int range ) { m_rangeMax = range;