X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f11220943f14b4bb5190db0dfd0054304f5015c..342751763793b5cdad252d731aac0618d0674e5b:/src/msw/radiobut.cpp diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index 0117ba49f1..0f7b1dc92e 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -29,10 +29,8 @@ #include "wx/msw/private.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) // IMPLEMENT_DYNAMIC_CLASS(wxBitmapRadioButton, wxRadioButton) -#endif bool wxRadioButton::MSWCommand(WXUINT param, WXWORD id) { @@ -54,7 +52,9 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); @@ -90,11 +90,11 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, msStyle |= WS_BORDER; */ - m_hWnd = (WXHWND) CreateWindowEx(exStyle, RADIO_CLASS, (const char *)label, + m_hWnd = (WXHWND) CreateWindowEx(exStyle, RADIO_CLASS, (const wxChar *)label, msStyle,0,0,0,0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, "Failed to create radiobutton" ); + wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create radiobutton") ); #if wxUSE_CTL3D if (want3D) @@ -112,7 +112,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, // SetValue(value); // start GRW fix - if (label != "") + if (label != wxT("")) { int label_width, label_height; GetTextExtent(label, &label_width, &label_height, NULL, NULL, & this->GetFont()); @@ -142,7 +142,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, void wxRadioButton::SetLabel(const wxString& label) { - SetWindowText((HWND) GetHWND(), (const char *)label); + SetWindowText((HWND) GetHWND(), (const wxChar *)label); } void wxRadioButton::SetValue(bool value) @@ -157,33 +157,6 @@ bool wxRadioButton::GetValue(void) const return (SendMessage((HWND) GetHWND(), BM_GETCHECK, 0, 0L) != 0); } -WXHBRUSH wxRadioButton::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, WXWPARAM wParam, WXLPARAM lParam) -{ -#if wxUSE_CTL3D - if ( m_useCtl3D ) - { - HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam); - return (WXHBRUSH) hbrush; - } -#endif - - if (GetParent()->GetTransparentBackground()) - SetBkMode((HDC) pDC, TRANSPARENT); - else - SetBkMode((HDC) pDC, OPAQUE); - - ::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue())); - ::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue())); - - wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID); - - // Note that this will be cleaned up in wxApp::OnIdle, if backgroundBrush - // has a zero usage count. -// backgroundBrush->RealizeResource(); - return (WXHBRUSH) backgroundBrush->GetResourceHandle(); -} - void wxRadioButton::Command (wxCommandEvent & event) { SetValue ( (event.m_commandInt != 0) );