X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e273151278d28cceefe6eee8c49bc6915306805d..9cc62fc819e1b2b01af9732a3ad218aeec13e4d4:/src/palmos/radiobox.cpp diff --git a/src/palmos/radiobox.cpp b/src/palmos/radiobox.cpp index 606509e649..f592c79cd8 100644 --- a/src/palmos/radiobox.cpp +++ b/src/palmos/radiobox.cpp @@ -2,10 +2,10 @@ // Name: src/palmos/radiobox.cpp // Purpose: wxRadioBox implementation // Author: William Osborne - minimal working wxPalmOS port -// Modified by: +// Modified by: Wlodzimierz ABX Skiba - native wxRadioBox implementation // Created: 10/13/04 // RCS-ID: $Id$ -// Copyright: (c) William Osborne +// Copyright: (c) William Osborne, Wlodzimierz Skiba // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -38,12 +38,12 @@ #include "wx/log.h" #endif -#include "wx/palmos/private.h" - #if wxUSE_TOOLTIPS #include "wx/tooltip.h" #endif // wxUSE_TOOLTIPS +#include "wx/radiobut.h" + // TODO: wxCONSTRUCTOR #if 0 // wxUSE_EXTENDED_RTTI WX_DEFINE_FLAGS( wxRadioBoxStyle ) @@ -102,19 +102,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) item */ -#define RADIOBTN_PARENT_IS_RADIOBOX 0 - -// --------------------------------------------------------------------------- -// private functions -// --------------------------------------------------------------------------- - -// --------------------------------------------------------------------------- -// global vars -// --------------------------------------------------------------------------- - -// the pointer to standard radio button wnd proc -static WXFARPROC s_wndprocRadioBtn = (WXFARPROC)NULL; - // =========================================================================== // implementation // =========================================================================== @@ -150,11 +137,6 @@ int wxRadioBox::GetNumHor() const return 0; } -bool wxRadioBox::MSWCommand(WXUINT cmd, WXWORD id) -{ - return FALSE; -} - // Radio box item wxRadioBox::wxRadioBox() { @@ -172,7 +154,28 @@ bool wxRadioBox::Create(wxWindow *parent, const wxValidator& val, const wxString& name) { - return false; + // initialize members + m_majorDim = majorDim == 0 ? n : majorDim; + + if(!wxControl::Create(parent, id, pos, size, style, val, name)) + return false; + + for(int i=0; iSetGroup( id ); + rb->Create( + this, + wxID_ANY, + choices[n], + pos, + size, + ( n == 0 ? wxRB_GROUP : 0 ) | + ( style & wxRA_USE_CHECKBOX ) ? wxRB_USE_CHECKBOX : 0 + ); + } + + SetSize(size); } bool wxRadioBox::Create(wxWindow *parent, @@ -186,7 +189,10 @@ bool wxRadioBox::Create(wxWindow *parent, const wxValidator& val, const wxString& name) { - return false; + wxCArrayString chs(choices); + + return Create( parent, id, title, pos, size, chs.GetCount(), + chs.GetStrings(), majorDim, style, val, name ); } wxRadioBox::~wxRadioBox() @@ -239,14 +245,6 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) { } -void wxRadioBox::GetSize(int *width, int *height) const -{ -} - -void wxRadioBox::GetPosition(int *x, int *y) const -{ -} - void wxRadioBox::SetFocus() { } @@ -272,19 +270,10 @@ void wxRadioBox::Show(int item, bool show) { } -bool wxRadioBox::ContainsHWND(WXHWND hWnd) const -{ - return false; -} - void wxRadioBox::Command(wxCommandEvent & event) { } -void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn) -{ -} - void wxRadioBox::SendNotificationEvent() { } @@ -294,28 +283,4 @@ bool wxRadioBox::SetFont(const wxFont& font) return false; } -// ---------------------------------------------------------------------------- -// our window proc -// ---------------------------------------------------------------------------- - -WXLRESULT wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) -{ - return 0; -} - -WXHBRUSH wxRadioBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), -#if wxUSE_CTL3D - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam -#else - WXUINT WXUNUSED(message), - WXWPARAM WXUNUSED(wParam), - WXLPARAM WXUNUSED(lParam) -#endif - ) -{ - return (WXHBRUSH)0; -} - #endif // wxUSE_RADIOBOX