wrc bug with CBS_DROPDOWN style

Eric Frias efrias at syncad.com
Wed Sep 17 10:44:38 CDT 2003


We just discovered a bug in the resource compiler: it will not allow you to
create a combo box with the style CBS_DROPDOWN.

The problem is this: the three mutually-exclusive types of combo boxes are
CBS_SIMPLE = 1, CBS_DROPDOWN = 2, and CBS_DROPDOWNLIST = 3.  The resource
compiler sets up the default style to CBS_SIMPLE (which is correct), but
when you specify CBS_DROPDOWN, it gets ored with the default value, which
turns it into 3, CBS_DROPDOWNLIST.

The patch below works, but might offend someone's sensibilities about what
'defaultstyle' means.  I couldn't find a simple way to handle this with the
way the code was structured.  It might be more correct to just remove the
CT_COMBOBOX case completely, and then at the end of the function, after the
NOT mask is applied, do:
     if (!(ctrl->style->or_mask & (CBS_SIMPLE | CBS_DROPDOWN |
CBS_DROPDOWNLIST)))
          ctrl->style->or_mask |= CBS_SIMPLE;

Here's the patch:

diff -u -r1.38 parser.y
--- parser.y    9 Jul 2003 21:55:45 -0000       1.38
+++ parser.y    17 Sep 2003 14:01:56 -0000
@@ -1978,7 +1978,8 @@
                defaultstyle |= LBS_NOTIFY | WS_BORDER;
                break;
        case CT_COMBOBOX:
-               defaultstyle |= CBS_SIMPLE;
+               if (!(ctrl->style->or_mask & (CBS_SIMPLE | CBS_DROPDOWN |
CBS_DROPDOWNLIST)))
+                       defaultstyle |= CBS_SIMPLE;
                break;
        case CT_STATIC:
                if(special_style == SS_CENTER || special_style == SS_LEFT ||
special_style == SS_RIGHT)


Eric




More information about the wine-patches mailing list