home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 206.lha / Flist_v1.2 / Sources / help.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-12-28  |  2.5 KB  |  80 lines

  1. /* 
  2.     This file contains the Help routine
  3.  
  4.     To invoke the help routine, hit the Help key!
  5.  
  6.     Written by Steve (Raz) Berry with help from Carol Schnepper
  7.     (I stole the window spec and the code to wait for a keypress from
  8.     her example program 'Timerwin.c')
  9.  
  10. */
  11.  
  12. #include "flist.h"
  13. #include <stdio.h>
  14.  
  15. extern struct Screen *scrptr;
  16.  
  17. struct   NewWindow helpwin = {
  18.    40,0,                                  /* LeftEdge and TopEdge */
  19.    500, 200,                              /* Width and Height */
  20.    -1, -1,                                /* DetailPen and BlockPen */
  21.    CLOSEWINDOW|VANILLAKEY,                /* IDCMP Flags */
  22.    WINDOWDEPTH|WINDOWDRAG|WINDOWCLOSE     /* Flags */
  23.    |SMART_REFRESH|ACTIVATE,
  24.    NULL, NULL,                            /* Gadget and Image pointers */
  25.    "Help",                                /* Title string */
  26.    NULL,                                  /* Screen ptr null (this screen) */
  27.    NULL,                                  /* BitMap pointer */
  28.    50, 20,                                /* MinWidth and MinHeight */
  29.    320, 200,                              /* MaxWidth and MaxHeight */
  30.    WBENCHSCREEN                           /* Type of window */
  31.    };
  32.  
  33. /* Here is the text to be output */
  34.  
  35. char *text[] = {
  36.         "",
  37.         "Key        Command Description",
  38.         "---        ------- -----------",
  39.         "^A         bring up the ARP Filerequestor.",
  40.         "^C         abort Flist.",
  41.         "^D         change to current Directory.",
  42.         "^G         re-Get the current directory.",
  43.         "^K         delete (Kill) current file.",
  44.         "^L         Repaint and restore screen.",
  45.         "^N         Make directory",
  46.         "^P         get Parent directory.",
  47.         "^R         Rename current file or directory",
  48.         "^S         sort list by Names.",
  49.         "^T         sort list by Time.",
  50.         "^Z         sort list by Size.",
  51.         "^O         sort by Pattern (ARP wildcards).",
  52.         "^U         Erase line.",
  53.         "^X         Execute REXX macro.",
  54.         " Hitting the Esc key will insert the current filename into",
  55.         " the command line.",
  56.         "   Hit any key or the close gadget to continue."
  57.         };
  58.  
  59. Help()
  60. {
  61.     int i;
  62.     struct Window *helptr;
  63.     struct RastPort *hrp;
  64.  
  65.     helptr = OpenWindow(&helpwin);
  66.     if (helptr == NULL) 
  67.         auto_req("Couldn't open Window!");
  68.     else {
  69.           hrp = helptr->RPort;
  70.         Move(hrp,10L,20L);
  71.  
  72.         for (i=0;i<21;i++){
  73.             Text(hrp,text[i],strlen(text[i]));
  74.             Move(hrp,10,i+20+8*i);
  75.         }
  76.  
  77.         wait_for_event(helptr);
  78.     }
  79. }
  80.