fix wrc to parse some Borland dialog resources

Michael Lin mlin at corvu.com.au
Sun Mar 6 21:41:42 CST 2005


Borland C++ compiler allows extended style controls with both dialogs 
and extended style dialogs.
Also it allows bitwise and '&' and bitwise negation '~' to specify it's 
style.

For example, the parser is changed to parse the following test dialog 
resource:

BTNPROPGEN_DLG DIALOG 0, 0, 356, 223
STYLE WS_CHILD | WS_CAPTION
CAPTION "General"
FONT 8, "MS Sans Serif"
BEGIN
    LTEXT           "Button name:",150,11,6,45,14,0,WS_EX_RIGHT
    LISTBOX         108, 142,  40, 122, 148, LBS_STANDARD & ~LBS_SORT
END

ChangeLog:
* change wrc to parse extended style controls in dialog
* change wrc to parse '&' and '~' when specifying style

-------------- next part --------------
Index: tools/wrc/parser.y
===================================================================
RCS file: /home/wine/wine/tools/wrc/parser.y,v
retrieving revision 1.48
diff -u -r1.48 parser.y
--- tools/wrc/parser.y	2 Mar 2005 13:53:50 -0000	1.48
+++ tools/wrc/parser.y	7 Mar 2005 00:53:57 -0000
@@ -813,7 +813,7 @@
 /* ------------------------------ Dialog ------------------------------ */
 /* FIXME: Support EXSTYLE in the dialog line itself */
 dialog	: tDIALOG loadmemopts expr ',' expr ',' expr ',' expr dlg_attributes
-	  tBEGIN  ctrls tEND {
+	  tBEGIN  exctrls tEND {
 		if($2)
 		{
 			$10->memopt = *($2);
@@ -998,6 +998,8 @@
 	| '(' style ')'		{ $$ = $2; }
         | any_num       	{ $$ = new_style($1, 0); }
         | tNOT any_num		{ $$ = new_style(0, $2); }
+        | style '&' style	{ $$ = new_style($1->or_mask & $3->or_mask, $1->and_mask & $3->and_mask); free($1); free($3);}
+        | '~' any_num		{ $$ = new_style(~$2, 0); }
         ;
 
 ctlclass


More information about the wine-patches mailing list