Weekly updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2002-10-28 23:24:17 +00:00
parent 5f60853843
commit 1351c353d3
5 changed files with 97 additions and 29 deletions

View File

@@ -70,9 +70,23 @@ bool wxRadioButton::Create(
,rsName))
return FALSE;
long lSstyle = HasFlag(wxRB_GROUP) ? WS_GROUP : 0;
long lSstyle = WS_TABSTOP;
lSstyle |= BS_AUTORADIOBUTTON;
if (HasFlag(wxRB_GROUP))
lSstyle |= WS_GROUP;
//
// wxRB_SINGLE is a temporary workaround for the following problem: if you
// have 2 radiobuttons in the same group but which are not consecutive in
// the dialog, Windows can enter an infinite loop! The simplest way to
// reproduce it is to create radio button, then a panel and then another
// radio button: then checking the last button hangs the app.
//
// Ideally, we'd detect (and avoid) such situation automatically but for
// now, as I don't know how to do it, just allow the user to create
// BS_RADIOBUTTON buttons for such situations.
//
lSstyle |= HasFlag(wxRB_SINGLE) ? BS_RADIOBUTTON : BS_AUTORADIOBUTTON;
if (HasFlag(wxCLIP_SIBLINGS))
lSstyle |= WS_CLIPSIBLINGS;
@@ -148,18 +162,38 @@ bool wxRadioButton::OS2Command(
, WXWORD wId
)
{
if (wParam == BN_CLICKED)
if (wParam != BN_CLICKED)
return FALSE;
if (m_bFocusJustSet)
{
//
// See above: we want to ignore this event
//
m_bFocusJustSet = FALSE;
}
else
{
bool bIsChecked = GetValue();
if (HasFlag(wxRB_SINGLE))
{
//
// When we use a "manual" radio button, we have to check the button
// ourselves -- but it's reset to unchecked state by the user code
// (presumably when another button is pressed)
//
if (!bIsChecked )
SetValue(TRUE);
}
wxCommandEvent rEvent( wxEVT_COMMAND_RADIOBUTTON_SELECTED
,m_windowId
);
rEvent.SetEventObject(this);
ProcessCommand(rEvent);
return TRUE;
}
else
return FALSE;
return TRUE;
} // end of wxRadioButton::OS2Command
void wxRadioButton::SetFocus()