From 6c3f0d8e560c5317100ea9e670699f085e5ed88d Mon Sep 17 00:00:00 2001 From: rmkaplan Date: Thu, 30 Jan 2025 22:53:26 -0800 Subject: [PATCH] Improved reference coordinates --- lispusers/REGIONMANAGER | 36 ++++++++++++++++------- lispusers/REGIONMANAGER.LCOM | Bin 9661 -> 9823 bytes lispusers/REGIONMANAGER.TEDIT | 54 ++++++++++++++++++++-------------- 3 files changed, 57 insertions(+), 33 deletions(-) diff --git a/lispusers/REGIONMANAGER b/lispusers/REGIONMANAGER index a591907f..a48efebe 100644 --- a/lispusers/REGIONMANAGER +++ b/lispusers/REGIONMANAGER @@ -1,12 +1,12 @@ (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) -(FILECREATED "27-Oct-2024 21:59:33" {WMEDLEY}REGIONMANAGER.;134 41230 +(FILECREATED "25-Nov-2024 17:59:00" {WMEDLEY}REGIONMANAGER.;135 42008 :EDIT-BY rmk - :CHANGES-TO (FNS CLOSE-TYPED-W) + :CHANGES-TO (FNS \RELCREATEREGION.REF) - :PREVIOUS-DATE " 2-Nov-2023 23:48:28" {WMEDLEY}REGIONMANAGER.;133) + :PREVIOUS-DATE "27-Oct-2024 21:59:33" {WMEDLEY}REGIONMANAGER.;134) (PRETTYCOMPRINT REGIONMANAGERCOMS) @@ -446,7 +446,8 @@ (DEFINEQ (\RELCREATEREGION.REF - [LAMBDA (REF WHICH) (* ; "Edited 27-Feb-2022 08:43 by rmk") + [LAMBDA (REF WHICH) (* ; "Edited 25-Nov-2024 17:47 by rmk") + (* ; "Edited 27-Feb-2022 08:43 by rmk") (* ; "Edited 23-Jan-2022 20:20 by rmk") (* ; "Edited 2-Jan-2022 11:01 by rmk") @@ -474,6 +475,10 @@ 'REGION)) (FETCH (REGION BOTTOM) OF (WINDOWPROP (WFROMDS T) 'REGION))) + ELSEIF (REGIONP REF) + THEN (CL:IF (EQ WHICH 'X) + (FETCH (REGION LEFT) OF REF) + (FETCH (REGION BOTTOM) OF REF)) ELSEIF [AND (LISTP REF) (SETQ ANCHOR (OR (REGIONP (CAR REF)) (AND (WINDOWP (CAR REF)) @@ -510,6 +515,15 @@ (CL:WHEN (CADR SPEC) (ADD VAL (CADR SPEC))) VAL + ELSEIF (WINDOWP REF) + THEN (SETQ REF (WINDOWPROP REF 'REGION)) + (CL:IF (EQ WHICH 'X) + (FETCH (REGION LEFT) OF REF) + (FETCH (REGION BOTTOM) OF REF)) + ELSEIF (POSITIONP REF) + THEN (CL:IF (EQ WHICH 'X) + (FETCH (POSITION XCOORD) OF REF) + (FETCH (POSITION YCOORD) OF REF)) ELSE (\ILLEGAL.ARG REF]) (\RELCREATEREGION.SIZE @@ -732,11 +746,11 @@ ) ) (DECLARE%: DONTCOPY - (FILEMAP (NIL (1615 6733 (SET-TYPED-REGIONS 1625 . 3800) (GRAB-TYPED-REGION 3802 . 4828) ( -REGISTER-TYPED-REGION 4830 . 6127) (REGION-TYPE 6129 . 6731)) (6734 14803 (RM-CREATEW 6744 . 8867) ( -RM-CLOSEW 8869 . 11887) (RM-GETREGION 11889 . 14038) (CLOSE-TYPED-W 14040 . 14801)) (15446 22925 ( -RELCREATEREGION 15456 . 20079) (RELGETREGION 20081 . 22688) (RELCREATEPOSITION 22690 . 22923)) (22926 -29730 (\RELCREATEREGION.REF 22936 . 26687) (\RELCREATEREGION.SIZE 26689 . 29728)) (29783 39125 ( -RM-ATTACHWINDOW 29793 . 39123)) (39126 40860 (CLOSEWITH 39136 . 39663) (CLOSEWITH.DOIT 39665 . 39945) -(MOVEWITH 39947 . 40470) (MOVEWITH.DOIT 40472 . 40858))))) + (FILEMAP (NIL (1622 6740 (SET-TYPED-REGIONS 1632 . 3807) (GRAB-TYPED-REGION 3809 . 4835) ( +REGISTER-TYPED-REGION 4837 . 6134) (REGION-TYPE 6136 . 6738)) (6741 14810 (RM-CREATEW 6751 . 8874) ( +RM-CLOSEW 8876 . 11894) (RM-GETREGION 11896 . 14045) (CLOSE-TYPED-W 14047 . 14808)) (15453 22932 ( +RELCREATEREGION 15463 . 20086) (RELGETREGION 20088 . 22695) (RELCREATEPOSITION 22697 . 22930)) (22933 +30508 (\RELCREATEREGION.REF 22943 . 27465) (\RELCREATEREGION.SIZE 27467 . 30506)) (30561 39903 ( +RM-ATTACHWINDOW 30571 . 39901)) (39904 41638 (CLOSEWITH 39914 . 40441) (CLOSEWITH.DOIT 40443 . 40723) +(MOVEWITH 40725 . 41248) (MOVEWITH.DOIT 41250 . 41636))))) STOP diff --git a/lispusers/REGIONMANAGER.LCOM b/lispusers/REGIONMANAGER.LCOM index 73f93ab4ae069995003d144a2a0655f42970d40e..5f7b6c23a0a4647c1da45022d4db795277f73f67 100644 GIT binary patch delta 633 zcmZut%Wl&^6pdMc$SM!IVRd9FQo67;4?AOfl~7L-Q`ZyO4k;2sqDfRL9<54+*mcc{ zg4ZC?KPX)y*t6gp5E37N_yAy`fZ_ul!m{w+S*th-jS``luLIiMnN{eY0y zkA&^6qHHqfoMbfMUO;^lTl>@T?vuTp$I}U>FZTAIHG<-Ob>%*Gp2F-7;}{oxwr!i3 zJUGze%K{lUSIfm_~Ob+*r*pKsbmrCq$LeLwtgvpr+J zT-_=y$m5eg<%#BJ_}iu9%?{^?SZ#^3{)27kxB;Oj;rY; z8>Vs;C7~LDbAfrOSt^jKVG`mt^~66y>M@MEsoDrL(EnoSg&4{_q_Q__==;Uj`r08E zEo_3j?%7Q!ay0<+DQ>AeR~ul0BGaEPlfI04{T!^t7XX+`kj_EwBbHswvZZ_!g?S&0 ho~sGhEvVqg^ShuecNSBZ38*WUk(B6ZPLFO_)xV{jpMwAZ delta 507 zcmZutyH3ME5X2QyDxL-1$Pywc9A)p$iR}W(#Fxb4@J03og9HVH6o^L2Wc3;%f`rX!i%hAJ2hc%c0qrmk8&hL*}x1xrM&6?jNQ9vRP z+{XU-XgEGOJ3Jm8V03+Uez6>&t#l?Gv)z}GljHCdc4wdzej3#4bsGnJm*v#I&YoSX zR6DVf?No+KMn}M .5 -1) results in a WIDTH that is one point smaller than half the width of window's region. Fraction and adjustment default to 1 and 0 respectively. -region/window/SCREEN/TTY: equivalent to (region/window/SCREEN/TTY 1 0). +list of the form (anchor fraction adjustment), where anchor is a region, window, or an atom SCREEN or TTY. The corresponding dimension of the anchor is mutiplied by fraction and adjustment is added to the result. For example, specifying ( .5 -1) results in a WIDTH that is one point smaller than half the width of window's region. Fraction and adjustment default to 1 and 0 respectively. +region/window/SCREEN/TTY:equivalent to (region/window/SCREEN/TTY 1 0). CORNERX can be LEFT, RIGHT, or NIL=LEFT, CORNERY can be BOTTOM, TOP, or NIL=BOTTOM. If LEFT/TOP are specified, for example, the region will be displayed down and to the right of the reference point. If RIGHT/BOTTOM, then up and to the left. The reference-point arguments REFX and REFY are interpreted as follows: NIL: LASTMOUSEX/LASTMOUSEY natural number: an absolute screen coordinate -(anchor fraction adjustment) or just region/window/SCREEN/TTY: the quantity determined relative to the size of anchor (as above) is added to the anchors left/bottom produce the REFX/REFY coordinate. In this case, fractions specified as LEFT/BOTTOM/NIL are interpreted as 0 and RIGHT/TOP are interpreted as 1. For example, a specification ( .4 -2) for REFY will produce a coordinate 2 points below the level that is 40% of the distance between the bottom and top of the window's region. -For convenience, if REFX is a position and REFY is NIL, then the XCOORD and YCOORD of REFX are taken as absolute values for REFX and REFY. -Also for convenience, if WIDTH is a potentially a list of RELCREATEREGION arguments, then the elements of that list are spread out in a recursive call. +(anchor fraction adjustment), or just region/window/SCREEN/TTY. The quantity determined relative to the size of anchor (as above) is added to the anchors left/bottom to produce the REFX/REFY coordinate. In this case, fractions specified as LEFT/BOTTOM/NIL are interpreted as 0 and RIGHT/TOP are interpreted as 1. For example, a specification ( .4 -2) for REFY will produce a coordinate 2 points below the level that is 40% of the distance between the bottom and top of the window's region. +If REFX and REFY are positions, then the XCCORD of REFX and the YCOORD of REFY are taken as the absolute values for REFX and REFY respectively. For conveninence, if REFX is a position and REFY is NIL, then the XCOORD and YCOORD of REFX are taken as absolute values for REFX and REFY. +Also for convenience, if WIDTH is potentially a list of RELCREATEREGION arguments, then the elements of that list are spread out in a recursive call. (RELGETREGION WIDTH HEIGHT CORNERX CORNERY REFX REFY MINSIZE) [Function] Calls GETREGION with an initial ghost region as created by RELCREATEREGION. CORNERX and CORNERY determine the ghost region's fixed corner, and the cursor starts at the region's diagonally opposite corner. If MINSIZE is true, then WIDTH and HEIGHT are taken as the minimum sizes of the region, except for adjustments that may be needed to ensure that all corners of the ghost region are initially visible on the screen. @@ -50,10 +60,10 @@ Calls GETREGION with an initial ghost region as created by RELCREATEREGION. COR Creates a position with X and Y coordinates specified by REFX and REFY references as above. Constellation regions -Applications are often set up as a constellation of windows, a central or primary window surrounded by some number of satellites for menus, headers, prompts, and secondary outputs. The main panel of a file browser, for example, displays the list of files, but above it are carefully arranged windows for the column headers, summary information, and prompts, and off to the side is the menu of file browser commands. FILEBROWSER interprets the screen region that the user sweeps out for a new browser as the region for the whole constellation,the smallest region that will enclose the central window and all of its satellites. Similarly, the screen region given to TEDIT and SEDIT is divided between the prompt window and the central editing window, again so that the whole constellation (a pair in these cases) fit within the provided region. -Each of these applications is constructed by anticipating the subregions that the satellite windows will occupy after they are attached, decreasing the constellation region by their estimated (using WIDTHIFWINDOW HEIGHTIFWINDOW) or actual sizes, and then using remainder as the region for the central window. +Applications are often set up as a constellation of windows, a central or primary window surrounded by some number of satellites for menus, headers, prompts, and secondary outputs. The main panel of a file browser, for example, displays the list of files, but above it are carefully arranged windows for the column headers, summary information, and prompts, and off to the side is the menu of file browser commands. FILEBROWSER interprets the screen region that the user sweeps out for a new browser as the region for the whole constellation, the smallest region that will enclose the central window and all of its satellites. Similarly, the screen region given to TEDIT and SEDIT is divided between the prompt window and the central editing window, again so that the whole constellation (a pair in these cases) fits within the provided region. +Each of these applications is constructed by anticipating the subregions that the satellite windows will occupy after they are attached, decreasing the constellation region by their estimated (using WIDTHIFWINDOW HEIGHTIFWINDOW) or actual sizes, and then using the remainder as the region for the central window. An alternative approach is to construct the central window first, giving it the entire constellation region, and then to have ATTACHWINDOW reshape that window to accomodate the satellite windows as they are attached in sequence. This leads to the same final configuration, but there is no need for separate calculations to pre-adjust the region of the central window. -REGIONMANAGER provides an overlay veneer for ATTACHWINDOW that implements this strategy. If the new argument TAKEFROMCENTRAL is true, then the region of the WINDOWTOATTACH will be substracted from the region of the existing central window according to the EDGE parameter of the attachment. +REGIONMANAGER provides an overlay for ATTACHWINDOW that implements this strategy. If the new argument TAKEFROMCENTRAL is true, then the region of the WINDOWTOATTACH will be substracted from the region of the existing central window according to the EDGE parameter of the attachment. (ATTACHWINDOW WINDOWTOATTACH MAINWINDOW EDGE POSITIONONEDGE WINDOWCOMACTION TAKEFROMCENTRAL) [Function] This behavior is also triggered if the UNDERCONSTRUCTION property of the central window is true. Thus, a constellation can be set up by creating all of the satellites and the central window, marking the central window as under construction, and then doing the sequence of attachments. The property can be reset to NIL when the construction is complete, so the central window does not shrink if other windows are attached (e.g. expanded menus) by later user actions. @@ -68,14 +78,14 @@ Establishes a link between the PARENT window and any number of CHILDREN windows If NEWPOS is the new position of PARENT, moves each of the move-children so that they stand in the same relation to PARENT after it moves as before. -(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# 1) (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 (ARABIC)) (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 Letter FOLIOINFO (ARABIC)) (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 (ARABIC)) (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 Letter FOLIOINFO (ARABIC)) (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 (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))) 1$4$4$1 $$1 $4$4$4$4$1$18$18$J$ PAGEHEADING RUNNINGHEADMODERN -rd(DEFAULTFONT 1 (TERMINAL 12) (TERMINAL 8) (TERMINAL 8) (PDF (TERMINAL 8)) (POSTSCRIPT (TERMINAL 8))) TERMINALMODERN TERMINALTERMINAL +(SEQUENCE NIL NIL (0 0 0 0) ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# 1) (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 (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (ALTERNATE NIL NIL (0 0 0 0) ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (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 (ARABIC)) (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 Letter FOLIOINFO (ARABIC)) (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 (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))))) 1$4$4$1 $$1 $4$4$4$4$1$18$18$J$ PAGEHEADING RUNNINGHEADMODERN +CLASSIC +TERMINALMODERN TERMINALTERMINAL TIMESROMAN$  HRULE.GETFN   HRULE.GETFN  HRULE.GETFN   HRULE.GETFN  HRULE.GETFN D   }/ [ CT  1   -; 3o)      4 n  o2 V@1 %!  A  &MmIS-f< +; 3o)      4 n  o2 V@1 %!  A  &MmIS-g< 3E " - -l /3 -t2C  "O=  , l)9 S~ - 4!Uh'2&$"&( )MDATE:f+2z \ No newline at end of file + +l /4 v2C  &% "O=  , l)9 W~ & 4!Uh'2&$"&( )MDATE:iem3\z \ No newline at end of file