[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Calculates the Width and Height for the layout used on the speed button and optionally renders the control.
Source position: buttons.pp line 374
protected procedure TCustomSpeedButton.MeasureDraw( |
Draw: Boolean; |
PaintRect: TRect; |
out PreferredWidth: Integer; |
out PreferredHeight: Integer |
); |
Draw |
|
True if the background and content for the control are drawn. False to calculate the preferred width and height only. |
PaintRect |
|
Drawing area on the canvas where the content is positioned. |
PreferredWidth |
|
Returns the preferred width calculated for the control. |
PreferredHeight |
|
Returns the preferred height calculated for the control. |
MeasureDraw determines the space needed to draw the content for the speed button control. Values in the Caption, ShowCaption, Glyph, Margin, Spacing, and Layout properties are used to determine the layout for the control elements and the space needed to draw the control without clipping.
When Draw is enabled, the control is rendered to its Canvas using the State, Transparent and Layout settings. Otherwise, only measurements are performed in the method.
No actions are performed in the method if the Glyph property has not been assigned for the control; in this case, the output parameters in PreferredWidth and PreferredHeight are unchanged from their default values.
PaintRect contains the area where the control is drawn on its Canvas, and provides the bounds for the background on the control.
GetGlyphSize is called to get the dimensions for the glyph bitmap including any drawing effect applied in ThemeServices for the control State.
When Caption has been assigned and ShowCaption is enabled, the text size is included in the calculated space requirements. The values in Margins and Spacing are included in the horizontal or vertical size based on the value in Layout. Values in Alignment and UseRightToLeftReading are used when the text rectangle is calculated. If the Font matches the default System font settings, ThemeServices.DrawText is called to measure/render the text for the control.
Values in PreferredWidth and PreferredHeight are updated and returned to the calling routine in the output parameters.
Used in the implementation of the CalculatePreferredSize and Paint methods.
|
The bitmap with the glyph image(s) displayed for button states. |
|
|
Space between the glyph bitmap and the aligned edge in the button layout. |
|
|
Spacing between the Glyph bitmap and the Caption for the control. |
|
|
Indicates the alignment of the glyph bitmap relative to the caption for the control. |
|
|
Indicates if the Caption for the speed button is displayed. |
|
|
Horizontal alignment for the text displayed on the button control. |
|
|
Internal member used to store the TButtonState for the control. |
|
|
Indicates if the control is drawn with transparency. |
|
|
Calculates the default height and Width required for the control. |
|
|
Paints the background for the control to the specified rectangle. |
|
|
Updates the state for the control, and paints it to the control Canvas. |
|
|
Gets the theme element details used to draw the control. |
|
|
Gets the size of the glyph within the specified PaintRect. |
|
|
Gets the size of the Caption text within the specified PaintRect. |
|
|
A clipped window into the parent Canvas. |
|
|
The text displayed for the control. |
|
|
True when BiDiMode is not bdLeftToRight. |
|
|
Draws the text for a themed control. |
Version 4.0 | Generated 2025-05-03 | Home |