From 301f9db326861703be81162ff14bb21a13eb131f Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Wed, 31 Oct 2007 01:58:25 +0000 Subject: [PATCH] Implement IsItemShown and IsItemEnabled. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/radiobox.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/mac/carbon/radiobox.cpp b/src/mac/carbon/radiobox.cpp index da6e258868..2966b503d7 100644 --- a/src/mac/carbon/radiobox.cpp +++ b/src/mac/carbon/radiobox.cpp @@ -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 )