      SUBROUTINE CHNGDISP
C SETS LINE TYPES AND WIDTHS, SYMBOL TYPES, AND AXIS TYPES, AND
C SETS THE PLOT BOUNDARIES FOR ELLIPSE
C
C 29 AUGUST 1991      J.T. ARMSTRONG

      IMPLICIT UNDEFINED (A-Z)
      INCLUDE 'PARAMETR.INC'
      INCLUDE 'ELLIPSE.INC'
      CHARACTER*1 DISPCMD

      DISPCMD = '0'

   10 CONTINUE        ! RETURN HERE AFTER COMMAND INTERPRETATION

      CALL SHOWDATA
      CALL EGA_RESTORE_DEFAULT
      CALL LOCATE (0,1)
      CALL WRITE_STRING('Command:')
      CALL PGCURSE(XR,YR,DISPCMD)
      CALL CAPS(DISPCMD)

      IF (DISPCMD.EQ.'A') THEN
          DISP_ORB = .NOT.DISP_ORB

      ELSE IF (DISPCMD.EQ.'B') THEN
          DISP_CURV = .NOT.DISP_CURV

      ELSE IF (DISPCMD.EQ.'C') THEN
          DISP_CALC = .NOT.DISP_CALC

      ELSE IF (DISPCMD.EQ.'D') THEN
          DISP_ERR = .NOT.DISP_ERR

      ELSE IF (DISPCMD.EQ.'E') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter data symbol (1-31; best=17,21):    ')
          READ(INC,*) SYM_DAT

      ELSE IF (DISPCMD.EQ.'F') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter calc. pt. symbol (1-31; best=21,1):')
          READ(INC,*) SYM_MOD

      ELSE IF (DISPCMD.EQ.'G') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter orbit pt. symbol (1-31; best=1,20):')
          READ(INC,*) SYM_ORB

      ELSE IF (DISPCMD.EQ.'H') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter error bar line width (0-21):       ')
          READ(INC,*) ERRLINWD

      ELSE IF (DISPCMD.EQ.'I') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter error bar line type (1-5):         ')
          READ(INC,*) ERRLINTY

      ELSE IF (DISPCMD.EQ.'J') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter data-to-calc. pt. line width (1-21)')
          READ(INC,*) O_CLINWD

      ELSE IF (DISPCMD.EQ.'K') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter data-to-calc. pt. line type (1-5): ')
          READ(INC,*) O_CLINTY

      ELSE IF (DISPCMD.EQ.'L') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter orbit line width (1-21):           ')
          READ(INC,*) ORBLINWD

      ELSE IF (DISPCMD.EQ.'M') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter orbit line type (1-5):             ')
          READ(INC,*) ORBLINTY

      ELSE IF (DISPCMD.EQ.'N') THEN
          CALL LOCATE(0,20)
          CALL WRITE_STRING('Enter box type (-2 to 2; 0 = no axes)    ')
          READ(INC,*) AXIS

      ELSE IF (DISPCMD.EQ.'O') THEN
          WRITE(OUTC,*) ' Enter RA min, max (0, 0 => autoscale):       '
          READ(INC,*) RAMIN, RAMAX
          WRITE(OUTC,*) ' Enter Dec min, max (0, 0 => autoscale):      '
          READ(INC,*) DECMIN, DECMAX

          IF (ABS(RALO).LT..001 .AND. ABS(RAHI).LT..001) THEN
              RALO  = RAMIN - 0.1*(RAMAX-RAMIN)             ! AUTO-SCALE
              RAHI  = RAMAX + 0.1*(RAMAX-RAMIN)
          END IF
          IF (ABS(DECLO).LT..001 .AND. ABS(DECHI).LT..001) THEN
              DECLO  = DECMIN - 0.1*(DECMAX-DECMIN)         ! AUTO-SCALE
              DECHI  = DECMAX + 0.1*(DECMAX-DECMIN)
          END IF

      ELSE IF (DISPCMD.EQ.'Q') THEN
          GO TO 999

      ELSE IF (DISPCMD.EQ.'X') THEN
          GO TO 999

      ELSE
        CALL LOCATE (0, 1)
        CALL WRITE_STRING ( '?  help      ' )
        CALL LOCATE (0, 2)
        CALL WRITE_STRING ( 'A  toggle display of calc. orbit' )
        CALL LOCATE (0, 3)
        CALL WRITE_STRING ( 'B  toggle dots/line for orbit display' )
        CALL LOCATE (0, 4)
        CALL WRITE_STRING ( 'C  toggle display of calc. points' )
        CALL LOCATE (0, 5)
        CALL WRITE_STRING ( 'D  toggle display of error bars' )
        CALL LOCATE (0, 6)
        CALL WRITE_STRING ( 'E  set symbol for data points (0-31)' )
        CALL LOCATE (0, 7)
        CALL WRITE_STRING ( 'F  set symbol for calc. points (0-31)' )
        CALL LOCATE (0, 8)
        CALL WRITE_STRING ( 'G  set symbol for orbit points (0-31)' )
        CALL LOCATE (0, 9)
        CALL WRITE_STRING ( 'H  set line width for error bars (1-21)' )
        CALL LOCATE (0,10)
        CALL WRITE_STRING ( 'I  set line type for error bars (1-5)' )
        CALL LOCATE (0,11)
        CALL WRITE_STRING ( 'J  set line width for data->calc. (1-21)' )
        CALL LOCATE (0,12)
        CALL WRITE_STRING ( 'K  set line type for data->calc. (1-5)' )
        CALL LOCATE (0,13)
        CALL WRITE_STRING ( 'L  set line width for orbit curve (1-21)' )
        CALL LOCATE (0,14)
        CALL WRITE_STRING ( 'M  set line type for orbit curve (1-5)' )
        CALL LOCATE (0,15)
        CALL WRITE_STRING ( 'N  set box type (-2 to 2)   ' )
        CALL LOCATE (0,16)
        CALL WRITE_STRING ( 'O  set RA, Dec min, max' )
        CALL LOCATE (0,17)
        CALL WRITE_STRING ( '                                     ' )
        CALL LOCATE (0,18)
        CALL WRITE_STRING ( '                                   ' )
        CALL LOCATE (0,20)
        CALL WRITE_STRING ( 'X  Quit to main program' )
        CALL LOCATE (0,21)
        CALL WRITE_STRING ( 'Q  Quit to main program' )
      END IF

      CALL PGASK(.TRUE.)
      CALL PGADVANCE
      CALL PGASK(.FALSE.)
      GO TO 10

  999 CONTINUE
      RETURN
      END

