Example #1
0
void         set_date(char *       s)
{ 
  strcpy(date,s); 
  strcpy(attr,hilt); 
  xygoto(60,1); 
  iprintf(put_chr,"%s",date); 
  strcpy(attr,normal); 
} 
Example #2
0
/*
 * Name:    show_init_mode
 * Date:    July 21, 1991
 * Notes:   Draw the sample screen.
 */
void show_init_mode( void )
{
char *sample;
int line, i;

   cls( );
   xygoto( -1, -1 );
   sample = mode_screen[0];
   for (i=0,line=1; sample != NULL; line++, i++) {
      sample = mode_screen[i];
      s_output( (char far *)sample, line, 0, 7 );
   }
   for (i=0; i<19; i++)
      (*mode[i].show_me)();
}
Example #3
0
void tdemacro( void )
{
int c;
char fname[82];
FILE *macro_file;                  


   cls( );
   show_box( 0, 0, macro_screen, NORMAL );
   xygoto( 42, 14 );
   c = getkey( );
   while (c != '1' && c != '2')
      c = getkey( );
   if (c == '1') {
      puts( "" );
      puts( "" );
      puts( "" );
      puts( "Enter file name that contains the macro definitions :" );
      gets( fname );
      if ((c = access( fname, EXIST )) != 0) {
         puts( "\nFile not found.  Press any key to continue." );
         c = getkey( );
         cls( );
         return;
      } else if ((macro_file = fopen( fname, "rb" )) == NULL ) {
         puts( "\nCannot open macro file.  Press any key to contine." );
         c = getkey( );
         cls( );
         return;
      }

      fread( (void *)&macros.first_stroke[0], sizeof(int), MAX_KEYS, macro_file );
      fread( (void *)&macros.strokes[0], sizeof(STROKES), STROKE_LIMIT, macro_file );
      fseek( tde_exe, macro_offset + 8, SEEK_SET );
      fwrite( (void *)&macros.first_stroke[0], sizeof(int), MAX_KEYS, tde_exe );
      fwrite( (void *)&macros.strokes[0], sizeof(STROKES), STROKE_LIMIT, tde_exe );
      fclose( macro_file );
      puts( "" );
      puts( "" );
      puts( "" );
      puts( "New macros successfully installed.  Press any key to continue." );
      c = getkey( );
   }
   cls( );
}
Example #4
0
/*
 * Name:    change_modes
 * Date:    July 21, 1991
 * Notes:   Real workhorse function of the utility.  Get a key and then
 *          figure out what to do with it.
 */
