Docs: LCL/extctrls. Updates topics for changes in 96291eb9.

* Updates:
*  TCustomPanel.SetParentBackground
*  TCustomPanel.UpdateParentColorChange
*  TCustomPanel.Color
This commit is contained in:
dsiders 2022-12-15 05:30:27 +00:00
parent 1648da0278
commit 98bb18f7e1

View File

@ -6545,22 +6545,35 @@ handler (when assigned).
</element> </element>
<element name="TCustomPanel.SetParentBackground"> <element name="TCustomPanel.SetParentBackground">
<short>Sets the background used for the parent control.</short> <short>
Sets the value for the ParentBackground property.
</short>
<descr> <descr>
<p> <p>
<var>SetParentBackground</var> is an overridden procedure used to the set the <var>SetParentBackground</var> is an overridden method used to set the
background used for the parent control. SetParentBackground ensures that the value for the ParentBackground property. SetParentBackground ensures that the
<var>ControlStyle</var> property is updated to include or omit the value <var>ControlStyle</var> property is updated to include or omit the values
<var>csOpaque</var>. When AParentBackground contains <b>True</b>, the value which control the opacity for the control. When AParentBackground contains
is excluded from ControlStyle. When AParentBackground contains <b>False</b>, <b>True</b>, the value csParentBackground is included in ControlStyle. When
the value is included in ControlStyle. AParentBackground contains <b>False</b>, csParentBackground is excluded from
ControlStyle.
</p> </p>
<p> <p>
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 <b>True</b>, csOpaque is excluded
from ControlStyle and the control becomes transparent. When both properties
are set to <b>False</b>, csOpaque is included in ControlStyle and the control
is drawn using the value in Color as the background color.
</p> </p>
</descr> </descr>
<seealso> <seealso>
<link id="#lcl.controls.TWinControl.SetParentBackground">TWinControl.SetParentBackground</link> <link id="TCustomPanel.UpdateParentColorChange"/>
<link id="TCustomPanel.ParentColor"/>
<link id="TCustomPanel.ParentBackground"/>
<link id="#lcl.controls.TControl.SetParentBackground">TControl.SetParentBackground</link>
<link id="#lcl.controls.TControl.ControlStyle">TControl.COntrolStyle</link>
<link id="#lcl.controls.TControlStyleType">TControlStyleType</link>
</seealso> </seealso>
</element> </element>
<element name="TCustomPanel.SetParentBackground.AParentBackground"> <element name="TCustomPanel.SetParentBackground.AParentBackground">
@ -6573,24 +6586,30 @@ Updates the control to reflect changes to the ParentColor property.
</short> </short>
<descr> <descr>
<p> <p>
<var>UpdateParentColorChange</var> updates the control to reflect changes to <var>UpdateParentColorChange</var> updates the control to use the opacity
the <var>ParentColor</var> property. needed for the values in the <var>ParentColor</var> or
<var>ParentBackground</var> properties.
</p> </p>
<p> <p>
When ParentColor is <b>True</b>, the parent color is used, so the value If either ParentColor or ParentBackground is <b>True</b>, the value
<var>csOpaque</var> is excluded from the <var>ControlStyle</var> property. <var>csOpaque</var> is excluded from the <var>ControlStyle</var> property.
Otherwise, Parent color is not used, and the value <var>csOpaque</var> is If both properties are <b>False</b>, csOpaque is included in the ControlStyle
included in the <var>ControlStyle</var> property. property.
</p> </p>
<p> <p>
UpdateParentColorChange is called from the <var>Loaded</var> method when the UpdateParentColorChange is called from the <var>Loaded</var> method when the
component has finished loading using the LCL component streaming mechanism. component has finished loading using the LCL component streaming mechanism.
It is also called from the <var>CMParentColorChanged</var> method when the It is called from the <var>CMParentColorChanged</var> method when the
change message is handled for the control. change message is handled for the control. It is also called when a new value
is assigned to the ParentColor or ParentBackground properties.
</p> </p>
</descr> </descr>
<errors/> <seealso>
<seealso/> <link id="TCustomPanel.ParentColor"/>
<link id="TCustomPanel.ParentBackground"/>
<link id="TCustomPanel.Loaded"/>
<link id="TCustomPanel.CMParentColorChanged"/>
</seealso>
</element> </element>
<element name="TCustomPanel.ShowAccelChar"> <element name="TCustomPanel.ShowAccelChar">
@ -6829,18 +6848,29 @@ the control.
<descr> <descr>
<p> <p>
<var>Color</var> is a <var>TColor</var> property with the background color <var>Color</var> is a <var>TColor</var> property with the background color
for the panel. It sets the default value for the property. for the panel.
</p> </p>
<p> <p>
The default value in Color is the same as the value in the parent window The default value for Color is determined by the UseCLDefault compiler define.
Color property. If the color is clDefault , the result will need to be When UseCLDefault is defined, the default value is clDefault, and the color
resolved using the <var>GetDefaultColor</var> method. Convenience routines will need to be resolved using the <var>GetDefaultColor</var> method.
which obtain the color by resolving clDefault and ParentColor are also Convenience routines which obtain the color by resolving clDefault and
provided in <var>TControl.GetColorResolvingParent</var> and ParentColor are also provided in <var>TControl.GetColorResolvingParent</var>
<var>TControl.GetRGBColorResolvingParent</var>. and <var>TControl.GetRGBColorResolvingParent</var>. If UseCLDefault is not
defined, the the default value is clWindow.
</p>
<p>
Setting an explicit value in Color causes both ParentColor and
ParentBackground to be set to <b>False</b>, and the control is redrawn.
</p>
<p>
Set ParentBackground or ParentColor to <b>True</b> to use the background color
from the Parent control, making the panel transparent when drawn.
</p> </p>
</descr> </descr>
<seealso> <seealso>
<link id="TCustomPanel.ParentBackground"/>
<link id="TCustomPanel.ParentColor"/>
<link id="#lcl.controls.TControl.Color">TControl.Color</link> <link id="#lcl.controls.TControl.Color">TControl.Color</link>
</seealso> </seealso>
</element> </element>
@ -6884,7 +6914,7 @@ The default value for the property is <b>True</b>.
</descr> </descr>
<seealso> <seealso>
<link id="#lcl.controls.TControl.ControlStyle">TControl.ControlStyle</link> <link id="#lcl.controls.TControl.ControlStyle">TControl.ControlStyle</link>
<link id="#lcl.controls.TWinControl.ParentBackground">TWinControl.ParentBackground</link> <link id="#lcl.controls.TControl.ParentBackground">TControl.ParentBackground</link>
</seealso> </seealso>
</element> </element>
@ -11877,6 +11907,6 @@ the display in the other docked control.
</topic> </topic>
</module> </module>
<!-- ExtCtrls -->
</package> </package>
<!-- ExtCtrls -->
</fpdoc-descriptions> </fpdoc-descriptions>