Changeset 133 for trunk/SRC/Utilities/report.pro
- Timestamp:
- 07/07/06 11:57:27 (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Utilities/report.pro
r132 r133 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME:report6 5 ; 7 ; PURPOSE: comme dialog_message.pro si il y a deja des widgets actives 8 ; ou comme message.pro si il n''y a pas de widgets actives. pour poser 9 ; des question dont la reponse n''est pas oui/non utiliser xquestion 6 ; @file_comments 7 ; Like dialog_message.pro if there is already some widget 8 ; active or like message.pro if there is not any widget active. 9 ; To ask a question whose answer is not yes/no,use xquestion. 10 10 ; 11 ; CATEGORY: 12 ; 13 ; CALLING SEQUENCE:res = report(text) 14 ; 15 ; INPUTS: text: un string on un vecteur de string. Si le string ne 11 ; @param text {in}{required} un string on un vecteur de string. Si le string ne 16 12 ; comporte qu''un element, on cherche les eventuels characteres de 17 13 ; retour a la ligne: '!C'. If text is set to an array of strings, each 18 14 ; array element is displayed as a separate line of text. 19 15 ; 20 ; KEYWORD PARAMETERS: 21 ; SIMPLE: activate to print only the message without the name 16 ; @keyword SIMPLE activate to print only the message without the name 22 17 ; and the line of the routine (defined by calling routine_name) 23 18 ; 24 ; ceux dialog_message.pro et message.pro avec en + 25 ; PARENT qui fait la meme chose que DIALOG_PARENT de dialog_message.pro 19 ; @keyword _extra used to pass keywords from dialog_message.pro and message.pro 26 20 ; 27 ; OUTPUTS: -1 si le mot cle QUESTION n''est pas activer 28 ; si le mot cle est active la fonction retourne 1 pour yes et 29 ; 0 pour no. 21 ; @keyword PARENT same as DIALOG_PARENT de dialog_message.pro 30 22 ; 31 ; COMMON BLOCKS: 23 ; @keyword QUESTION Set this keyword to create a "Question" dialog. 24 ; The default dialog type is "Warning" 32 25 ; 33 ; SIDE EFFECTS: 26 ; @keyword DEFAULT_NO Set this keyword to make the "No" button the default 27 ; selection for "Question" dialog. Normally, the default is yes. 34 28 ; 35 ; RESTRICTIONS: 29 ; @keyword SIMPLE Activate to print the error message without printing 30 ; the routine name with its full path. 36 31 ; 37 ; EXAMPLE: 32 ; @returns -1 if the keyword QUESTION is not activated 33 ; If the keyword is activated, return 1 for yes and 0 for no. 38 34 ; 39 ; si aucun widget n''est active:35 ; @example If there is not any widget activated: 40 36 ; 41 37 ; IDL> help, report('toto tata') 42 38 ; % $MAIN$: toto tata 43 39 ; <Expression> INT = -1 44 ; IDL> help, report(' ca marche?',/question)45 ; ca marche? y/n (default answer is y)40 ; IDL> help, report('does it works ?',/question) 41 ; does it works ? y/n (default answer is y) 46 42 ; <Expression> BYTE = 1 47 ; IDL> help, report('question1: !C ca marche?',/question)43 ; IDL> help, report('question1: !C does it works ?',/question) 48 44 ; question1: 49 ; ca marche? y/n (default answer is y)45 ; does it works ? y/n (default answer is y) 50 46 ; <Expression> BYTE = 1 51 47 ; 52 ; si des widgets sont deja actives, c''est la meme chose mais avec des 53 ; widgets! 48 ; If widgets are already activated, it is the same thing but with widgets! 54 49 ; 55 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)50 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 56 51 ; 21/10/1999 52 ; 53 ; @version $ID$ 54 ; 57 55 ;- 58 56 ;------------------------------------------------------------ … … 63 61 compile_opt idl2, strictarrsubs 64 62 ; 65 res = -1 ; 66 ; on separe le texte en differentes lignes (separees par !C) si ce 67 ; n''est pas deja fait... 63 res = -1 ; 64 ; we separate the text in different lines (separated by !C) if it is not already done... 68 65 if n_elements(text) EQ 1 then text = str_sep(text, '!C', /trim) 69 ; il y a des widgets actifs, c''est facile on appelledialog_massage66 ; there is some widgets activated, it is easy, we call dialog_massage 70 67 if (widget_info(/managed))[0] NE 0 then BEGIN 71 68 res = dialog_message(text, dialog_parent = parent, QUESTION = question $ … … 73 70 if keyword_set(question) THEN res = res EQ 'Yes' ELSE res = -1 74 71 ENDIF ELSE BEGIN 75 ; aucun widget n''est actif76 ; on pose unequestion ?72 ; there is not any widget activated 73 ; do we ask a question ? 77 74 if keyword_set(question) then BEGIN 78 ; quelle est la reponse par defaut ?75 ; what i sthe answer by default ? 79 76 if keyword_set(default_no) then answer = 'n' ELSE answer = 'y' 80 77 default_answer = answer … … 83 80 read, text[n_elements(text)-1]+' y/n (default answer is '+default_answer+')' , answer 84 81 answer = strlowcase(answer) ; 85 ; si la reponse ne convient pas82 ; if the answer is not appropriated 86 83 while answer NE '' and answer NE 'y' and answer NE 'n' do begin 87 84 read, text[n_elements(text)-1]+' y/n (default answer is '+default_answer+')' , answer 88 85 answer = strlowcase(answer) 89 86 ENDWHILE ; 90 ; on ajuste res en fonction de la reponse87 ; we adjust res in function of th answer 91 88 case answer of 92 89 '':res = default_answer EQ 'y' … … 95 92 endcase 96 93 endif ELSE BEGIN 97 ; si on ne pose pas de question on fait juste unprint94 ; If we do not ask any question, we just make a print 98 95 IF keyword_set(simple) THEN prefix = '' ELSE prefix = '% '+routine_name(1)+': ' 99 96 if n_elements(text) GT 1 THEN $
Note: See TracChangeset
for help on using the changeset viewer.