From: David Elliott Date: Sat, 5 Apr 2003 23:26:30 +0000 (+0000) Subject: Added GetBordersForSizer(int *bordertop, int *borderOther) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2ace5cf632140dcaea31a60debfc998343410c7a Added GetBordersForSizer(int *bordertop, int *borderOther) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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; +} +