C       ADVANCED RAY SETTINGS DIALOG HANDLER
C
        IF(COMMAND.EQ.'RAYSETTINGS') THEN
 !       CALL WDIALOGSELECT(RAYSETTINGS)
           SELECT CASE(MESSAGE)
            CASE ('IDOK')
C       RADIO BUTTON STATUS
C       SURTOL
 !       CALL WDIALOGGETDOUBLE(SURTOL,SURTOL)
C       AIMTOL
 !       CALL WDIALOGGETDOUBLE(AIMTOL,AIMTOL)
C       CAIMTOL
 !       CALL WDIALOGGETDOUBLE(CAIMTOL,CAIMTOL)
C       MRAYS
 !       CALL WDIALOGGETINTEGER(MRAYS,MRAYS)
C       NRAITR
 !       CALL WDIALOGGETINTEGER(NRAITR,NRAITR)
C       NEWOBJ
 !       CALL WDIALOGGETINTEGER(NEWOBJ,NEWOBJ)
C       NEWOBJ
 !       CALL WDIALOGGETINTEGER(NEWREF,NEWREF)
C       NEWIMG
 !       CALL WDIALOGGETINTEGER(NEWIMG,NEWIMG)
C       RESET TO DEFAULTS CHECKBOX
 !       CALL WDIALOGGETCHECKBOX(DEFAULTS,ISET)
        IF(ISET.EQ.1) THEN
        AIMTOL=1.0D-8
        CAIMTOL=1.0D-3
        SURTOL=1.0D-8
        NRAITR=100
        MRAYS=200
 !       CALL WDIALOGPUTDOUBLE(SURTOL,SURTOL)
C       MRAYS
 !       CALL WDIALOGPUTINTEGER(MRAYS,MRAYS)
C       AIMTOL
 !       CALL WDIALOGPUTDOUBLE(AIMTOL,AIMTOL)
C       CAIMTOL
 !       CALL WDIALOGPUTDOUBLE(CAIMTOL,CAIMTOL)
C       NRAITR
 !       CALL WDIALOGPUTINTEGER(NRAITR,NRAITR)
C       RESET TO DEFAULTS CHECKBOX
 !       CALL WDIALOGGETCHECKBOX(DEFAULTS,ISET)
                END IF
        OUTLYNE='RAY SETTINGS HAVE BEEN ADJUSTED'
        CALL SHOWIT(0)
C
        CASE('IDCANCEL')
 !       CALL WDialogHide()
 !       CALL WDialogUnload()
        END SELECT
                                END IF
