X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aaa6d89a0d0810b001a9217df913b9b74b883c8d..8064223b7b1b3657363b7a635c381b9269d95e55:/src/mac/carbon/radiobox.cpp diff --git a/src/mac/carbon/radiobox.cpp b/src/mac/carbon/radiobox.cpp index 102bc58cbc..69ce082c1b 100644 --- a/src/mac/carbon/radiobox.cpp +++ b/src/mac/carbon/radiobox.cpp @@ -107,7 +107,7 @@ bool wxRadioBox::Create( wxWindow *parent, SetMajorDim( majorDim == 0 ? n : majorDim, style ); - m_label = label; + m_labelOrig = m_label = label; Rect bounds = wxMacGetBoundsForControl( this, pos, size ); if ( bounds.right <= bounds.left ) @@ -128,7 +128,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxRadioButton *radBtn = new wxRadioButton( this, wxID_ANY, - wxStripMenuCodes(choices[i]), + GetLabelText(choices[i]), wxPoint( 5, 20 * i + 10 ), wxDefaultSize, i == 0 ? wxRB_GROUP : 0 ); @@ -181,6 +181,22 @@ bool wxRadioBox::Enable(unsigned int item, bool enable) return current->Enable( enable ); } +bool wxRadioBox::IsItemEnabled(unsigned int item) const +{ + if (!IsValid( item )) + return false; + + unsigned int i = 0; + wxRadioButton *current = m_radioButtonCycle; + while (i != item) + { + i++; + current = current->NextInCycle(); + } + + return current->IsEnabled(); +} + // Returns the radiobox label // wxString wxRadioBox::GetLabel() const @@ -309,6 +325,23 @@ bool wxRadioBox::Show(unsigned int item, bool show) return current->Show( show ); } +bool wxRadioBox::IsItemShown(unsigned int item) const +{ + if (!IsValid( item )) + return false; + + unsigned int i = 0; + wxRadioButton *current = m_radioButtonCycle; + while (i != item) + { + i++; + current = current->NextInCycle(); + } + + return current->IsShown(); +} + + // Simulates the effect of the user issuing a command to the item // void wxRadioBox::Command( wxCommandEvent& event ) @@ -321,14 +354,11 @@ void wxRadioBox::Command( wxCommandEvent& event ) // void wxRadioBox::SetFocus() { - int i; wxRadioButton *current; - i = 0; current = m_radioButtonCycle; while (!current->GetValue()) { - i++; current = current->NextInCycle(); }