From 9153da02e75e73f0876c23f7399f980eb93f3772 Mon Sep 17 00:00:00 2001 From: sbrowne Date: Sat, 18 Jul 2015 14:48:19 +0200 Subject: [PATCH] Don't use extra margins around content of wxStaticBox in wxOSX. This makes top and left borders for the controls inside the box the same as right and bottom ones. Closes #16808. (this is a backport of bd177b0635063e1bdcca8d3ebb8f267650b03671 from master) --- docs/changes.txt | 1 + src/osx/cocoa/statbox.mm | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index db09133f7a..bbe75517be 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -643,6 +643,7 @@ wxOSX: - Generate wxEVT_TEXT_ENTER for wxTE_PASSWORD controls too (mj_smoker). - Send wxIconizeEvent when a window is iconized/restore (Rob Krakora). - Use correct colour for disabled wxStaticText (sbrowne). +- Fix too large top and left margins inside wxStaticBox (sbrowne). - Fix bottom margins sizes for several controls (sbrowne). - Fix initial position of controls with layout insets (Tim Kosse). - Don't allow pasting rich text in non-wxTE_RICH text controls (Tim Kosse). diff --git a/src/osx/cocoa/statbox.mm b/src/osx/cocoa/statbox.mm index 1a346a4d75..95852e7f7b 100644 --- a/src/osx/cocoa/statbox.mm +++ b/src/osx/cocoa/statbox.mm @@ -71,6 +71,9 @@ wxWidgetImplType* wxWidgetImpl::CreateGroupBox( wxWindowMac* wxpeer, { NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSBox* v = [[wxNSBox alloc] initWithFrame:r]; + NSSize margin = { 0.0, 0.0 }; + [v setContentViewMargins: margin]; + [v sizeToFit]; wxStaticBoxCocoaImpl* c = new wxStaticBoxCocoaImpl( wxpeer, v ); #if !wxOSX_USE_NATIVE_FLIPPED c->SetFlipped(false);