Defines a class to contain and perform calculations on a TRect. The advantage of using TRSObjectRect is that the class can be used as a published property, where the user will be able to set the boundaries of the rectangle at design time. The TRSObjectRect class is a descendant of the RSGraphics.TRSCustomRect class which publishes the boundaries of the rectangle represented by the class.
The TRSObjectRect represents the dimensions of a rectangle. The coordinates are specified as four separate integers representing the left, top, right, and bottom sides.
Typically, values represent pixel locations, where the origin of the pixel coordinate system is in the top left corner of the screen (screen coordinates) or the top left corner of a control's client area (client coordinates). When a TRSObjectRect value represents a rectangle on the screen, by convention the top and left edges are considered inside the rectangle and the bottom and right edges are considered outside the rectangle. This convention allows the width of the rectangle to be Right - Left and the height to be Bottom - Top.
Note
|
The BoundsRect property represents the underlying TRect rectangle. You should use the provided properties; Left, Right, Top, Bottom, Width, and Height; to set the rectangle's fields. If you use the BoundsRect field's directly, the OnChange event will not be called.
|
Namespace: RSGraphics
|
Name
|
Description
|
|
Bottom
|
Represents property Bottom.
|
|
BoundsRect
|
Specifies the underlying TRect rectangle for the class.
You should use the provided properties; Left, Right, Top, Bottom, Width, and Height; to set the rectangle's fields. If you use the BoundsRect field's directly, the OnChange event will not be called. However, setting the entire property (e.g., BoundsRect := Rect(0,0,10,10)) will fire the OnChange event,
|
|
Height
|
Represents property Height.
|
|
Left
|
Represents property Left.
|
|
OnChange
|
Occurs when the rectangle's dimensions are changed through the class' properties or the transformation methods ( MoveTo, Scale , Translate ). If you change the BoundsRect's fields directly, an OnChange event will not occur. Write an OnChange event handler if you want to respond to changes in the rectangle.
Note
|
Note that the OnChange event is not published, either in this class or in RSGraphics.TRSObjectRect. This allows you to use the TRSCustomRect class to publish a rectangle and receive OnChange events at design-time (similar to publishing a TPen property).
|
|
|
Right
|
Represents property Right.
|
|
Top
|
Represents property Top.
|
|
Width
|
Represents property Width.
|
Top
|
|
Name
|
Description
|
|
Assign(TPersistent)
|
Represents method Assign(TPersistent). (Inherited from RSGraphics.TRSCustomRect.)
|
|
Change
|
Represents method Change. (Inherited from RSGraphics.TRSCustomRect.)
|
|
GetSize(Integer)
|
Represents method GetSize(Integer). (Inherited from RSGraphics.TRSCustomRect.)
|
|
MoveTo(Integer,Integer)
|
Moves the object rect Top, Left to the specified X,Y. It retains the width and height of the rectangle. (Inherited from RSGraphics.TRSCustomRect.)
|
|
Scale(Integer,Integer)
|
Scales the object rectangle by the specified DX, DY. The scaling is done from the rectangle's center point so Left, Right, Top, and Bottom all change. (Inherited from RSGraphics.TRSCustomRect.)
|
|
SetBoundsRect(TRect)
|
Sets the BoundsRect property. (Inherited from RSGraphics.TRSCustomRect.)
|
|
SetSize(Integer,Integer)
|
Represents method SetSize(Integer,Integer). (Inherited from RSGraphics.TRSCustomRect.)
|
|
Translate(Integer,Integer)
|
Moves the object rectangle Top, Left by the specified delta X and Y. It retains the width and height of the rectangle. (Inherited from RSGraphics.TRSCustomRect.)
|
Top
|