Text preview for : WManWindows.mesa_Oct77.pdf part of xerox WManWindows.mesa Oct77 xerox mesa 3.0_1977 listing WManWindows.mesa_Oct77.pdf



Back to : WManWindows.mesa_Oct77.pd | Home

WManW1ndows.mesa 25-0CT-77 15:24:43 Page 1


--File: WManWindows.mesa
--Edited by Sandman October 7, 1977 9:46 AM
DIRECTORY
SegmentDefs: FROM "segmentdefs",
StreamDefs: FROM "streamdefs",
StringDefs: FROM "stringdefs",
SystemOefs: FROM "systemdefs",
MenuDefs: FROM "menudefs",
RectangleDefs: FROM "rectangledefs",
WindowDefs: FROM "windowdefs",
WManagerDefs: FROM "wmanagerdefs";
DEFINITIONS FROM StreamDefs, MenuDefs, RectangleDefs, WindowDefs, WManagerDefs;
WManWindows: PROGRAM[WMState: WMDataHandle]
IMPORTS SegmentDefs, StreamDefs, SystemDefs, MenuDefs, RectangleDefs, WindowDefs, WManagerDefs
EXPORTS WManagerDefs
SHARES StreamDefs, WManaaerDefs ~
BEGIN
OPEN WMState;
CR: CHARACTER = 15C;
-- some externals
PutSelect: PUBLIC PROCEDURE [w: WindowHandle, x: xCoord, y: yCoord]=
BEGIN
-- Declare Locals
i: CARDINAL;
str: STRING;
nw: WindowHandle;
doit: BOOLEAN;
[nw, doit] .. WindowFrontEnd[w, leftbutton];
IF do it THEN
BEGIN
-- get current selection and jam it into the keyboard stream
str ~ GetSelection[w];
IF nw.ks H NIL THEN
rOR i DECREASING IN [0 .. str. length) DO
nw.ks.putback[nw.ks, str[i]];
ENDLOOP;
SystemDefs.FreeHeapString[str];
END;
ButtonWait;
SetCursor[textpointer];
END;
CreateWindow: PUBLIC PROCEDURE [w: WindowHandle, x: xCoord, y: yCoord]
BEGIN
-- define locals
i: INTEGER;
rectangle: Rptr;
ds: DisplayHandle;
ks: StreamHandle;
name: STRING;
nw: WindowHandle;
mb: AMouseButton .. None;
-- Look at mouse for what to do
SetCursor[leftbutton);
UNTIL 1mb" GetMouseButton[]) Red DO
IF mb