CheckRadioButton

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There appears to be a small difference in the way the CheckRadioButton
function works in wine than Windows.  This function takes three
parameters: the id of the first radio button in a group, the id of the
last radio button in a group and the id of the one which should be
checked.  I have found a Windows program which passes a value of zero
for third parameter.  In all versions of Windows I tested, this results
in all the radio buttons in the group being unchecked.

The current implementation for CheckRadioButton in wine will adjust the
first two parameters to make sure the third falls within the range.  If
the third paramter is zero, this results in the first id being set to
zero.  When this happens all radio buttons in the dialog with an id less
than the upper id are cleared instead of only the ones in the specified
group.

It is unclear from the msdn documentation what CheckRadioButton should
do if the third parameter is not in the range of the first two, but I
would suggest the wine implementation be changed to use all parameters
as is to be consistent with how Windows works.  Even without the checks,
no harm is done in the current implementation even if the parameters
passed do not make any sense.

Changelog:
  Kevin Groeneveld <kgroeneveld@mcmaster.ca>
  Modify CheckRadioButton function to be more consistent with Windows.




diff -ur wine-20030813/windows/dialog.c wine-20030813.patched/windows/dialog.c
--- wine-20030813/windows/dialog.c	2003-08-23 23:12:51.000000000 -0400
+++ wine-20030813.patched/windows/dialog.c	2003-08-23 23:42:06.000000000 -0400
@@ -1293,9 +1293,8 @@
 {
     RADIOGROUP radioGroup;
 
-    /* perform bounds checking for a radio button group */
-    radioGroup.firstID = min(min(firstID, lastID), checkID);
-    radioGroup.lastID = max(max(firstID, lastID), checkID);
+    radioGroup.firstID = firstID;
+    radioGroup.lastID = lastID;
     radioGroup.checkID = checkID;
 
     return EnumChildWindows(hwndDlg, (WNDENUMPROC)CheckRB,


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux