/* file drawmap-req.h */ #define NUM_CHAR 25 /* # characters in text buffer */ #define TLEFT 24 /* left edge of requester */ #define TTOP 24 /* top edge of requester */ #define TWIDTH 8*(NUM_CHAR+5) /* width of requester */ #define THEIGHT 80 /* height of requester */ #define GAD_FIRST 1 /* initial gadget id */ #define GAD_LEFT 16 /* string gadget left edge */ #define GAD_TOP THEIGHT/2 /* string gadget top edge */ struct IntuiText rtext = { /* text in requester */ BLACK, ORANGE, JAM1, GAD_LEFT, (GAD_TOP-4)/2, NULL, (UBYTE *) "Enter desired text:", NULL }; UBYTE userinput[NUM_CHAR+1]; /* buffer for user text */ UBYTE defaulttext[] = "Text"; /* default text */ struct StringInfo gadgetinput = { /* gadget string text */ &userinput[0], /* buffer for user input */ NULL, /* no undo buffer */ 0, /* character position in buffer */ NUM_CHAR+1, /* max. characters in buffer */ 0, /* buffer position of first */ /* displayed character */ 0, 0, 0, 0, 0, NULL, 0, NULL /* Intuition local variables */ }; struct Gadget gad = { /* string gadget structure */ NULL, /* pointer to next gadget */ GAD_LEFT, GAD_TOP, 8*(NUM_CHAR+1), /* left, top, width, height */ 10, /* of hit box */ GADGHCOMP, /* flags */ RELVERIFY | ENDGADGET, /* activation flags */ REQGADGET | STRGADGET, /* gadget type = string */ NULL, /* border descriptor */ NULL, /* alternate imagery */ NULL, /* gadget text */ 0, /* no mutual exclusion */ (APTR) &gadgetinput, /* special info */ GAD_FIRST, /* gadget identifier */ NULL /* pointer to data */ }; short bordertop2[] = { /* inside top border */ 8, 8, TWIDTH-9, 8 }; short borderright2[] = { /* inside right border */ TWIDTH-9, 8, TWIDTH-9, THEIGHT-9 }; short borderbottom2[] = { /* inside bottom border */ TWIDTH-9, THEIGHT-9, 8, THEIGHT-9 }; short borderleft2[] = { /* inside left border */ 8, THEIGHT-9, 8, 8 }; short bordertop[] = { /* top border lines */ 0, 0, TWIDTH-1, 0, TWIDTH-2, 1, 1, 1, 2, 2, TWIDTH-3, 2, TWIDTH-4, 3, 3, 3 }; #define NUM_PAIRS_TOP sizeof(bordertop) / (2*sizeof(short)) short borderright[] = { /* right border lines */ TWIDTH-4, 3, TWIDTH-4, THEIGHT-4, TWIDTH-3, 2, TWIDTH-3, THEIGHT-3, TWIDTH-2, THEIGHT-2, TWIDTH-2, 1, TWIDTH-1, 0, TWIDTH-1, THEIGHT-1 }; #define NUM_PAIRS_RIGHT sizeof(borderright) / (2*sizeof(short)) short borderbottom[] = { /* bottom border lines */ TWIDTH-1, THEIGHT-1, 0, THEIGHT-1, 1, THEIGHT-2, TWIDTH-2, THEIGHT-2, TWIDTH-3, THEIGHT-3, 2, THEIGHT-3, 3, THEIGHT-4, TWIDTH-4, THEIGHT-4 }; #define NUM_PAIRS_BOTTOM sizeof(borderbottom) / (2*sizeof(short)) short borderleft[] = { /* left border lines */ 3, THEIGHT-4, 3, 3, 2, THEIGHT-3, 2, 2, 1, 1, 1, THEIGHT-2, 0, THEIGHT-1, 0, 0 }; #define NUM_PAIRS_LEFT sizeof(borderleft) / (2*sizeof(short)) struct Border border_left2 = { /* inside left border */ 0, 0, BLACK, ORANGE, JAM1, 2, (short *) &borderleft2[0], NULL }; struct Border border_bottom2 = { /* inside bottom border */ 0, 0, WHITE, ORANGE, JAM1, 2, (short *) &borderbottom2[0], &border_left2 }; struct Border border_right2 = { /* inside right border */ 0, 0, WHITE, ORANGE, JAM1, 2, (short *) &borderright2[0], &border_bottom2 }; struct Border border_top2 = { /* inside top border */ 0, 0, BLACK, ORANGE, JAM1, 2, (short *) &bordertop2[0], &border_right2 }; struct Border border_left = { /* left border */ 0, 0, WHITE, ORANGE, JAM1, NUM_PAIRS_LEFT, (short *) &borderleft[0], &border_top2 }; struct Border border_bottom = { /* bottom border */ 0, 0, BLACK, ORANGE, JAM1, NUM_PAIRS_BOTTOM, (short *) &borderbottom[0], &border_left }; struct Border border_right = { /* right border */ 0, 0, BLACK, ORANGE, JAM1, NUM_PAIRS_RIGHT, (short *) &borderright[0], &border_bottom }; struct Border border_top = { /* top border */ 0, 0, WHITE, ORANGE, JAM1, NUM_PAIRS_TOP, (short *) &bordertop[0], &border_right };