Topic : The GFA-Basic Compendium Author : GFA Systemtechnik GmbH Version : GFABasic.HYP v2.98 (12/31/2023) Subject : Documentation/Programming Nodes : 899 Index Size : 28056 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : @default : Document not found @help : Help @options : +g -i -s +z @width : 75 @hostname : STRNGSRV @hostname : CAB @hostname : HIGHWIRE @hostname : THING View Ref-FileGRAF_RUBBERBOX(lx,ty,min_w,min_h[,last_w,last_h]) lx, ty, min_w, min_h: iexp last_w, last_h: ivar This function draws an outline of a rectangle while the left button is held down. The top left corner is fixed, but the width and height of the rectangle change with the position of the mouse. The function should be called only when a button is pressed, since it terminates when the button is released. Returns 0 if an error occured. lx - x-coordinate of top left corner. ty - y-coordinate of top left corner. min_w - Minimum width of rectangle. min_h - Minimum height of rectangle. last_w - Returns width of rectangle when function terminates. last_h - Returns heigth of rectangle when function terminates. The parameters last_w and last_h are optional, these values can also be found by querying GINTOUT(1) to GINTOUT(2). Example: DO ~EVNT_BUTTON(1,1,1,mx%,my%,bu%,kb%) ~GRAP_RUBBERBOX(mx%,my%,1,1,w%,h%) BOX mx%,my%,mx%+w%,my%+h% LOOP UNTIL BTST(kb%,3) --> EVNT_BUTTON() waits for the left button to be pressed, then puts the mouse coordinates into mx% and my%, and the status of the keyboard 'modifier' keys into kb%. The variables mx% and my% are then passed to GFAF_RUBBERBOX(), which continuously draws rectangles from (mx%, my%) to the current mouse position. When the function is terminated by releasing the button, GRAF_RUBBERBOX() puts the last width and height into w% and h%. A fixed box is then drawn with the standard BOX command. The program then ends if the Alternate key was held down when the mouse button was first pressed (i.e. bit 3 of kb% is set to 1), or otherwise loops around to draw another box. graf_rubberbox()+