X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80fdcdb90ef779185492dab676d461fc34933312..7c60222510bc5e197b12f153c4bf05db66cb0f4a:/src/osx/cocoa/gauge.mm?ds=sidebyside diff --git a/src/osx/cocoa/gauge.mm b/src/osx/cocoa/gauge.mm index d748223702..c9742ac478 100644 --- a/src/osx/cocoa/gauge.mm +++ b/src/osx/cocoa/gauge.mm @@ -37,6 +37,13 @@ @end +@interface NSView(PossibleSizeMethods) +- (NSControlSize)controlSize; +@end + +namespace +{ + class wxOSXGaugeCocoaImpl : public wxWidgetCocoaImpl { public : @@ -64,6 +71,27 @@ public : [(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() { @@ -75,7 +103,8 @@ protected: } } }; - + +} // anonymous namespace wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(parent),