]> git.saurik.com Git - wxWidgets.git/commitdiff
Added GetBordersForSizer(int *bordertop, int *borderOther)
authorDavid Elliott <dfe@tgwbd.org>
Sat, 5 Apr 2003 23:26:30 +0000 (23:26 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Sat, 5 Apr 2003 23:26:30 +0000 (23:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/statbox.h
src/cocoa/statbox.mm

index 17675904252effdf4b11137d44e9532329b98083..2ebb3c79d63d83ff0fd0c308ffad7ca21e236c70 100644 (file)
@@ -54,6 +54,8 @@ protected:
 // Implementation
 // ------------------------------------------------------------------------
 public:
+    void GetBordersForSizer(int *borderTop, int *borderOther) const;
+protected:
 };
 
 #endif // __WX_COCOA_STATBOX_H__
index 33320f707c4085b222bab44da1be034a94c90418..23dd3261d615fd009a3a8adeb87c91b931676e50 100644 (file)
@@ -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;
+}
+