The Meta-Environment API

gui-actions.tb

Go to the documentation of this file.
00001 #ifndef __GUI_ACTIONS__
00002 #define __GUI_ACTIONS__
00003 
00004 #include <graph-utils.tb>
00005 #include <module-manager.tb>
00006 #include <dialog.idef>
00007 
00008 process AskQuestion(Question : str, Answer : term?) is
00009   snd-msg(ask-question(Question))
00010   . rec-msg(ask-question-result(Answer?))
00011 
00012 process PromptForDirectory(Title : str, 
00013                       Paths : list, 
00014               Cancel: bool?,
00015               Path : str?) is
00016   snd-msg(ask-for-directory(Title, Paths))
00017   .
00018   (
00019     rec-msg(ask-for-directory-result(Path?))
00020     . Cancel := false
00021   +
00022     rec-msg(ask-for-directory-cancel)
00023     . Cancel := true
00024   )
00025 
00026 process PromptForFile(Title : str, 
00027                       Paths : list, 
00028               Modulename : str, 
00029               Cancel: bool?,
00030               Filename : str?) is
00031 let
00032   Extension : str
00033 in
00034   snd-msg(cm-get-language-extension(Modulename))
00035   .
00036   (
00037     rec-msg(cm-language-extension(Modulename, Extension?))
00038   +
00039     rec-msg(cm-no-language-extension(Modulename))
00040     . Extension := ".trm"
00041   )
00042   . snd-msg(ask-for-file(Title, Paths, Extension))
00043   .
00044   (
00045     rec-msg(ask-for-file-result(Filename?))
00046     . Cancel := false
00047   +
00048     rec-msg(ask-for-file-cancel)
00049     . Cancel := true
00050   )
00051 endlet
00052 
00053 process PromptForFileWithExtension(String : str, 
00054                                    Paths : list, 
00055                    Extension : str, 
00056                    Cancel: bool?,
00057                    Filename : str?) is
00058   snd-msg(ask-for-file(String, Paths, Extension))
00059   .
00060   (
00061     rec-msg(ask-for-file-result(Filename?))
00062     . Cancel := false
00063   +
00064     rec-msg(ask-for-file-cancel)
00065     . Cancel := true
00066   )
00067 
00068 process ExitAction is
00069   shutdown("")
00070 
00071 process ShowTreeAction(EditorId : session-id) is
00072 let
00073   Tree : term
00074 in
00075   GetFocus(EditorId, Tree?)
00076   .
00077   if not-equal(Tree, UNDEFINED) then
00078     ShowTree(Tree, false, false, false)
00079   else
00080     tau
00081   fi
00082 endlet
00083 
00084 process ShowFullTreeWithoutLayoutAction(EditorId : session-id) is
00085 let
00086   Tree : term
00087 in
00088   GetFocus(EditorId, Tree?)
00089   .
00090   if not-equal(Tree, UNDEFINED) then
00091     ShowTree(Tree, false, true, false)
00092   else
00093     tau
00094   fi
00095 endlet
00096 
00097 process ShowFullTreeAction(EditorId : session-id) is
00098 let
00099   Tree : term
00100 in
00101   GetFocus(EditorId, Tree?)
00102   .
00103   if not-equal(Tree, UNDEFINED) then
00104     ShowTree(Tree, true, true, false)
00105   else
00106     tau
00107   fi
00108 endlet
00109 
00110 process ShowSharedTreeAction(EditorId : session-id) is
00111 let
00112   Tree : term
00113 in
00114   GetFocus(EditorId, Tree?)
00115   .
00116   if not-equal(Tree, UNDEFINED) then
00117     ShowTree(Tree, true, true, true)
00118   else
00119     tau
00120   fi
00121 endlet
00122 
00123 #endif /*__GUI_ACTIONS__*/

Generated on Fri Sep 12 13:08:53 2008 for meta by  doxygen 1.4.6