home *** CD-ROM | disk | FTP | other *** search
- #include "mono:defines"
- #include "mono:xvariables"
-
-
-
-
-
- VOID scroll_text(how)
- USHORT how;
- {
- USHORT hold_line;
- int iter;
-
- SetAPen(rportinstruct,lt_blue);
-
- if (how == UP)
- {
- if (line0_text >= (MAX_LINES-SHOW_LINES))
- {
- DisplayBeep(screen1);
- return;
- }
- RectFill(rportinstruct, 1, 11, 317, 184);
- for (iter=0, hold_line=(++line0_text); iter<SHOW_LINES; iter++)
- instructIT[iter].IText=instructline[hold_line++];
- PrintIText(rportinstruct, &instructIT[0], 0, 0);
- return;
- }
- if (how == DOWN)
- {
- if (line0_text == 0)
- {
- DisplayBeep(screen1);
- return;
- }
- RectFill(rportinstruct, 1, 11, 317, 184);
- for (iter=0, hold_line=(--line0_text); iter<SHOW_LINES; iter++)
- instructIT[iter].IText=instructline[hold_line++];
- PrintIText(rportinstruct, &instructIT[0], 0, 0);
- return;
- }
- if (how == PAGE)
- {
- if (line0_text > (MAX_LINES-SHOW_LINES-SHOW_LINES))
- line0_text=(MAX_LINES-SHOW_LINES-SHOW_LINES);
- RectFill(rportinstruct, 1, 11, 317, 184);
- for (iter=0, hold_line=(line0_text+=SHOW_LINES); iter<SHOW_LINES; iter++)
- instructIT[iter].IText=instructline[hold_line++];
- PrintIText(rportinstruct, &instructIT[0], 0, 0);
- return;
- }
- }
-
- VOID ckinstructmsg()
- {
- ULONG instructclass;
- USHORT instructcode;
- USHORT hold_line;
- instructclass=0;
- instructcode=0;
-
-
- while(instructmsg=(struct IntuiMessage *)GetMsg(instructwindow->UserPort))
- {
- instructclass = instructmsg->Class;
- instructcode = instructmsg->Code;
- if (instructclass == GADGETUP) getID(instructmsg);
- ReplyMsg(instructmsg);
- }
- if ( (instructclass == RAWKEY) && (instructcode == HELP) )
- {
- line0_text=0; /* within instructions */
- for (j=0, hold_line=line0_text; j<SHOW_LINES; j++)
- instructIT[j].IText=instructline[hold_line++];
- RectFill(rportinstruct, 1, 11, 317, 184);
- PrintIText(rportinstruct, &instructIT[0], 0, 0);
- }
- if(instructclass == CLOSEWINDOW)
- {
- instruct=FALSE;
- RemoveGadget(instructwindow, &dnscrollgag);
- RemoveGadget(instructwindow, &upscrollgag);
- RemoveGadget(instructwindow, &instructpagegag);
- CloseWindow(instructwindow);
- }
- if (instructclass == GADGETUP)
- {
- if (gagid == 31) scroll_text(PAGE);
- if (gagid == 32) scroll_text(UP);
- if (gagid == 33) scroll_text(DOWN);
- }
- }
-
- VOID instruction()
- {
- ninstructw.Screen = screen1;
- ninstructw.FirstGadget=&instructpagegag;
- instructpagegag.NextGadget=&upscrollgag;
- upscrollgag.NextGadget=&dnscrollgag;
- if ((instructwindow=(struct Window *)OpenWindow(&ninstructw))==NULL) cleanup();
- rportinstruct=instructwindow->RPort;
- SetAPen(rportinstruct,lt_blue);
- RectFill(rportinstruct, 1, 11, 317, 184);
-
-
- PrintIText(rportinstruct, &instructIT[0], 0, 0);
-
-
- instruct=TRUE;
- while (instruct)
- {
- Wait(1<<instructwindow->UserPort->mp_SigBit);
- ckinstructmsg();
- }
- }
-