implemented CheckRadioButton()

svn path=/trunk/; revision=6707
This commit is contained in:
Thomas Bluemel 2003-11-19 12:48:48 +00:00
parent 8ac4a64766
commit ded778c60a
2 changed files with 52 additions and 18 deletions

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.51 2003/11/19 12:25:03 weiden Exp $
/* $Id: stubs.c,v 1.52 2003/11/19 12:48:47 weiden Exp $
*
* COPYRIGHT: See COPYING WINBOOLthe top level directory
* PROJECT: ReactOS user32.dll
@ -94,22 +94,6 @@ BroadcastSystemMessageW(
}
/*
* @unimplemented
*/
WINBOOL
STDCALL
CheckRadioButton(
HWND hDlg,
int nIDFirstButton,
int nIDLastButton,
int nIDCheckButton)
{
UNIMPLEMENTED;
return FALSE;
}
/*
* @unimplemented
*/

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dialog.c,v 1.21 2003/11/08 15:35:58 mf Exp $
/* $Id: dialog.c,v 1.22 2003/11/19 12:48:48 weiden Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/dialog.c
@ -116,6 +116,14 @@ typedef struct
HWND control;
} GETDLGITEMINFO;
/* CheckRadioButton structure */
typedef struct
{
UINT firstID;
UINT lastID;
UINT checkID;
} RADIOGROUP;
/*********************************************************************
* dialog class descriptor
@ -2187,3 +2195,45 @@ CheckDlgButton(
SendDlgItemMessageA( hDlg, nIDButton, BM_SETCHECK, uCheck, 0 );
return TRUE;
}
static BOOL CALLBACK CheckRB(HWND hwnd, LPARAM lParam)
{
LONG lChildID = GetWindowLongW(hwnd, GWL_ID);
RADIOGROUP *lpRadioGroup = (RADIOGROUP *)lParam;
if((lChildID >= lpRadioGroup->firstID) &&
(lChildID <= lpRadioGroup->lastID))
{
if (lChildID == lpRadioGroup->checkID)
{
SendMessageW(hwnd, BM_SETCHECK, BST_CHECKED, 0);
}
else
{
SendMessageW(hwnd, BM_SETCHECK, BST_UNCHECKED, 0);
}
}
return TRUE;
}
/*
* @implemented
*/
WINBOOL
STDCALL
CheckRadioButton(
HWND hDlg,
int nIDFirstButton,
int nIDLastButton,
int nIDCheckButton)
{
RADIOGROUP radioGroup;
radioGroup.firstID = nIDFirstButton;
radioGroup.lastID = nIDLastButton;
radioGroup.checkID = nIDCheckButton;
return EnumChildWindows(hDlg, CheckRB, (LPARAM)&radioGroup);
}