Browse Source

Don't add default dialog style when explicit style specified.

Print style even if it is 0.
Add testcase.
binutils-2_13-branch
Nick Clifton 25 years ago
parent
commit
91eafb409b
  1. 3
      binutils/ChangeLog
  2. 6
      binutils/rcparse.y
  3. 10
      binutils/resrc.c
  4. 6
      binutils/testsuite/binutils-all/windres/printstyle.rc
  5. 8
      binutils/testsuite/binutils-all/windres/printstyle.rsd

3
binutils/ChangeLog

@ -3,11 +3,14 @@
* rcparse.y: CLASS definitions in DIALOG resources
are quoted.
Fix typo in BEDIT warning.
Don't add default dialog style when explicit style specified.
* rclex.l: "\xhex" encoding in strings corrected.
"\a" escape (used for right justified key definitions in menus) is
encodes as binary 8.
* resrc.c: Print style even if it is 0.
2002-04-09 Gunnar Degnbol <degnbol@danbbs.dk>
* resrc.c: print CLASS names in quotes

6
binutils/rcparse.y

@ -340,6 +340,7 @@ dialog:
dialog.ex = NULL;
dialog.controls = NULL;
sub_res_info = $3;
style = 0;
}
styles BEG controls END
{
@ -363,6 +364,7 @@ dialog:
memset (dialog.ex, 0, sizeof (struct dialog_ex));
dialog.controls = NULL;
sub_res_info = $3;
style = 0;
}
styles BEG controls END
{
@ -387,6 +389,7 @@ dialog:
dialog.ex->help = $9;
dialog.controls = NULL;
sub_res_info = $3;
style = 0;
}
styles BEG controls END
{
@ -416,7 +419,6 @@ styles:
dialog.class = $3;
}
| styles STYLE
{ style = dialog.style; }
styleexpr
{
dialog.style = style;
@ -432,12 +434,14 @@ styles:
| styles FONT numexpr ',' QUOTEDSTRING
{
dialog.style |= DS_SETFONT;
style |= DS_SETFONT;
dialog.pointsize = $3;
unicode_from_ascii ((int *) NULL, &dialog.font, $5);
}
| styles FONT numexpr ',' QUOTEDSTRING cnumexpr cnumexpr
{
dialog.style |= DS_SETFONT;
style |= DS_SETFONT;
dialog.pointsize = $3;
unicode_from_ascii ((int *) NULL, &dialog.font, $5);
if (dialog.ex == NULL)

10
binutils/resrc.c

@ -131,7 +131,7 @@ static FILE *cpp_pipe;
static char *cpp_temp_file;
/* Input stream is either a file or a pipe. */
/* Input stream is either a file or a pipe. */
static enum {ISTREAM_PIPE, ISTREAM_FILE} istream_type;
@ -2052,10 +2052,11 @@ write_rc_dialog (e, dialog)
{
const struct dialog_control *control;
if (dialog->style != 0)
fprintf (e, "STYLE 0x%lx\n", dialog->style);
fprintf (e, "STYLE 0x%lx\n", dialog->style);
if (dialog->exstyle != 0)
fprintf (e, "EXSTYLE 0x%lx\n", dialog->exstyle);
if ((dialog->class.named && dialog->class.u.n.length > 0)
|| dialog->class.u.id != 0)
{
@ -2063,12 +2064,14 @@ write_rc_dialog (e, dialog)
res_id_print (e, dialog->class, 1);
fprintf (e, "\n");
}
if (dialog->caption != NULL)
{
fprintf (e, "CAPTION \"");
unicode_print (e, dialog->caption, -1);
fprintf (e, "\"\n");
}
if ((dialog->menu.named && dialog->menu.u.n.length > 0)
|| dialog->menu.u.id != 0)
{
@ -2076,6 +2079,7 @@ write_rc_dialog (e, dialog)
res_id_print (e, dialog->menu, 0);
fprintf (e, "\n");
}
if (dialog->font != NULL)
{
fprintf (e, "FONT %d, \"", dialog->pointsize);

6
binutils/testsuite/binutils-all/windres/printstyle.rc

@ -0,0 +1,6 @@
101 DIALOG DISCARDABLE 0, 0, 186, 95
STYLE 0
BEGIN
DEFPUSHBUTTON "OK",1,129,7,50,14
END

8
binutils/testsuite/binutils-all/windres/printstyle.rsd

@ -0,0 +1,8 @@
0000 00000000 20000000 ffff0000 ffff0000 .... ...........
0010 00000000 00000000 00000000 00000000 ................
0020 36000000 20000000 ffff0500 ffff6500 6... .........e.
0030 00000000 10100000 00000000 00000000 ................
0040 00000000 00000000 01000000 0000ba00 ................
0050 5f000000 00000000 01000150 00000000 _..........P....
0060 81000700 32000e00 0100ffff 80004f00 ....2.........O.
0070 4b000000 00000000 K.......
Loading…
Cancel
Save