;+
; PROJECT
;
;           Solar-B EIS
;
; NAME
;           EIS_VIEW_STUDY_DESCRIPTIONS
;
;
; PURPOSE
;
;           Procedure to display a study description file using IDL's
;           XDisplayFile routine. This text is NOT editable!
;
; INPUTS
;
;           st_id - a study ID
;           tlbID - the widget ID of the parent widget
;
; OUPUTS
;
;           None
;
; CATEGORY
;
;           EIS Technical Planning - eis_mk_study & eis_mk_plan
;
; WRITTEN
;           John A Rainnie RAL Feb-2006
;
; HISTORY
;
;           v0.1 JAR 21-March-2007
;               Removed zdbase dependency. Now study description
;               is NEVER editable
;                   
;-
;************************************************************************
PRO eis_view_study_descriptions , st_id , tlbID = tlbID

; OK, convention is study description file is 
;                   "~/planning_db/study_descriptions/desc000001.txt"
idValue  = STRING(format='(I06)',st_id)
baseName = STRJOIN(['desc',idValue,'.txt'],/SINGLE)
; Get path of study_descriptions (either USER/OFFICIAL)
path = eis_get_study_descriptions_path()
; Create the filename
fileName  = CONCAT_DIR(path , baseName)
; Just check the file exists
IF (FILE_TEST(fileName[0]) NE 1) THEN BEGIN
    BEEP
    mText = 'File not found. Aborting'
    complain = DIALOG_MESSAGE( mText       ,                        $
                         DIALOG_PARENT = tlbID,                $
                         /ERROR )
    RETURN
ENDIF

; Editable/Non-Editable if USER/OFFICIAL
XDISPLAYFILE , fileName[0]            ,                                     $
               GROUP       = tlbID    ,                                     $
               TITLE       = fullName ,                                     $
               /MODAL                 ,                                     $
               DONE_BUTTON = 'Quit'

END
