home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 August / macformat-027.iso / mac / Shareware City / Developers / Oberon⁄F / Demo (.txt) next >
Encoding:
Oberon Document  |  1994-06-07  |  24.9 KB  |  271 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. StdLogos.ViewDesc
  23. Geneva
  24. Geneva
  25. Geneva
  26. Geneva
  27. Geneva
  28. HostPictures.StdViewDesc
  29. UUUUUU
  30. 33ff33
  31. !  !!
  32. QUQ#!!#
  33. 22022
  34. S#!#0
  35. 334#D$C$#D$!
  36. D2B2$B
  37. 3AC"#D$BC#D##$A
  38. DCB4DF
  39. 22B42C24$234T
  40.  !!##!
  41. UQUUQUU
  42. 3##30
  43. $DFBDd#F$#DB
  44. DD331
  45. f6f6cf0
  46. U32230
  47. 33"2"2
  48. dB4d2IDF
  49. 3    B24B21
  50. c#!!`
  51. fc! !!
  52. ((22#30
  53. 3#3#C$1
  54. 3#$#C$dC$df
  55. #JDC#$C#C
  56. ffb""8
  57. 3B42DBD$1
  58. DB42$BdDD
  59. 2JBB4
  60. D    B2B22B22A1
  61. "&#USS#US
  62. #C$C(c)DBDLDC
  63. #DJC$JA
  64. eUf56f
  65. fFD2B6B6
  66. D2iiIDFIfDDi
  67. Djffj*F
  68. #313!/
  69. fdaaIAA
  70. f&bBiI&
  71. EEJJ#C$
  72. / !!/
  73. Vfc3S6
  74. haifID
  75. iffiFf
  76. I*EaB
  77. hffkk
  78. kfiiffi
  79. iffif
  80. ifiiF
  81. ffdfDf
  82. Ffjfjf
  83. JDj22?
  84. #f#c#cc#!/
  85. ffiif
  86. ifFff
  87. 6f6ff
  88. f    iffidf
  89. 2260f
  90. hhfhh
  91. 6f6f6f6f6622
  92. f6f6f3cc## 
  93. #&ffc#&`
  94. 6f6f6f626
  95. 6ff6b26f`
  96. ffkfkii
  97. f6fcc#c
  98. &f6f6
  99. kfmfk
  100. 6f6f6
  101. #6f6f6
  102. fiffF
  103. f6f6f662
  104. kfkf`h
  105. fhfn(hkff
  106. fkkff`
  107. fiDfif
  108. *j**h
  109. dhddHk
  110. dKMKII
  111. hhkfh
  112. ffmfk
  113. ffFDF
  114. hfhff
  115. hfhfh
  116. ffmf`
  117. ffkfh
  118. fhkff
  119. fdDf`
  120. fhfhff
  121. fbDDK
  122. k$dd`
  123. N))ff`
  124. U5330
  125. UU330
  126. 35SU5S
  127. 35U5SU55US3
  128. 553SUU0
  129. 5U5USS0
  130. SUUSU5UU
  131. USSU5U30
  132. 35SSU5U1
  133. 33SU5
  134. 3SUUS
  135. SUS30
  136. 5U5SUUSUUSU"
  137. SUS33
  138. 5USS330
  139. SU530
  140. 3U335
  141. S33UU5
  142. 5SS3SUU55SU5US
  143. U5SU5UU530
  144. 3SUSS
  145. 33UU5
  146. SUSS33
  147. S    USUS3S35UU
  148. SU33U5SU5
  149. SUU5UU5
  150. QQ33U
  151. Geneva
  152. Geneva
  153. Geneva
  154. MODULE SamplesEx0;
  155.     IMPORT Out;
  156.     PROCEDURE Do*;
  157.     BEGIN
  158.         Out.String("Hello World"); Out.Ln
  159.     END Do;
  160. END SamplesEx0.
  161. TextControllers.StdCtrlDesc
  162. TextControllers.ControllerDesc
  163. Containers.ControllerDesc
  164. Controllers.ControllerDesc
  165. Geneva
  166. Geneva
  167. DevCommanders.StdViewDesc
  168. DevCommanders.ViewDesc
  169. Geneva
  170. Geneva
  171. MODULE SamplesEx0;
  172.     IMPORT Outo;
  173.     PROCEDURE Do*;
  174.     BEGIN
  175.         Out.String("Hello World"); Out.Ln
  176.     END Do;
  177. END SamplesEx0.
  178. Geneva
  179. Geneva
  180. Geneva
  181. MODULE Addresses;
  182.     IMPORT Views, Dialog, TextModels, TextMappers, TextViews;
  183.         adr*: RECORD (Dialog.Interactor)
  184.             name*:    ARRAY 64 OF CHAR;
  185.             email*:    ARRAY 64 OF CHAR;
  186.             customerID*:    LONGINT;
  187.             getsUpdates*:    BOOLEAN;
  188.             Text*:    PROCEDURE
  189.         END;
  190.     PROCEDURE Text;
  191.         VAR t: TextModels.Model; f: TextMappers.Formatter; v: Views.View;
  192.     BEGIN
  193.         t := TextModels.dir.New();
  194.         f.ConnectTo(t);
  195.         f.WriteString(adr.name); f.WriteString(", "); f.WriteString(adr.email); f.WriteLn;
  196.         f.WriteString("Customer ID "); f.WriteInt(adr.customerID);
  197.         IF adr.getsUpdates THEN f.WriteString(" - gets updates") END;
  198.         f.WriteLn;
  199.         v := TextViews.dir.New(t);
  200.         Views.Open(v, NIL, "");
  201.         adr.name := ""; adr.email := ""; adr.customerID := 0; adr.getsUpdates := FALSE;
  202.         adr.Notify
  203.     END Text;
  204. BEGIN
  205.     adr.Text := Text
  206. END Addresses.
  207. Geneva
  208.  Oberon/F
  209.     Macintosh
  210.     Demo
  211.     12.94
  212. Guided Demonstration of Oberon/F, Version 1.0 Mac.
  213. This Demo
  214. This text is a brief introduction to Oberon/F. Read it and follow the small hands
  215. on examples to get a feeling for the concepts and working model of Oberon/F.
  216. Oberon/F
  217. Oberon/F is an integrated cross
  218. platform development system for the language Oberon. Currently, versions for Macintosh System 7 and Windows 3.1/NT 3.1 are available; other versions are planned. Oberon/F fully exploits the platform-specific user interface. Access to the underlying platform is possible, but can be isolated into special low-level modules. All modules relying on portable interfaces only, which includes most of the Oberon/F services, are fully portable, and still adopt the platform
  219. specific look-and-feel.
  220. The development environment for Oberon/F is identical with the production run
  221. time environment of Oberon/F, enabling rapid development. The language Oberon is statically type
  222. checked, fully type-safe, and garbage collected. Being a direct descendant of Pascal and Modula
  223. 2, it is easy to learn and to teach, programs are legible, and various programming paradigms, including object
  224. oriented programming, are easily expressed. Oberon is simple enough to serve as a scripting language, yet powerful enough to enable system
  225. level programming: Oberon/F itself is entirely written in Oberon. The Oberon compiler produces fast, native, 32-bit code. The system uses dynamic linking to completely avoid explicit linking steps in the development cycle.
  226. Oberon/F is a fully extensible open framework. New subsystems, at equal footing with the standard texts, forms, and development subsystems, can be added freely and easily. Existing subsystems can be extended to accommodate new needs. Still, traditional double
  227. clickable applications can be created as well.
  228. Oberon/F is based on a compound document model; it is planned to adopt OLE 2.0 and OpenDoc in the future. Embedded document parts can be edited and resized in place. This demo text contains several embedded parts. Here is a first one: A non
  229. portable Macintosh PICT
  230. 2 view (without editing capabilities); it can be resized by first clicking into the picture, then selecting it by clicking into the grey border lines, and finally dragging the displayed resize handles. Resizing constraints are resolved on the fly: In the example, the PICT view stays in proportion.
  231.     A PICT
  232. 2 viewer as an example of an embedded document part
  233. The Oberon/F framework supports drag & drop editing (integration with the finder "clippings" mechanism is not yet available). To copy, hold down the option key when starting to drag.
  234. An embedded object can be edited as a part of the embedding text. To avoid focusing an embedded part when trying to select it as a whole, hold down the command key while clicking into the part. (When clicking into a part while holding down the shift key in order to extend a selection, focussing is also disabled.)
  235. Almost all operations in Oberon/F are subject to a multi
  236. level undo/redo feature. (In fact, the framework makes it so easy to program something in an undoable fashion that it is almost more involved not to do so.)
  237. Program Development
  238. The following embedded part is a fully editable text, showing the complete source of a small Oberon module. To compile the module, focus the embedded part by clicking into it, and then execute Compile from menu Dev.
  239. SamplesEx0 is a minimal "hello world" program in Oberon. It writes a single line to the system log text. Execute Open
  240. Log from menu Dev to display the system log, if it isn't open already.
  241. Exported items in Oberon modules are marked by a trailing asterisk; there are no separate header files, definition modules, or the like. Consistency of interfaces and implementations is fully checked by the compiler; version integrity is checked by the dynamic linker.
  242. Module SamplesEx0 exports a single command Do. Commands are Oberon procedures that have no explicit parameters; they can be executed directly from the user interface. There is no need for a top
  243. level module or a "main" procedure. A command can be added to a menu, attached to a button, or executed directly from within a text. To do the latter, the name of the command must be preceded by the name of the implementing module:
  244.  SamplesEx0.Do
  245. To execute a command by name, simply select the command string and execute Execute from menu Dev. Another possibility is to precede the command name with a special embedded part, called a commander 
  246.  that can be inserted anywhere into a text using Insert
  247. Commander from menu Dev. Clicking on a commander executes the appropriate command.
  248. If the source contains errors detectable by the compiler, these are flagged directly in the text. For example, the following module version erroneously imports the (non
  249. existing) module Outo, instead of Out. Try to compile the module - the compiler inserts special embedded parts, error markers, flagging the errors that it found. (The compiler also writes a report to the system log.)
  250. By clicking on an error marker, it is expanded to display a short error message. Correct the mistake (delete the superfluous o in IMPORT Outo), and compile again. The marker disappears, and the module is compiled successfully.
  251. The set of currently loaded modules can be inspected using Loaded
  252. Modules from menu Info. The interfaces of modules (loaded or not) can be displayed using the browser: Select a module name and execute Interface from menu Info.
  253. A module remains loaded until it is explicitly unloaded, or until the system is restarted. To unload a module, select the module name and execute Unload
  254. Module
  255. List from menu Dev. For example, unload SamplesEx0, modify the string "Hello world", recompile SamplesEx0, and activate SamplesEx0.Do again. Note that your changes do not affect the running system until after you have unloaded the old module. Such an explicit unloading is a very useful mechanism to allow major changes in multiple modules, while still using and working with the previous version. (Consider editing the Oberon/F system editor with itself...)
  256. Linking Programs to Forms
  257. Besides the text and programming subsystems, the standard Oberon/F configuration also comes with a forms subsystem, including a visual designer.
  258. The following module defines a simple record variable to be used for a data entry form.
  259. After compiling the module, a dialog box can be created for the variable Addresses.adr using command New
  260. Form... from menu Dev. Just enter the name of the exported global variable Addresses.adr into the link field, and click on the Create button. The type information extracted by the compiler is available to Oberon/F at run-time, which is used to automatically create a data-entry window for the form, with a simple default layout.
  261. The created layout can be edited, and then opened as a dialog using the Open
  262. Dialog
  263. (Aux) command in menu Dev.
  264. The text entry fields and the checkbox are directly linked to the fields name, email, and getsUpdates of the variable Addresses.adr. The button is linked to the field Text, a procedure variable initialized to refer to procedure Text in module Addresses. Clicking the button causes procedure Text to be called. In turn, a new text is created, a report based on the variable adr is written to the text, a new text view is created, and used to open a window displaying the report. Next, the dialog variable is cleared and the system is notified that the variable has changed, causing the form's display to resynchronize with the changed variable.
  265. A form can be saved from within the visual editor; thereafter it can be attached to a menu entry, or another dialog's button. Dialogs are saved in the standard document format, and in a platform
  266. independant way.
  267. And more ...
  268. After this first impression, you may want to consult your documentation for an in-depth coverage of Oberon/F. The file Manuals:Roadmap gives an overview over the available documentation.
  269. Geneva
  270. Documents.ControllerDesc
  271.