Syntax12b.Scn.Fnt\ParcElemsAlloc Syntax24.Scn.FntSyntax10.Scn.FntSyntax12.Scn.FntStampElemsAlloc16 Sep 98 Z   9  Z0*LineElemsAlloc LinkElemsAlloc*X*6%*vXSyntax10b.Scn.Fnt*X*X*IY*zY*Y*kY*Y*Y* Z*"?Z* copy =>P @ NameCmdPar=> move => @ NameCmdPar=> deleteMNNN88f8\ Chapter2 Chapter2([8#Syntax10.Scn.FntDynamic Attributes\ Floating2*<[[*<[] pNameCmdElemTools.SetAttrParstaticresult Value '%staticresult.Value %s.Value'AddpNamesCmdPar#Syntax10.Scn.FntX@wpNamestaticresultCmdPar` pNameCmdElemTools.SetAttrPard DynValue '%d.DynValue %d.Value'AddpNamedCmdParDynValueXXXXXXX#Syntax10.Scn.FntX *\  tp:`NameCmdParMenuLockedPanel.Menu.TextSyntax10.Scn.Fnt>@ TextFieldElemsNewNamenameCmdPar  P4ListElemsNewNametypeCmdPar#Syntax10.Scn.Fnt**Boolean String Integer Real LongReal Text 0StaticTextElemsNewNameCmdParName: P4ButtonElemsNewNameCmdElemTools.AddAttrPar'%name.Value' '%type.Value'iAdd P4NameCmdElemTools.DelAttrPar'%name.Value'iDelB4 \ Chapter2<[8#Syntax10.Scn.FntCommands\ Floating2D8#Syntax10.Scn.FntElemTools.SetAttr 2\ Floating3  l3`[NametxtCmdParStaticText`[@ NameCmdElemTools.SetAttrPartxt Align #CaptionL`[@ NameCmdElemTools.SetAttrPartxt Align #CaptionC`[@ NameCmdElemTools.SetAttrPartxt Align #CaptionR  @ NameCmdElemTools.SetAttrPartxt Value #CaptionValue1  @ NameCmdElemTools.SetAttrPartxt Value #CaptionValue2  @ NameCmdElemTools.SetAttrPartxt Value StaticText Align LeftDefault\ Floating2}U8#Syntax10.Scn.FntElemTools.DelAttr  \ Floating3*([\ Floating2ek8#Syntax10.Scn.FntElemTool.Align  Floating3\ O\ Floating28#Syntax10.Scn.FntElemTools.SetSize  \ Floating3\  \ Floating3   "NameCmdParButton`[P4NameCmdParButton\ Floating28#Syntax10.Scn.FntElemTools.LogParam Floating3   @ NameCmdElemTools.LogParamPar#Cmd '#Caption'Test it !   \ Floating28#Syntax10.Scn.FntElemTools.ParamToCaret Floating3z   0 NameCmdPar~Syntax10i.Scn.Fnt5 0StaticTextElemsNewNameCmdParHTML-HelperSyntax10.Scn.Fnt @ ButtonElemsNewNameCmdElemTools.ParamToCaretParbold @ NameCmdElemTools.ParamToCaretParitalic @ NameCmdElemTools.ParamToCaretParimage @ NameCmdElemTools.ParamToCaretParlink @ NameCmdElemTools.ParamToCaretParunderline @ NameCmdElemTools.ParamToCaretParmark 1JGJ J1G1@ 0%А  0\ Floating28#Syntax10.Scn.FntElemTools.ShowTabs   Floating3\ Floating28#Syntax10.Scn.FntElemTools.SetTabPos \ Floating3\ Chapter2[8#Syntax10.Scn.Fnt Elems.Panel Floating2(*<[*<[9\  Tp19NameCmdParMenuLockedPanel.Menu.Text-ESyntax10.Scn.Fnt ZAreaButtonElemsNewNameCmdElemTools.SetSizeParw hgSyntax10.Scn.FntP4P4PElemsAllocBM.6(ʦ?i???i????i?iiiiii?i?i?i???i?????????i????????i??i?ii?i?i?i????i???????i???????i????i?iiiiii?i??ii?i?i?i?iii?iiiiiiiiiiii?iiiiiii?iiiiiii?iiiiii?i???i????i?iiiiii?i瓓?i罓?i?i???i????i?iiiiii?i瓽?i罽?i?i???i????i?iiiiii?i?i?i ]NameCmdElemTools.SetSizeParwgSyntax10.Scn.FntP4P4PElemsAllocBM.6(ʦ?i???i????i?iiiiii?i?i?i???i?????????i????????i??i?ii?i?i?i????i???????i???????i????i?iiiiii?i??ii?i?i?i?iii?iiiiiiiiiiii?iiiiiii?iiiiiii?iiiiii?i???i????i?iiiiii?i瓓?i罓?i?i???i????i?iiiiii?i瓽?i罽?i?i???i????i?iiiiii?i?i?i ]NameCmdElemTools.SetSizeParhgSyntax10.Scn.FntP4P4PElemsAllocBM.6(ʦ?i???i????i?iiiiii?i?i?i???i?????????i????????i??i?ii?i?i?i????i???????i???????i????i?iiiiii?i??ii?i?i?i?iii?iiiiiiiiiiii?iiiiiii?iiiiiii?iiiiii?i???i????i?iiiiii?i瓓?i罓?i?i???i????i?iiiiii?i瓽?i罽?i?i???i????i?iiiiii?i?i?i [NameCmdElemTools.AlignParrightgSyntax10.Scn.FntP4P4PElemsAllocBM.6(ʦ?i???i????i?iiiiii?i?i?i???i?????????i????????i??i?ii?i?i?i????i???????i???????i????i?iiiiii?i??ii?i?i?i?iii?iiiiiiiiiiii?iiiiiii?iiiiiii?iiiiii?i???i????i?iiiiii?i瓓?i罓?i?i???i????i?iiiiii?i瓽?i罽?i?i???i????i?iiiiii?i?i?i \NameCmdElemTools.AlignPardowngSyntax10.Scn.FntP4P4PElemsAllocBM.6(ʦ?i???i????i?iiiiii?i?i?i???i?????????i????????i??i?ii?i?i?i????i???????i???????i????i?iiiiii?i??ii?i?i?i?iii?iiiiiiiiiiii?iiiiiii?iiiiiii?iiiiii?i???i????i?iiiiii?i瓓?i罓?i?i???i????i?iiiiii?i瓽?i罽?i?i???i????i?iiiiii?i?i?i ZNameCmdElemTools.AlignParcentergSyntax10.Scn.FntP4P4PElemsAllocBM.6(ʦ?i???i????i?iiiiii?i?i?i???i?????????i????????i??i?ii?i?i?i????i???????i???????i????i?iiiiii?i??ii?i?i?i?iii?iiiiiiiiiiii?iiiiiii?iiiiiii?iiiiii?i???i????i?iiiiii?i瓓?i罓?i?i???i????i?iiiiii?i瓽?i罽?i?i???i????i?iiiiii?i?i?i ^NameCmdElemTools.AlignParupgSyntax10.Scn.FntP4P4PElemsAllocBM.6(ʦ?i???i????i?iiiiii?i?i?i???i?????????i????????i??i?ii?i?i?i????i???????i???????i????i?iiiiii?i??ii?i?i?i?iii?iiiiiiiiiiii?iiiiiii?iiiiiii?iiiiii?i???i????i?iiiiii?i瓓?i罓?i?i???i????i?iiiiii?i瓽?i罽?i?i???i????i?iiiiii?i?i?i YNameCmdElemTools.AlignParvcentergSyntax10.Scn.FntP4P4PElemsAllocBM.6(ʦ?i???i????i?iiiiii?i?i?i???i?????????i????????i??i?ii?i?i?i????i???????i???????i????i?iiiiii?i??ii?i?i?i?iii?iiiiiiiiiiii?iiiiiii?iiiiiii?iiiiii?i???i????i?iiiiii?i瓓?i罓?i?i???i????i?iiiiii?i瓽?i罽?i?i???i????i?iiiiii?i?i?i \NameCmdElemTools.AlignParleftgSyntax10.Scn.FntP4P4PElemsAllocBM.6(ʦ?i???i????i?iiiiii?i?i?i???i?????????i????????i??i?ii?i?i?i????i???????i???????i????i?iiiiii?i??ii?i?i?i?iii?iiiiiiiiiiii?iiiiiii?iiiiiii?iiiiii?i???i????i?iiiiii?i瓓?i罓?i?i???i????i?iiiiii?i瓽?i罽?i?i???i????i?iiiiii?i?i?i @Bm ListElemsNewNameCmd#ValuePar@Syntax10.Scn.Fntq qStaticTextElemsNewNameCmdParAreaButtonq qNameCmdParButtonq qNameCmdParCheckBoxq qNameCmdParColorq qNameCmdParFrameq qNameCmdParListq qNameCmdParPanelq qNameCmdParPasswordq qNameCmdParRadioButtonq qNameCmdParStaticTextq qNameCmdParTextAreaq qNameCmdParTextFieldSyntax8.Scn.FntAreaButtonElems.Insert ButtonElems.Insert CheckBoxElems.Insert ColorElems.Insert FrameElems.Insert ListElems.Insert PanelElems.Insert TextFieldElems.InsertPW RadioButtonElems.Insert StaticTextElems.Insert TextAreaElems.Insert TextFieldElems.Insert ZSyntax12i.Scn.Fnt@ StaticTextElemsNewNameCmdParInsert @ NameCmdParAlignmentSyntax10b.Scn.Fnt0 ButtonElemsNewNameCmdPanel.OpenParInspector.PanelInspector0 NameCmdDocuments.OpenParDynamicAttributes.PanelDyn. Attributes@FrameElemsNew  NameCmdParTabStop@`P4TextFieldElemsNewNametabposCmdElemTools.SetTabPosPar#Value S NameCmdElemTools.SetTabPosParlastLastS NameCmdElemTools.SetTabPosParfirstFirstqNameCmdParPos:@`P4 NameCmdElemTools.ShowTabsParononP4 NameCmdElemTools.ShowTabsParoffoffIP4PopupElemsAlloc?KSyntax10.Scn.FntLinkElemsAllocElems.Text[b wv w 0wX9w9wXXww9*FFGD00# x z oz K   \ Chapter2[\8#Syntax10.Scn.FntMessages\ Floating28#Syntax10.Scn.Fnt Elems.AttrMsg\ Floating3M  Syntax8i.Scn.Fnt a  5 8#Syntax10.Scn.Fnt EnumNames A 8#Syntax10.Scn.Fnt Elems.AttrMsg  Zw  J\ Floating3  nRE(5<  A\ Chapter2m\8#Syntax10.Scn.Fnt Procedures\ Floating2c8#Syntax10.Scn.FntElems.CreateElem4 Floating3\ Floating28#Syntax10.Scn.FntElems.GetBooleanK Floating3 Floating28#Syntax10.Scn.FntElems.SetBooleanG Floating3 Floating28#Syntax10.Scn.FntElems.GetClassB Floating3h Floating28#Syntax10.Scn.FntElems.NamedElemF\ Floating3o8#Syntax10.Scn.FntElems.CmdContexti\ Floating28#Syntax10.Scn.FntElems.UpdateElem$ Floating3\ Floating2  k>8#Syntax10.Scn.FntElems.NamedElem?8#Syntax10.Scn.FntElems.GetString&8#Syntax10.Scn.Fnt Elems.Done"98#Syntax10.Scn.FntElems.SetString.8#Syntax10.Scn.FntElems.UpdateElem< Z Normal Z0*W Elems Christoph Ertl,   Contents  0 Abstract  1 Introduction  2 Handling of Elems  1.1 Inserting Elems  1.2 Resizing Elems  3 Working with PanelElems  4 Basic Elems  4.1 AreaButtonElems  4.2 ButtonElems  4.3 CheckBoxElems  4.4 ColorElems  4.5 FrameElems  4.6 ListElems  4.7 PanelElems  4.8 PasswordElems  4.9 RadioButtonElems  4.10 StaticTextElems  4.11 TextAreaElems  4.12 TextFieldElems  5 Macros  6 How to control Elems  6.1 Inspector.Panel  6.2 Dynamic Attributes  6.3 Commands  6.4 Elems.Panel  6.5 Messages  6.6 Procedures    0 Abstract Textelements in Oberon normally have a fixed size depending on the font and/or their caption. They are further standalone and don't reference to other elements. The module Elems extends these textelements with the following functionality: - resizing by the user. - Attributes of other Elems (in the same context) can be referenced with a uniform interface (via messages). The module PanelElems extends this funtionality with additional capabilities: - any textelement can be placed in a PanelElem (overlapping is allowed). - PanelElems are also textelements, which makes nesting possible. As extensions of the class Elems several textelements such as StaticText, TextField, Checkbox, Radiobutton, ..., were implemented. With this extensions graphical user interfaces can be realized without programming or with simple and small programs. Note that no changes in the Oberon System had to be made.  1 Introduction One of the major advantages of the PanelElems is that they are designed to hold common textelements. A new textelement can be used in a panel without changes. The other side is that the Elems, implemented for usage with PanelElems, also can be placed in an Oberon text. Another advantage are the macros which enable the user to create complex parameters for any Oberon command.  2 Handling of Elems  2.1 Inserting Elems Each Elem can be inserted by setting the caret and then calling it's insert command (e.g. ButtonElems.Insert). Syntax for inserting commands: ElemName.Insert name cmd par W H [Elem_specific_pars] W and H are only used if greater than 0. Sample: ButtonElems.Insert "" "System.Time" "" 100 0 "MyCaption" ~ A more comfortable way is to use the Elems.Panel and then the Inspector.Panel  2.2 Resizing Elems Each Elem has a sensitive area at the bottom right corner. By clicking into this area with MM and dragging the mouse, the Elem can be resized. Interclicking with ML or MR cancels resizing. Sample:   3 Working with PanelElems  The mouseclicks inside a panel fit to the Oberon mouseclicks. e.g: left sets the cursor, right selects an elem, ... click Action  left Sets the cursor right Selects an elem If no elem is hit a selection with a rubber band can be made middle Moves an elem if hit at its border Moves the selection if no elem is hit Resizes an elem if hit at its bottom-right corner Forwards the click to the hit elem left + middle Copies a selection to the cursor position right + middle Copies the current selection to the cursor position Moving the selection is also possible via the arrow-keys. The selection is moved one pixel. Therefore an exact positioning is possible.  4 Basic Elems  Each Elem has several attributes. The standard attributes are the following. Cmd: The command to be executed. Macros are possible. Par: The parameters of the command 'Cmd'. Macros are possible. Locked: With this attribute enabled the Elem cannot be resized. Some elems do have additional behavior if locked.   4.1 AreaButtonElems   Insert: AreaButtonElems.Insert name cmd par W H Generator: AreaButtonElems.New Sample: AreaButtonElems.Insert "" "System.Time" "" 0 0 An AreaButton is a button which can have various looks. To modify its look the AreaButton must be unlocked. In this mode the behavior of an AreaButton is like that of a PanelElem. To use the button it must be locked. Attributes Locked: Indicates the behavior.  4.2 ButtonElems   Insert: ButtonElems.Insert name cmd par W H caption Generator: ButtonElems.New Sample: ButtonElems.Insert "" "ElemTools.LogInput" "#Caption" 200 0 "TestButton" Clicking on a Button with MM starts the execution of the command given in the attribute 'Cmd'. Moving the mouse outside the Button or interclicking with MR or ML cancels the execution. Attributes Caption: The caption to be displayed.  4.3 CheckBoxElems   Insert: CheckBoxElems.Insert name cmd par W H checked Generator: CheckBoxElems.New Sample: CheckBoxElems.Insert "" "ElemTools.LogInput" "#Value" 0 0 "Y" A CheckBox represents a value which can be 'on' or 'off'. Clicking on a CheckBox with MM toggles the Value and starts the execution of the given Cmd. Moving the mouse outside the CheckBox or interclicking with MR or ML cancels the execution and the value is not toggled. Attributes Value: Indicates whether the Elem is 'on' or 'off'.  4.4 ColorElems   Insert: ColorElems.Insert name cmd par W H currentColor nrOfColors Generator: ColorElems.New Sample: ColorElems.Insert "" "Edit.ChangeColor" "#Value" 0 0 1 16 Clicking on the ColorElem causes a colortable to be opened. From this table a color can be selected. Clicking only inside the elem without moving the mouse to the table selects the previous set color. Attributes Value: The current set color (is also displayed inside the elem). NrOfColors: 16 or 256  4.5 FrameElems   Insert: FrameElems.Insert name cmd par W H 3D Generator: FrameElems.New Sample: FrameElems.Insert "" "" "" 0 0 "Y" Displays a frame. Useful only inside of PanelElems. This elem can be used to make logical groups of elems visible. Attributes Cmd: Not used. Par: Not used. 3D: Indicates whether the frame should be drawn in 3D style.  4.6 ListElems     Insert: ListElems.Insert name cmd par W H Generator: ListElems.New Sample: ListElems.Insert "" "Documents.Open" "'#Value'" Attributes Cmd: Command to be executed if a line is clicked with MM. Scrollbar: Indicates the presence of a scrollbar. Popup: If set the list pops up if it is clicked with MM. Combo: Behaves like popup, additionally the editing of the value is possible. Locked: If not set the contents of the list can be edited using MM + MR. Value: Currently activated line. Note !!: setting this Attribute causes the activation of a line holding this value. The containing text isn't changed. ValueT: The list's text. Line: The current line (Value represents the string at this line). ComboV: The text of the combo field as string. ComboVT: The text of the combo field as text. Sel: Selected lines as string (separated with blanks). SelT: Selected lines as text (separated with CR). PopupH: Indicates the maximal height of the popup-list in pixels. The size is calculated automatically until PopupH is reached. The width also depends on the text inside. The module ListElems provides a command called 'ListElems.MoveLine'. With this command simple operations on list lines are possible. ListElems.MoveLine 'fromListName' 'toListName' 'value' Deletes the line containing 'value' in the first list and appends a line with 'value' to the second one. If one list name is not given the action to this list is suppressed. Therefore three different behaviors are possible.  parameter behavior  Move 'A' 'B' '#Value' moves current line from list A to list B Copy '' 'B' '#Value' inserts '#Value' into list B Delete 'A' '' '#Value' deletes current line from list A Example:   4.7 PanelElems   Insert: PanelElems.Insert name cmd par W H Generator: PanelElems.New Sample: PanelElems.Insert "" "" "" 50 100 A Panel can hold textelements (although there exist some exceptions) and they can be placed freely. They also may overlap. Further information is found in the chapter 'Working with PanelElems'. Attributes Cmd: Command to be executed when the panel is loaded. The context is set to the panels text, so parameters can refer elems placed inside the Panel. Border: The width of the border. Menu: Specifies a filename which should be used as menu. This attribute is a dynamic attribute, which must be added as described in the chapter 'Dynamic Attributes'. Locked: If set to 'on' the contents of the panel cannot be changed.  Sample of a PanelElem  4.8 PasswordElems   Insert: TextFieldElems.InsertPW name cmd par W H password Generator: TextFieldElems.NewPW Sample: TextFieldElems.InsertPW "" "ElemTools.LogInput" "#PValue" 0 0 "test" A PasswordElem behaves like a TextFieldElem which echoes only the '*' mark. Attributes PValue The password. This value is not displayed in the Inspector.Panel.  4.9 RadioButtonElems     Insert: RadioButtonElems.Insert name cmd par W H myValue value Generator: RadioButtonElems.New Sample: RadioButtonElems.Insert "sel" "ElemTools.LogInput" "#Value" 0 0 "one" "" RadioButtonElems.Insert "sel" "ElemTools.LogInput" "#Value" 0 0 "two" "" RadioButtons are grouped buttons that represent a set of options. Only one can be selected at a time. All RadioButtons representing the same option set, have to have the same name. Clicking on a RadioButton with MM sets the option (attribute 'Value') to the contents of the attribute 'MyValue' and starts the execution of the command given in the attribute 'Cmd'. Moving the mouse outside the RadioButton or interclicking with MR or ML cancels the execution and the option stays unchanged. An single RadioButton behaves like a switch, which only can be set to 'on'. Attributes Value: The value of the option represented. MyValue: The value of the elem (each Elem should have a different 'MyValue').  4.10 StaticTextElems  Insert: StaticTextElems.Insert name cmd par W H value align borderStyle transparent Generator: StaticTextElems.New Sample: StaticTextElems.Insert "" "System.Time" "" 300 0 "a simple text" "C" "3D" "Y" Displays a static text. Changes can only be made using the Inspector.Panel. Normally only used inside Panels. A StaticText has also the possibility to execute a command. Clicking on it with MM starts the execution of command given in the attribute 'Cmd'. Moving outside the StaticText or interclicking with MR or ML cancels the execution. If using a StaticText as description of a RadioButton or CheckBox it's useful to set the 'Cmd' attribute in that way that it also changes the RadioButton's setting. An example follows below. To realize this funcionality the ElemTools.SetAttr command is used. Attributes Cmd: Is called if the StaticText is clicked with MM. Par: Is used as parameter for Cmd. Value: The text to be displayed. Align: Alignment (Left, Center, Right). Border: Indicates the presence of a border. 3D: With this attribute enabled the border (if used) is drawn in 3D style. Transparent: If checked no background is drawn. Example:  The RadioButtons are called 'option' and their 'MyValue' attributes are set to 'one' and 'two'. Attributes of the StaticText with value 'One' Cmd: ElemTools.SetAttr Par: option 'Value' 'one' The CheckBox is called 'chkbox'. Attributes of the StaticText with value 'Checkbox Description' Cmd: ElemTools.SetAttr Par: chkbox 'Value' 'S'  4.11 TextAreaElems  Insert: TextAreaElems.Insert name cmd par W H Generator: TextAreaElems.New Sample: TextAreaElems.Insert "" "" "" 400 80 A TextArea is an element which holds a scrollable Oberon text. Attributes Cmd: Not used. Par: Not used. Value: The text of the element. Scrollbar: Indicates whether a scrollbar is displayed. ReadOnly: Indicates whether the text can be edited.  4.12 TextFieldElems  Insert: TextFieldElems.Insert name cmd par W H value Generator: TextFieldElems.New Sample: TextFieldElems.Insert "" "ElemTools.LogInput" "#Value" 0 0 "The Value" A TextFieldElem is an element which holds one line of an Oberon text. Pressing the return-key starts the execution of the command given in the attribute 'Cmd'. Attributes Value: The text to be edited. MaxLen: The maximum length (in characters) of the field (0 means no limitation).  5 Macros With the use of macros complex commands and parameters depending on several elems in the same context are possible. On execution the macros are expanded to the current values. % reference to a foreign attribute. Syntax: %elemName.attributeName # reference to an own attribute. Syntax: #attributeName \ redefines the following character. \n is replaced with a carriage-return. \t is replaced with a tabulator. \s is replaced with the most recent selection. All other characters are written as they are and the backslash is suppressed. Therefore the other macro characters can be written as simple characters. ' is replaced with a double quote " and used to create String parameters blank one blank is always suppressed, thus a concatenation is possible Note: boolean-values are expanded to 'Y' and 'N'. Examples:  Attr Makro Result    Par %text1.Value The Value of the elem named text1.   Par '%text2.Value' The double quoted Value of the elem named text2.   Par %text3.Value .Mod The Value of the elem named text3 with an appended ".Mod".  Cmd #Caption The caption of the button is executed.  Example: MultiOpen Select a protocol:  http  ftp  file   The RadioButtons are called 'protocol' and their 'MyValue' attributes are set to 'http://', 'ftp://' and ''. The TextfieldElem is called 'file'. Attributes of the ButtonElem: Cmd: Documents.Open Par: '%protocol.Value %file.Value'  6 How to control Elems  6.1 Inspector.Panel The inspector is a special editor (Panel), which allows dynamic inspection and modification of the public attributes of an element. With help of the 'Inspect' button a selected element can be inspected. The modification can be applied to a selected element using the 'Apply' button.  Inspector.Panel  6.2 Dynamic Attributes As shown above, every Elem has its own attributes to set its behavior and look. To extend this settings there's the possibility to set additional attributes, so called 'dynamic attributes'. The major advantage of the dynamic attributes is, that values can be stored which otherwise would be stored in a global variable of an extra program or in an extra element. Setting and reading dynamic attributes is handled the same as with default attributes. They can be added with the DynamicAttributes.Panel or by using the ElemTools.AddAttr  command. To delete such an attribute the DynamicAttributes.Panel or the ElemTools.DelAttr  command can be used. Sample without dynamic attributes (value stored in additional elem)    Sample without dynamic attributes (value stored in dynamic attribute of the TextFieldElem)   (inspect the TextField to see the result)  DynamicAttributes.Panel  6.3 Commands ElemTools.SetAttr elemName attributeName Value {attributeName Value} An attribute with the name 'AttributeName' of the Elem with the name 'ElemName' is set to 'Value'. The Elem is searched in the same context. Note: Boolean values must be set using 'Y' or 'N'. Using the parameter 'S' inverts the state of a boolean value. Example:    ElemTools.DelAttr attributeName This command deletes the dynamic attribute with the name 'AttributeName' of the selected elem. More information of dynamic attributes is found in the chapter 'Dynamic Attributes' . ElemTools.Align [L | C | R] [U | V | D] This command requires a selection inside a Panel. All selected Elems are aligned to specified alignment relativ to the first selected Elem. If only one Elem is selected then the alignment is used relative to the Panel which holds this Elem. L ... Left C ... Center R ... Right U ... Up V ... Center vertical D ... Down ElemTools.SetSize [W] [H] With this command all selected Elems are set to the same Width and/or Height according to the first selected Elem. If only one elem is selected and this is placed inside a panel, then the size of the panel is adjusted to enclose the element exactly. W ... Width H ... Height Example: ElemTools.SetSize W   ElemTools.LogParam This command writes his parameter to the System.Log. It's useful to find errors in complex parameters, as you can see the result with expanded macros. Example:  Attributes Cmd: ElemTools.LogParam Par: #Cmd '#Caption' The Result in the System.Log is: ---------------------------------- ElemTools.LogParam "Test it !" ---------------------------------- ElemTools.ParamToCaret This command writes his parameter to the caret position. Using this command, simple inserting functionality is possible. Example:  Attributes of the ButtonElem with caption 'bold' Cmd: ElemTools.ParamToCaret Par: ElemTools.ShowTabs "on" | "off" This command is used to switch between the normal display mode and the mode where all elements which have a tabstop display their tabstop number. Using this command, a Panel must be selected. ElemTools.SetTabPos "first" | "last" | pos Sets the tabstop position of the selected elem. This command should only be used for elems placed in panels, because the tabstop position of elements placed in text is given with the their order in this text.  6.4 Elems.Panel This Panel provides most of the Commands of chapter 5.3 in a GUI. Documents.Open Elems.Panel opens this Panel.  Elems.Panel  6.5 Messages Elems.AttrMsg With this Message the Attributes of an Elem can be get, set and enumerated. CONST (* name *) Bool = 7; Char = 6; Int = 3; Real = 4; LongReal = 5; String = 2; Set = 8; Text = 9; (* id *) get = 1; set = 2; enum = 3; enumProps = 4; TYPE EnumNames = PROCEDURE (name : ARRAY OF CHAR; class : INTEGER); AttrMsg = RECORD (Texts.ElemMsg) id : INTEGER; hasProps : BOOLEAN; enum: EnumNames; name: ARRAY 32 OF CHAR; class: INTEGER; s: ARRAY 256 OF CHAR; set: SET; b: BOOLEAN; c: CHAR; i: LONGINT; r: REAL; lr: LONGREAL; t: Texts.Text; END ; - id (get, set, enum, enumProps): Indicates that the attribute should be set or read or that all attributes should be enumerated. If the id is set to 'enum' then the enum-procedure must be set. - hasProps: This field indicates whether the attribute has special properties. e.g: 'Align' attribute of a StaticText. - enum The Procedure which is called with every Attribute if 'id' is set to 'enum' - name: The name of the referenced attribute. - class (Bool, Int, Real, LongReal, Char, String, Set, Text): The class of the referenced Attribute. - s, set, b, i, r, lr, t : One of this fields is set, depending on the value of 'class'. Note: if t is used the sender/receiver has to copy the text but not the elem  1.Example: The 'Value' of the Elem called "test" in the current context has to be read and then set to "TestString"; VAR o : Elems.Elem; attr : Elems.AttrMsg; s : ARRAY 256 OF CHAR; BEGIN ...... (* get the elem *) o := Elems.NamedElem("test", Elems.CmdContext); IF o # NIL THEN (* get the value *) attr.id := Elems.get; attr.name := "Value"; o.handle(o, attr); IF Elems.Done THEN IF attr.class = Elems.String THEN COPY(attr.s, s) ELSE (* attr 'Value' is not of type String *) END ELSE (* elem o doesn't have an attribute called 'Value' *) END; (* set the value *) attr.id := Elems.set; attr.name := "Value"; attr.class := Elems.String; COPY("TestString", attr.s); o.handle(o, attr); Elems.UpdateElem(o); (* make changes visible *) ELSE (* the current context doesn't have an elem called 'test' *) END; ...... 2.Example: We want to output all public Attributes of a given element. PROCEDURE MyEnum (name: ARRAY OF CHAR; class : INTEGER); BEGIN Out.String(name); Out.Ln END MyEnum; VAR o : Elems.Elem; attr : Elems.AttrMsg; BEGIN ..... attr.id := Elems.enum; attr.enum := MyEnum; o.handle(o, attr); ......  6.6 Procedures The module 'Elems' provides some procedures to work with elements with a few simple instructions. Elems.CreateElem(generator : ARRAY OF CHAR) : Elem Creates an element using the commando 'generator' und returns it. If using this procedure to create elements there is no need to import the modul of the element. Elems.GetBoolean (e : Texts.Elem; name : ARRAY OF CHAR; VAR b : BOOLEAN); Reads the attribute 'name' of the element 'e'. It expects that the value is of type boolean. 'Elems.Done' indicates the success of the operation. There exists a procedure for every supported attribute type. Elems.SetBoolean (e : Texts.Elem; name : ARRAY OF CHAR; b : BOOLEAN); Sets the attribute 'name' of the element 'e'. 'Elems.Done' indicates the success of the operation. There exists a procedure for every supported attribute type. Elems.GetClass (e : Texts.Elem; name : ARRAY OF CHAR) : INTEGER; Returns the type of the attribute 'name' of element 'e'. This procedure is useful to use the correct type accessing an unknown attribute. If the attribute doesn't exist 'Elems.NoClass' is returned. The returned value is one of the following: Elems.String, Elems.Int, Elems.Real, Elems.LongReal, Elems.Bool, Elems.Set, Elems.Text, Elems.NoClass Elems.NamedElem (name : ARRAY OF CHAR; context : Texts.Text) : Elem; Searches for an element with 'name' in 'context'. If no element is found NIL is returned. Usually the variable 'Elems.CmdContext' is used for 'context'. Elems.CmdContext holds the context of the last command started. Elems.UpdateElem (e : Texts.Elem); Notifies all views that the element has to be redrawn. After changing an attribute of an element this procedure can be used to make the changes visible. Example: The 'Value' of the Elem called "test" in the current context has to be read and then set to "TestString"; VAR o : Elems.Elem; s : ARRAY 256 OF CHAR; BEGIN ...... (* get the elem *) o := Elems.NamedElem("test", Elems.CmdContext); IF o # NIL THEN (* get the value *) Elems.GetString(o, "Value", s); IF Elem.Done THEN ...... ELSE (* elem o doesn't have an attribute called 'Value' *) END; Elems.SetString(o, "Value", "TestString"); Elems.UpdateElem(o); (* make changes visible *) ELSE (* the current context doesn't have an elem called 'test' *) END; ......  file: Elems.Text