X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c92d798f9d11d15acb4af65f7fc03187ea9eee7c..6ecfe2ac4981d681466520df56cb1a5366469ddf:/src/msw/radiobox.cpp?ds=inline diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 5daf5146d3..2767986d6a 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -43,9 +43,7 @@ #include "wx/tooltip.h" #endif // wxUSE_TOOLTIPS -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -#endif // VZ: the new behaviour is to create the radio buttons as children of the // radiobox instead of creating them as children of the radiobox' parent. @@ -182,7 +180,7 @@ bool wxRadioBox::Create(wxWindow *parent, { // initialize members m_selectedButton = -1; - m_noItems = n; + m_noItems = 0; m_majorDim = majorDim == 0 ? n : majorDim; m_noRowsOrCols = majorDim; @@ -196,6 +194,7 @@ bool wxRadioBox::Create(wxWindow *parent, return FALSE; // and now create the buttons + m_noItems = n; #if RADIOBTN_PARENT_IS_RADIOBOX HWND hwndParent = GetHwnd(); #else @@ -658,7 +657,7 @@ bool wxRadioBox::ContainsHWND(WXHWND hWnd) const return FALSE; } -void wxRadioBox::Command (wxCommandEvent & event) +void wxRadioBox::Command(wxCommandEvent & event) { SetSelection (event.m_commandInt); ProcessCommand (event); @@ -687,6 +686,24 @@ void wxRadioBox::SendNotificationEvent() ProcessCommand(event); } +bool wxRadioBox::SetFont(const wxFont& font) +{ + if ( !wxControl::SetFont(font) ) + { + // nothing to do + return FALSE; + } + + // also set the font of our radio buttons + WXHFONT hfont = wxFont(font).GetResourceHandle(); + for ( int n = 0; n < m_noItems; n++ ) + { + ::SendMessage((HWND)m_radioButtons[n], WM_SETFONT, (WPARAM)hfont, 0L); + } + + return TRUE; +} + long wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) { // This is required for the radiobox to be sensitive to mouse input,