X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dad7b12aee25f7f061b4876d3dc10e5657497b2a..6db6bfd1ce8c6c4b06a74e04fad3470ac792a770:/src/mac/carbon/radiobox.cpp diff --git a/src/mac/carbon/radiobox.cpp b/src/mac/carbon/radiobox.cpp index 9df4bb6cb4..e2799918b4 100644 --- a/src/mac/carbon/radiobox.cpp +++ b/src/mac/carbon/radiobox.cpp @@ -28,16 +28,14 @@ #include "wx/radiobut.h" #include "wx/mac/uma.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -#endif //------------------------------------------------------------------------------------- // ¥ wxRadioBox() //------------------------------------------------------------------------------------- // Default constructor BEGIN_EVENT_TABLE(wxRadioBox, wxControl) -EVT_RADIOBUTTON( -1 , wxRadioBox::OnRadioButton ) +EVT_RADIOBUTTON( wxID_ANY , wxRadioBox::OnRadioButton ) END_EVENT_TABLE() void wxRadioBox::OnRadioButton( wxCommandEvent &outer ) @@ -199,7 +197,7 @@ bool wxRadioBox::Enable(int item, bool enable) int i; wxRadioButton *current; - if ((item < 0) || (item >= m_noItems)) + if (!IsValid(item)) return false; i = 0; @@ -231,7 +229,7 @@ wxString wxRadioBox::GetString(int item) const int i; wxRadioButton *current; - if ((item < 0) || (item >= m_noItems)) + if (!IsValid(item)) return wxEmptyString; i = 0; @@ -291,7 +289,7 @@ void wxRadioBox::SetString(int item,const wxString& label) int i; wxRadioButton *current; - if ((item < 0) || (item >= m_noItems)) + if (!IsValid(item)) return; i=0; current=m_radioButtonCycle; @@ -313,7 +311,7 @@ void wxRadioBox::SetSelection(int item) int i; wxRadioButton *current; - if ((item < 0) || (item >= m_noItems)) + if (!IsValid(item)) return; i=0; current=m_radioButtonCycle; @@ -338,7 +336,8 @@ bool wxRadioBox::Show(bool show) wxControl::Show(show); current=m_radioButtonCycle; - for (i=0;iShow(show); current=current->NextInCycle(); } @@ -350,20 +349,20 @@ bool wxRadioBox::Show(bool show) //------------------------------------------------------------------------------------- // Shows or hides the given button -void wxRadioBox::Show(int item, bool show) +bool wxRadioBox::Show(int item, bool show) { - int i; + int i; wxRadioButton *current; - if ((item < 0) || (item >= m_noItems)) - return; + if (!IsValid(item)) + return false; i=0; current=m_radioButtonCycle; while (i!=item) { i++; current=current->NextInCycle(); } - current->Show(show); + return current->Show(show); } //------------------------------------------------------------------------------------- @@ -419,9 +418,9 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) x_offset = x; y_offset = y; GetPosition(&x_current, &y_current); - if ((x == -1) && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) + if ((x == wxDefaultCoord) && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) x_offset = x_current; - if ((y == -1)&& !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) + if ((y == wxDefaultCoord)&& !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) y_offset = y_current; // define size @@ -444,7 +443,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) eachHeight[i] = (int)((3*eachHeight[i])/2); if (maxWidth