void change_modes( void )
{
int c;
int m;
int new_field;

   m = 0;
   xygoto( mode[m].col, mode[m].line );
   color = 112;
   (*mode[m].show_me)();
   for (c=0; c != F3  &&  c != F10  &&  c != ESC;) {
      c = getkey( );
      new_field = FALSE;
      color = 112;
      switch (c) {
         case RTURN :
         case DOWN  :
            color = 7;
            (*mode[m].show_me)();
            ++m;
            if (m > 18)
               m = 0;
            new_field = TRUE;
            break;
         case UP    :
            color = 7;
            (*mode[m].show_me)();
            --m;
            if (m < 0)
               m = 18;
            new_field = TRUE;
            break;
         case LEFT  :
            switch (m) {
               case Ins     :
               case Ind     :
               case Write_Z :
               case Smart   :
               case Trim    :
               case Eol     :
               case Size    :
               case Backup  :
               case Ruler   :
               case Time    :
                  mode[m].mode = !mode[m].mode;
                  break;
               case PTAB    :
               case LTAB    :
                  if (mode[m].mode > 1)
                     --mode[m].mode;
                  else
                     mode[m].mode = 1040 / 2;
                  break;
               case WW      :
                  --mode[m].mode;
                  if (mode[m].mode < 0)
                     mode[m].mode = 2;
                  break;
               case Date    :
                  --mode[m].mode;
                  if (mode[m].mode < 0)
                     mode[m].mode = 5;
                  break;
               case Crlf    :
                  if (mode[m].mode == CRLF)
                     mode[m].mode = LF;
                  else
                     mode[m].mode = CRLF;
                  break;
               case Left    :
               case Para    :
                  if (mode[m].mode > 0)
                     --mode[m].mode;
                  else
                     mode[m].mode = mode[Right].mode - 1;
                  break;
               case Right   :
                  if (mode[m].mode > mode[Left].mode + 1 &&
                      mode[m].mode > mode[Para].mode + 1)
                     --mode[m].mode;
                  else
                     mode[m].mode = 1040;
                  break;
               case Initcase   :
                  if (mode[m].mode == 1)
                     mode[m].mode = 2;
                  else
                     mode[m].mode = 1;
                  break;
            }
            (*mode[m].show_me)();
            break;
         case RIGHT :
            switch (m) {
               case Ins     :
               case Ind     :
               case Write_Z :
               case Smart   :
               case Trim    :
               case Eol     :
               case Size    :
               case Backup  :
               case Ruler   :
               case Time    :
                  mode[m].mode = !mode[m].mode;
                  break;
               case PTAB     :
               case LTAB     :
                  if (mode[m].mode < 1040 / 2)
                    ++mode[m].mode;
                  else
                     mode[m].mode = 1;
                  break;
               case WW      :
                  ++mode[m].mode;
                  if (mode[m].mode > 2)
                     mode[m].mode = 0;
                  break;
               case Date    :
                  ++mode[m].mode;
                  if (mode[m].mode > 5)
                     mode[m].mode = 0;
                  break;
               case Crlf    :
                  if (mode[m].mode == CRLF)
                     mode[m].mode = LF;
                  else
                     mode[m].mode = CRLF;
                  break;
               case Left    :
               case Para    :
                  if (mode[m].mode < mode[Right].mode)
                     ++mode[m].mode;
                  else
                     mode[m].mode = 0;
                  break;
               case Right   :
                  if (mode[m].mode < 1038)
                     ++mode[m].mode;
                  else {
                     if (mode[Left].mode < mode[Para].mode)
                        mode[m].mode = mode[Para].mode + 1;
                     else
                        mode[m].mode = mode[Left].mode + 1;
                  }
                  break;
               case Initcase   :
                  if (mode[m].mode == 1)
                     mode[m].mode = 2;
                  else
                     mode[m].mode = 1;
                  break;
            }
            (*mode[m].show_me)();
            break;
      }
      if (new_field) {
         color = 112;
         (*mode[m].show_me)();
         xygoto( mode[m].col, mode[m].line );
      }
   }

   /*
    * write changes to "tde.exe" if user presses F10.
    */
   if (c == F10) {
      in_modes.insert        = mode[Ins].mode;
      in_modes.indent        = mode[Ind].mode;
      in_modes.ptab_size     = mode[PTAB].mode;
      in_modes.ltab_size     = mode[LTAB].mode;
      in_modes.smart_tab     = mode[Smart].mode;
      in_modes.control_z     = mode[Write_Z].mode;
      in_modes.crlf          = mode[Crlf].mode;
      in_modes.trailing      = mode[Trim].mode;
      in_modes.show_eol      = mode[Eol].mode;
      in_modes.word_wrap     = mode[WW].mode;
      in_modes.left_margin   = mode[Left].mode;
      in_modes.parg_margin   = mode[Para].mode;
      in_modes.right_margin  = mode[Right].mode;
      in_modes.cursor_size   = mode[Size].mode;
      in_modes.do_backups    = mode[Backup].mode;
      in_modes.ruler         = mode[Ruler].mode;
      in_modes.date_style    = mode[Date].mode;
      in_modes.time_style    = mode[Time].mode;
      in_modes.search_case   = mode[Initcase].mode;
      fseek( tde_exe, mode_offset, SEEK_SET );
      fwrite( (void *)&in_modes, sizeof( MODE_INFO ), 1, tde_exe );
   }
   cls( );
}
Example #5
0
/*
 * Name:    select_file
 * Purpose: To let user select a file from dir list
 * Date:    February 13, 1992
 * Passed:  flist: pointer to list of files
 *          stem:  base directory
 *          dir:   directory display stuff
 * Notes:   let user move thru the file names with the cursor keys
 */
