// headers
// ---------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "radiobox.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
{
}
-wxRadioButton *wxRadioBox::GetRadioButton(int i)
+wxRadioButton *wxRadioBox::GetRadioButton(int i) const
{
return (wxRadioButton *)m_radios.Get(i);
}
void wxRadioBox::DoMoveWindow(int x, int y, int width, int height)
{
+ wxRect oldRect = GetRect();
+
+ m_pos.x = x;
+ m_pos.y = y;
m_size.x = width;
m_size.y = height;
}
}
}
+
+ // refresh old and new area
+ GetParent()->RefreshRect(oldRect.Union(GetRect()));
}
// get the origin of the client area in the client coordinates
wxPoint wxRadioBox::GetClientAreaOrigin() const
{
- return GetParent()->GetClientAreaOrigin() + GetPosition();
+ return GetPosition();
}
void wxRadioBox::SetString(int item, const wxString& label)
{
+ wxRadioButton *btn = GetRadioButton(item);
+ if(btn)
+ btn->SetLabel(label);
}
void wxRadioBox::SetSelection(int N)
// Find string for position
wxString wxRadioBox::GetString(int item) const
{
- wxString ret;
-
- return ret;
+ wxRadioButton *btn = GetRadioButton(item);
+ if(btn)
+ return btn->GetLabel();
+ return wxEmptyString;
}
// ----------------------------------------------------------------------------
bool wxRadioBox::Show(bool show)
{
- // TODO
- return false;
+ for(int i=0; i<GetCount(); i++)
+ Show(i, show);
+ return true;
}
// Show a specific button
bool wxRadioBox::Show(int item, bool show)
{
- // TODO
+ wxRadioButton *btn = GetRadioButton(item);
+ if(btn)
+ {
+ bool ret = btn->Show(show);
+ RefreshRect(btn->GetRect());
+ return ret;
+ }
return false;
}
area.SetSize(rect->GetSize());
}
- GetParent()->Refresh( eraseBack , &area );
+ GetParent()->RefreshRect(area);
}
void wxRadioBox::Command(wxCommandEvent & event)