From 9d320a7a84a90164abe30646258a0f80ae0254d5 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 9 Jun 2011 01:09:33 +0000 Subject: [PATCH] inner layout support git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/gauge.mm | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/gauge.mm b/src/osx/cocoa/gauge.mm index d748223702..79762b5540 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 = 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), -- 2.45.2