int  select_file( FTYPE *flist, char *stem, DIRECTORY *dir )
{
int  ch;                /* input character from user */
int  func;              /* function of character input by user */
int  fno;               /* index into flist of the file under cursor */
int  goodkey;           /* is key a recognized function key? */
int  r;                 /* current row of cursor */
int  c;                 /* current column of cursor */
int  offset;            /* offset into file list */
int  stop;              /* stop indicator */
int  stem_len;          /* stem length */
int  color;             /* color of help screen */
int  file_color;        /* color of current file */
int  change;            /* boolean, hilite another file? */
int  oldr;              /* old row */
int  oldc;              /* old column */
char asize[20];         /* ascii file size */
char blank[20];         /* blank out file names */

   /*
    * initial everything.
    */
   memset( blank, ' ', 12 );
   blank[12] = '\0';
   c = r = 1;
   ch = fno = offset = 0;
   color = g_display.help_color;
   file_color = g_display.hilited_file;
   goodkey = TRUE;
   stop = FALSE;
   stem_len = strlen( stem );
   s_output( stem, dir->row+1, dir->col+19, color );
   s_output( flist[fno].fname, dir->row+1, dir->col+19+stem_len, color );
   ltoa( flist[fno].fsize, asize, 10 );
   s_output( blank, dir->row+2, dir->col+19, color );
   s_output( asize, dir->row+2, dir->col+19, color );
   itoa( dir->cnt,  asize, 10 );
   s_output( blank, dir->row+2, dir->col+57, color );
   s_output( asize, dir->row+2, dir->col+57, color );
   xygoto( (c-1)*14+dir->col+2, r+dir->row+3 );
   hlight_line( (c-1)*14+dir->col+2, r+dir->row+3, 12, file_color );
   change = FALSE;
   while (stop == FALSE) {
      oldr = r;
      oldc = c;
      ch = getkey( );
      func = getfunc( ch );

      /*
       * User may have redefined the Enter and ESC keys.  Make the Enter key
       *  perform a Rturn in this function. Make the ESC key do an AbortCommand.
       */
      if (ch == RTURN)
         func = Rturn;
      else if (ch == ESC)
         func = AbortCommand;

      switch (func) {
         case Rturn       :
         case NextLine    :
         case BegNextLine :
            stop = TRUE;
            break;
         case AbortCommand :
            stop = TRUE;
            break;
         case LineUp :
            if (r > 1) {
               change = TRUE;
               --r;
            } else {
               r = dir->lines;
               change = TRUE;
               if (offset == 0 || c > 1) {
                  if (c > 1)
                     --c;
               } else if (dir->vcols > 0 && offset > 0 && c == 1) {
                  /*
                   * recalculate the dir display stuff.
                   */
                  offset -= dir->lines;
                  recalculate_dir( dir, flist, offset );
               }
            }
            goodkey = TRUE;
            break;
         case LineDown :
            if (r < dir->prow) {
               change = TRUE;
               ++r;
            } else if (r < dir->lines && c != dir->cols) {
               change = TRUE;
               ++r;
            } else {
               change = TRUE;
               r = 1;
               if (offset == dir->vcols * dir->lines || c < dir->cols) {
                  if (c < dir->cols)
                     ++c;
               } else if (dir->vcols > 0 && offset < dir->vcols * dir->lines &&
                         c == dir->cols) {
                  offset += dir->lines;
                  recalculate_dir( dir, flist, offset );
               }
            }
            goodkey = TRUE;
            break;
         case CharLeft :
            if (offset == 0 || c > 1) {
               if (c > 1) {
                  change = TRUE;
                  --c;
               }
            } else if (dir->vcols > 0 && offset > 0 && c == 1) {
               change = TRUE;

               /*
                * recalculate the dir display stuff.
                */
               offset -= dir->lines;
               recalculate_dir( dir, flist, offset );
            }
            goodkey = TRUE;
            break;
         case CharRight :
            if (offset == dir->vcols * dir->lines || c < dir->cols) {
               if (c < dir->cols) {
                  change = TRUE;
                  ++c;
                  if (c == dir->cols) {
                     if ( r > dir->prow)
                        r = dir->prow;
                  }
               }
            } else if (dir->vcols > 0 && offset < dir->vcols * dir->lines &&
                         c == dir->cols) {
               change = TRUE;
               offset += dir->lines;
               recalculate_dir( dir, flist, offset );
               if (r > dir->prow)
                  r = dir->prow;
            }
            goodkey = TRUE;
            break;
         case BegOfLine :
            change = TRUE;
            c = r = 1;
            goodkey = TRUE;
            break;
         case EndOfLine :
            change = TRUE;
            r = dir->prow;
            c = dir->cols;
            goodkey = TRUE;
            break;
         case ScreenDown :
            change = TRUE;
            r = (c == dir->cols) ? r = dir->prow : dir->lines;
            goodkey = TRUE;
            break;
         case ScreenUp :
            change = TRUE;
            r = 1;
            goodkey = TRUE;
            break;
         default :
            break;
      }
      if (goodkey) {
         s_output( blank, dir->row+1, dir->col+19+stem_len, color );
         fno = offset + (c-1)*dir->lines + (r-1);
         s_output( flist[fno].fname, dir->row+1, dir->col+19+stem_len, color );
         ltoa( flist[fno].fsize, asize, 10 );
         s_output( blank, dir->row+2, dir->col+19, color );
         s_output( asize, dir->row+2, dir->col+19, color );
         xygoto( (c-1)*14+dir->col+2, r+dir->row+3 );
         goodkey = FALSE;
         if (change) {
            hlight_line( (oldc-1)*14+dir->col+2, oldr+dir->row+3, 12, color );
            hlight_line( (c-1)*14+dir->col+2, r+dir->row+3, 12, file_color );
            change = FALSE;
         }
      }
   }
   dir->select = fno;
   return( func == AbortCommand ? ERROR : OK );
}
Example #6
0
/*
 * Name:    tdecfgfile
 * Date:    June 5, 1992
 * Notes:   read in a configuration file
 */
