X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1a87edf286921de9b182f3d19adb6bb63ba85ebd..d3e0ffbcd01cd6172234f9dc14f870ed6e1125cd:/src/palmos/radiobox.cpp diff --git a/src/palmos/radiobox.cpp b/src/palmos/radiobox.cpp index 80ec1b6103..a82b1e6f6f 100644 --- a/src/palmos/radiobox.cpp +++ b/src/palmos/radiobox.cpp @@ -177,6 +177,8 @@ bool wxRadioBox::Create(wxWindow *parent, if(m_pos.y==wxDefaultCoord) m_pos.y=0; + m_label = title; + if(!wxControl::Create(parent, id, m_pos, m_size, style, val, name)) return false; @@ -231,7 +233,7 @@ wxRadioBox::~wxRadioBox() { } -wxRadioButton *wxRadioBox::GetRadioButton(int i) +wxRadioButton *wxRadioBox::GetRadioButton(int i) const { return (wxRadioButton *)m_radios.Get(i); } @@ -250,6 +252,10 @@ void wxRadioBox::DoGetSize( int *width, int *height ) const 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; @@ -273,21 +279,29 @@ void wxRadioBox::DoMoveWindow(int x, int y, int width, int height) end.y = (use_cols ? ((j+1)*m_size.y)/minor : ((k+1)*m_size.y)/m_majorDim); wxRadioButton* rb = GetRadioButton(i); if(rb) - rb->SetSize(end.x-start.x-1,end.y-start.y-1); + { + rb->SetSize(start.x,start.y,end.x-start.x-1,end.y-start.y-1); + } i++; } } } + + // 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) @@ -303,9 +317,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; } // ---------------------------------------------------------------------------- @@ -331,9 +346,12 @@ void wxRadioBox::SetFocus() { } -bool wxRadioBox::Show(bool show) +// Enable all subcontrols +bool wxRadioBox::Enable(bool enable) { - return false; + for(int i=0; iShow(show); + RefreshRect(btn->GetRect()); + return ret; + } + return false; +} + +wxString wxRadioBox::GetLabel() +{ + return m_label; +} + +void wxRadioBox::SetLabel(const wxString& label) +{ + m_label = label; +} + +void wxRadioBox::Refresh(bool eraseBack, const wxRect *rect) +{ + wxRect area = GetRect(); + + if(rect) + { + area.Offset(rect->GetPosition()); + area.SetSize(rect->GetSize()); + } + + GetParent()->RefreshRect(area); } void wxRadioBox::Command(wxCommandEvent & event)