/////////////////////////////////////////////////////////////////////////////
-// Name: msw/radiobut.cpp
+// Name: src/msw/radiobut.cpp
// Purpose: wxRadioButton
// Author: Julian Smart
// Modified by:
#if wxUSE_RADIOBTN
+#include "wx/radiobut.h"
+
#ifndef WX_PRECOMP
- #include "wx/radiobut.h"
#include "wx/settings.h"
#include "wx/dcscreen.h"
#endif
// buttons in the same group: Windows doesn't do it automatically
if ( m_isChecked )
{
- // If another radiobutton in the group currently has the focus, we have to
+ // If another radiobutton in the group currently has the focus, we have to
// set it to this radiobutton, else the old readiobutton will be reselected
// automatically, if a parent window loses the focus and regains it.
bool shouldSetFocus = false;
// A wxRB_SINGLE button isn't part of this group
break;
}
-
+
if (btn)
{
if (btn == pFocusWnd)
int wRadio, hRadio;
if ( !str.empty() )
{
- GetTextExtent(str, &wRadio, &hRadio);
+ GetTextExtent(GetLabelText(str), &wRadio, &hRadio);
wRadio += s_radioSize + GetCharWidth();
if ( hRadio < s_radioSize )
return best;
}
-#endif // wxUSE_RADIOBTN
+WXDWORD wxRadioButton::MSWGetStyle(long style, WXDWORD *exstyle) const
+{
+ WXDWORD styleMSW = wxControl::MSWGetStyle(style, exstyle);
+ if ( style & wxRB_GROUP )
+ styleMSW |= WS_GROUP;
+
+ return styleMSW;
+}
+
+#endif // wxUSE_RADIOBTN