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:
parent
d8245a8160
commit
17fb35240e
@ -163,7 +163,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
wxRadioButton *GetRadioButton(int i);
|
wxRadioButton *GetRadioButton(int i) const;
|
||||||
|
|
||||||
wxPoint m_pos;
|
wxPoint m_pos;
|
||||||
wxSize m_size;
|
wxSize m_size;
|
||||||
|
@ -233,7 +233,7 @@ wxRadioBox::~wxRadioBox()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRadioButton *wxRadioBox::GetRadioButton(int i)
|
wxRadioButton *wxRadioBox::GetRadioButton(int i) const
|
||||||
{
|
{
|
||||||
return (wxRadioButton *)m_radios.Get(i);
|
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)
|
void wxRadioBox::DoMoveWindow(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
|
wxRect oldRect = GetRect();
|
||||||
|
|
||||||
m_size.x = width;
|
m_size.x = width;
|
||||||
m_size.y = height;
|
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
|
// 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)
|
void wxRadioBox::SetString(int item, const wxString& label)
|
||||||
{
|
{
|
||||||
|
wxRadioButton *btn = GetRadioButton(item);
|
||||||
|
if(btn)
|
||||||
|
btn->SetLabel(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRadioBox::SetSelection(int N)
|
void wxRadioBox::SetSelection(int N)
|
||||||
@ -307,9 +315,10 @@ int wxRadioBox::GetSelection() const
|
|||||||
// Find string for position
|
// Find string for position
|
||||||
wxString wxRadioBox::GetString(int item) const
|
wxString wxRadioBox::GetString(int item) const
|
||||||
{
|
{
|
||||||
wxString ret;
|
wxRadioButton *btn = GetRadioButton(item);
|
||||||
|
if(btn)
|
||||||
return ret;
|
return btn->GetLabel();
|
||||||
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@ -354,14 +363,21 @@ bool wxRadioBox::Enable(int item, bool enable)
|
|||||||
|
|
||||||
bool wxRadioBox::Show(bool show)
|
bool wxRadioBox::Show(bool show)
|
||||||
{
|
{
|
||||||
// TODO
|
for(int i=0; i<GetCount(); i++)
|
||||||
return false;
|
Show(i, show);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show a specific button
|
// Show a specific button
|
||||||
bool wxRadioBox::Show(int item, bool show)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,7 +401,7 @@ void wxRadioBox::Refresh(bool eraseBack, const wxRect *rect)
|
|||||||
area.SetSize(rect->GetSize());
|
area.SetSize(rect->GetSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
GetParent()->Refresh( eraseBack , &area );
|
GetParent()->RefreshRect(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRadioBox::Command(wxCommandEvent & event)
|
void wxRadioBox::Command(wxCommandEvent & event)
|
||||||
|
Loading…
Reference in New Issue
Block a user