diff --git a/include/wx/cocoa/statbox.h b/include/wx/cocoa/statbox.h index 1767590425..2ebb3c79d6 100644 --- a/include/wx/cocoa/statbox.h +++ b/include/wx/cocoa/statbox.h @@ -54,6 +54,8 @@ protected: // Implementation // ------------------------------------------------------------------------ public: + void GetBordersForSizer(int *borderTop, int *borderOther) const; +protected: }; #endif // __WX_COCOA_STATBOX_H__ diff --git a/src/cocoa/statbox.mm b/src/cocoa/statbox.mm index 33320f707c..23dd3261d6 100644 --- a/src/cocoa/statbox.mm +++ b/src/cocoa/statbox.mm @@ -43,3 +43,17 @@ wxStaticBox::~wxStaticBox() SetNSBox(NULL); } +void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const +{ + NSRect contentRect = [[GetNSBox() contentView] frame]; + NSRect thisRect = [m_cocoaNSView frame]; + *borderTop = thisRect.size.height - (contentRect.origin.y+contentRect.size.height); + *borderOther = thisRect.size.width - (contentRect.origin.x+contentRect.size.width); + int nextBorder = contentRect.origin.y; + if(nextBorder > *borderOther) + *borderOther = nextBorder; + nextBorder = contentRect.origin.x; + if(nextBorder > *borderOther) + *borderOther = nextBorder; +} +