From 98bb18f7e1483f67a30eb7ff6895f71ef4405fab Mon Sep 17 00:00:00 2001 From: dsiders Date: Thu, 15 Dec 2022 05:30:27 +0000 Subject: [PATCH] Docs: LCL/extctrls. Updates topics for changes in 96291eb9. * Updates: * TCustomPanel.SetParentBackground * TCustomPanel.UpdateParentColorChange * TCustomPanel.Color --- docs/xml/lcl/extctrls.xml | 84 ++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 27 deletions(-) diff --git a/docs/xml/lcl/extctrls.xml b/docs/xml/lcl/extctrls.xml index 3952a9537a..89c7629483 100644 --- a/docs/xml/lcl/extctrls.xml +++ b/docs/xml/lcl/extctrls.xml @@ -6545,22 +6545,35 @@ handler (when assigned). -Sets the background used for the parent control. + +Sets the value for the ParentBackground property. +

-SetParentBackground is an overridden procedure used to the set the -background used for the parent control. SetParentBackground ensures that the -ControlStyle property is updated to include or omit the value -csOpaque. When AParentBackground contains True, the value -is excluded from ControlStyle. When AParentBackground contains False, -the value is included in ControlStyle. +SetParentBackground is an overridden method used to set the +value for the ParentBackground property. SetParentBackground ensures that the +ControlStyle property is updated to include or omit the values +which control the opacity for the control. When AParentBackground contains +True, the value csParentBackground is included in ControlStyle. When +AParentBackground contains False, csParentBackground is excluded from +ControlStyle.

-SetParentBackground calls the inherited method prior to exit. +The UpdateParentColorChange method is called to update ControlStyle to reflect +the values in the ParentColor or ParentBackground properties. If either +ParentColor or ParentBackground are set to True, csOpaque is excluded +from ControlStyle and the control becomes transparent. When both properties +are set to False, csOpaque is included in ControlStyle and the control +is drawn using the value in Color as the background color.

-TWinControl.SetParentBackground + + + +TControl.SetParentBackground +TControl.COntrolStyle +TControlStyleType
@@ -6573,24 +6586,30 @@ Updates the control to reflect changes to the ParentColor property.

-UpdateParentColorChange updates the control to reflect changes to -the ParentColor property. +UpdateParentColorChange updates the control to use the opacity +needed for the values in the ParentColor or +ParentBackground properties.

-When ParentColor is True, the parent color is used, so the value +If either ParentColor or ParentBackground is True, the value csOpaque is excluded from the ControlStyle property. -Otherwise, Parent color is not used, and the value csOpaque is -included in the ControlStyle property. +If both properties are False, csOpaque is included in the ControlStyle +property.

UpdateParentColorChange is called from the Loaded method when the component has finished loading using the LCL component streaming mechanism. -It is also called from the CMParentColorChanged method when the -change message is handled for the control. +It is called from the CMParentColorChanged method when the +change message is handled for the control. It is also called when a new value +is assigned to the ParentColor or ParentBackground properties.

- - + + + + + +
@@ -6829,18 +6848,29 @@ the control.

Color is a TColor property with the background color -for the panel. It sets the default value for the property. +for the panel.

-The default value in Color is the same as the value in the parent window -Color property. If the color is clDefault , the result will need to be -resolved using the GetDefaultColor method. Convenience routines -which obtain the color by resolving clDefault and ParentColor are also -provided in TControl.GetColorResolvingParent and -TControl.GetRGBColorResolvingParent. +The default value for Color is determined by the UseCLDefault compiler define. +When UseCLDefault is defined, the default value is clDefault, and the color +will need to be resolved using the GetDefaultColor method. +Convenience routines which obtain the color by resolving clDefault and +ParentColor are also provided in TControl.GetColorResolvingParent +and TControl.GetRGBColorResolvingParent. If UseCLDefault is not +defined, the the default value is clWindow. +

+

+Setting an explicit value in Color causes both ParentColor and +ParentBackground to be set to False, and the control is redrawn. +

+

+Set ParentBackground or ParentColor to True to use the background color +from the Parent control, making the panel transparent when drawn.

+ + TControl.Color
@@ -6884,7 +6914,7 @@ The default value for the property is True. TControl.ControlStyle -TWinControl.ParentBackground +TControl.ParentBackground @@ -11877,6 +11907,6 @@ the display in the other docked control. - +