Docs: LCL/stdctrls. Clarifies content in TCustomListBox.OnSelectionChange, TSelectionChangeEvent topics for Windows. Removes unneeded whitespace.

This commit is contained in:
dsiders 2023-09-14 00:42:40 +01:00
parent 1aaba956ad
commit 484983c9ab

View File

@ -4423,11 +4423,20 @@ Specifies an event handler for change notifications from a list box control.
<descr>
<p>
<var>TSelectionChangeEvent</var> is an object procedure type which specifies
an event handler signalled when the select is changed in a list box control.
an event handler signalled when a selection is changed for a list box control.
Arguments passed to the handler identify the list box control, and the origin
of the change notification.
for the change notification.
</p>
<p>
The <var>User</var> argument is <b>True</b> when the action performed includes
one of the following:
</p>
<ul>
<li>An alpha-numeric key is pressed.</li>
<li>A cursor navigation key is pressed.</li>
<li>The Home, End, Page Up, or Page Down key is pressed.</li>
</ul>
<p>
TSelectionChangeEvent is the type used to implement the
<var>OnSelectionChange</var> property in <var>TCustomListBox</var>. The
application must implement and assign an object procedure using the signature
@ -4441,8 +4450,9 @@ for the handler to respond to the event notification.
</element>
<element name="TSelectionChangeEvent.User">
<short>
<b>True</b> if the user changed the selection, <b>False</b> if changed by
code.
<b>True</b> on entry if the change was caused by user interaction with the
control. <b>False</b> if the selection was changed in program code, like
setting the selected item index for the list box control.
</short>
</element>
@ -6107,8 +6117,8 @@ the value derived in the event handler.
<descr>
<p>
<var>OnSelectionChange</var> is a <var>TSelectionChangeEvent</var> property
with the event handler signalled when a selection is changed in the list box
control. OnSelectionChange is signalled (when assigned) from the
with the event handler signalled when an item selection on the control has been
changed. OnSelectionChange is signalled (when assigned) from the
<var>DoSelectionChange</var> method, and occurs prior to calling the
<var>Click</var> method for the control.
</p>
@ -6117,10 +6127,26 @@ The <var>User</var> argument indicates whether the selection change results
from user interaction with the control (<b>True</b>), or from code or methods
called at run-time (<b>False</b>).
</p>
<remark>
On the Windows platform, OnSelectionChange is signalled when the user clicks on
a list item that is already selected. It is also signalled when a mouse click
occurs on an unused area on the list box control. These behaviors are built in
to the native control on the platform, and are not configurable.
</remark>
<p>
Use OnClick to perform actions when the mouse is clicked on an item on the list
box control.
</p>
<p>
Use ClickOnSelChange to indicate whether Click / OnClick are called when the
left mouse button is released during a click action or when OnSelectionChanged
is performed for the control.
</p>
</descr>
<seealso>
<link id="TCustomListBox.DoSelectionChange"/>
<link id="TCustomListBox.Click"/>
<link id="TCustomListBox.OnClick"/>
<link id="TCustomListBox.ClickOnSelChange"/>
<link id="TCustomListBox.SelectRange"/>
<link id="TCustomListBox.MultiSelect"/>