void tdecfgfile( void )
{
FILE *config;
char fname[80];
int  rc;

   /*
    * prompt for the configuration file name.
    */
   cls( );
   xygoto( 0, 3 );
   puts( "Enter configuration file name, e.g. tde.cfg  :" );
   gets( fname );

   if (strlen( fname ) != 0) {
      rc = OK;
      if ((rc = access( fname, EXIST )) != 0) {
         puts( "\n\n Error: File not found." );
         getkey( );
         rc = ERROR;
      } else if ((config = fopen( fname, "r" )) == NULL ) {
         puts( "\n\nError: Cannot open configuration file." );
         getkey( );
         rc = ERROR;
      }

      /*
       * if everything is everthing so far, get the current editor settings.
       */
      if (rc == OK) {
         fseek( tde_exe, keys_offset, SEEK_SET );
         fread( (void *)&key_func, sizeof(KEY_FUNC), 1, tde_exe );
         fseek( tde_exe, two_key_offset, SEEK_SET );
         fread( (void *)&two_key_list, sizeof(TWO_KEY), 1, tde_exe );
         fseek( tde_exe, macro_offset, SEEK_SET );
         fread( (void *)&macros, sizeof(MACRO), 1, tde_exe );
         fseek( tde_exe, color_offset, SEEK_SET );
         fread( (void *)&temp_colours, sizeof(COLORS), 1, tde_exe );
         fseek( tde_exe, mode_offset, SEEK_SET );
         fread( (void *)&in_modes, sizeof( MODE_INFO ), 1, tde_exe );
         fseek( tde_exe, sort_offset, SEEK_SET );
         fread( (void *)&sort_order, sizeof( SORT_ORDER ), 1, tde_exe );

         stroke_count = get_stroke_count( );

         /*
          * put the current modes into an array.  it's easier to work
          *   with them in an array.  This is from cfgmode.c.
          */
         modes[Ins]         = in_modes.insert;
         modes[Ind]         = in_modes.indent;
         modes[PTAB]        = in_modes.ptab_size;
         modes[LTAB]        = in_modes.ltab_size;
         modes[Smart]       = in_modes.smart_tab;
         modes[Write_Z]     = in_modes.control_z;
         modes[Crlf]        = in_modes.crlf;
         modes[Trim]        = in_modes.trailing;
         modes[Eol]         = in_modes.show_eol;
         modes[WW]          = in_modes.word_wrap;
         modes[Left]        = in_modes.left_margin;
         modes[Para]        = in_modes.parg_margin;
         modes[Right]       = in_modes.right_margin;
         modes[Size]        = in_modes.cursor_size;
         modes[Backup]      = in_modes.do_backups;
         modes[Ruler]       = in_modes.ruler;
         modes[Date]        = in_modes.date_style;
         modes[Time]        = in_modes.time_style;
         modes[InflateTabs] = in_modes.inflate_tabs;
         modes[Initcase]    = in_modes.search_case;
         modes[JustRM]      = in_modes.right_justify;

         line_no = 1;
         while (!feof( config )) {
            if (fgets( line_in, 1500, config ) == NULL)
               break;
            parse_line( line_in );
            ++line_no;
         }

         /*
          *  if we changed any modes, reset them b4 we write them to tde.exe.
          */
         in_modes.insert        = modes[Ins];
         in_modes.indent        = modes[Ind];
         in_modes.ptab_size     = modes[PTAB];
         in_modes.ltab_size     = modes[LTAB];
         in_modes.smart_tab     = modes[Smart];
         in_modes.control_z     = modes[Write_Z];
         in_modes.crlf          = modes[Crlf];
         in_modes.trailing      = modes[Trim];
         in_modes.show_eol      = modes[Eol];
         in_modes.word_wrap     = modes[WW];
         in_modes.left_margin   = modes[Left];
         in_modes.parg_margin   = modes[Para];
         in_modes.right_margin  = modes[Right];
         in_modes.cursor_size   = modes[Size];
         in_modes.do_backups    = modes[Backup];
         in_modes.ruler         = modes[Ruler];
         in_modes.date_style    = modes[Date];
         in_modes.time_style    = modes[Time];
         in_modes.inflate_tabs  = modes[InflateTabs];
         in_modes.search_case   = modes[Initcase];
         in_modes.right_justify = modes[JustRM];

         fseek( tde_exe, keys_offset, SEEK_SET );
         fwrite( (void *)&key_func, sizeof(KEY_FUNC), 1, tde_exe );
         fseek( tde_exe, two_key_offset, SEEK_SET );
         fwrite( (void *)&two_key_list, sizeof(TWO_KEY), 1, tde_exe );
         fseek( tde_exe, macro_offset, SEEK_SET );
         fwrite( (void *)&macros, sizeof(MACRO), 1, tde_exe );
         fseek( tde_exe, color_offset, SEEK_SET );
         fwrite( (void *)&temp_colours, sizeof(COLORS), 1, tde_exe );
         fseek( tde_exe, mode_offset, SEEK_SET );
         fwrite( (void *)&in_modes, sizeof( MODE_INFO ), 1, tde_exe );
         fseek( tde_exe, sort_offset, SEEK_SET );
         fwrite( (void *)&sort_order, sizeof( SORT_ORDER ), 1, tde_exe );
         fclose( config );
         printf( "\n\n    Configuration file read.  Press a key to continue :" );
         getkey( );
      }
   }
   cls( );
}
Example #7
0
void master_help( HELP_WINDOW *hw, KEY_DEFS *help, struct screen *help_heading,
                  char *t, int *ch )
{
FILE *fp;               
int col, row, i, j;
int update_name, change_color, draw_page;
char str[80];
char *blank = "                                                 ";
char temp[20];
HELP_WINDOW hw_k;

   xygoto( -1, -1 );
   save_and_draw( hw, help_heading, &w_ptr );
   show_key_def_list( hw, help );

   col = hw->ulft_col + hw->dply_col;
   row = hw->ulft_row + hw->dply_row + hw->v_row;
   change_color = TRUE;
   *ch = 0;
   while (*ch!=F3 && *ch != F10 && *ch!=ESC) {
      draw_page = FALSE;
      position_cursor( hw, hw->line_length, &update_name, &change_color, ch );
      switch (*ch) {
         case PGUP :
            if (hw->select > hw->avail_lines-1) {
               hw->select = hw->select - hw->avail_lines;
               if (hw->v_row > hw->select)
                  hw->select = hw->v_row;
               draw_page = TRUE;
            } else if (hw->select - hw->v_row > 0) {
               hw->select = hw->v_row;
               draw_page = TRUE;
            }
            break;
         case PGDN :
            if (hw->select + hw->avail_lines < hw->num_entries) {
               hw->select = hw->select + hw->avail_lines;
               draw_page = TRUE;
            } else if (hw->select + hw->avail_lines - hw->v_row <
                                                         hw->num_entries) {
               hw->select = hw->num_entries - 1;
               draw_page = TRUE;
            }
            if ((hw->num_entries - 1) - hw->select <
                                              hw->avail_lines && draw_page) {
               i = row - hw->v_row;
               scroll_window( 0, i, col, i+hw->avail_lines-1,
                              col+hw->line_length, NORMAL );
            }
            break;
         case F5 :
            hw_k.dply_col = 2;
            hw_k.dply_row = 3;
            hw_k.line_length = 33;
            hw_k.avail_lines = 6;
            hw_k.v_row = 0;
            hw_k.select = 0;
            hw_k.num_entries = NUM_FUNC;
            hw_k.ulft_col = 20;
            hw_k.ulft_row = row + 1;
            if (hw_k.ulft_row > 12)
               hw_k.ulft_row = row - 12;
            hw_k.total_col = 37;
            hw_k.total_row = 12;
            new_assignment_help( &hw_k, avail_func, func_head, ch );
            if (*ch == RTURN) {
               help[hw->select].key[0] = '*';
               help[hw->select].func_index = (unsigned char)hw_k.select;
               s_output( help[hw->select].key, row, col, cfg.attr );
               s_output( "                     ", row, col+31, cfg.attr );
               s_output( avail_func[help[hw->select].func_index],
                         row, col+31, cfg.attr );
               *ch = 0;
            }
            break;
         case F7 :
            hw_k.ulft_col = 14;
            hw_k.ulft_row = 10;
            hw_k.total_col = 52;
            hw_k.total_row = 5;
            save_and_draw( &hw_k, file_head, &w_ptr );
            xygoto( hw_k.ulft_col+28, hw_k.ulft_row+2 );
            gets( str );
            j = TRUE;
            if ((i = access( str, EXIST )) == 0) {
               s_output( blank, hw_k.ulft_row+2, hw_k.ulft_col+1, NORMAL );
               s_output( "OK to overwrite exiting file (y/n)?",
                          hw_k.ulft_row+2, hw_k.ulft_col+1, NORMAL );
               xygoto( hw_k.ulft_col+38, hw_k.ulft_row+2 );
               i = getkey( );
               while (i != 'Y' && i != 'y' && i != 'N' && i != 'n')
                  i = getkey( );
               if (i == 'n' || i == 'N')
                  j = FALSE;
            }
            xygoto( -1, -1 );
            if (j == TRUE && (fp = fopen( str, "w" )) != NULL) {
               for (i=0; i<hw->num_entries && j; i++) {
                  fprintf( fp, " %22s  = ", help[i].key+3 );
                  fprintf( fp, "  %s\n",  avail_func[help[i].func_index] );
               }
               fclose( fp );
            } else {
               s_output( blank, hw_k.ulft_row+2, hw_k.ulft_col+1, NORMAL );
               s_output( "Cannot open file.  Press any key to contine.",
                          hw_k.ulft_row+2, hw_k.ulft_col+1, NORMAL );
               j = getkey( );
            }
            window_control( &w_ptr, RESTORE, hw_k.ulft_col, hw_k.ulft_row,
                            hw_k.total_col, hw_k.total_row );
            break;
         case F8 :
            if ((fp = fopen( "PRN", "a" )) != NULL) {
               hw_k.ulft_col = 20;
               hw_k.ulft_row = 10;
               hw_k.total_col = 42;
               hw_k.total_row = 5;
               save_and_draw( &hw_k, print_head, &w_ptr );
               j = TRUE;
               for (i=0; i<hw->num_entries && j; i++) {
                  itoa( i+1, temp, 10 );
                  s_output( temp, hw_k.ulft_row+2, hw_k.ulft_col+16, NORMAL );
                  fprintf( fp, " %22s  = ", help[i].key+3 );
                  fprintf( fp, "  %s\n",  avail_func[help[i].func_index] );
                  if (kbhit()) {
                     j = getkey( );
                     if (j == ESC)
                        j = FALSE;
                     else
                        j = TRUE;
                  }
               }
               fprintf( fp, "\f" );
               fclose( fp );
               window_control( &w_ptr, RESTORE, hw_k.ulft_col, hw_k.ulft_row,
                               hw_k.total_col, hw_k.total_row );
            }
            break;
      }
      if (draw_page == TRUE) {
         show_key_def_list( hw, help );
         update_name = TRUE;
         change_color = TRUE;
      }
      row = hw->ulft_row + hw->dply_row + hw->v_row;
      if (update_name) {
         s_output( help[hw->select].key, row, col, NORMAL );
         s_output( avail_func[help[hw->select].func_index], row, col+31,
                      NORMAL );
      }
      if (change_color)
         hlight_line( col, row, hw->line_length, cfg.attr );
      *ch = getkey( );
      change_color = FALSE;
   }
   window_control( &w_ptr, RESTORE, hw->ulft_col, hw->ulft_row,
                   hw->total_col, hw->total_row );
}