X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b45ed7a273799b1b360482496a706a211eca6435..590e21b0e29d2406625227419e39b671b581a6a5:/src/mac/carbon/radiobox.cpp diff --git a/src/mac/carbon/radiobox.cpp b/src/mac/carbon/radiobox.cpp index bfc9b87637..103d68ca44 100644 --- a/src/mac/carbon/radiobox.cpp +++ b/src/mac/carbon/radiobox.cpp @@ -19,6 +19,7 @@ //------------------------------------------------------------------------------------- #include "wx/defs.h" +#include "wx/arrstr.h" #include "wx/radiobox.h" #include "wx/radiobut.h" @@ -28,9 +29,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) #endif -#pragma mark - -#pragma mark ### Constructors & destructor ### - //------------------------------------------------------------------------------------- // ¥ wxRadioBox() //------------------------------------------------------------------------------------- @@ -96,6 +94,18 @@ wxRadioBox::~wxRadioBox() //------------------------------------------------------------------------------------- // Create the radiobox for two-step construction +bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, + const wxPoint& pos, const wxSize& size, + const wxArrayString& choices, + int majorDim, long style, + const wxValidator& val, const wxString& name) +{ + wxCArrayString chs(choices); + + return Create(parent, id, label, pos, size, chs.GetCount(), + chs.GetStrings(), majorDim, style, val, name); +} + bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], @@ -148,9 +158,6 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, } -#pragma mark - -#pragma mark ### Specific functions (reference v2) ### - //------------------------------------------------------------------------------------- // ¥ Enable(bool) //------------------------------------------------------------------------------------- @@ -349,9 +356,6 @@ void wxRadioBox::Show(int item, bool show) current->Show(show); } -#pragma mark - -#pragma mark ### Other external functions ### - //------------------------------------------------------------------------------------- // ¥ Command //------------------------------------------------------------------------------------- @@ -383,9 +387,6 @@ void wxRadioBox::SetFocus() } -#pragma mark - -#pragma mark ### Internal functions ### - //------------------------------------------------------------------------------------- // ¥ DoSetSize //------------------------------------------------------------------------------------- @@ -464,6 +465,11 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) x_start = charWidth; y_start = 15 ; + if ( UMAGetSystemVersion() >= 0x1030 ) + { + //need to add a few more pixels for the top border on panther + y_start = y_start + 5; //how many exactly should this be to meet the HIG? + } x_offset = x_start; y_offset = y_start; @@ -521,6 +527,11 @@ wxSize wxRadioBox::DoGetBestSize() const totHeight = GetRowCount() * (maxHeight + charHeight/2) + charHeight ; totWidth = GetColumnCount() * (maxWidth + charWidth) + charWidth; + if ( UMAGetSystemVersion() >= 0x1030 ) + { + //need to add a few more pixels for the static boxborder on panther + totHeight = totHeight + 10; //how many exactly should this be to meet the HIG? + } // handle radio box title as well GetTextExtent(GetTitle(), &eachWidth, NULL); eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ;