From: David Elliott Date: Thu, 19 Jul 2007 17:58:38 +0000 (+0000) Subject: Implement most of wxRadioBox's methods. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4c1a4c41800b628d2fbd034da8a9cb45e3eec0bf Implement most of wxRadioBox's methods. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/cocoa/radiobox.h b/include/wx/cocoa/radiobox.h index e628f593df..d775800331 100644 --- a/include/wx/cocoa/radiobox.h +++ b/include/wx/cocoa/radiobox.h @@ -109,6 +109,22 @@ public: protected: WX_NSMatrix GetNSMatrix() const; virtual wxSize DoGetBestSize() const; + + int GetRowForIndex(int n) const + { + if(m_windowStyle & wxRA_SPECIFY_COLS) + return n / GetMajorDim(); + else + return n % GetMajorDim(); + } + + int GetColumnForIndex(int n) const + { + if(m_windowStyle & wxRA_SPECIFY_COLS) + return n % GetMajorDim(); + else + return n / GetMajorDim(); + } }; #endif // __WX_COCOA_RADIOBOX_H__ diff --git a/src/cocoa/radiobox.mm b/src/cocoa/radiobox.mm index c67639ccf1..2eacb188f9 100644 --- a/src/cocoa/radiobox.mm +++ b/src/cocoa/radiobox.mm @@ -79,7 +79,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid, NSMutableArray *allCells = [NSMutableArray arrayWithCapacity:n]; for(int i=0; i