X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..7325e21c4fda06b0f4a2ea5fd72169bae06a0d19:/src/gtk/gauge.cpp diff --git a/src/gtk/gauge.cpp b/src/gtk/gauge.cpp index 2d8ed0c4d3..2bcebf39ac 100644 --- a/src/gtk/gauge.cpp +++ b/src/gtk/gauge.cpp @@ -4,13 +4,9 @@ // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "gauge.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -57,7 +53,7 @@ bool wxGauge::Create( wxWindow *parent, PostCreation(size); SetBestSize(size); - + return TRUE; } @@ -66,16 +62,19 @@ void wxGauge::DoSetGauge() wxASSERT_MSG( 0 <= m_gaugePos && m_gaugePos <= m_rangeMax, _T("invalid gauge position in DoSetGauge()") ); - gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), - m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (m_widget), + m_rangeMax ? ((double)m_gaugePos)/m_rangeMax : 0.0); } wxSize wxGauge::DoGetBestSize() const { + wxSize best; if (HasFlag(wxGA_VERTICAL)) - return wxSize(28, 100); + best = wxSize(28, 100); else - return wxSize(100, 28); + best = wxSize(100, 28); + CacheBestSize(best); + return best; } void wxGauge::SetRange( int range ) @@ -106,12 +105,6 @@ int wxGauge::GetValue() const return m_gaugePos; } -void wxGauge::ApplyWidgetStyle() -{ - SetWidgetStyle(); - gtk_widget_set_style( m_widget, m_widgetStyle ); -} - wxVisualAttributes wxGauge::GetDefaultAttributes() const { // Visible gauge colours use a different colour state