+Syntax12.Scn.Fnt ZParcElemsAlloc Syntax14m.Scn.Fnt*Syntax10.Scn.Fnt zStampElemsAlloc10 Sep 98 Z  ϳSyntax12m.Scn.FntSyntax12i.Scn.Fnt LinkElemsAllocElem.Guide.Text/Elem.Guide.Text$'Elem.Guide.TextElem.Guide.TextElem.Guide.TextElem.Guide.TextElem.Guide.TextKElem.Guide.TextElem.Guide.Text6Elem.Guide.TextSElem.Guide.Textzr*Elem.Guide.Text`Elem.Guide.Text!Elem.Guide.TextElem.Guide.Text!Elem.Guide.TextElem.Guide.Text*rElem.Guide.TextЊElem.Guide.TextbElem.Guide.Text?>Elem.Guide.TextXElem.Guide.Text|Elem.Guide.Text*Elem.Guide.Text Z `:K Z MarkElemsAlloc/ ZP W Z $'   t ZP F Z  ;  7 ZP A  ' D D  U ZP p Z ! ZP  Z % ZP < Z KSyntax12b.Scn.Fnt ZP $ Z  X$ P XX~oQ$ x2 #%R%4/H ,  6  ZP ]/; Sv ZP  Z zr  &  P V. A     F2' Z E ZP :? Z `  ZP 'j Z  u ZP 'LkGP  Z ! P ' Z    0 ZP ' pR  ^0 9 @,D Z b ZP '   l >/W ZP 'G>_ X Z ! y ZP 'E@E  Z rP '|~| Z Њ ZP ' ZP ': ?> g ZP 'q^wIj $^ Z X ZP ' Z |q ZP   Z   tM0uLineElemsAlloc 4vzTableElemsAllocCSyntax10.Scn.Fnt?Syntax10i.Scn.FntH/left 0/right 0/nohead "*"/noline "*"/col "LL"/table /columns string G@@SSyntax10.Scn.Fnt ZParcElemsAllocfg/left 0/right 0/nohead "*"/noline "*"/col "LL"/table control column formatting string = {L|C|R|N|-}. ,  SSyntax10.Scn.FntParcElemsAlloc/left 0/right 0/nohead "*"/noline "*"/col "LL"/table L left flush C centered R right flush N numeric (period adjusted) - default  tM'y CSyntax10.Scn.Fnt<Syntax10i.Scn.FntE/left 0/right 0/nohead "*"/noline "*"/col "LL"/table /rows string J9@@SSyntax10.Scn.Fnt ZParcElemsAlloccd/left 0/right 0/nohead "*"/noline "*"/col "LL"/table control row formatting string = {B|L|C|T|-}. 69 SSyntax10.Scn.Fnt ZParcElemsAllocwx/left 0/right 0/nohead "*"/noline "*"/col "LL"/table B bottom flush L common baseline C centered T top flush - default  tM'wz CSyntax10.Scn.Fnt?Syntax10i.Scn.FntG/left 0/right 0/nohead "*"/noline "*"/col "LL"/table /noheads string O9SSyntax10.Scn.Fnt ZParcElemsAlloc^_/left 0/right 0/nohead "*"/noline "*"/col "LL"/table turn header lines off string = {H|V |*}. Z @@SSyntax10.Scn.Fnt ZParcElemsAllocST/left 0/right 0/nohead "*"/noline "*"/col "LL"/table H horizontal V vertical * all  tM'u @ CSyntax10.Scn.Fnt?Syntax10i.Scn.FntI/left 0/right 0/nohead "*"/noline "*"/col "LL"/table /nolines string B SSyntax10.Scn.Fnt ZParcElemsAllockl/left 0/right 0/nohead "*"/noline "*"/col "LL"/table turn separation lines off string = {L|R|B|T|H|V|*}. @SSyntax10.Scn.Fnt ZParcElemsAlloc/left 0/right 0/nohead "*"/noline "*"/col "LL"/table L left frame R right frame B bottom frame T top frame H horizontal separation V vertical separation * all  tM'zSyntax10.Scn.Fnt ZParcElemsAlloc5Syntax10i.Scn.Fnt  /left 0/right 0/nohead "*"/noline "*"/table /period string /left integer /right integer /bottom integer /top integer /grid integer `6^aSyntax10.Scn.Fnt ZParcElemsAlloc/left 0/right 0/nohead "*"/noline "*"/table first char redefines period (e.g. ",") left cell margin right cell margin bottom cell margin top cell margin cell width grid *)  tM0u `S  ZP g Z V=4P CDocumentation of Text Elements for Oberon Last Update:  Table of Contents Element Class Author Access M. Rammerstorfer AutoMenu M. Hof Balloon H. Mssenbck Clock M. Franz Dialogs M. Knasmller Directory H. Mssenbck Error M. Hausner Fold H. Mssenbck Font H. Mssenbck Graphic C. Szyperski Handler H. Mssenbck History H. Mssenbck Icon R. Griesemer Index M. Hof Info C. Steindl Line C. Szyperski Link H. Mssenbck Mark H. Mssenbck MetaFile S. Chiettini Open, AutoDir C. Steindl, M. Hof Picture C. Steindl, M. Hof Popup M. Franz Stamp C. Szyperski Style C. Szyperski Table C. Szyperski Tree M. Hof Version H. Mssenbck This documentation is a periodically updated collection of sections describing fully independent text elements. Each section is divided into two subsections: A textual introduction to the functionality of the particular elements, followed by a list of supported commands. For each command, the command name, its explicit and its implicit parameters are given. Potential implicit parameters are the caret, selections, the marked viewer, or the command viewer (i.e. the one from where the command was issued). Explicit parameters are described using a compact syntax explained in the tutorial Edit.Guide.Text. Companion documentation: Edit.Open Edit.Guide.Text - Tutorial and Release Notes Get newest version: Web.Open ftp://ftp.ssw.uni-linz.ac.at/pub/Oberon/LinzTools/Elem.Guide.Cod Access Elements Access Elements are an extension of popup elements and look like open elements. The main differences to open elements are the following of directories to open a file in another directory (without changing the current directory), and the different possibilities to open a file. command explicit parameters implicit parameters AccessElems.Insert (name | string | ^) caret Insert an element at the caret position. AutoMenu Elements AutoMenu Elements are an extension of popup elements. They can be spread arbitrarily over an Oberon text. If a text containing AutoMenuElems is opened with Edit.Open, all AutoMenuElems are copied automatically into the menu viewer. This allows the automatic extension of menus for particular texts. command explicit parameters implicit parameters AutoMenuElems.Insert caret Insert an element at the caret position. Balloon Elements Balloon elements offer balloon help (i.e., popup explanations) in texts. A balloon element contains a dictionary of names and their explanations (see below). The explanations can pop up on demand. Module BalloonElems also defines a frame handler that - if installed in text frames - produces the following behavior: when the user clicks at a name in this frame with the middle and right mouse button the name is looked up in the first balloon element of this frame's text (if the name is imported, it is looked up in the balloon elements of the imported module's text). If the name is found, the corresponding explanation is shown in a popup window as long as the right mouse button is pressed. If it is not found, it is looked up in a default dictionary named "Balloon.Text". If not found, the module name in the viewer's menu is prepended to the name before it is looked up in "Balloon.Text" again. If it is still not found there, the click is passed to the default handler of text frames. The custom handler is automatically installed when BalloonElems is loaded (see module HandlerElems to learn about the installation of custom handlers). Dictionary format Since a balloon element is an extension of a popup element, its dictionary is stored as the menu text of the popup element. It can be opened for editing with a middle-right click on the element. The dictionary has the format: Dictionary = {Name Explanation}. Name = string. Explanation = any text up to the next string or to the end of the file. Example dictionary: "Elem" A balloon element containing a dictionary of words and their explanations. "Other" ... ... command explicit parameters implicit parameters BalloonElems.Insert caret inserts an empty balloon element at the caret position. BalloonElems.Install explicitly loads the module BalloonElems thus installing the handler in module HandlerElems. BalloonElems.LoadDictionary reloads the dictionary "Balloon.Text" after it has been modified. Procedures - Popup (dict, beg, end) shows the stretch [beg..end[ from dict in a popup window as long as the right mouse button is pressed. - FrameHandler (f, m) is a custom handler that intercepts middle+right mouse clicks at some name and looks up the name in the dictionaries as explained above. This handler is defined as the current handler in HandlerElems during module initialization. Thus it is automatically installed in all frames that contain a handler element in their menu text. Clock Elements Analog clocks elements displaying the current time (whenever the machine is idle). command explicit parameters implicit parameters ClockElems.Insert [number] caret Insert a clock (with radius given in mm; default is 8) at the caret position. Dialog Elements Dialog elemts support incorporation of panels compatible with the Dialogs package into texts. The command DialogElems.Insert inserts a new dialog element into a text at the text caret position. Using the middle mouse button, a dialog element can be "opened" for editing in a dialog viewer. The command DialogElems.Update in the viewers menu can be used to make the modifications in the dialog permanent. Dialog elements can be used like ordinary dialogs: focus the element using the left mouse key and do everything what you would do with an ordinary dialog. command explicit parameters implicit parameters DialogElems.Insert ("^" | "*" | name) caret (plus marked viewer, if "*" is used) Inserts a dialog element sized to show the dialog stored in file "name". If a dialog viewer is marked, the command inserts the dialog of this viewer. Directory Elements Directory elements allow a user to conveniently switch between working directories. These elements are derived from popup elements and always show the current working directory. Note: these elements are currently only available on the Power Macintosh. User interaction. A middle click at a directory element pops up a list of path names, e.g., HD:Oberon:MyFolder (an absolute path name) or $Source (a relative path name starting in the directory that contains the Oberon application). By selecting one of the menu items the current working directory is switched to that path and is displayed in the directory element. If the selected menu item is "^", the directory path is taken from the most recent selection. The menu can be edited after a middle-right click at the element (in the same way as in popup elements). command explicit parameters implicit parameters DirElems.Insert caret inserts a directory element at the caret position. Error Elements Error elements can be used to translate error lists produced by a compiler into special marking elements within the source text. Since elements move when editing text, it becomes possible to edit a large number of errors at a time. Error elements are temporary elements and hence vanish automatically when storing a text. By clicking on an error element using MM, the element may be toggled between its (initial) compact form and its full form. In the compact form, it displays the error number. In the full form, the element displays the corresponding error message. In order for this function to work properly, the file OberonErrors.Text is required. This file contains the error code/error message pairs. command explicit parameters implicit parameters ErrorElems.Mark ("^" | error-list) marked viewer Takes the list of errors produced by a compiler (position, error code pairs) and inserts error marks into the marked text. If error marks were already present in that text, they are removed beforehand. ErrorElems.Unmark marked viewer Remove all error elements from the marked text. ErrorElems.LocateNext marked viewer, caret (in marked viewer) Locate the next error element starting the search at the caret position. If no caret is set in the marked viewer, the first error element is located. Fold Elements Fold elements can be used to hierarchically fold text pieces. Folding a text piece causes its replacement by another, usually shorter or empty text piece. Unfolding a folded text piece reveils the original text piece while hiding its replacement. A (partially) folded text may be compiled as if it where fully unfolded using a utility module Folds. Folds also includes the functionality of ErrorElems, as defined elsewhere in this documentation. Options such as the compiler or error message file to be used can be specified in a file Folds.Profile. command explicit parameters implicit parameters FoldElems.Insert selection Makes the selection foldable by inserting a pair of fold elements around it. The fold elements are in expanded state. FoldElems.InsertCollapsed selection Makes the selection foldable by inserting a pair of fold elements around it. The fold elements are in collapsed state. FoldElems.Expand marked viewer or command viewer Unfolds (expands) all folds in the specified viewer. FoldElems.Collapse marked viewer or command viewer Folds (collapses) all folds in the specified viewer. FoldElems.Marks ("^" | "on" | "off") marked viewer or command viewer Makes all fold elements in the specified viewer visible or invisible. FoldElems.Search selection, focus viewer Searches for the selected text pattern in the text of the focus viewer starting at the caret position. It searches also within folded parts and opens folds if necessary to display occurrences of the pattern. If no selection exists, the last search pattern is used again. If no caret is set, the search starts at the beginning of the text. FoldElems.Restore marked viewer or command viewer Restores all folds that were expanded during a FoldElems.Search command to their previous state. Folds.Compile ("*" [compiler-options]) marked viewer or command viewer Compiles the marked text containing folds. The compiler is started on the fully expanded view of the text. Folds.ShowError [caret] Shows the next error after the caret position. If no caret is set, the first error in the text is displayed. Folds.SetProfile Sets the options specified in the file Folds.Profile (which compiler and which error message file should be used; should warnings be displayed). SetProfile is done automatically at the beginning. If Folds.Profile is missing, default options are: Compiler.Compile, OberonErrors.Text, warnings displayed. Procedures ExpandAll(t, from, temp) expands all fold elements in text t if they are after the text position from. If temp is TRUE, the folds are only expanded temporarily and can be collapsed again with FoldElems.Restore. CollapseAll(t, modes) collapses all fold elements in text t if they are of a kind that is contained in the set modes. FindElem(t, pos, proc, e) searches text t starting at position pos. For every encountered text element procedure proc is invoked. If this procedure returns TRUE, the element is returned by FindElem as e. Switch(e) switches the fold element e from collapsed to expanded or vice versa. Twin(e) If (e, x) is a pair of fold elements, Twin(e) returns x. Font Elements Font elements allow a user to conveniently set the font family, font size, font style and color of a piece of text. They are derived from popup elements. User interaction. A middle click at a font element pops up a list of font families (e.g., Syntax, Courier, Math, ...), font sizes (e.g., 10, 12, 14, ...), and font styles (plain, bold, italic, mark [= bold + italic]). The selected text stretch will get the family, size or style chosen from the font menu. If the selected menu item is a name (e.g., red, blue, green) but not a valid font name, its color is used to set the color of the selected text stretch. Other attributes of the text stretch remain unchanged. The list of families, sizes, styles and colors can be edited after a middle-right click at the element (in the same way as in popup elements). command explicit parameters implicit parameters FontElems.Insert caret inserts a font element at the caret position (preferably in the menu of a viewer). Hint. It is a good idea to insert a font element in Edit.Menu.Text so that font selection is available in every text viewer. Graphics Elements Graphic elements support incorporation of graphs compatible with the standard Draw package into texts. A single command is provided by module GraphicElems in order to insert a new graphics. Using the middle mouse button, a graphics element can be "opened" for editing. As a result, a graphics viewer is opened displaying the graph. The command GraphicElems.Update in the viewer's menu can be used to propagate changes made to the graph back to the graphics element. Graphic elements support inplace editing: focus the element using the left mouse key and use standard Draw editing techniques within the activated graphics frame. command explicit parameters implicit parameters GraphicElems.Insert ("^" | "*" | name) caret (plus marked viewer, if "*" is used) Inserts a graphics element sized to show the graph stored in graphics file "name". If an open graphics viewer is marked, the command can be used to insert all or part of a displayed graph: if a selection exists in the marked graphics viewer's graph, only the selection is copied into the graphics element. Handler Elements Module HandlerElems allows a user to define a current handler. This handler is automatically installed in all text frames whose menu contains a handler element. Thus it is possible to intercept messages to text frames and to react to them in a specific way. Custom handlers typically handle only a few messages and forward others to the standard handler TextFrames.Handle. They can also be cascaded so that the current handler forwards messages to the previously installed handler and so on until the message finally gets to TextFrames.Handle (see procedure SetHandler below). command explicit parameters implicit parameters HandlerElems.Insert caret inserts a handler element at the caret position (should be in a menu frame). HandlerElems.ListHandlers prints a list of all handlers installed with SetHandler. This is useful to see which handlers are currently installed. HandlerElems.ResetHandlers resets the current handler to TextFrames.Handle. Procedures - SetHandler (name, new, old) sets the current handler to new. The caller of SetHandler is expected to give a name for new (to be used by ListHandlers). On exit, old contains the previously installed handler. This can be used to make new forward messages to old. Hints - It is a good idea to add a handler element to Edit.Menu.Text so that all text viewers will contain it in the future. Since a handler element looks exacly like a popup element, one of the popup elements in Edit.Menu.Text can be replaced by a handler element. HistoryElements History elements can be used to maintain the change history of a text. This is done by marking changed text regions with virtual colors between 16 and 255. Using the history element as a popup menu the user can make one of these virtual colors red while the other virtual colors are displayed as black. History elements are used as follows: After inserting a history element anywhere into a text (HistoryElems.Insert) the element behaves like a popup element. When it is opened with a MM+MR click it shows the text 16: The user can add a description of the text region to be marked, e.g. 16: modifications on April 21 Now he can mark arbitrary regions in the text with red color. All red regions are considered having the virtual color 16. If the user wants to mark a different text region with a new virtual color, he reopens the history element (MM+MR click) and adds a new line, e.g.: 16: modifications on April 21 17: modifications on Mai 2 When he now clicks on the history element with the middle mouse button and switches to color 17, all text having the color 16 is displayed in black while text having the color 17 is displayed in red (so far, there is no text with color 17). The contents of the color element changes to 16: modifications on April 21 17: modifications on Mai 2 Now the user can again mark text pieces in red thus assigning the virtual color 17 to them. Using the history element he can always make one of the virtual colors visible. command explicit parameters implicit parameters HistoryElems.Insert caret Inserts a history element at the caret position. HistoryElems.ShowMark caret Sets the caret to the next text piece colored in red. HistoryElems.ChangeColor oldColor newColor Changes all text pieces in the marked viewer from oldColor to newColor. The colors are specified by their color numbers (1..15). This command can be used to make several virtual colors visible at the same time. First the user switches to one of the virtual colors so that it is displayed in red. Then he changes it to blue, say, using HistoryElems.ChangeColors 1 3. Finally he selects a new virtual color to be displayed in red. Icon Elements Display a small "walking sysiphus" icon. By clicking on such an icon using MM, a screen saver is started. Using an icon editor, the file IconElems.Icon may be changed or replaced to install a different animated icon. command explicit parameters implicit parameters IconElems.Insert caret Inserts a new Icon Element at the caret position. File required: IconElems.Icon Info Elements Info elements are similar to popup menus. When clicking on the element with the middle mouse button, it responds by showing a text. This text contains additional information about the text in which the element is inserted. A typical application is a source module where you would like to add some informations about the programmer and the programming task to the document. command explicit parameters implicit parameters InfoElems.Insert caret Inserts a new Info Element at the caret position. Hints The module Find exports a command called AllInfo which can be very useful in combination with InfoElems: Find.AllInfo ^  searches within the InfoElems of the files specified with Find.Domain. The selection must be of the form item = searchPattern where item is one of {"Title", "Author", "Abstract", "Keywords", "Version", "From", "Until", "Hints", "Changes"}, searchPattern must match exactly or contain asterisks. E.g.: Find.AllInfo Author = *CS* Contents of a new InfoElem: "Title": no title "Author": no name "Abstract": no abstract "Keywords:": no keywords "Version": no version "From": 28.10.94 16:59:45 "Until": no date (use StampElems.Insert) "Hints": This text can again contain arbitrary text elements! Line Elements Line elements support horicontal or vertical lines within a text. A single command is provided to insert new line elements. The insertion command takes certain parameters such that line elements can be set to automatically adapt in width and height. command explicit parameters implicit parameters LineElems.Insert ("^" | ( ("auto" | "tab" | W) ("auto" | H) ) ) caret Inserts a line of given or automatically adopted width and height into a text. Width and height may be set in units of 1/10 mm. Otherwise, the width may be set to extend to the end of the current line ("auto") or to the next tabulator position ("tab"). The height may be set to equal the paragraphs line height (determined by the parc's line attribute). Link Elements This module provides two kinds of text elements: link elements and link menus. - A link element represents a hypertext link to a mark element (MarkElems). When the user middle-clicks at the link element the text around the associated mark element is displayed. A middle click at the mark element leads one back to the link element. - A link menu is an extension of a popup element (PopupElems). It can be used in the menu bar of a viewer. When the user clicks at a link menu, a list of all mark elements in the viewer pops up. By selecting an entry the user can get to any of the mark elements quickly. The list of marks is collected automatically. For example, the user can invoke the command MarkElems.MarkProcs to insert mark elements in front of all procedure names in procedure declarations. The link menu will then show all these mark elements and the procedure names following them in the text. Of course the user can also insert mark elements explicitly (e.g., in front of type names or variable names). These marks will also be shown in the link menu together with the names following them in the text. User interaction. A middle click at a link element displays the text around the associated mark element. If the mark element is in the same text as the link element, the text is scrolled to the mark element's position. If it is in a different text, a new viewer is opened showing the mark element and its surrounding text. A middle-right click at a link element opens a viewer showing the value of the link target (expressed by the tuple ). This text can be edited and stored back to the element with LinkElems.Update from the viewer's menu. A middle click at a link menu pops up a list of all marks in the viewer's text. By selecting a specific entry the text is scrolled to that mark. command explicit parameters implicit parameters LinkElems.Insert caret inserts a link element at the caret position. The target point of the link is taken from the most recent selection. If a mark element is selected the link goes to that mark element otherwise a new mark element is inserted at the beginning of the selection. LinkElems.InsertMenu caret inserts a link menu at the caret position. Link menus should only be used in the menu bar of a viewer. LinkElems.Update updates an edited value. See also "middle-right click" above. Procedures New(f, k) creates and returns a link element that leads to the mark element with the key k in file f. FollowLink(f, k, lf, le) follows as link to a mark element with the key k in file f. The frame containing the link element must be given in lf and the link element itself in le. These two parameters are used to establish a backwards link. Hint It is a good idea to insert a link menu in Edit.Menu.Text, so that a list of all marks can be popped up in all text viewers. Picture Elements Picture elements display a Picture (see also Pictures.Text). It supports all picture formats registered with module Pictures. command explicit parameters implicit parameters PElems.Insert "name of picture file" w h caret insert a picture element with the given picture at the caret position in the specified size. The default size is taken if no size is specified. If only a width is given the height is scaled accordingly. PElems.Paste caret and clipboard contents insert a picture element with the picture stored in the clipboard at the caret position. PElems.Copy current selection Copies the picture of the selected picture element into the clipboard. PElems.Resize width height current selection Sets the size of the selected picture element. Attention: In order to read other picture formats (e.g. GIF), these formats have to be registered with module Pictures (e.g. for GIF pictures you have to execute GIF.Install). Mark Elements Mark elements mark a certain position in a text. They are typically used as the target of hypertext links (LinkElems) or as bookmarks. They can be referenced via a numeric key. User interaction. If one got to a mark element by following a hypertext link, a middle click at this element will lead one back to the source of the link, i.e., to the corresponding link element. A middle+right click will open a viewer showing the element's key. The key can be edited and stored back to the element with MarkElems.Update from the viewers menu. This may be useful in rare cases to resolve key ambiguities. command explicit parameters implicit parameters MarkElems.Insert caret inserts a mark element with a new key at the caret position. MarkElems.Update updates an edited key value. See also "middle click" above. MarkElems.ShowNext caret searches for the next mark element after the caret position and sets the caret to it. MarkElems.MarkProcs marked viewer inserts mark elements in front of all procedure declarations in the marked viewer. This is useful in the context of link menus (see LinkElems.Menu) which automatically create links to all mark elements in a text. Procedures New() returns a new and initialized mark element that has not been inserted into a text yet. Index Elements Index elements work similar to mark elements. They also mark a text position which may be used as the target of hypertext links (LinkElems) or as bookmarks. The added functionality is their ability to automatically create an index of the corresponding text. User interaction. A middle click will open a viewer showing the text associated with this element. The associated text can be edited and stored back to the element with IndexElems.Update resp. MarkElems.Update from the viewer menus. command explicit parameters implicit parameters IndexElems.Insert caret inserts an index element with a new key at the caret position. The current selection is taken as the associated text. If there is no current selection, the associated text is empty. IndexElems.Update updates the edited associated text. See also "middle click" above. IndexElems.Hide marked viewer hides all index elements in the marked viewer. IndexElems.Show marked viewer redisplays all index elements in the marked viewer. IndexElems.Index server-name "*" {option} Generates an Index for the marked viewer. As a side effect, text is printed as well. For a detailed description of available options read the information on Edit.Print. The index is displayed in a separate viewer. It has the following format: tab pagenumber {"," pagenumber }. MetaFile Elements MetaFileElems display Windows-MetaFiles (under Windows only). MetaFiles contain Windows-GDI calls in a binary coded format. They can be displayed on the screen, on the printer, or written into files. command explicit parameters implicit parameters MetaFileElems.Insert name of metafile caret reads the meta file from the specified file and inserts a MetaFile element at the caret position. MetaFileElems.Paste caret and clipboard contents reads the meta file from the clipboard and inserts a MetaFile element at the caret position. MetaFileElems.Copy selection copies the selected MetaFile element into the clipboard. Attention: when inserting metafile elements from a file, this file should contain a placeable metafile, which is a quasi-standard with enhanced functionality. Most Windows-applications use this standard when storing metafiles. Open Elements Open elements can be used to conveniently open files. Open elements are popup elements that perform the command 'Documents.Open' on the selected item. Depending on the extension of the selected item, different open commands are called (e.g. Dialog.Open for *.Dlg, System.Open for *.Tool,...). The predefined mappings of extensions to commands is taken from 'Documents.Profile'. If the selected item is not a file but a directory, the command System.ChangeDir is executed. command explicit parameters implicit parameters OpenElems.Insert caret inserts an open element at the caret position. AutoDir Elements are a special kind of open elements which automatically collect all the files from the current directory that match the name of the element (e.g. "*", "*.Mod", "*.Text"). command explicit parameters implicit parameters OpenElems.InsertAutoDir caret inserts an AutoDir element at the caret position. Popup Elements Popup elements respond to a middle mouse click by showing a text of lines (usually commands) that can be selected (executed) by moving the mouse up and down. The default behavior is to interpret the selected line as a command and execute it. Oberon.Par is initialized with the viewer and the frame containing the menu as well as with the menu text and the position of the command in this text. If the menu contains just a single line it does not pop up but this line is selected by default. If the user clicks at the menu without moving the mouse the most recently selected line is assumed to be still selected. If the selected line starts with another element (e.g., a link element) this element receives a middle-click message, i.e., it is executed. If the selected line is a popup element (i.e. it is the first element in this line), a middle left interclick opens and closes this popup element. Editing a menu. A middle+right click at a popup element opens a viewer that displays the menu text. This text can be edited (commands can be added or removed) and stored back to the element by executing the command PopupElems.Update from the menu bar of the viewer. The menu name can be changed by editing the name of the edit viewer. command explicit parameters implicit parameters PopupElems.Insert (name | string | ^) inserts a popup menu at the caret position. The command argument specifies the menu name. PopupElems.InsertCmd inserts a command menu at the caret position. The command argument specifies the menu name. PopupElems.InsertMenu (name | string | ^) inserts a small popup menu at the caret position. The height of a small menu is chosen such that the menu fits into the menu bar of a viewer. The command argument specifies the menu name. PopupElems.Toggle If executed from the menu bar of the menu edit viewer, the command toggles between a small and a large menu element. PopupElems.Update can be executed from the menu bar of the menu edit viewer. It stores the text in this viewer as the menu text of the edited popup menu. PopupElems.HelpText ("On" | "Off") Specifies if the help text (if any exist) will be shown. PopupElems.ShowCommands ("On" | "Off") Specifies if the command name or an alias of the command will be shown in the popup menu. Procedures - MeasureMenu(m) computes the metrics of the popup window for the menu text. This procedure has to be called whenever the menu text has been modified. Hints for implementors of subclasses - Intercepting the menu selection: In subclasses of popup menus the menu selection can be intercepted by reacting to the execute message (ExecMsg) that is sent to the menu when one of its lines is selected. This message contains the position (origin) of the selected line in the menu text. - Popup menus with icons: A popup element usually displays a string (its name). If this string is empty an empty element box is drawn. A subclass of popup elements can then draw an icon into the menu box. Stamp Elements Display the date of the most recent store operation on the text containing the element. (After insertion, StampElems display the current date.) The insert command takes an optional font name which is used to preset the font of the inserted element. command explicit parameters implicit parameters StampElems.Insert [name] caret Inserts a new stamp element, where the name indicated the font to be used. (If name is omitted, the default font is used.) Style Elements Style Elements extend standard Parcs by adding a name and automatic conformance of equally named parcs within a text. For example, a parc named "heading" may be set to format a section heading. Then, all parcs with that name use and maintain the same format as changes are propagated automatically. When copying a style parc from one text to another the behaviour of the copied parc depends on the target text. If it already contains a style with that name, the copied parc will adopt itself to that style. Otherwise, the copied parc defines a new style. Likewise, a style parc may be renamed. If it is renamed to a style that already exists in the containing text, the parc will adopt to that style, while otherwise it introduces a new style. Some examples for style parcs follow below. Note that the Syntax8.Scn.Fnt file should be available to get nicely labled style parcs. command explicit parameters implicit parameters StyleElems.Insert ("^" | name | string) caret Insert a new style parc with the given name at the caret position. A quoted string may be used to assign names consisting of multiple words. StyleElems.Rename ("^" | name | string) selected parc Renames the selected parc to the given name. Table Elements Table Elements are automatically formatted tables created from raw, unformatted data. A plain text separated by tabulator characters into columns and by carriage returns into rows can be used to define the table. Furthermore, a certain set of options may be used to modify the default formatting of the table. Clicking on a table element using MM opens an viewer such that the table contents can be edited. Tables may contain arbitrary text elements, including tables. However, elements incorporated into a table are frozen as is, i.e. messages broadcasted to all visible elements in a text frame are not passed to elements nested into a table. Hence, only static elements should be inserted into tables. Starting from a defining text containing arbitrary strings separated by tabulator and carriage-return characters, a table is constructed. Tabulators separate columns, carriage-returns separate rows. The separated strings form the contents of table cells. Each such string may in turn contain arbitrary text elements and especially it may contain nested tables. The defining text is bound to a table element and can be edited by clicking on a table with the middle mouse button. In return, a standard text viewer is opened containing an update command in its menu bar. The syntax of the defining text is as follows, table options will be defined later. table = {option} "/table" {line}. line = cell {TAB cell} CR. cell = ["#" | "&"] . A string starting with a digit, a period (.), or a sign (+ or -) is considered numeric, otherwise it is considered nonnumeric. A number sign (#) prefixing a string is suppressed and enforces numerical interpretation; likewise, an ampersand (&) prefixing a string is suppressed and enforces nonnumerical interpretation. The default table formatting causes all cells in the first column to be formatted left flush. In all other columns, the default format for numeric cells is period-aligned and that for nonnumeric cells is centered. All cells in a row are by default aligned to a common base line. Also, the default format causes the table to be framed and separating lines between rows and columns to be drawn. Finally, for a table with more than two rows or two columns the first row or column separatation line is drawn using two parallel lines, respectively. Most of the default formats can be changed using the provided option set. For table elements the printing dilemma discussed in section 1.5 needs to be reconsidered. Following the strategy developed for texts, a table would be recasted when printing. However, one of the primary attributes of a table are its measures, i.e. the space taken for individual cells of the table and the arrangement of the cells with respect to each other. It is not acceptable that a table gets completely redimensioned when printed. Hence, for table elements a different printing strategy has been choosen: the displayed table on the screen follows - down to the character level - the metrics of the printer fonts. The resulting screen image looks a bit distorted, however, the displayed measures correspond as closely as possible to the printed ones. The following table gives an overview over available table formatting options.  option effect (measures in 1/10 mm) argument values                    *) A parc at the beginning of the table defining text introduces a minimal cell height as well as a cell height grid (if the grid option of the parc is set) Overview of TableElems Options command explicit parameters implicit parameters TableElems.Insert ["^" | name] caret Insert a table defined by the given text at the caret position. If no defining file is given, or the table definition is syntactically erroneous, an empty table is inserted. TableElems.Update (to be called from menu frame) Take the viewer's content frame's text as defining text and update the associated table element. Version Elements Version elements simplify the handling of multiple versions of a module in the same source file. Text pieces that differ from one version to the other are enclosed in version elements which look like angle brackets. When the user middle-clicks on the opening bracket a popup menu with a list of version names appears. Selecting one of the names replaces the bracketed text with the text that is stored for the selected version. Example: Assume that we have two versions of a module: one for Windows and one for the Mac. In the Windows version a declaration might read CONST delimiter = "\"; while in the Mac version it should read CONST delimiter = ":"; Select the declaration text in the Windows version and execute VersionElems.Insert Windows. This will insert version elements around the selection. Now middle-right click on the opening bracket. Since this bracket is derived from a popup element, an edit viewer will be opened showing the text "Windows". Add a new line with the text "Mac" and click PopupElems.Update. A middle-click on the opening bracket now shows a popup menu with the two entries "Windows" and "Mac". Select "Mac". The text between the brackets disappears and you can enter the declaration as it should be in the Mac version. You can switch between the two versions using the popup menu as described above. When you select a version from the popup menu, all version elements in the text will switch to this version. Alternatively you can use VersionElems.SetVersion Windows to set the version of all version elements to Windows. In order to delete a version v from an element, switch the element to a version other than v, open the menu text and textually delete the entry v. command explicit parameters implicit parameters VersionElems.Insert versionName selection inserts a pair of version elements around the current selection.