|
|
|
|
||
|
DEFINITION MODULE DMClipboard; (******************************************************************* Module DMClipboard ('Dialog Machine' DM_V3.0) Copyright (c) 1987-2006 by Olivier Roth, Andreas Fischlin and ETH Zurich. Purpose Use of the clipboard together with the standard Edit menu by a 'Dialog Machine' program, plus support of the transfer of picture or text objects from or to the clipboard into a 'Dialog Machine' program. Remarks See also modules DMWTextIO and DMWPictIO. Uses DMMenus, DMWindows, internal 'Dialog Machine' modules, and the Toolbox. This module belongs to the 'Dialog Machine'. Programming o Design Olivier Roth 09/04/1987 Andreas Fischlin 14/03/1989 o Implementation Olivier Roth 09/04/1987 Andreas Fischlin 14/03/1989 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: 23/10/1990 AF *******************************************************************) FROM SYSTEM IMPORT ADDRESS; FROM DMWindows IMPORT RectArea; TYPE EditCommands = ( undo, cut, copy, paste, clear ); (* When a Desk Accessory-Window is on top the DA has to interprete the Edit-Commands, but when there is no DA-Window the front-most window, your application has to perform an adaequate action. With the following procedures you can install procedures for that case. *) VAR ClipboardDone: BOOLEAN; (* Read only variable, which returns whether any of the following procedures has been successful. E.g. if the clipboard does currently contain no picture and the Dialog Machine program calls GetPictureFromClipboard the value becomes FALSE. *) PROCEDURE InstallEditMenu ( UndoProc, CutProc, CopyProc, PasteProc, ClearProc: PROC ); PROCEDURE RemoveEditMenu; PROCEDURE UseEditMenu; (* The above three procedures either install, remove, or use the usual Edit-Menu with the Undo-, Cut-, Copy-, Paste-,and Clear-Commands with all their usual shortcuts. The meaning of install, remove, and use are the same as the corresponding procedures from module DMMenus. *) PROCEDURE EnableEditMenu; PROCEDURE DisableEditMenu; (* Enables or Disables the complete EditMenu ( but will not redraw the Menubar with "Edit" in grey ). *) PROCEDURE EnableEditCommand( whichone : EditCommands); PROCEDURE DisableEditCommand( whichone : EditCommands); (* Enables or Disables the specified Command from the EditMenu *) PROCEDURE PutPictureIntoClipboard; (* Copies the currently saved picture associated with the current Dialog Machine window to the Clipboard. *) PROCEDURE GetPictureFromClipboard (simultaneousDisplay: BOOLEAN; destRect: RectArea); (* Allows to transfer the current pictorial content of the clipboard to the current Dialog Machine window. If simultaneousDisplay 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). 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 GetTextFromClipboard). *) PROCEDURE PutTextIntoClipboard; (* Copies the currently saved text associated with the current Dialog Machine window to the Clipboard. *) PROCEDURE GetTextFromClipboard (simultaneousDisplay: BOOLEAN; destRect: RectArea; fromLine: LONGINT); (* Allows to transfer the current textual content of the clipboard to the current Dialog Machine window. If simultaneousDisplay 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 GetPictureFromClipboard). The resulting text object will be always terminated by 0C. *) END DMClipboard.
|
||
|
|
|