]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/gauge.mm
On OSX don't propogate the alignment setting from column to renderer if it is a custo...
[wxWidgets.git] / src / osx / cocoa / gauge.mm
index 71b9043b0a4055e0e0f77b16dc3feefb6de70e87..e9c35f40b55da84f337c4defc7a3f19f6396c4b9 100644 (file)
 
 @interface wxNSProgressIndicator : NSProgressIndicator
 {
-    wxWidgetImpl* impl;
 }
 
-- (void)setImplementation: (wxWidgetImpl *) theImplementation;
-- (wxWidgetImpl*) implementation;
-- (BOOL) isFlipped;
-
 @end
 
 @implementation wxNSProgressIndicator
 
-- (id)initWithFrame:(NSRect)frame
-{
-    [super initWithFrame:frame];
-    impl = NULL;
-    return self;
-}
-
-- (void)setImplementation: (wxWidgetImpl *) theImplementation
++ (void)initialize
 {
-    impl = theImplementation;
-}
-
-- (wxWidgetImpl*) implementation
-{
-    return impl;
-}
-
-- (BOOL) isFlipped
-{
-    return YES;
+    static BOOL initialized = NO;
+    if (!initialized)
+    {
+        initialized = YES;
+        wxOSXCocoaClassAddWXMethods( self );
+    }
 }
 
 @end
@@ -60,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] )
@@ -94,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];
@@ -113,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;
 }