From dce0eee55644bc0e38762d40e625d3d917c2c4d1 Mon Sep 17 00:00:00 2001 From: dsiders Date: Tue, 30 Aug 2022 04:42:52 +0100 Subject: [PATCH] Docs: LCL/stdctrls. Updates topic content and See Also links. * Removes topics no longer in source code. * Fixes grammar and typos. * Fixes tagging for Nil in content. --- docs/xml/lcl/stdctrls.xml | 160 ++++++++++++++++++++++++++------------ 1 file changed, 109 insertions(+), 51 deletions(-) diff --git a/docs/xml/lcl/stdctrls.xml b/docs/xml/lcl/stdctrls.xml index 4bf865de33..efd5859f9a 100644 --- a/docs/xml/lcl/stdctrls.xml +++ b/docs/xml/lcl/stdctrls.xml @@ -296,6 +296,7 @@ information about scrollbars used for windowed controls. + Performs actions needed to translate and apply scrollbar notification @@ -307,7 +308,7 @@ messages. -Always returns +Always returns True Always returns True. @@ -1789,7 +1790,12 @@ value is assigned to the TextHint property. Displays an emulated TextHint for the control. - + + + + +TControl.Font + @@ -1807,7 +1813,7 @@ value is assigned to the TextHint property. -Handler for custom drawing items; calls DrawItem. +Handler for custom drawing an item; calls DrawItem. @@ -1817,7 +1823,7 @@ value is assigned to the TextHint property. -Determines the height of an item, using MeasureItem in variable owner-draw +Determines the height of an item using MeasureItem in variable owner-draw mode. @@ -2182,8 +2188,18 @@ needed) and calling the InternalDrawItem routine. Handles key up events forwarded from the LCL interface. - - + +

+KeyUpAfterInterface is an overridden method in +TCustomComboBox. It ensures that the EditingDone method is called +when a VK_RETURN Key code is received from the LCL interface. The +internal edit completion flag is reset prior to exiting from the method. +

+
+ +TControl.EditingDone +TControl.OnEditingDone +
Key code examined in the method. @@ -2280,13 +2296,13 @@ method. -Invokes the OnChange handler, signalling a change in the edit box. +Signals the OnChange event handler when the value for the control is changed.

Change is a procedure used to perform actions needed when the value for the control is changed. Change is called from the -LMChanged method used to process the change notification message. +LMChanged method used to process the change notification message. Change calls the Changed method, inherited from TControl, to Perform the control message. The OnChange event handler is signalled (when assigned). @@ -3374,7 +3390,7 @@ calls the AddObject method in Items to store the values in The string added to Items. -The associated object, can be Nil. +The associated object, can be Nil. @@ -3432,7 +3448,7 @@ text, differing in case. -The object associated with the item; can be Nil. +The object associated with the item; can be Nil. @@ -4611,23 +4627,22 @@ created. CalculateStandardItemHeight is an Integer function used to get the standard height for items in the control. CalculateStandardItemHeight is used in descendent classes, like -TCustomCheckListBox, when its Style property is set to +TCustomCheckListBox, when its Style property is set to lbStandard and the Handle for the control (and its Canvas) has not been allocated.

CalculateStandardItemHeight gets the height for items using a temporary -TBitmap instance. -The Font for the control is assigned to the Canvas in the the bitmap -instance, and its TextHeight method is called to get the return value. +TBitmap instance. The Font for the control is assigned to the Canvas in the +the bitmap instance, and its TextHeight method is called to get the return +value.

-CalculateStandardItemHeight is called from the MeasureItem and FontChanged -methods in the TCustomCheckListBox descendent. +CalculateStandardItemHeight is called from the FontChanged method in the +TCustomCheckListBox descendent.

-TCustomCheckListBox.MeasureItem TCustomCheckListBox.FontChanged
@@ -5177,7 +5192,7 @@ values in the object instance. The item text.
-The associated object, or Nil when not used. +The associated object, or Nil when not used. @@ -9841,29 +9856,24 @@ Performs actions needed when a click message is handled for the control.

