Contents
Navigation
Home User Reference Other Resources

The QTPlgRect class lets you deal with rectangular areas using instances of this class.

Since version 6.7 of the plugin this class can be used in Console Applications






The QTPlgRect class constructors are called when you create a new instance of the class, while the ˜QTPlgRect class destructor, is called automatically when the class is no more in use. Also, you can invoke the class destructor by setting the instance of the class to nil.
Once a new class instance is returned, it is good practice to check the class property to be sure that the new object can be used. A QTPlgRect object is valid if it is not empty, that is if the bottom coordinate is greater than the top coordinate and if the right coordinate is greater than the left. As, when creating an instance of this class by using the , all of the coordinates of the rectangle are set to 0, then the class property will be false; this being the case, it is lecit to continue to use the class.

The class provides you with the following initializer methods:
()
This is the default constructor. All of the class properties are set to 0
(other as QTPlgRect)
This is the copy constructor. The properties of the object to be copied will be used to initialize the new class instance properties
(c as control)
the coordinates of the rectangle are initialized according to the position, expressed in local coordinate system, of the RealBasic control specified by the c parameter
(w as integer, h as integer)
this version of the class constructor causes both the and the to be set to 0; the will equal to (set by the w parameter) and the will equal to (set via the h parameter)
[Deprecated]: since version 6.6 of the plugin this constructor is deprecated and will be removed from a future plugin version; use the class constructor instead
(size as )
this version of the class constructor causes both the and the to be set to 0; the will equal to the property of the size object and the will equal to the property of the size object

returns a reference to the Rect C structure used by QuickDraw to define rectangles. useful for toolbox programmers
specifies the left corner, in pixels, of the rectangle. This value is intended in local coordinate system
specifies the top corner, in pixels, of the rectangle. This value is intended in local coordinate system
specifies the right corner, in pixels, of the rectangle. This value is intended in local coordinate system
specifies the bottom corner, in pixels, of the rectangle. This value is intended in local coordinate system
specifies the width, in pixels, of the rectangle area
[Deprecated]: since version 6.6 of the plugin this property is deprecated and will be removed from a future plugin version; use the class property instead
specifies the height, in pixels, of the rectangle area
[Deprecated]: since version 6.6 of the plugin this property is deprecated and will be removed from a future plugin version; use the class property instead
specifies the width and height, in pixels, of the rectangle area
specifies the horizontal coordinate, in pixel, of the rectangle center
[Deprecated]: since version 6.6 of the plugin this property is deprecated and will be removed from a future plugin version; use the class property instead
specifies the vertical coordinate, in pixel, of the rectangle center
[Deprecated]: since version 6.6 of the plugin this property is deprecated and will be removed from a future plugin version; use the class property instead
the coordinates, in pixel, of the center of the rectangle
specifies the left and top coordinates, in pixel, of the current rectangle
specifies the right and bottom coordinates, in pixel, of the current rectangle
specifies the ratio, expressed as absolute value, between the and the of the rectangle

(bounds as QTPlgRect) as QTPlgRect
given the current rectangle and the rectangle specified by the bounds parameter, this function creates a new rectangle whose dimensions represent the largest possible rectangle to fit in bounds, while maintaining its aspect ratio. The new rectangle is also centered respect to bounds
returns a new rectangle with the characteristics discussed above or nil if some error occurred. Check the class property for errors