]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/gauge.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "gauge.h"
17 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
21 IMPLEMENT_DYNAMIC_CLASS(wxGauge
,wxControl
)
23 bool wxGauge::Create( wxWindow
*parent
, wxWindowID id
, int range
,
24 const wxPoint
& pos
, const wxSize
& size
,
25 long style
, const wxValidator
& validator
, const wxString
& name
)
29 PreCreation( parent
, id
, pos
, size
, style
, name
);
31 SetValidator( validator
);
35 m_useProgressBar
= TRUE
;
37 m_widget
= gtk_progress_bar_new();
46 void wxGauge::SetRange( int r
)
49 if (m_gaugePos
> m_rangeMax
) m_gaugePos
= m_rangeMax
;
51 gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget
), ((float)m_gaugePos
)/m_rangeMax
);
54 void wxGauge::SetValue( int pos
)
57 if (m_gaugePos
> m_rangeMax
) m_gaugePos
= m_rangeMax
;
59 gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget
), ((float)m_gaugePos
)/m_rangeMax
);
62 int wxGauge::GetRange(void) const
67 int wxGauge::GetValue(void) const