home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / tab.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-30  |  1.7 KB  |  57 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. /*  Tab.c  */
  22.  
  23. #include <externs.h>
  24.  
  25.  
  26.  
  27. void AVL_SET_TAB()
  28. {
  29.     char f[AVL_MAX_LINEL+10];
  30.     AVL_EDIT_WINDOW_PTR w;
  31.     AVL_WIN_PTR m1;
  32.     short co;
  33.     int n1, n2;
  34.     static char *msg = " GWAda - Set Identation Length ";
  35.     static char *msg2 = "Current identation length: ";
  36.     w = &avl_windows[avl_window];
  37.     n1 = strlen(msg) + 10;
  38.     n2 = (80 - n1) / 2;
  39.     m1 = AVL_MAKE_WINDOW(msg,7,n2,9,n1+n2,avl_wnd_bk_color,avl_wnd_color);
  40.     while ( 1 ) {
  41.         _settextposition(1,1);
  42.         sprintf(f,"%d", avl_tab_size);
  43.         _outtext(msg2);
  44.         if (AVL_PROMPT(1,strlen(msg2)+1,f,2)) {
  45.             AVL_DEL_WINDOW(m1);
  46.             return;
  47.             }
  48.         sscanf(f,"%d",&n2);
  49.         if (n2 >= 1 && n2 <= 8) {
  50.             w -> tabsize = avl_tab_size = n2;
  51.             AVL_DEL_WINDOW(m1);
  52.             return;
  53.             }
  54.         else 
  55.             AVL_ERROR("Invalid identation length. Must be in the 1..8 range!");
  56.         }
  57. }
  58.