Click is an overridden method in TButtonControl. Click -calls the DoOnChange method to signal the OnEditingDone -and OnChange event handlers (when assigned). Click calls the -inherited method prior to exit. +calls the DoOnChange method which signals the +OnEditingDone and OnChange event handlers (when +assigned). Click calls the inherited method prior to exit.

-Click is used when messages are handled in the control and -csClickEvents is not used in the ControlStyle property. +Click is called when the LM_CLICKED message is handled for the control. It +occurs when click events are not enabled in ControlStyle and +ControlState.

+ + TControl.Click +TControl.OnEditingDone
- -Handles the CM_WANTSPECIALKEY message for the control. - - - - -Control message examined in the method. - - Constructor for the class instance. @@ -9892,24 +9902,66 @@ instance. Checked is a Boolean property which indicates if the control is displayed using its "checked" or "unchecked" state. The value for the property is always False in TButtonControl, and is -overridden in a descendent class. +overridden in descendent classes like TCustomCheckBox.

-Disables clicking on the button, without showing the button in a disabled -state. +Disables calling the Click method without changing the Enabled state for +the control. - - + +

+ClicksDisabled is a Boolean property which controls +whether the Click method is called when a the Checked property is changed in +the control. +

+

+The TCustomCheckBox descendant uses ClicksDisabled in its DoClickOnChange +method; when set to False, the Click method is called to signal both the +OnChange and OnClick handlers for the control. When set to True, only the +OnChange event handler is signalled. This emulates the Delphi OnClick +behavior. +

+

+ClicksDisabled is also used to prevent calling Click when the Checked +property in a linked button action is updated. +

+
+ + + + + + +
-Event handler for changes to properties in the control. - - + +Event handler for signalled when the button control is clicked. + + +

+OnChange is signalled from the DoOnChange method, and occurs when +the Click method is called for the class instance. It is signalled after the +OnEditingDone event handler. The Sender argument contains the current button +control class instance (Self). +

+

+The OnClick event handler can also be used for the notification when +ClicksDisabled is set to False. +

+
+ + + + +TControl.OnEditingDone +TControl.OnClick +
@@ -11035,16 +11087,20 @@ handler. Use ClicksDisabled is control the event handler signalled. Performs actions when the control is clicked.

-Click is an overridden method in TCustomCheckBox, and -ignores mouse up event notifications. It does not call the inherited method; -the click action is performed in the DoClickOnChange method when the -inherited ClicksDisabled property is False. +Click is an overridden method in TCustomCheckBox. It +ignores mouse up event notifications, and does not call the inherited method. +The click action is performed either in the DoClickOnChange method when the +ClicksDisabled property is False, or when the LM_CLICKED message is +handled for the control and click events are not enabled in ControlStyle and +ControlState.

TControl.Click +TControl.ControlState +TControl.ControlStyle
@@ -11053,7 +11109,7 @@ inherited ClicksDisabled property is False.

DoClickOnChange is a procedure used to signal event handler(s) -when the LC_CHANGED message is handled for the control. +when the LM_CHANGED message is handled for the control. DoClickOnChange calls the Changed method to dispatch the control message.

@@ -11374,6 +11430,7 @@ meanings in the State property. + @@ -12126,11 +12183,12 @@ updated for the new text rectangle.

No actions are performed in the method if Parent has not been -assigned (contains Nil), or when a handle has not been allocated in the -Parent control. +assigned (contains Nil), or when a handle has not been allocated in +the Parent control.

-Please note: CalculatePreferredSize does not call the inherited method. +Please note that CalculatePreferredSize does not call the inherited +method.

@@ -13116,9 +13174,9 @@ the form is destroyed.

However, if you create the component yourself by code, and don't specify an -Owner for it (Create(Nil)), you are responsible for freeing the component -when it is no longer needed. You better construct it with Create(Self), where -Self means the containing Form or Parent control. +Owner for it (Create(Nil)), you are responsible for freeing the +component when it is no longer needed. You should construct it with +Create(Self), where Self means the containing Form or Parent control.

A control also must have a Parent control, maybe the Form, so that it can