]>
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 wxString
& name
)
29 PreCreation( parent
, id
, pos
, size
, style
, name
);
33 m_useProgressBar
= TRUE
;
35 m_widget
= gtk_progress_bar_new();
44 void wxGauge::SetRange( int r
)
47 if (m_gaugePos
> m_rangeMax
) m_gaugePos
= m_rangeMax
;
49 gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget
), ((float)m_gaugePos
)/m_rangeMax
);
52 void wxGauge::SetValue( int pos
)
55 if (m_gaugePos
> m_rangeMax
) m_gaugePos
= m_rangeMax
;
57 gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget
), ((float)m_gaugePos
)/m_rangeMax
);
60 int wxGauge::GetRange(void) const
65 int wxGauge::GetValue(void) const