Don't add default dialog style when explicit style specified.
Print style even if it is 0. Add testcase.
This commit is contained in:
parent
4d0b1625bf
commit
91eafb409b
|
@ -3,11 +3,14 @@
|
||||||
* rcparse.y: CLASS definitions in DIALOG resources
|
* rcparse.y: CLASS definitions in DIALOG resources
|
||||||
are quoted.
|
are quoted.
|
||||||
Fix typo in BEDIT warning.
|
Fix typo in BEDIT warning.
|
||||||
|
Don't add default dialog style when explicit style specified.
|
||||||
|
|
||||||
* rclex.l: "\xhex" encoding in strings corrected.
|
* rclex.l: "\xhex" encoding in strings corrected.
|
||||||
"\a" escape (used for right justified key definitions in menus) is
|
"\a" escape (used for right justified key definitions in menus) is
|
||||||
encodes as binary 8.
|
encodes as binary 8.
|
||||||
|
|
||||||
|
* resrc.c: Print style even if it is 0.
|
||||||
|
|
||||||
2002-04-09 Gunnar Degnbol <degnbol@danbbs.dk>
|
2002-04-09 Gunnar Degnbol <degnbol@danbbs.dk>
|
||||||
|
|
||||||
* resrc.c: print CLASS names in quotes
|
* resrc.c: print CLASS names in quotes
|
||||||
|
|
|
@ -340,6 +340,7 @@ dialog:
|
||||||
dialog.ex = NULL;
|
dialog.ex = NULL;
|
||||||
dialog.controls = NULL;
|
dialog.controls = NULL;
|
||||||
sub_res_info = $3;
|
sub_res_info = $3;
|
||||||
|
style = 0;
|
||||||
}
|
}
|
||||||
styles BEG controls END
|
styles BEG controls END
|
||||||
{
|
{
|
||||||
|
@ -363,6 +364,7 @@ dialog:
|
||||||
memset (dialog.ex, 0, sizeof (struct dialog_ex));
|
memset (dialog.ex, 0, sizeof (struct dialog_ex));
|
||||||
dialog.controls = NULL;
|
dialog.controls = NULL;
|
||||||
sub_res_info = $3;
|
sub_res_info = $3;
|
||||||
|
style = 0;
|
||||||
}
|
}
|
||||||
styles BEG controls END
|
styles BEG controls END
|
||||||
{
|
{
|
||||||
|
@ -387,6 +389,7 @@ dialog:
|
||||||
dialog.ex->help = $9;
|
dialog.ex->help = $9;
|
||||||
dialog.controls = NULL;
|
dialog.controls = NULL;
|
||||||
sub_res_info = $3;
|
sub_res_info = $3;
|
||||||
|
style = 0;
|
||||||
}
|
}
|
||||||
styles BEG controls END
|
styles BEG controls END
|
||||||
{
|
{
|
||||||
|
@ -416,7 +419,6 @@ styles:
|
||||||
dialog.class = $3;
|
dialog.class = $3;
|
||||||
}
|
}
|
||||||
| styles STYLE
|
| styles STYLE
|
||||||
{ style = dialog.style; }
|
|
||||||
styleexpr
|
styleexpr
|
||||||
{
|
{
|
||||||
dialog.style = style;
|
dialog.style = style;
|
||||||
|
@ -432,12 +434,14 @@ styles:
|
||||||
| styles FONT numexpr ',' QUOTEDSTRING
|
| styles FONT numexpr ',' QUOTEDSTRING
|
||||||
{
|
{
|
||||||
dialog.style |= DS_SETFONT;
|
dialog.style |= DS_SETFONT;
|
||||||
|
style |= DS_SETFONT;
|
||||||
dialog.pointsize = $3;
|
dialog.pointsize = $3;
|
||||||
unicode_from_ascii ((int *) NULL, &dialog.font, $5);
|
unicode_from_ascii ((int *) NULL, &dialog.font, $5);
|
||||||
}
|
}
|
||||||
| styles FONT numexpr ',' QUOTEDSTRING cnumexpr cnumexpr
|
| styles FONT numexpr ',' QUOTEDSTRING cnumexpr cnumexpr
|
||||||
{
|
{
|
||||||
dialog.style |= DS_SETFONT;
|
dialog.style |= DS_SETFONT;
|
||||||
|
style |= DS_SETFONT;
|
||||||
dialog.pointsize = $3;
|
dialog.pointsize = $3;
|
||||||
unicode_from_ascii ((int *) NULL, &dialog.font, $5);
|
unicode_from_ascii ((int *) NULL, &dialog.font, $5);
|
||||||
if (dialog.ex == NULL)
|
if (dialog.ex == NULL)
|
||||||
|
|
|
@ -131,7 +131,7 @@ static FILE *cpp_pipe;
|
||||||
|
|
||||||
static char *cpp_temp_file;
|
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;
|
static enum {ISTREAM_PIPE, ISTREAM_FILE} istream_type;
|
||||||
|
|
||||||
|
@ -2052,10 +2052,11 @@ write_rc_dialog (e, dialog)
|
||||||
{
|
{
|
||||||
const struct dialog_control *control;
|
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)
|
if (dialog->exstyle != 0)
|
||||||
fprintf (e, "EXSTYLE 0x%lx\n", dialog->exstyle);
|
fprintf (e, "EXSTYLE 0x%lx\n", dialog->exstyle);
|
||||||
|
|
||||||
if ((dialog->class.named && dialog->class.u.n.length > 0)
|
if ((dialog->class.named && dialog->class.u.n.length > 0)
|
||||||
|| dialog->class.u.id != 0)
|
|| dialog->class.u.id != 0)
|
||||||
{
|
{
|
||||||
|
@ -2063,12 +2064,14 @@ write_rc_dialog (e, dialog)
|
||||||
res_id_print (e, dialog->class, 1);
|
res_id_print (e, dialog->class, 1);
|
||||||
fprintf (e, "\n");
|
fprintf (e, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dialog->caption != NULL)
|
if (dialog->caption != NULL)
|
||||||
{
|
{
|
||||||
fprintf (e, "CAPTION \"");
|
fprintf (e, "CAPTION \"");
|
||||||
unicode_print (e, dialog->caption, -1);
|
unicode_print (e, dialog->caption, -1);
|
||||||
fprintf (e, "\"\n");
|
fprintf (e, "\"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dialog->menu.named && dialog->menu.u.n.length > 0)
|
if ((dialog->menu.named && dialog->menu.u.n.length > 0)
|
||||||
|| dialog->menu.u.id != 0)
|
|| dialog->menu.u.id != 0)
|
||||||
{
|
{
|
||||||
|
@ -2076,6 +2079,7 @@ write_rc_dialog (e, dialog)
|
||||||
res_id_print (e, dialog->menu, 0);
|
res_id_print (e, dialog->menu, 0);
|
||||||
fprintf (e, "\n");
|
fprintf (e, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dialog->font != NULL)
|
if (dialog->font != NULL)
|
||||||
{
|
{
|
||||||
fprintf (e, "FONT %d, \"", dialog->pointsize);
|
fprintf (e, "FONT %d, \"", dialog->pointsize);
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
101 DIALOG DISCARDABLE 0, 0, 186, 95
|
||||||
|
STYLE 0
|
||||||
|
BEGIN
|
||||||
|
DEFPUSHBUTTON "OK",1,129,7,50,14
|
||||||
|
END
|
||||||
|
|
|
@ -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…
Reference in New Issue