[Lazarus] TextHint in TComboBox
Ondrej Pokorny
lazarus at kluug.net
Thu Aug 13 20:54:22 CEST 2020
On 13.08.2020 17:58, Juha Manninen via lazarus wrote:
> On Thu, Aug 13, 2020 at 6:50 PM Juha Manninen <juha.manninen62 at gmail.com> wrote:
>> AFAIK it is not emulated on Windows. LCL-Win32 reports LCLCapability
>> flag lcTextHint.
> Actually it is emulated for older Windows versions.
> function TWin32WidgetSet.GetLCLCapability has :
> ...
> lcTextHint:
> begin
> if (ComCtlVersion >= ComCtlVersionIE6) then
> Result := LCL_CAPABILITY_YES
> else
> Result := LCL_CAPABILITY_NO;
> end;
>
> For Windows 10 it should report LCL_CAPABILITY_YES.
Funnily I tested with themes off, so I got LCL_CAPABILITY_NO :)
But yes, you are correct. That is not optimal. We need to split
lcTextHint into lcTextHintEdit and lcTextHintMemo. Because as I wrote
before WinAPI doesn't support TextHint for multi-line text boxes
(TMemo):
https://docs.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-edit_setcuebannertext
So for TMemo we need the emulated code, which works now with a minor bug
(the TextHint is not visible when the form is shown the first time).
Strangely the bug is present only in a themed application, not in an
unthemed one.
Ondrej
More information about the lazarus
mailing list