home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / oberon / text / dialogs.text (.txt) < prev    next >
Oberon Text  |  1977-12-31  |  33KB  |  711 lines

  1. Syntax10.Scn.Fnt
  2. ParcElems
  3. Alloc
  4. Syntax20.Scn.Fnt
  5. Syntax14.Scn.Fnt
  6. Syntax12.Scn.Fnt
  7. Syntax14b.Scn.Fnt
  8. DialogElems
  9. Alloc
  10. DialogStaticTexts
  11. ItemDesc
  12. Syntax10.Scn.Fnt
  13. ComboBox 
  14. Syntax10.Scn.Fnt
  15. Text 
  16. DialogComboBoxes
  17. mhk28
  18. Syntax10.Scn.Fnt
  19. AnalogClock 
  20. DialogAnalogClocks
  21. Syntax10.Scn.Fnt
  22. Clock 
  23. DialogClocks
  24. Syntax10.Scn.Fnt
  25. Date 
  26. DialogDates
  27. Syntax10.Scn.Fnt
  28. ColorPicker 
  29. DialogColorPickers
  30. Syntax10.Scn.Fnt
  31. IntegerSlider 
  32. Syntax10.Scn.Fnt
  33. Line 
  34. DialogLines
  35. Syntax10.Scn.Fnt
  36. Circle 
  37. DialogCircles
  38. Syntax10.Scn.Fnt
  39. Rectangle 
  40. DialogRectangles
  41. Syntax10.Scn.Fnt
  42. Sliders 
  43. DialogSliders
  44. staticTextRadio
  45. Syntax10.Scn.Fnt
  46. Radio Buttons
  47. DialogTexts
  48. DialogRadioButtons
  49. radio2
  50. DialogGroupBoxes
  51. radio3
  52. Syntax10.Scn.Fnt
  53. GroupBox
  54. staticTextCheck
  55. Syntax10.Scn.Fnt
  56. CheckBox 
  57. DialogCheckBoxes
  58. checkbox
  59. DialogButtons
  60. Button
  61. Syntax10.Scn.Fnt
  62. DialogIntSliders
  63. DialogIntSlider
  64. Syntax12i.Scn.Fnt
  65. Syntax12b.Scn.Fnt
  66. DialogButtons
  67. ItemDesc
  68. DialogInsert.Do
  69. fileName  
  70. Syntax10.Scn.Fnt
  71. DialogLines
  72. DialogStaticTexts
  73. Syntax10.Scn.Fnt
  74. DialogTexts
  75. Syntax10.Scn.Fnt
  76. Dialog.Open
  77. fileName 
  78. Syntax10.Scn.Fnt
  79. Dialog.Edit
  80. fileName 
  81. Syntax10.Scn.Fnt
  82. Syntax10.Scn.Fnt
  83. Dialog
  84. fileName
  85. DialogListBoxes
  86. Syntax10.Scn.Fnt
  87. temp43
  88. Syntax10.Scn.Fnt
  89. temp26
  90. Syntax10.Scn.Fnt
  91. Syntax10.Scn.Fnt
  92. Syntax10.Scn.Fnt
  93. DialogInsert.Open
  94. DialogButtons
  95. ItemDesc
  96. System.Time
  97. Syntax10.Scn.Fnt
  98. DialogButtons
  99. ItemDesc
  100. MyEdit.Print
  101. file 
  102. Syntax10.Scn.Fnt
  103. DialogStaticTexts
  104. Syntax10.Scn.Fnt
  105. DialogTexts
  106. DialogTexts
  107. ItemDesc
  108. DialogStaticTexts
  109. Syntax10.Scn.Fnt
  110. DialogCheckBoxes
  111. draft
  112. Draft
  113. Syntax10.Scn.Fnt
  114. draft
  115. DialogButtons
  116. Print
  117. MyEdit.Print
  118. Syntax10.Scn.Fnt
  119. Syntax10b.Scn.Fnt
  120.     Syntax10i.Scn.Fnt
  121. DialogStaticTexts
  122. ItemDesc
  123. Syntax10.Scn.Fnt
  124. Search for:
  125. DialogTexts
  126. search
  127. MyUI.SearchReset
  128. MyUI.SearchReset
  129. Syntax10.Scn.Fnt
  130. Replace with:
  131. DialogCheckBoxes
  132. Syntax10.Scn.Fnt
  133. DialogButtons
  134. Search
  135. MyUI.Search
  136. Syntax10.Scn.Fnt
  137. Replace
  138. MyUI.Replace
  139. Syntax10.Scn.Fnt
  140. folds
  141. Syntax10.Scn.Fnt
  142. search FoldElems
  143. DialogRadioButtons
  144. ItemDesc
  145. block
  146. MyUI.Adjust
  147. DialogGroupBoxes
  148. Syntax10.Scn.Fnt
  149. Adjustment
  150. DialogStaticTexts
  151. tblock
  152. Syntax10.Scn.Fnt
  153. block
  154. center
  155. MyUI.Adjust
  156. MyUI.Adjust
  157. right
  158. MyUI.Adjust
  159. tcenter
  160. Syntax10.Scn.Fnt
  161. center
  162. tleft
  163. Syntax10.Scn.Fnt
  164. tright
  165. Syntax10.Scn.Fnt
  166. right
  167. before
  168. MyUI.Break
  169. Adjust
  170. Syntax10.Scn.Fnt
  171. Page Break
  172. tbefore
  173. Syntax10.Scn.Fnt
  174. before
  175. normal
  176. MyUI.Break
  177. tnormal
  178. Syntax10.Scn.Fnt
  179. normal
  180. Columns
  181. MyUI.Columns
  182. Syntax10.Scn.Fnt
  183. Columns
  184. MyUI.Columns
  185. Syntax10.Scn.Fnt
  186. MyUI.Columns
  187. Syntax10.Scn.Fnt
  188. First
  189. Syntax10.Scn.Fnt
  190. First Line Indentation
  191. firstdefault
  192. MyUI.First
  193. tfirstdefault
  194. Syntax10.Scn.Fnt
  195. default
  196. DialogTexts
  197. tfirstnumber
  198. MyUI.FirstReset
  199. firstnumber
  200. MyUI.First
  201. tfirstnumber 
  202. DialogCheckBoxes
  203. MyUI.Grid
  204. tgrid
  205. Syntax10.Scn.Fnt
  206. Line grid
  207. leftm
  208. Syntax10.Scn.Fnt
  209. Left Margin
  210. leftmargindef
  211. MyUI.Left
  212. tleftmargindef
  213. Syntax10.Scn.Fnt
  214. default
  215. leftmargin
  216. MyUI.Left
  217. tleftmargin 
  218. tleftmargin
  219. MyUI.LeftReset
  220. rightm
  221. Syntax10.Scn.Fnt
  222. Right Margin
  223. rightmargindef
  224. MyUI.Right
  225. trightmargindef
  226. Syntax10.Scn.Fnt
  227. default
  228. rightmargin
  229. MyUI.Right
  230. trightmargin
  231. trightmargin
  232. MyUI.RightReset
  233. Width
  234. Syntax10.Scn.Fnt
  235. Maximal Line Width
  236. widthdef
  237. MyUI.Width
  238. twidthdef
  239. Syntax10.Scn.Fnt
  240. default
  241. width
  242. MyUI.Width
  243. twidth 
  244. twidth
  245. MyUI.WidthReset
  246. Syntax10.Scn.Fnt
  247. Tab Spacing
  248. every
  249. MyUI.Tabs
  250. tevery 
  251. t1every
  252. Syntax10.Scn.Fnt
  253. every
  254. tevery
  255. MyUI.TabsReset1
  256. MyUI.Tabs
  257. tenum 
  258. tenum
  259. MyUI.TabsReset2
  260. Syntax10.Scn.Fnt
  261. Leading Paragraph Space
  262. leaddef
  263. MyUI.Lead
  264. tleaddef
  265. Syntax10.Scn.Fnt
  266. default
  267. leadnumber
  268. MyUI.Lead
  269. tleadnumber
  270. MyUI.LeadReset
  271. Syntax10.Scn.Fnt
  272. Minimal Line Height
  273. linedef
  274. MyUI.Line
  275. tlinedef
  276. Syntax10.Scn.Fnt
  277. default
  278. linenumber
  279. MyUI.Line
  280. tlinenumber 
  281. tlinenumber
  282. MyUI.LineReset
  283. DialogButtons
  284. GetAll
  285. MyUI.GetAll
  286. Syntax10.Scn.Fnt
  287. DialogComboBoxes
  288. styles
  289. MyUI.Style
  290. tstyles
  291. Syntax10.Scn.Fnt
  292. Style:
  293. DialogRadioButtons
  294. ItemDesc
  295. marked
  296. DialogStaticTexts
  297. Syntax10.Scn.Fnt
  298. most recent selection
  299. smarked
  300. Syntax10.Scn.Fnt
  301. marked viewer
  302. sfiles
  303. Syntax10.Scn.Fnt
  304. list of files
  305. DialogTexts
  306. files
  307. DialogGroupBoxes
  308. source
  309. Syntax10.Scn.Fnt
  310. Source
  311. DialogCheckBoxes
  312. options
  313. Syntax10.Scn.Fnt
  314. Options
  315. Syntax10.Scn.Fnt
  316. disable index checks
  317. assert
  318. symbol
  319. stype
  320. Syntax10.Scn.Fnt
  321. disable type guards
  322. Syntax10.Scn.Fnt
  323. disable NIL checks
  324. sinit
  325. Syntax10.Scn.Fnt
  326. suppress initialization of local pointers to NIL
  327. sassert
  328. Syntax10.Scn.Fnt
  329. suppress code generation for ASSERT function
  330. ssymbol
  331. Syntax10.Scn.Fnt
  332. allow generation of new symbol file
  333. Syntax10.Scn.Fnt
  334. find text position corresponding to pc
  335. DialogButtons
  336. Compile
  337. MyUI.Compile
  338. Syntax10.Scn.Fnt
  339. FoldsCompile
  340. MyUI.FoldsCompile
  341. Syntax10.Scn.Fnt
  342. DialogStaticTexts
  343. ItemDesc
  344. Syntax10.Scn.Fnt
  345. Type:
  346. Syntax10.Scn.Fnt
  347. PopupElems.ElemDesc
  348. DialogButtons
  349. GetType
  350. MyUI.GetType
  351. Syntax10.Scn.Fnt
  352. DialogRectangles
  353. DialogCheckBoxes
  354. ItemDesc
  355. alternate
  356. DialogStaticTexts
  357. Syntax10.Scn.Fnt
  358. alternating pages
  359. DialogTexts
  360. copies
  361. Syntax10.Scn.Fnt
  362. Copies:
  363. Syntax10.Scn.Fnt
  364. Font for headers and page numbers
  365. DialogRadioButtons
  366. nohdr
  367. DialogGroupBoxes
  368. Header
  369. Syntax10.Scn.Fnt
  370. Header
  371. Syntax10.Scn.Fnt
  372. defhdr
  373. Syntax10.Scn.Fnt
  374. default
  375. header
  376. poshdrleft
  377. Syntax10.Scn.Fnt
  378. From the left:
  379. Syntax10.Scn.Fnt
  380. From the bottom:
  381. poshdrbottom
  382. Syntax10.Scn.Fnt
  383. Width:
  384. hdrwidth
  385. HdrPos
  386. Syntax10.Scn.Fnt
  387. Header Positioning
  388. Syntax10.Scn.Fnt
  389. custom
  390. Syntax10.Scn.Fnt
  391. custom
  392. Syntax10.Scn.Fnt
  393. From the left:
  394. Syntax10.Scn.Fnt
  395. From the bottom:
  396. Syntax10.Scn.Fnt
  397. Width:
  398. postxtleft
  399. postxtbottom
  400. txtwidth
  401. Syntax10.Scn.Fnt
  402. Height:
  403. txtheight
  404. TextBody
  405. Syntax10.Scn.Fnt
  406. Text Body Positioning
  407. Syntax10.Scn.Fnt
  408. Page number of first page:
  409. tfirstpage
  410. nopagenr1
  411. Syntax10.Scn.Fnt
  412. no page number on first page
  413. nopagenr
  414. Syntax10.Scn.Fnt
  415. no page numbers
  416. Romannum
  417. Syntax10.Scn.Fnt
  418. Roman numerals (up to 30)
  419. Syntax10.Scn.Fnt
  420. From:
  421. Syntax10.Scn.Fnt
  422. Syntax10.Scn.Fnt
  423. Pages
  424. Syntax10.Scn.Fnt
  425. Pages
  426. DialogButtons
  427. SaveOptions
  428. MyUI.SaveOptions
  429. Syntax10.Scn.Fnt
  430. Print
  431. MyUI.Print
  432. Syntax10.Scn.Fnt
  433. draft
  434. Syntax10.Scn.Fnt
  435. draft mode
  436. fromto
  437. DefaultOptions
  438. MyUI.SetDefaultOptions
  439. Syntax10.Scn.Fnt
  440. custom1
  441. default1
  442. Syntax10.Scn.Fnt
  443. default
  444. custom2
  445. default2
  446. Syntax10.Scn.Fnt
  447. default
  448. MyUI.InitPrintDlg
  449. DialogStaticTexts
  450. ItemDesc
  451. Syntax10.Scn.Fnt
  452. DialogButtons
  453. MyUI.Num
  454. Syntax10.Scn.Fnt
  455. MyUI.Num
  456. Syntax10.Scn.Fnt
  457. MyUI.Num
  458. Syntax10.Scn.Fnt
  459. MyUI.Num
  460. Syntax10.Scn.Fnt
  461. MyUI.Num
  462. Syntax10.Scn.Fnt
  463. MyUI.Num
  464. Syntax10.Scn.Fnt
  465. MyUI.Num
  466. Syntax10.Scn.Fnt
  467. MyUI.Num
  468. Syntax10.Scn.Fnt
  469. MyUI.Num
  470. Syntax10.Scn.Fnt
  471. MyUI.Op
  472. "mult"
  473. Syntax10.Scn.Fnt
  474. MyUI.Op
  475. "sub"
  476. Syntax10.Scn.Fnt
  477. MyUI.Op
  478. "add"
  479. Syntax10.Scn.Fnt
  480. MyUI.Op
  481. "res"
  482. Syntax10.Scn.Fnt
  483. DialogTexts
  484. MyUI.SetVar
  485. Syntax10.Scn.Fnt
  486. DialogComboBoxes
  487. MyUI.Variable
  488. MyUI.Reset
  489. Syntax10.Scn.Fnt
  490. MyUI.Num
  491. Syntax10.Scn.Fnt
  492. MyUI.Comma
  493. Syntax10.Scn.Fnt
  494. MyUI.Op
  495. "div"
  496. Syntax10.Scn.Fnt
  497. MyUI.Clear
  498. Syntax10.Scn.Fnt
  499. MyUI.Op
  500. "sqr"
  501. Syntax10.Scn.Fnt
  502. MyUI.Op
  503. "sin"
  504. Syntax10.Scn.Fnt
  505. MyUI.Op
  506. "cos"
  507. Syntax10.Scn.Fnt
  508. MyUI.Op
  509. "tan"
  510. Syntax10.Scn.Fnt
  511. MyUI.Op
  512. "exp"
  513. Syntax10.Scn.Fnt
  514. DialogCheckBoxes
  515. invers
  516. Syntax10.Scn.Fnt
  517. invers
  518. MyUI.ShowNumber
  519. MyUI.Op
  520. "sign"
  521. Syntax10.Scn.Fnt
  522. MyUI.Num
  523. Syntax10.Scn.Fnt
  524. MyUI.Num
  525. Syntax10.Scn.Fnt
  526. MyUI.Num
  527. Syntax10.Scn.Fnt
  528. MyUI.Num
  529. Syntax10.Scn.Fnt
  530. MyUI.Num
  531. Syntax10.Scn.Fnt
  532. MyUI.Num
  533. Syntax10.Scn.Fnt
  534. Syntax10.Scn.Fnt
  535. Vars: 
  536. DialogRectangles
  537. MyUI.Op
  538. "oneDivX"
  539. Syntax10.Scn.Fnt
  540. MyUI.InitCalc
  541. A Guide to Dialogs
  542. A Graphical User Interface for Oberon
  543. M. Knasm
  544. ller, 12.8.94 / 16.2.95
  545. 1. Introduction
  546. Graphical user interfaces of modern workstations are usually composed of a number of items such as buttons, check boxes, text fields and scroll bars which allow a user to interactively communicate with the computer. We call a panel of such items a dialog.
  547. This guide describes the use of dialogs in the Oberon System. Dialogs extend the original user interface of Oberon and give the user a choice between a compact textual interface (for professional programmers) and a more intuitive graphical interface (for end users).
  548. A similar package for graphical user interfaces is the Gadgets system implemented for Oberon System 3. While the Gadgets system is more powerful (e.g. nested objects) it is also more complicated and incompatible with the standard Oberon system. The virtue of the Dialogs package is that it is extremly light-weight and smoothly fits into the existing Oberon system.
  549. Figure 1 shows a sample dialog. Dialogs can be edited interactively and stored on a file. Applications can use dialogs by loading them from a file and retrieving their items by name or by a number. Dialog items can also be connected to commands that are called automatically when the item is clicked. Thus it is very simple to add a graphical user interface to any Oberon program. 
  550. Figure 1. A sample dialog
  551. Module Dialog offers commands to use, edit and print a dialog. Dialogs can be displayed in two modes: Dialog.Open opens a dialog for using it while Dialog.Edit opens it for editing. 
  552. 2. Using Dialogs
  553. Opening a Dialog for Using its Items
  554. Dialog.Open (name | ^) opens a dialog viewer and displays the dialog from file name. The menu text of the opened viewer is taken from the file Dialog.Menu.Text if such a file exists.
  555. The user can now work with the dialog by clicking at buttons or check boxes or by typing text into a text field. He cannot modify the dialog, i. e., he cannot add or move dialog items. To do that he has to use the command Dialog.Edit. 
  556. Opening a Dialog for Editing
  557. Dialog.Edit (name | ^) opens a dialog viewer and displays the dialog from file name for editing. If such a file does not exist, a new dialog is created.
  558. The following sections describe how to build dialogs by inserting items, moving and resizing them, and inspecting and modifying their attributes. Most editing operations can be done by moving and clicking the mouse. Thus clicking the left button while editing a dialog, causes a cross to appear. This is called the caret.
  559. Inserting New Dialog Items
  560. Dialog items (buttons, check boxes, etc.) can be inserted in viewers opened with Dialog.Edit. Every dialog item is defined in a separate module that exports also a command Insert, to insert an item of this class in the panel containing the caret position. 
  561. The syntax of the Insert command is
  562.     <itemModule>.Insert ([name] [x y w h] | ^)
  563. where name is a panel-wide unique name, x and y are the lower left coordinates, w is the width and h is the heigth of the object. if these parameters are not set, standard values will be taken. Usually no item can overlap others.
  564. The following items are currently implemented:
  565. DialogButtons. A button is a small named rectangle that can be pushed with an mouse click. 
  566. DialogCheckBoxes. A check box is a rectangular button that can be in two states, on and off, toggled with a mouse click. Usally there is a static text displayed to its right. 
  567. DialogStaticTexts. A static text item is a text that is shown in a panel but cannot be edited.
  568. DialogTexts. A text item is a rectangle in which the user can enter text.
  569. DialogGroupBoxes. A group box groups together several objects. Of course a group box may overlap other elements.
  570. DialogRadioButtons. A radio button is a diamond object with a state that can be on or off. All radio buttons within a group box are related and represent mutually exclusive choices (i.e., only one button of this set is on at any time).
  571. DialogListBoxes. A list box displays a text of lines, that can be selected by moving the mouse up and down.
  572. DialogComboBoxes. A combo box is an item containing an entry field and a push button. It responds to a mouse click on the push button by showing a text of lines that can be selected by moving the mouse up and down.
  573. DialogSliders. A slider item consists of a rectangular area with a small bar inside. It is used to enter integer numbers.
  574. DialogIntegerSliders. An integer slider item consists of a rectangular area with an integer number inside.
  575. DialogLines. A line item is a graphical object, which can be used to draw a line in the panel.
  576. DialogCircles. A circular item which may overlap other elements.
  577. DialogRectangles. A rectangular item which may overlap other elements.
  578. DialogDates. A date item displays the current date.
  579. DialogClocks. A (digital) clock is an item displaying the current time.
  580. DialogAnalogClock. An analog clock displaying the current time.
  581. DialogColorPicker. A color picker item is a rectangular item, which allows the user to select one of the sixteen Oberon colors.
  582. DialogGraphics. Graphic items support incorporation of graphs compatible with the standard Draw package into dialogs.
  583. DialogKeplers. Kepler items support incorporation of ports compatible with the Kepler package into dialogs.
  584. Items can also be created using the dialog "Insert.Dlg", which can be opened with Dialog.Open Insert.Dlg (see Figure 2). 
  585. Figure 2. Insert.Dlg
  586. Selecting an item of the list box and clicking the "Set" Button inserts a new item in the panel containing the caret. There are also several text items which allow the user to specify parameters for the new items. If these parameters are not set, default values will be taken.
  587. The meaning of the text items are as follow:
  588.     Name the panel-wide unique name of the item.
  589.     X, Y the lower left corner coordinates of the item in panel-relative coordinates.
  590.     W the width of the item.
  591.     H the height of the item.
  592.     Cmd a command which is called whenever a property of the object is changed.
  593.     Par a string containing the names of the text items or combo boxes and Oberon stings that should be                         concatenated to form Oberon.Par.Text. 
  594. Cmd and Par are associated by following rule: The command cmd can assume that Oberon.Par.text contains the texts defined through the property par (e.g. if par = "t1 t2 "t3"" and if there is a text item t1 containing the text "name" and also a text item t2 containing the text "text", then the command can assume that Oberon.Par.text contains the text "name text t3")).
  595. Example: To create a dialog that allows you to invoke System.Time via a button you have to do the following:
  596. -    type "MyDialog" in the Dialog field and click the "Edit" Button.
  597. -    set the caret in the new viewer with a left mouse click.
  598. -    type "Time" in the Name field and "System.Time" in the Cmd field.
  599. -    select "Button" from the list box and click the "Set" Button.
  600. This will make the following dialog (see Figure 3).
  601. Figure 3. MyDialog
  602. -    store it on a file with the command Dialog.Store.
  603. -    open it again clicking the "Open" button.
  604. -    every click at the "Time" button will now invoke the command System.Time. 
  605. Mouse Clicks
  606. ML sets the caret to the position of the mouse pointer.
  607. MR selects all dialog items in the rectangle described with the pressed mouse button.
  608. MM moves the selected elements (or the element under the mouse pointer if no element is selected) while the mouse is moved.
  609. MR + ML deletes the selected items.
  610. MR + MM copies the selected object to the position of the mouse pointer.
  611. MM + ML changes the size of the element under the mouse pointer, while the mouse is moved.
  612. MM + MR opens a dialog to edit the properties of the object under the mouse pointer.
  613. ML + MM copies the selected objects to the mouse pointer.
  614. Storing a Dialog on a File
  615. Dialog.Store stores the dialog under the name appearing in its menu frame.
  616. Printing a Dialog
  617. Dialog.Print server  (* | ^ | {name} ~) prints dialogs to a print server named server. If "*" is specified, the dialog in the marked viewer is printed. Otherwise the dialogs specified by the names are printed.
  618. 3. Inspecting and Modifying the Attributes of an Item
  619. The attributes of an item can be conveniently inspected and modified by doing an MM+MR click on the item. A new dialog will appear that allows changing the attributes of the inspected item. Alternatively the user may also inspect and modify these attributes using the following commands.
  620. Retrieving Attributes
  621. Dialog.GetInitCmd writes the command of the marked dialog to the log viewer. This cmd will be called by open the dialog with Dialog.Open. It can be used to initaly different items.
  622. Dialog.GetCmd writes the command of the object under the caret to the log viewer.
  623. Dialog.GetPar writes the parameter of the object under the caret to the log viewer.
  624. Dialog.GetDim writes the coordinates of the lower left corner, the width and the height of the object under the caret to the log viewer
  625. Dialog.GetName writes the name of the object under the caret to the log viewer.
  626. Changing the Attributes of an Item
  627. Dialog.SetInitCmd (cmd | ^) sets the command of the marked dialog to cmd.
  628. Dialog.SetCmd (cmd | ^) sets the command of the object under the caret to cmd.
  629. DialogSetPar (par | ^) sets the parameter of the object under the caret to par.
  630. Dialog.SetDim (x y w h | ^) sets the lower left corner coordinates of the object under the caret to x and y, the width to w, and the height to h. 
  631. Dialog.SetName (name | ^) sets the name of the object under the caret to name.
  632. Dialog.AlignSelected (dir | ^) aligns the selected objects so that they have the same left, right, top or bottom coordinates (specified by dir = R(ight), L(eft), U(p) or D(own)).
  633. Dialog.RegulateDistance (dir | ^) regulates the distance between the selected objects.
  634. Dialog.SetGrid (int| ^) sets the grid to which mouse movements are restricted.
  635. 4. A very simple Dialog
  636. Dialogs can be used as a graphical user interface for existing Oberon applications. This is shown in Fig. 4. Lets assume a dialog "Open.Dlg" that contains a text named "file" and a button named "Open". The button is associated with the command Edit.Open. The button property par (see above) is set to "file".
  637. Figure 4. Open.Dlg.
  638. The user can open the dialog with Dialog.Open Open.Dlg and can write a file-name in the text item. Pressing the "Open"-button opens the specified file.
  639. 5. Retrieving Dialog Items from a Program
  640. Dialog items can be retrieved by name. A dialog panel p can be opened by DialogFrames.OpenPanel(..., p). The item with the name "n" can then be retrieved with item : = p.NamedObject ("n").
  641. The following example shows how to use dialogs from a program. Lets assume a dialog "Test.Dlg" (see Fig. 5) that contains a text named "file", a check box named "draft", and a button named "Do". The button is associated with a command MyEdit.Print. Thus clicking the button calls this command which prints the file specified by the "file" in the mode specified by the check box "draft" (draft mode or normal mode). 
  642. Figure 5. Test.Dlg
  643. The source code of MyEdit could be as follows:
  644. MODULE MyEdit;
  645.     IMPORT DialogCheckBoxes, DialogFrames, Dialogs, DialogTexts, Oberon, TextFrames, Texts;
  646.     VAR  w: Texts.Writer; 
  647.     PROCEDURE Open*;
  648.     (** you can also use Dialog.Open Test.Dlg instead of this command *)
  649.         VAR x, y: INTEGER; p: Dialogs.Panel;
  650.     BEGIN
  651.         Oberon.AllocateUserViewer (Oberon.Mouse.X, x, y);
  652.         DialogFrames.OpenPanel ("Test.Dlg", x, y, p);
  653.     END Open;
  654.     PROCEDURE Print*;
  655.     (** prints the text in draft or not draft mode *)
  656.         VAR t, draft: Dialogs.Object; par: Oberon.ParList; res: INTEGER; t1: Texts.Text; p: Dialogs.Panel;
  657.     BEGIN
  658.         NEW (par); par.text := TextFrames.Text (""); 
  659.         par.vwr := Oberon.FocusViewer; par.frame := Oberon.Par.frame;
  660.         p := Dialogs.cmdPanel; (*the panel from where the command was called*)
  661.         t := p.NamedObject ("file"); 
  662.         draft := p.NamedObject ("draft");
  663.         WITH t: DialogTexts.Item DO
  664.             WITH draft: DialogCheckBoxes.Item DO
  665.                 IF draft.on THEN
  666.                     Texts.WriteString (w, "QuickDraw % ");
  667.                 ELSE
  668.                     Texts.WriteString (w, "QuickDraw ");
  669.                 END;
  670.                 t1 := t.GetText (); Texts.Save (t1, 0, t1.len, w.buf); Texts.Append (par.text, w.buf); 
  671.                 Oberon.Call ("Edit.Print", par, FALSE, res);
  672.             ELSE
  673.             END
  674.         ELSE
  675.         END
  676.     END Print;
  677. BEGIN
  678.     Texts.OpenWriter (w);
  679. END MyEdit.
  680. 6. Dialog Elements
  681. Dialogs can also be used as elements in a text (subclass of Texts.Element). 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 viewer
  682. s 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.
  683. command    explicit parameters    implicit parameters
  684. DialogElems.Insert    ("^" | "*" | name)    caret (plus marked viewer, if "*" is used)
  685. 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.
  686. 7 Sample Dialogs
  687. In the following, some dialogs which manages a simplified working with the Oberon system, are presented. The sample dialogs are contained in the Oberon Dialogs distribution.
  688. Search and Replace
  689. Figure 6. Search.Dlg
  690. Parcs and Style Elements
  691. Figure 7. GetSet.Dlg
  692. Select a parc and click the GetAll button. Now you can change the settings of the parc with the help of the GetSet.Dlg. In the Style combo box all style elements contained in the text with the selection and in Styles.Text are displayed. You can insert style elements from the combo box by setting the caret at the right position and selecting the style from the combo box. You can define your standard styles in Styles.Text and use them in all your documents. 
  693. Compile
  694. Figure 8. Compile.Dlg
  695. Specify the source to compile and the options. These options are used additionally to those defined in Folds.Profile or to those that are listed in the specification of the source file.
  696. Inspector
  697. Figure 9. Inspector.Dlg
  698. Select a text element and click the GetType button. Now you see the type of the text element selected.
  699. Print
  700. Figure 10. Print.Dlg
  701. Specify the options and click the Print button to print the text in the marked viewer. You can save the options (in the file "PrintOptions") and revert to the default options.
  702. Calculator
  703. Figure 11. Calc.Dlg
  704. Do simple calculations by clicking on the buttons. You can associate the displayed value with a variable by typing the name into the text field and clicking the Set button. "Clr" clears the value displayed. "CR" also clears the list of variables in the combo box. The combo box in the upper right corner controls the display. You can select any of the following types: dec, bin, oct, hex, real and char. If you selected "invers", then the inverse functions of Sin (= ArcSin), Cos (= ArcCos), Tan (= ArcTan), Exp (= Ln) and Sqr (= Sqrt) are executed.
  705. Acknowledgments
  706. I wish to thank Prof. Hanspeter M
  707. ssenb
  708. ck, for the support of this project. Further thank goes to my colleagues Markus Hof, Christian Mayrhofer, Christoph Steindl and Josef Templ for their valueable input. Christoph Steindl is also the creator of the sample dialogs.
  709. Comments
  710. Error reports and comments may be sent to knasmueller@ssw.uni-linz.ac.at or oberon@ssw.uni-linz.ac.at
  711.