From 17fb35240e1f195412272043a6416ec0fc150690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 23 Feb 2005 20:46:32 +0000 Subject: [PATCH] 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 --- include/wx/palmos/radiobox.h | 2 +- src/palmos/radiobox.cpp | 32 ++++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/include/wx/palmos/radiobox.h b/include/wx/palmos/radiobox.h index f98c57b851..39640d620c 100644 --- a/include/wx/palmos/radiobox.h +++ b/include/wx/palmos/radiobox.h @@ -163,7 +163,7 @@ protected: private: void Init(); - wxRadioButton *GetRadioButton(int i); + wxRadioButton *GetRadioButton(int i) const; wxPoint m_pos; wxSize m_size; diff --git a/src/palmos/radiobox.cpp b/src/palmos/radiobox.cpp index 91febb5485..a9449d5594 100644 --- a/src/palmos/radiobox.cpp +++ b/src/palmos/radiobox.cpp @@ -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; iShow(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)