[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Sets the value for the Caption property.
Source position: controls.pp line 1521
protected procedure TControl.RealSetText( |
const Value: TCaption |
); virtual; |
Value |
|
The string value to store in the Text / Caption properties. |
RealSetText is a method used to apply the TCaption value in AValue to the text or caption for the control. RealSetText is called by the private SetText method, when SetTextBuf has not been overridden.
Notes on TControl.Caption, TControl.Text, et. al.
The Delphi VCL implementation relies on the virtual GetTextBuf and SetTextBuf methods to exchange text for controls.. This requires a lot of (unnecessary) copies to move values between Text and Caption.
The LCL uses strings to exchange text values because it is more efficient. To maintain VCL compatibility, the virtual RealGetText and RealSetText methods were introduced. These functions use the LCLInterface. The default GetTextBuf and SetTextBuf implementations calls the RealGetText and RealSetText methods as needed. As long as the GetTextBuf and/or SetTextBuf aren't overridden, GetText and SetText call RealGetText and RealSetText to avoid copying PChar values.
To keep things optimal, LCL implementations should always override RealGetText and RealSetText. GetTextBuf and SetTextBuf are only kept for compatibility with Delphi code.
|
The text displayed for the control. |
|
|
String with the text or caption for the control. |
|
|
Returns the Caption property. |
|
|
Updates the Text property from a PChar buffer. |
|
|
Copy the Text property into Buffer. |
Version 3.2 | Generated 2024-02-25 | Home |