aboutsummaryrefslogtreecommitdiff
path: root/binutils/resrc.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2000-06-13 21:21:43 +0000
committerDJ Delorie <dj@redhat.com>2000-06-13 21:21:43 +0000
commit2104a50e3e7d2d543fa1ae5dc8393a985e1f786c (patch)
tree9b05d18d8fd27beb2a7d7545f823ab67210dd5f7 /binutils/resrc.c
parent98ecb0a78be9b1064f6c7f644d2e7fccb1111f0c (diff)
downloadfsf-binutils-gdb-2104a50e3e7d2d543fa1ae5dc8393a985e1f786c.zip
fsf-binutils-gdb-2104a50e3e7d2d543fa1ae5dc8393a985e1f786c.tar.gz
fsf-binutils-gdb-2104a50e3e7d2d543fa1ae5dc8393a985e1f786c.tar.bz2
* rcparse.y (control): ICON controls take an id as the first
parameter, not an optional string. Also, call new convenience function that takes res_id's. * resrc.c (define_control): missing text means zero-length string, not zero ID. (define_icon_control): New. * windres.h: declare define_icon_control.
Diffstat (limited to 'binutils/resrc.c')
-rw-r--r--binutils/resrc.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/binutils/resrc.c b/binutils/resrc.c
index 814809e..a30719b 100644
--- a/binutils/resrc.c
+++ b/binutils/resrc.c
@@ -847,19 +847,42 @@ define_control (text, id, x, y, width, height, class, style, exstyle)
n->height = height;
n->class.named = 0;
n->class.u.id = class;
- if (text != NULL)
- res_string_to_id (&n->text, text);
- else
- {
- n->text.named = 0;
- n->text.u.id = 0;
- }
+ if (text == NULL)
+ text = "";
+ res_string_to_id (&n->text, text);
n->data = NULL;
n->help = 0;
return n;
}
+struct dialog_control *
+define_icon_control (iid, id, x, y, style, exstyle, help, data, ex)
+ struct res_id iid;
+ unsigned long id;
+ unsigned long x;
+ unsigned long y;
+ unsigned long style;
+ unsigned long exstyle;
+ unsigned long help;
+ struct rcdata_item *data;
+ struct dialog_ex *ex;
+{
+ struct dialog_control *n;
+ if (style == 0)
+ style = SS_ICON | WS_CHILD | WS_VISIBLE;
+ n = define_control (0, id, x, y, 0, 0, CTL_STATIC, style, exstyle);
+ n->text = iid;
+ if (help && !ex)
+ rcparse_warning (_("help ID requires DIALOGEX"));
+ if (data && !ex)
+ rcparse_warning (_("control data requires DIALOGEX"));
+ n->help = help;
+ n->data = data;
+
+ return n;
+}
+
/* Define a font resource. */
void