X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..aa50e893ee119e4c66414d7f194d89a3d9a23819:/src/msw/radiobut.cpp diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index 6a10d9168d..c75402ceaf 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -33,12 +33,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) // IMPLEMENT_DYNAMIC_CLASS(wxBitmapRadioButton, wxRadioButton) -bool wxRadioButton::MSWCommand(WXUINT param, WXWORD id) +bool wxRadioButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { if (param == BN_CLICKED) { wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId); event.SetEventObject( this ); + event.SetInt( GetValue() ); ProcessCommand(event); return TRUE; } @@ -137,6 +138,13 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, SetSize(x, y, width, height); + // for compatibility with wxGTK, the first radio button in a group is + // always checked (this makes sense anyhow as you need to ensure that at + // least one button in the group is checked and this is the simlpest way to + // do it) + if ( m_windowStyle & wxRB_GROUP ) + SetValue(TRUE); + return TRUE; } @@ -164,10 +172,10 @@ void wxRadioButton::Command (wxCommandEvent & event) ProcessCommand (event); } -WXHBRUSH wxRadioButton::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam) +WXHBRUSH wxRadioButton::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), + WXUINT WXUNUSED(message), + WXWPARAM WXUNUSED(wParam), + WXLPARAM WXUNUSED(lParam)) { #if wxUSE_CTL3D if ( m_useCtl3D )