home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 1
/
ARM_CLUB_CD.iso
/
contents
/
education
/
a
/
biology1
/
!Biology1
/
c
/
Res156
< prev
next >
Wrap
Text File
|
1991-12-02
|
2KB
|
53 lines
/* Res156.c */
#include <string.h>
#include "wimp.h"
#include "wimpt.h"
#include "prompts.h"
#include "keys.h"
/* NB in general a load of icons get put up & then forgotton about,
some mechanism needs implementing to keep some lists
of those which will want deleting at various times,
and then deleting them.
*/
static void make_icon (wimp_w wnd, int length, int line, string str, wimp_i *ic)
{
wimp_icreate info;
wimp_redrawstr r;
int len = str.maxlen;
info.w = wnd;
info.i.box.x0 = 4 + (standard_line - length) * 8;
info.i.box.x1 = info.i.box.x0 + (length * 8 + 4) * 2;
info.i.box.y1 = - line * 32;
info.i.box.y0 = info.i.box.y1 - 40 - 16;
info.i.flags = wimp_ITEXT | wimp_IBORDER |
wimp_IHCENTRE | wimp_IVCENTRE | wimp_IFILLED |
wimp_IBTYPE * wimp_BCLICKDEBOUNCE |
wimp_INDIRECT | 7 * wimp_IFORECOL;
info.i.data.indirecttext.buffer = str.str;
info.i.data.indirecttext.validstring = "";
info.i.data.indirecttext.bufflen = len + 1;
wimpt_noerr (wimp_create_icon (&info, ic));
r.w = wnd;
memcpy (&r.box, &info.i.box, sizeof (wimp_box));
wimpt_noerr (wimp_force_redraw (&r));
input_icon (wnd, *ic, NULL, key_ret);
}
void *prompt_string (wimp_w wnd, int line, int length, string str, int res_type)
{ wimp_i icon;
make_icon (wnd, length + 1, line, str, &icon);
return (concat_string_wakeup (wnd, icon, str, res_type));
}