This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] windres CONTROL statements with id, \a escapes, \xhex escapes, CLASS and STYLE in DIALOG


windrestest.tar.bz2 contains an example RC file to illustrate the
problems solved. Created with microsoft visual C++ 5.0.
Index: binutils//ChangeLog
===================================================================
RCS file: /cvs/src/src/binutils/ChangeLog,v
retrieving revision 1.417
diff -c -r1.417 ChangeLog
*** ChangeLog	2002/02/01 03:26:31	1.417
--- ChangeLog	2002/02/01 17:18:44
***************
*** 1,3 ****
--- 1,16 ----
+ 2002-02-01  Bernd Herd <info@herdsoft.com>
+ 
+ 	* rclex.l: "\a" escape (used for right justified 
+ 	key definitions in menus) is encodes as binary 8
+ 	* rclex.l: "\xhex" encoding in strings corrected
+ 	* rcparse.y: CLASS definitions in DIALOG resources 
+ 	are quooted.
+ 	* rcparse.y: CONTROL statements may have a numeric first
+ 	parameters like icons do.
+ 	* rcparse.y: if style attribute of DIALOG resource
+ 	is given, there is *no* implicit start value of
+ 	WS_VISIBLE | WS_POPUP.
+ 	
  2002-02-01  Alan Modra  <amodra@bigpond.net.au>
  
  	* Makefile.am: Run "make dep-am"
Index: binutils//rclex.l
===================================================================
RCS file: /cvs/src/src/binutils/rclex.l,v
retrieving revision 1.4
diff -c -r1.4 rclex.l
*** rclex.l	2001/09/19 05:33:16	1.4
--- rclex.l	2002/02/01 17:18:44
***************
*** 331,345 ****
  	      break;
  
  	    case 'a':
! 	      *s++ = ESCAPE_A;
  	      ++t;
  	      break;
  
- 	    case 'b':
- 	      *s++ = ESCAPE_B;
- 	      ++t;
- 	      break;
- 
  	    case 'f':
  	      *s++ = ESCAPE_F;
  	      ++t;
--- 331,340 ----
  	      break;
  
  	    case 'a':
! 	      *s++ = ESCAPE_B; /* Strange, but true... */
  	      ++t;
  	      break;
  
  	    case 'f':
  	      *s++ = ESCAPE_F;
  	      ++t;
***************
*** 394,402 ****
  		  if (*t >= '0' && *t <= '9')
  		    ch = (ch << 4) | (*t - '0');
  		  else if (*t >= 'a' && *t <= 'f')
! 		    ch = (ch << 4) | (*t - 'a');
  		  else if (*t >= 'A' && *t <= 'F')
! 		    ch = (ch << 4) | (*t - 'A');
  		  else
  		    break;
  		  ++t;
--- 389,397 ----
  		  if (*t >= '0' && *t <= '9')
  		    ch = (ch << 4) | (*t - '0');
  		  else if (*t >= 'a' && *t <= 'f')
! 		    ch = (ch << 4) | (*t - 'a' + 0xa);
  		  else if (*t >= 'A' && *t <= 'F')
! 		    ch = (ch << 4) | (*t - 'A' + 0xa);
  		  else
  		    break;
  		  ++t;
Index: binutils//rcparse.y
===================================================================
RCS file: /cvs/src/src/binutils/rcparse.y,v
retrieving revision 1.7
diff -c -r1.7 rcparse.y
*** rcparse.y	2001/09/19 05:33:16	1.7
--- rcparse.y	2002/02/01 17:18:46
***************
*** 415,426 ****
  	  {
  	    dialog.class = $3;
  	  }
! 	| styles STYLE
! 	    { style = dialog.style; }
  	    styleexpr
  	  {
  	    dialog.style = style;
  	  }
  	| styles EXSTYLE numexpr
  	  {
  	    dialog.exstyle = $3;
--- 415,438 ----
  	  {
  	    dialog.class = $3;
  	  }
! 	| styles CLASS QUOTEDSTRING
! 	  {
! 	    res_string_to_id(&dialog.class, $3);
! 	  }
! 
! 
!  	| styles STYLE
! { style = 0; }
  	    styleexpr
  	  {
  	    dialog.style = style;
  	  }
+ 
+ /* 	| styles STYLE numexpr
+ 	  {
+ 	    dialog.style = $3;
+ 	  }
+ */
  	| styles EXSTYLE numexpr
  	  {
  	    dialog.exstyle = $3;
***************
*** 515,521 ****
  	  {
  	    $$ = $3;
  	    if (dialog.ex == NULL)
! 	      rcparse_warning (_("IEDIT requires DIALOGEX"));
  	    res_string_to_id (&$$->class, "BEDIT");
  	  }
  	| CHECKBOX
--- 527,533 ----
  	  {
  	    $$ = $3;
  	    if (dialog.ex == NULL)
! 	      rcparse_warning (_("BEDIT requires DIALOGEX"));
  	    res_string_to_id (&$$->class, "BEDIT");
  	  }
  	| CHECKBOX
***************
*** 581,586 ****
--- 593,603 ----
  	    $$->data = $13;
  	    $$->class.named = 1;
    	    unicode_from_ascii(&$$->class.u.n.length, &$$->class.u.n.name, $5);
+ 	  }
+ 	| CONTROL resref numexpr ',' QUOTEDSTRING control_styleexpr
+ 	    cnumexpr cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data
+ 	  {
+ 	    $$ = define_icon_control ($2, $3, $7, $8, style, $11, $11, $12, dialog.ex);
  	  }
  	| CTEXT
  	    {

Attachment: windrestest.tar.bz2
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]