home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume43 / cwish / part05 / help.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-10  |  5.0 KB  |  150 lines

  1. /*---------------------------------------------------------------------------*
  2.  *
  3.  *                  cwish - windowing user friendly shell
  4.  *                  -------------------------------------
  5.  *
  6.  *               Copyright (c) 1988-1994 Hellmuth Michaelis
  7.  *
  8.  *                  Eggerstedtstr. 28
  9.  *                  22765 Hamburg
  10.  *                  Europe
  11.  *
  12.  *                  Tel:    +49 / 40 / 384298    (private)
  13.  *                  Tel:    +49 / 40 / 55903-170 (at work)
  14.  *                  e-mail: hm@hcswork.hcs.de
  15.  *
  16.  *                          --------oOo--------
  17.  *
  18.  *   This program is free software; you can redistribute it and/or modify
  19.  *   it under the terms of the GNU General Public License as published by
  20.  *   the Free Software Foundation; either version 2 of the License, or
  21.  *   (at your option) any later version.
  22.  *
  23.  *   This program is distributed in the hope that it will be useful,
  24.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  25.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  26.  *   GNU General Public License for more details.
  27.  *
  28.  *   You should have received a copy of the GNU General Public License
  29.  *   along with this program; if not, write to the Free Software
  30.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  31.  *
  32.  *---------------------------------------------------------------------------*
  33.  *
  34.  *    Last Edit-Date: [Fri Apr 29 12:15:14 1994]
  35.  *
  36.  *    -hm    fkey labels for help screen
  37.  *    -hm    update help screen
  38.  *
  39.  *----------------------------------------------------------------------------*/
  40.  
  41. #include "cwish.h"
  42.  
  43. #define    MAXHELPL    20
  44.  
  45.  
  46. /*---------------------------------------------------------------------------*
  47.  *    help function keys
  48.  *---------------------------------------------------------------------------*/
  49.  
  50. static struct fk_tab help_keys[] =
  51. {
  52.     {"                ", "         "},
  53.     {"                ", "         "},
  54.     {"                ", "         "},
  55.     {"                ", "         "},
  56.     {"                ", "         "},
  57.     {"                ", "         "},
  58.     {"                ", "         "},
  59.     {"                ", "         "}
  60. };
  61.  
  62. static char *helpstr[MAXHELPL] =
  63. {
  64. "   ----------------------- Command Window Commands: -------------------------",
  65. "",
  66. "   Backspace - Delete left character    Delete    - Delete cursor character",
  67. "   Control-F - Character forward        Control-B - Character backward",
  68. "   Control-A - Begin of line            Control-E - End of line",
  69. "   Control-N - Next line                Control-P - Previous line",
  70. "   Control-K - Kill line from cursor    Control-Y - Yank back killed line",
  71. "   Control-D - Exit back to system      \"%\" is the marked files wildcard char",
  72. "",
  73. "   ------------------------- File Window Commands: --------------------------",
  74. "",
  75. "   Cursor up, Cursor down, Cursor right, Cursor left - Select a file",
  76. "   Page Up   - Previous file page       Page Down - Next file page",
  77. "   F1        - Edit current file        F2        - Echo name to commandline",
  78. "   F3        - Display this help        F4        - Enter configuration menu",
  79. "   F5        - Mark the current file    F6        - Unmark all marked files",
  80. "   F7        - Alternate attribute line F8        - Close current directory",
  81. "",
  82. "   Alternate Invocation of F1...F8 by pressing ESCAPE and then '1'...'8'",
  83. "   Alternate Invocation of Page up/down by pressing ESCAPE and then 'N' or 'P'",
  84. };
  85.  
  86. char *contin = {"Press any key to continue ..."};
  87.  
  88. /*---------------------------------------------------------------------------*
  89.  *    help page
  90.  *---------------------------------------------------------------------------*/
  91. void
  92. help(void)
  93. {
  94.     int i;
  95.  
  96.     suspend_time();                /* stop updating time */
  97.  
  98.     cur_fktab = &help_keys;            /* help screen fkey label table */
  99.     init_flabels();
  100.  
  101.     wmove(stdscr, 0, 0);            /* first line */
  102.     wclear(stdscr);                /* clear window */
  103.     touchwin(stdscr);
  104.     wnoutrefresh(stdscr);
  105.  
  106.     move(0, 0);                /* first line */
  107.     attron(A_REVERSE);            /* highlight on */
  108.     addstr(headerline);            /* program/copyright header */
  109.     attroff(A_REVERSE);            /* highlight off */
  110.  
  111.     for (i = 0; i < MAXHELPL; i++)
  112.         mvaddstr(2 + i, 0, helpstr[i]);    /* print help screen */
  113.  
  114.     move(LINES - 1, 0);            /* last line */
  115.  
  116.     attron(A_REVERSE);            /* highlight on */
  117.     addstr(contin);
  118.     attroff(A_REVERSE);            /* highlight on */
  119.     move(LINES - 1, strlen(contin));    /* last line */
  120.     refresh();                /* show it */
  121.  
  122.     getch();                /* get any char from user */
  123.  
  124.     wmove(stdscr, 0, 0);            /* first line */
  125.     wclear(stdscr);                /* clear window */
  126.     touchwin(stdscr);
  127.     wnoutrefresh(stdscr);
  128.  
  129.     touchwin(cmnd_w);
  130.     touchwin(fst_w);
  131.     touchwin(file_w);
  132.     if (opt_attrib)
  133.         touchwin(attr_w);
  134.     if (opt_labels)
  135.         touchwin(flbl_w);
  136.  
  137.     resume_time();                /* restart updating time */
  138.  
  139.     header();                /* new header */
  140.     dis_hist();                /* display current commandline */
  141.     fresh_files();                /* refresh files */
  142.     attribs(1);                /* new attributes */
  143.     update_all();                /* update complete screen */
  144.  
  145.     cur_fktab = &sys_keys;            /* system fkey label table */
  146.     init_flabels();
  147. }
  148.  
  149. /*----------------------- E O F -------------------------------------------*/
  150.