X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b466e85a7e81db84545bc44c83cbe4ccacd4fe8e..bbfd45484113ff0bafcd0007a4b6faecc7909561:/src/osx/cocoa/gauge.mm diff --git a/src/osx/cocoa/gauge.mm b/src/osx/cocoa/gauge.mm index 2620e53035..d748223702 100644 --- a/src/osx/cocoa/gauge.mm +++ b/src/osx/cocoa/gauge.mm @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gauge.mm +// Name: src/osx/cocoa/gauge.mm // Purpose: wxGauge class // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id: gauge.cpp 54820 2008-07-29 20:04:11Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -19,24 +19,22 @@ @interface wxNSProgressIndicator : NSProgressIndicator { - WXCOCOAIMPL_COMMON_MEMBERS } -WXCOCOAIMPL_COMMON_INTERFACE - @end @implementation wxNSProgressIndicator -- (id)initWithFrame:(NSRect)frame ++ (void)initialize { - [super initWithFrame:frame]; - impl = NULL; - return self; + static BOOL initialized = NO; + if (!initialized) + { + initialized = YES; + wxOSXCocoaClassAddWXMethods( self ); + } } -WXCOCOAIMPL_COMMON_IMPLEMENTATION - @end class wxOSXGaugeCocoaImpl : public wxWidgetCocoaImpl @@ -45,19 +43,19 @@ public : wxOSXGaugeCocoaImpl( wxWindowMac* peer, WXWidget w) : wxWidgetCocoaImpl( peer, w ) { } - + void SetMaximum(wxInt32 v) { SetDeterminateMode(); wxWidgetCocoaImpl::SetMaximum( v ) ; } - + void SetValue(wxInt32 v) { SetDeterminateMode(); wxWidgetCocoaImpl::SetValue( v ) ; } - + void PulseGauge() { if ( ![(wxNSProgressIndicator*)m_osxView isIndeterminate] ) @@ -79,16 +77,16 @@ protected: }; -wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer, - wxWindowMac* parent, - wxWindowID id, +wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer, + wxWindowMac* WXUNUSED(parent), + wxWindowID WXUNUSED(id), wxInt32 value, wxInt32 minimum, wxInt32 maximum, - const wxPoint& pos, + const wxPoint& pos, const wxSize& size, - long style, - long extraStyle) + long WXUNUSED(style), + long WXUNUSED(extraStyle)) { NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSProgressIndicator* v = [[wxNSProgressIndicator alloc] initWithFrame:r]; @@ -98,7 +96,6 @@ wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer, [v setIndeterminate:FALSE]; [v setDoubleValue: (double) value]; wxWidgetCocoaImpl* c = new wxOSXGaugeCocoaImpl( wxpeer, v ); - [v setImplementation:c]; return c; }