XEROX REGION 2 4 1 REGION 1 4 By: Christopher Lane (LANE@SUMEX-AIM.ARPA) REGION facilitates having multiple complex cursor behaviors in a single window without having the CURSORMOVEDFNs, CURSORINFNs, CURSOROUTFNs, and BUTTONEVENTFNs of the behaviors know about each other. In its simplest form it can be used to implement active regions of varying sizes. To use REGION, set the various window functions of the window to the REGION window functions and put a list of REGIONEVENT records on the REGIONEVENTLST property of the window. When the cursor moves over the window, REGION checks which region it is in, calls the CURSOROUTFN of the previous region and the CURSORINFN of the new region. This is similar to having several windows within a window. If regions overlap, then the appropriate functions will be called on all regions affected by the mouse event. The REGIONEVENTLST property of the window should contain a list of REGIONEVENT records which have the fields: EVENTREGION A REGION record which is the region of the window over which the region specific functions will be invoked. REGIONBUTTONFN The BUTTONEVENTFN(WINDOW POSITION REGION REGIONEVENT) for the region. REGIONMOVEDFN The CURSORMOVEDFN(WINDOW POSITION REGION REGIONEVENT) for the region. REGIONINFN The CURSORINFN(WINDOW REGION REGIONEVENT) for the region. REGIONOUTFN The CURSOROUTFN(WINDOW REGION REGIONEVENT) for the region. REGIONREPAINTFN The REPAINTFN(WINDOW REGION REGIONEVENT) for the region. ACTIVEREGION Boolean indicating if the region is active or not. REGIONFLAGS User defined identification flags. REGIONUSERDATA User defined field. All of the fields in the REGIONEVENT record are optional. If a REGIONEVENT record has a NIL EVENTREGION, then that is considered the default REGIONEVENT and will be invoked whenever a mouse event occurs outside of any other region. The REGION window functions are: (WINDOWPROP WINDOW 'CURSORINFN (FUNCTION REGIONINFN)) (WINDOWPROP WINDOW 'CURSOROUTFN (FUNCTION REGIONOUTFN)) (WINDOWPROP WINDOW 'REPAINTFN (FUNCTION REGIONREPAINTFN)) (WINDOWPROP WINDOW 'CURSORMOVEDFN (FUNCTION REGIONMOVEDFN)) (WINDOWPROP WINDOW 'BUTTONEVENTFN (FUNCTION REGIONEVENTFN)) The above window properties can be set using the function: (REGION.INIT WINDOW REGIONEVENTLST SAVE?) [Function] The REGIONEVENTLST is a list of REGIONEVENT records to put on the window. If SAVE? is T, the CURSORINFN, CURSOROUTFN, etc. of the window are put into a default region event record (one with an EVENTREGION = NIL) and added to the REGIONEVENTLST. The REGIONFLAGS field of the REGIONEVENT record consists of whatever atoms the user wishes to identify regions with. These allow the user to issue commands such as "turn off all regions marked GRAPH", "activate all the MENU regions", etc. (ACTIVATEREGIONS FLAGS WINDOW) [Function] (DEACTIVATEREGIONS FLAGS WINDOW) [Function] Activate and deactivate all the REGIONEVENT records on WINDOW whose REGIONFLAGS have a flag in common with FLAGS. If FLAGS is T, activate or deactivates all REGIONEVENT records. The variable DISABLEFLG, if T, disables all of the region functions for all windows using the REGION package. Alternatively, setting DISABLEFLG to a window, or list of windows, disables all the windows using the REGION package except for those windows on DISABLEFLG. This allows turning off parts of the screen that should only be active at certain times.(LIST ((PAGE NIL (FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))(lÈ(È (È(ŠŠ8(ŠŠ8DÈÈ PAGEHEADING RUNNINGHEADTERMINAL  HELVETICA MODERN MODERN MODERN MODERNMODERN LOGO HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN ,ünz""!"@0$ê!68:<<;  öð    ³f eezº