X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/449c567346a1b3937e532cd87aac007faad76b04..b1d7de5ae0c53162b57ac20cfed04264f0f27b30:/src/cocoa/gauge.mm diff --git a/src/cocoa/gauge.mm b/src/cocoa/gauge.mm index 58eca4a675..028064b74a 100644 --- a/src/cocoa/gauge.mm +++ b/src/cocoa/gauge.mm @@ -32,6 +32,10 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID winid, int range, return false; SetNSView([[NSProgressIndicator alloc] initWithFrame: MakeDefaultNSRect(size)]); [m_cocoaNSView release]; + + [(NSProgressIndicator*)m_cocoaNSView setMaxValue:range]; + [(NSProgressIndicator*)m_cocoaNSView setIndeterminate:NO]; + if(m_parent) m_parent->CocoaAddChild(this); SetInitialFrameRect(pos,size); @@ -43,4 +47,25 @@ wxGauge::~wxGauge() { } +int wxGauge::GetValue() const +{ + return (int)[(NSProgressIndicator*)m_cocoaNSView doubleValue]; +} + +void wxGauge::SetValue(int value) +{ + [(NSProgressIndicator*)m_cocoaNSView setDoubleValue:value]; +} + +int wxGauge::GetRange() const +{ + return (int)[(NSProgressIndicator*)m_cocoaNSView maxValue]; +} + +void wxGauge::SetRange(int maxValue) +{ + [(NSProgressIndicator*)m_cocoaNSView setMinValue:0.0]; + [(NSProgressIndicator*)m_cocoaNSView setMaxValue:maxValue]; +} + #endif // wxUSE_GAUGE