home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 August / macformat-027.iso / mac / Shareware City / Developers / Oberon⁄F / System / Docu / Dialog (.txt) < prev    next >
Encoding:
Oberon Document  |  1994-06-07  |  16.1 KB  |  274 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Geneva
  16. TextRulers.StdRulerDesc
  17. TextRulers.RulerDesc
  18. TextRulers.StdStyleDesc
  19. TextRulers.StyleDesc
  20. TextRulers.AttributesDesc
  21. Geneva
  22. HostPictures.StdViewDesc
  23. Geneva
  24. Dialog
  25. Views
  26. Files
  27. Ports
  28. Domains
  29. Fonts
  30. Stores
  31. Models
  32. Controllers
  33. Geneva
  34. Geneva
  35. 5.9 Dialog
  36. DEFINITION Dialog;
  37.     IMPORT Files, Ports;
  38.     TYPE
  39.         String = ARRAY 256 OF CHAR;
  40.         Interactor = RECORD
  41.             PROCEDURE (VAR i: Interactor) Notify;
  42.             PROCEDURE (VAR i: Interactor) CheckGuards
  43.         END;
  44.         Field = RECORD
  45.             PROCEDURE (VAR f: Field) Check (VAR err, p0, p1, p2: String)
  46.         END;
  47.         Array = RECORD (Field)
  48.             len: LONGINT
  49.         END;
  50.         Enumeration = RECORD (Field)
  51.             val: LONGINT;
  52.             PROCEDURE (VAR e: Enumeration) GetName (i: LONGINT; VAR name: String);
  53.             PROCEDURE (VAR e: Enumeration) GetValue (i: LONGINT; VAR val: LONGINT)
  54.         END;
  55.         Selection = RECORD (Field)
  56.             val, mask: SET;
  57.             PROCEDURE (VAR e: Enumeration) GetName (i: LONGINT; VAR name: String);
  58.             PROCEDURE (VAR e: Enumeration) GetValue (i: LONGINT; VAR val: LONGINT)
  59.         END;
  60.         Time = RECORD (Field)
  61.             year, month, day, hour, minute, second: INTEGER
  62.         END;
  63.         Subrange = RECORD (Field)
  64.             val, min, max: INTEGER
  65.         END;
  66.         Color = RECORD (Enumeration) END;
  67.         Size = RECORD (Enumeration) END;
  68.         Style = RECORD (Selection) END;
  69.         Weight = RECORD (Field)
  70.             val: INTEGER
  71.         END;
  72.         Length = RECORD (Enumeration) END;
  73.         Units = RECORD (Enumeration) END;
  74.         Par = POINTER TO ParDesc;
  75.         ParDesc = RECORD
  76.             disabled, checked: BOOLEAN;
  77.             string: String
  78.         END;
  79.         background: Ports.Color;
  80.         metricSystem: BOOLEAN;
  81.         maxBorderSize-: LONGINT;
  82.         par: Par;
  83.         showsStatus: BOOLEAN;
  84.         platform: INTEGER;
  85.         appName: ARRAY 32 OF CHAR;
  86.         GetTime: PROCEDURE (VAR t: Time);
  87.     PROCEDURE MapParamString (in, p0, p1, p2: ARRAY OF CHAR; VAR out: ARRAY OF CHAR);
  88.     PROCEDURE MapString (in: ARRAY OF CHAR; VAR out: ARRAY OF CHAR);
  89.     PROCEDURE ShowParamMsg (str, p0, p1, p2: ARRAY OF CHAR);
  90.     PROCEDURE ShowMsg (str: ARRAY OF CHAR);
  91.     PROCEDURE ShowParamStatus (str, p0, p1, p2: ARRAY OF CHAR);
  92.     PROCEDURE ShowStatus (str: ARRAY OF CHAR);
  93.     PROCEDURE GetOK (str, p0, p1, p2: ARRAY OF CHAR; VAR ok: BOOLEAN);
  94.     PROCEDURE GetIntSpec (type: Files.Type; VAR stationary: BOOLEAN;
  95.                                                 VAR loc: Files.Locator; VAR name: Files.Name);
  96.     PROCEDURE GetExtSpec (default: Files.Name; type: Files.Type; stationary: BOOLEAN;
  97.                                                 VAR loc: Files.Locator; VAR name: Files.Name);
  98.     PROCEDURE GetColor (in: Ports.Color; VAR out: Ports.Color; VAR set: BOOLEAN);
  99.     PROCEDURE DayOfWeek (VAR t: Time): INTEGER;
  100.     PROCEDURE Call (proc, errorMsg: ARRAY OF CHAR; VAR res: LONGINT);
  101.     PROCEDURE Beep;
  102.     PROCEDURE Disable;
  103.     PROCEDURE Call (proc: ARRAY OF CHAR; VAR res: LONGINT);
  104. END Dialog.
  105. Module Dialog provides a variety of auxiliary services to simplify user interaction of a program. In particular, the output of messages, e.g. error messages, is supported. Furthermore, various base types are provided: Field, Enumeration, Subrange, etc. These types are known to the framework and can be displayed by suitable controls, i.e. views which display not a normal model, but instead a variable of one of the mentioned types. Some of these types can be extended, e.g. enumerations can be extended to define a particular concrete enumeration type, which then can be displayed e.g. as a pop-up menu.
  106. TYPE String
  107. String type for various names to be displayed for the user, or to be entered by the user.
  108. TYPE Interactor
  109. Interface
  110. This is the base type of interactors, i.e. of global record variables which can be represented as dialog boxes or property sheets.
  111. PROCEDURE (VAR i: Interactor) Notify
  112. This procedure should be called after one or several fields of the interactor have been modified. It causes a broadcast of a Views.NotifyMsg with ~msg.checkGuards.
  113. PROCEDURE (VAR i: Interactor) CheckGuards
  114. This procedure should be called after one or several fields of the interactor have been modified such that enabled controls on this interactor may have become disabled, or vice versa. It causes a broadcast of a Views.NotifyMsg with msg.checkGuards.
  115. TYPE Field
  116. Interface
  117. Base type of various types which can be displayed and edited interactively.
  118. PROCEDURE (VAR f: Field) Check (VAR err, p0, p1, p2: String)
  119. Interface
  120. This procedure must be extended to check whether the field's current value is legal. If not, a non-empty error message err should be returned, otherwise err should be set to "". err may contain up to three place-holders in the form "^0", "^1", and "^2". These place-holders will be substituted by the parameter strings p0, p1, and p2, respectively. All four strings are mapped before they are used (cf. MapParamString below).
  121. TYPE Array
  122. Interface, Extension
  123. Base type of all array fields.
  124. len: LONGINT    len >= 0
  125. Indicates the number of array elements currently valid, i.e. elements [0..len).
  126. TYPE Enumeration
  127. Interface, Extension
  128. Base type of all enumeration types. An enumeration type defines a subset of the LONGINT type, and a name (string) for each element of this subset. All valid names can be enumerated by indexing from 0 upwards, and stopping when the empty string is returned.
  129. val: LONGINT
  130. Current value of the enumeration.
  131. PROCEDURE (VAR e: Enumeration) GetName (i: LONGINT; VAR name: String)
  132. Interface
  133. Given an index i, the corresponding name is returned. If i is outside of the valid index range, the emtpy string "" is returned.
  134. i >= 0    20
  135. name # "" iff index i is valid
  136. PROCEDURE (VAR e: Enumeration) GetValue (i: LONGINT; VAR val: LONGINT)
  137. Interface
  138. Given a valid index i, the corresponding value is returned.
  139. index i is valid    20
  140. TYPE Selection
  141. Interface, Extension
  142. A selection is similar to an enumeration, except that not exactly one value can be represented, but between 0 and 32 values instead, i.e. a selection is a set of enumerations.
  143. val: SET
  144. Current value of the selection.
  145. mask: SET
  146. Currently valid elements of the selection.
  147. PROCEDURE (VAR s: Selection) GetName (i: LONGINT; VAR name: String)
  148. Interface
  149. Given an index i, the corresponding name is returned. If i is outside of the valid index range, the emtpy string "" is returned.
  150. i >= 0    20
  151. name # "" iff index i is valid
  152. PROCEDURE (VAR s: Selection) GetValue (i: LONGINT; VAR val: LONGINT)
  153. Interface
  154. Given a valid index i, the corresponding value is returned.
  155. index i is valid    20
  156. TYPE Time
  157. Time information.
  158. year: INTEGER    1583 <= year <= 9999
  159. month: INTEGER    1 <= month <= 12
  160. day: INTEGER    1 <= day <= 31
  161. hour: INTEGER    1 <= hour <= 24
  162. minute: INTEGER    1 <= minute <= 60
  163. second: INTEGER    1 <= second <= 60
  164. TYPE Subrange
  165. Extension
  166. Subranges denote values which are restricted to lie in a subrange of INTEGER.
  167. val: INTEGER    min <= val <= max
  168. Current value.
  169. min, max: INTEGER    min <= max
  170. Subrange bounds.
  171. TYPE Color
  172. Extension
  173. Color enumeration.
  174. TYPE Size
  175. Extension
  176. Enumeration for font sizes given in points (Fonts.point).
  177. TYPE Style
  178. Extension
  179. Selection type for font styles. Valid elements are {Fonts.italic..Fonts.strikeout}.
  180. TYPE Weight
  181. Extension
  182. Field type for font weights. Values range from 1 to 1000.
  183. TYPE Length
  184. Extension
  185. Enumeration type for unsigned document units. Values range from Views.undefined to Views.infinite.
  186. TYPE Units
  187. Extension
  188. Enumeration type for signed document units. Values range from -Views.infinite to +Views.infinite.
  189. TYPE Par
  190. Values of this parameter type are used to set up the names of menu items, and to disable or check menu items. The global variable par of this type is predefined.
  191. disabled: BOOLEAN
  192. Initially set to FALSE, this field can be set to TRUE by guard commands, to disable a menu item or a control.
  193. checked: BOOLEAN
  194. Initially set to FALSE, this field can be set to TRUE to show a check mark for a menu item.
  195. string: String
  196. For menu items which show different strings depending on the current context, the current string can be deposited here.
  197. VAR background: Ports.Color    background >= 0
  198. The background color of dialogs.
  199. VAR metricSystem: BOOLEAN
  200. This variable indicates whether sizes should be measured in metric units or in inches.
  201. VAR maxBorderSize: LONGINT    maxBorderSize > 0    [units]
  202. This variable indicates how much space around a focussed or selected view may be occupied by its container's marks.
  203. VAR par: Par
  204. Standard parameter for menu and control disabling. This pointer must not be NIL during the execution of a menu guard or a control guard.
  205. VAR showStatus: BOOLEAN
  206. Indicates whether status messages are currently possible.
  207. VAR version: INTEGER
  208. Indicates the current version of Oberon/F.
  209.     100 = version 1.0
  210. VAR platform: INTEGER
  211. Indicates on which host operating system the application is running.
  212.     11 = Windows 3.1
  213.     12 = Windows95
  214.     13 = Windows/NT 3.x
  215.     21 = Mac OS 7.x
  216. VAR appName: ARRAY 32 OF CHAR
  217. Gives the name of the application program which is currently running; the default is "Oberon/F".
  218. PROCEDURE GetTime (VAR t: Time)
  219. Get the current time.
  220. PROCEDURE MapParamString (in, p0, p1, p2: ARRAY OF CHAR;
  221.                                                             VAR out: ARRAY OF CHAR)
  222. Translates string in into string out. Strings of the form "#Subsystem:message" are translated if there is a corresponding "strings" resource file for this subsystem (in the subsystem's "Rsrc" directory). Otherwise, the "#Subsystem:" prefix is stripped away, if there is no resource file.
  223. As an example, "#System:Cancel" may be translated to "Cancel" in the USA, and to "Abbrechen" in Germany; or to "Cancel" if the resource file or the appropriate entry is missing.
  224. Three additional input parameters can be spliced into the in parameter. These parameters are inserted where "^0", "^1", or "^2" occur in in. The parameters are mapped individually as well.
  225. MapParamString allows to remove country- and language-specific strings from a program source text, while at the same time providing a default string in the program source text such that the program always works, even if string resources are missing.
  226. PROCEDURE MapString (in: ARRAY OF CHAR; VAR out: ARRAY OF CHAR)
  227. This is a simplified version of MapParamString which has no additional input parameters.
  228. Except for performance, equivalent to:
  229.     MapParamString(in, "", "", "", out)
  230. PROCEDURE ShowParamMsg (str, p0, p1, p2: ARRAY OF CHAR)
  231. Presents str as a message to the user. The string is mapped, as are the additional input parameters p0, p1, and p2.
  232. PROCEDURE ShowMsg PROCEDURE (str: ARRAY OF CHAR)
  233. This is a simplified version of ShowParamMsg which has no additional input parameters.
  234. Except for performance, equivalent to:
  235.     ShowParamMsg(str, "", "", "")
  236. PROCEDURE ShowParamStatus (str, p0, p1, p2: ARRAY OF CHAR)
  237. Presents str as a message to the user. The string is mapped, as are the additional input parameters p0, p1, and p2. In contrast to ShowParamMsg, ShowParamStatus is used for shorter-living messages, e.g. messages produced and updated during a lengthy process.
  238. PROCEDURE ShowStatus PROCEDURE (str: ARRAY OF CHAR)
  239. This is a simplified version of ShowParamStatus which has no additional input parameters.
  240. Except for performance, equivalent to:
  241.     ShowParamStatus(str, "", "", "")
  242. PROCEDURE GetOK (str, p0, p1, p2: ARRAY OF CHAR; VAR ok: BOOLEAN)
  243. Modal dialog
  244. Presents a mapped string, with the optional parameters p0 to p2, in a modal dialog box. The user has the choices to say "yes" (ok) or "no". The result is returned in ok.
  245. PROCEDURE GetIntSpec (type: Files.Type; VAR stationary: BOOLEAN;
  246.                                                 VAR loc: Files.Locator; VAR name: Files.Name)
  247. Modal dialog
  248. Ask the user for a file specification (loc, name). type indicates which file type is desired ("" stands for Oberon documents, "*" is a wildcard for all file types; other types are platform-specific, e.g. "TXT" for Windows Ascii files or "TEXT" for Macintosh Ascii files). loc # NIL indicates a valid file specification. stationary indicates whether the specified file is a stationary, i.e. a template which should be copied before a modification.
  249. PROCEDURE GetExtSpec (default: Files.Name; type: Files.Type; stationary: BOOLEAN;
  250.                                                 VAR loc: Files.Locator; VAR name: Files.Name)
  251. Modal dialog
  252. Ask the user for a file specification for externalizing a file.
  253. PROCEDURE GetColor (in: Ports.Color; VAR out: Ports.Color; VAR set: BOOLEAN)
  254. Modal dialog
  255. Ask the user for a color.
  256. PROCEDURE DayOfWeek (VAR t: Time): INTEGER
  257. Return the weekday of time t, with encoding Monday = 0, Tuesday = 1, ... Sunday = 6;
  258. (DayOfWeek + 1) MOD 7 + 1 transforms to the American convention Sunday = 1, Monday = 2, ... Saturday = 7.
  259. 1583 <= year <= 9999    (not explicitly checked)
  260. PROCEDURE Beep
  261. Emit a short beep sound.
  262. PROCEDURE Disable
  263. Disables the menu/control filter par.
  264. Except for performance equivalent to:
  265.     IF par # NIL THEN par.disabled := TRUE END
  266. PROCEDURE Call (cmd, errorMsg: ARRAY OF CHAR; VAR res: LONGINT)
  267. Call executes a sequence of Oberon commands (i.e. a parameterless exported procedures) denoted by cmd. If the corresponding modules are not yet loaded, Call tries to load them. If some error occurrs, command execution terminates and res is returned with a value # 0. If errorMsg = "", Call does not display error messages. If errorMsg # "", Call displays errorMsg in case of an error, appended with a short description of the particular error having occurred.
  268. TextControllers.StdCtrlDesc
  269. TextControllers.ControllerDesc
  270. Containers.ControllerDesc
  271. Controllers.ControllerDesc
  272. Geneva
  273. Documents.ControllerDesc
  274.