#include "wx/radiobox.h"
-#include "wx/arrstr.h"
-#include "wx/radiobut.h"
+#ifndef WX_PRECOMP
+ #include "wx/radiobut.h"
+ #include "wx/arrstr.h"
+#endif
+
#include "wx/mac/uma.h"
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
-EVT_RADIOBUTTON( wxID_ANY , wxRadioBox::OnRadioButton )
+ EVT_RADIOBUTTON( wxID_ANY , wxRadioBox::OnRadioButton )
END_EVENT_TABLE()
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 )
wxRadioButton *radBtn = new wxRadioButton(
this,
wxID_ANY,
- wxStripMenuCodes(choices[i]),
+ GetLabelText(choices[i]),
wxPoint( 5, 20 * i + 10 ),
wxDefaultSize,
i == 0 ? wxRB_GROUP : 0 );
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
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 )
//
void wxRadioBox::SetFocus()
{
- int i;
wxRadioButton *current;
- i = 0;
current = m_radioButtonCycle;
while (!current->GetValue())
{
- i++;
current = current->NextInCycle();
}