RectStuff®

Version 2.1 - Feb 1999 - OSMOSE éditeur ©1998-2002.

Généralités - Texte français et commandes.

Autor : Thibaud@osmose.net Editor : editeur@osmose.net distributeur exclusif : sales@e-node.com


Routines syntax

 


rs_FLASH RECT(count;top;left;bottom;right)

Paramètres Type flêche Description
count Integer -> Number of times the rect must be flashed
top, left, right, bottom Integers -> rectangle, in local coordinates

Make the rectangle specified by top;left;bottom;right flash count times.

Index des routines


rs_INVERT RECT(top;left;bottom;right)

Paramètres Type flêche Description
top, left, right, bottom Integers -> rectangle, in local coordinates

Invert the rectangle specified by top;left;bottom;right.

This video effect stays until the window is redrawned. You can't "save" this effect.

Index des routines


rs_SET THE RECT(aRect;top;left;bottom;right)

Paramètres Type flêche Description
aRect Real <- Real for storing the coordinates
top, left Integers -> rectangle coordinates

rs_SET THE RECT put in the real aRect the 4 integers passed as coordinate. You can easely prepare a set of rectangles, and then use other routines such as rs_FLASH THE RECT or rs_INVERT THE RECT. rs_SET THE RECT must also be used for preparing the rectangles to be used by the drag'n drop or the rect's selection routines.

Index des routines


rs_FLASH THE RECT(count;aRect)

Paramètres Type flêche Description
count Integer -> Number of times the rect must be flashed
aRect Réel -> Real, local coordinates of the rectangle

Make the rectangle specified by aRect flash count times. aRect must have been filled by rs_SET THE RECT.

Index des routines


rs_INVERT THE RECT(count;aRect)

Paramètres Type flêche Description
aRect Real -> Real contenant les coordonnées du rectangle

Invert the rectangle specified by aRect. aRect must have been filled by rs_SET THE RECT. This video effect stays until the window is redrawned. You can't "save" this effect.

Index des routines


rs_DRAG RECT ON ONE RECT(startRect;destRect;goodDrop;frameRect)

Paramètres Type flêche Description
startRect Real -> start rectangle
destRect Real -> destination rectangle
goodDrop Integer <- 1 if startRect was dropped on desRect
frameRect Integer -> Frame destRect instead of inverting it
doOffset Integer -> Calcultate an offset if the scrollbars are scrolled

This routine will be usually called from the object method of an invisible button (because 4D gives such object the "mouseUp" event when the mouse is down.

A standard button is given this event when the mouse is released), or a list, or any object wich works when the mouse id down.

If doOffset is not 0, the routine changes rectangle coordinates in function of the atual scroll of the window. If startRect is given "on the way" (ie when dropping an array element), you must set doOffset to 0. If you call the routine from an object (invisible button by exemple), it is necessary for the plug-in to take care of the actual scroll.

Index des routines


rs_DRAG RECT ON LOT OF RECTS(startRect;aRects;index;frameRect)

Paramètres Type flêche Description
startRect Real -> start rectangle
arrRects Array Real -> destination rectangles
index Integer <- position, in arrRect, of the dropped rect
frameRect Integer -> Frame rectangles in arrRects instead of inverting
calculerOffset Entier -> Calculer un offset pour rectDepart

This routine does the same thing than rs_DRAG RECT ON ONE RECT, but it is given, as 2nd parameter, an array of reals. Each element of this array must hav been filled by tp_SET THE RECT. Each time the mouse (with button down) enters within one of the rectangles of arrRects, this rectangle will be inverted (or framed if frameRect is set to 1).

After the mouse is released, index is set to -1 if it was not released within one of the destination rectangles. Else, it is set to the position of the destination rectangle in the array arrRects.

Note: an element of an array can't receive any value from a plug-in. This is not a fact of RectStuff, it is a "rule" for all plug-ins. You must use a buffer variable.

For example, it is not possible to write:

rs_SET THE RECT(unTableau{10};5;5;25;25)

you must write:

rs_SET THE RECT($unRect;5;5;25;25)
unTableau{10}:=$unRect

Index des routines


rs_SELECTION RECT(top;left;bottom;right;allScreen)

Paramètres Type flêche Description
Top, left, right, bottom Integers <- Rectangle drawned by the user
allScreen Integer -> Use all the screen

The routine waits for the user to press the mouse. It then follows the moves, drawing a "selection rectangle", just like when you select files on the desktop by example.

When the user has finished (the button is released), top, left bottom and right are filled with the coordinates of the rectangle. If he did nothing (simple mouse up, or go back to the start point), all parameters are set to 0. The selection rect is drawned in the frontmost window. If allScreen is not 0, the all the screen can be used.

Note: if allScreen is 0 (drawing the rectangle in the window only), you will receive local coordinates. Else, top, left, bottom and right are globals coordinates.

Index des routines


rs_SELECTION RECT_2(top;left;bottom;right;arrRects;tIndex;frameRect;letHilited)

Paramètres Type flêche Description
Top, left, right, bottom Integers -> Rectangle drawned by the user
arrRects Real Array -> testing rectangles
arrIndex Integer or Long integer array <- selected rectangles
frameRect Integer -> frame instead of invert
letHilited Integer -> let the rects inverted when finished

This routine does the same as rs_SELECTION RECT, with the ability of selecting one or more of the rectangles stored in arrRects (filled with rs_SET THE RECT). Any rect of arrRects wich is within the user rect is hilited. It is just like in the form editor of 4D, when you can select object. When the user has finished, top, left, bottom and right are filled with the coordinates of the user rect. The sie of arrIndex is equal to the number of hilited rectangles. Each element of arrIndex is the position of the corresponding rectangle in arrRects. If letHilited is not 0, the selected rectangle stay hilited (or framed). Beware that this effect is not persistant, and the next time 4D redraw the window (by example when a ScreenSaver draw things on the screen), the hilited/framed rectangles will be undrawned.

Please note:

Index des routines