]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/gauge.mm
guarding open combo box against AppDefined NSEvents issued by wxEventLoop::WakeUp...
[wxWidgets.git] / src / osx / cocoa / gauge.mm
index e9c35f40b55da84f337c4defc7a3f19f6396c4b9..c9742ac478c389389444437a4b69eeb75054223f 100644 (file)
@@ -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
 // 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
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) Stefan Csomor
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 @end
 
 
 @end
 
+@interface NSView(PossibleSizeMethods)
+- (NSControlSize)controlSize;
+@end
+
+namespace
+{
+
 class wxOSXGaugeCocoaImpl : public wxWidgetCocoaImpl
 {
 public :
 class wxOSXGaugeCocoaImpl : public wxWidgetCocoaImpl
 {
 public :
@@ -64,6 +71,27 @@ public :
             [(wxNSProgressIndicator*)m_osxView startAnimation:nil];
         }
     }
             [(wxNSProgressIndicator*)m_osxView startAnimation:nil];
         }
     }
+
+    void GetLayoutInset(int &left , int &top , int &right, int &bottom) const
+    {
+        left = top = right = bottom = 0;
+        NSControlSize size = [(wxNSProgressIndicator*)m_osxView controlSize];
+
+        switch( size )
+        {
+            case NSRegularControlSize:
+                left = right = 2;
+                top = 0;
+                bottom = 4;
+                break;
+            case NSMiniControlSize:
+            case NSSmallControlSize:
+                left = right = 1;
+                top = 0;
+                bottom = 2;
+                break;
+        }
+    }
 protected:
     void SetDeterminateMode()
     {
 protected:
     void SetDeterminateMode()
     {
@@ -75,7 +103,8 @@ protected:
         }
     }
 };
         }
     }
 };
-
+    
+} // anonymous namespace
 
 wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer,
                                     wxWindowMac* WXUNUSED(parent),
 
 wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer,
                                     wxWindowMac* WXUNUSED(parent),