More support in wxRadioBox for PalmOS. Refreshing fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2005-02-23 20:46:32 +00:00
parent d8245a8160
commit 17fb35240e
2 changed files with 25 additions and 9 deletions

View File

@ -163,7 +163,7 @@ protected:
private:
void Init();
wxRadioButton *GetRadioButton(int i);
wxRadioButton *GetRadioButton(int i) const;
wxPoint m_pos;
wxSize m_size;

View File

@ -233,7 +233,7 @@ wxRadioBox::~wxRadioBox()
{
}
wxRadioButton *wxRadioBox::GetRadioButton(int i)
wxRadioButton *wxRadioBox::GetRadioButton(int i) const
{
return (wxRadioButton *)m_radios.Get(i);
}
@ -252,6 +252,8 @@ void wxRadioBox::DoGetSize( int *width, int *height ) const
void wxRadioBox::DoMoveWindow(int x, int y, int width, int height)
{
wxRect oldRect = GetRect();
m_size.x = width;
m_size.y = height;
@ -282,6 +284,9 @@ void wxRadioBox::DoMoveWindow(int x, int y, int width, int height)
}
}
}
// refresh old and new area
GetParent()->RefreshRect(oldRect.Union(GetRect()));
}
// get the origin of the client area in the client coordinates
@ -292,6 +297,9 @@ wxPoint wxRadioBox::GetClientAreaOrigin() const
void wxRadioBox::SetString(int item, const wxString& label)
{
wxRadioButton *btn = GetRadioButton(item);
if(btn)
btn->SetLabel(label);
}
void wxRadioBox::SetSelection(int N)
@ -307,9 +315,10 @@ int wxRadioBox::GetSelection() const
// 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;
}
// ----------------------------------------------------------------------------
@ -354,14 +363,21 @@ bool wxRadioBox::Enable(int item, bool enable)
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;
}
@ -385,7 +401,7 @@ void wxRadioBox::Refresh(bool eraseBack, const wxRect *rect)
area.SetSize(rect->GetSize());
}
GetParent()->Refresh( eraseBack , &area );
GetParent()->RefreshRect(area);
}
void wxRadioBox::Command(wxCommandEvent & event)