|
|
|
|
||
|
DEFINITION MODULE DMPTFiles; (******************************************************************* Module DMPTFiles ('Dialog Machine' DM_V3.0) Copyright (c) 1990-2006 by Olivier Roth, Andreas Fischlin and ETH Zurich. Purpose Dump and/or load picture or text objects from or to DMFiles.TextFiles into a 'Dialog Machine' program. Remarks See also modules DMWTextIO and DMWPictIO. Uses DMWindows, internal 'Dialog Machine' modules, and the Toolbox. This module belongs to the 'Dialog Machine'. Programming o Design Olivier Roth 04/01/1990 Andreas Fischlin 04/01/1990 o Implementation Olivier Roth 04/01/1990 Andreas Fischlin 31/01/1990 ETH Zurich Systems Ecology CHN E 35.1 Universitaetstrasse 16 8092 Zurich SWITZERLAND URLs: <mailto:RAMSES@env.ethz.ch> <http://www.sysecol.ethz.ch> <http://www.sysecol.ethz.ch/SimSoftware/RAMSES> Last revision of definition: 04/01/1990 AF *******************************************************************) FROM DMWindows IMPORT RectArea; FROM DMFiles IMPORT TextFile; VAR PTFileDone: BOOLEAN; (* Read only variable, which returns whether any of the following procedures has been successful. E.g. if the text file used does currently contain no picture and the Dialog Machine program calls LoadPicture the value becomes FALSE. *) PROCEDURE DumpPicture(VAR f: TextFile); (* Copies the currently saved picture associated with the current Dialog Machine window to the file f. *) PROCEDURE LoadPicture (VAR f: TextFile; simulDisplay: BOOLEAN; destRect: RectArea); (* Allows to transfer the current pictorial content of the file f to the current Dialog Machine window. The content of the file must be in the so-called RTF (rich text format) picture format as produced by procedure DumpText (see below) or commercial programs like Microsoft Word or WriteNow. If simulDisplay is true the picture will be simultaneously displayed in the current output window in the rectangle destRect. If the width or height of the destRect is <0 then the picture will be displayed in its original size, if the lower left corner is =MIN(INTEGER) then the picture's original lower left corner will be respected, otherwise it will be resized to fit exactly into the given rectangle (exception: if all of destRect are =0 then the picture is fitted entirely into the destination window; for more explanations see DMWPictIO.DEF). fit exactly into the given rectangle. In case there is currently a text or picture object open (see also module DMWTextIO), the picture will be appended to the already existing picture but NOT to the eventually already existing text. This mechanisms allows to transfer a picture into a picture but not into a text object (different from GetText). *) PROCEDURE DumpText(VAR f: TextFile); (* Copies the currently saved text associated with the current Dialog Machine window to the file f. The picture information will be written as so-called RTF picture, which contains of simple ASCII-code characters. This form is interpretable by MS RTF (rich text format) capable programs like Microsoft Word or WriteNow, which can directly open such a file and convert it into a picture. *) PROCEDURE LoadText (VAR f: TextFile; simulDisplay: BOOLEAN; destRect: RectArea; fromLine: LONGINT); (* Allows to transfer the current textual content of the file f to the current Dialog Machine window. If simulDisplay is true the text will be simultaneously displayed in the current output window in the rectangle destRect starting with line fromLine at the top left corner of the rectangle destRect. If the text contains long lines exceeding the width of the destRect, their display will be clipped (no auto-wrap). In case there is currently a text or picture object open (see also module DMWTextIO), the picture will be appended to the already existing picture or text of the current output window. This mechanisms allows to transfer a text into a picture and/or into a text object (different from GetPicture). The resulting text object will be always terminated by 0C. *) END DMPTFiles.
|
||
|
|
|