XEROX REGION 2 4 1 REGION 1 4 By: Christopher Lane (Lane@Sumex-Aim.Stanford.Edu) 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. To use, 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. 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 (WINDOW POSITION REGION REGIONEVENT) REGIONMOVEDFN (WINDOW POSITION REGION REGIONEVENT) REGIONINFN (WINDOW REGION REGIONEVENT) REGIONOUTFN (WINDOW REGION REGIONEVENT) REGIONREPAINTFN (WINDOW REGION REGIONEVENT) 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 it 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 macro: (ADDREGIONEVENT REGIONEVENT WINDOW) [Macro] can be used to add a REGIONEVENT record onto the current REGIONEVENTLST of WINDOW. 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. This allows selectively turning off cursor actions on parts of the screen.(LIST ((PAGE NIL (PAPERSIZE LETTER STARTINGPAGE# 225) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE NIL . LETTER) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE NIL . LETTER) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))(È(È(ŠŠ8(ŠŠ8DÈÈ PAGEHEADING RUNNINGHEADTERMINAL  HELVETICA MODERN MODERN MODERNMODERN LOGO HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN 4 ¹nz""@0$Y‹!68:<<;  <x  +ð    7.3  j ¹ ïŒzº