Recent

Author Topic: TextHint in TComboBox  (Read 166 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3817
  • I like bugs.
TextHint in TComboBox
« on: August 13, 2020, 02:21:11 pm »
Regarding issue :
 https://bugs.freepascal.org/view.php?id=30682

I added TextHint to TComboBox in r63731. It was a missing Delphi compatible feature.
QT5 ComboBox now works with native TextHint, GTK2 with emulated one.
Native support for Win32 is not implemented yet. Somebody please implement it.
Other widgetsets that natively support this feature for TComboBox should also be updated.

I have a question about TextHint support of TEdit in Win32. The widgetset binding code tests EmulatedTextHintShowing and calls CreateEmulatedTextHintFont from generic LCL code.
Does it mean it actually emulates the feature inside the binding code instead of using a native feature?
It should not be needed as the emulated TextHint works purely in LCL code level.
Same thing with QT4 binding code. It also uses emulated TextHint specific stuff. Is it needed?

TextHint in TMemo works only with widgetset's native support. It works with QT5 but not with GTK2.
The emulation for TMemo turned out to be tricky. It may never be implemented, unless somebody provides a patch of course.

I sent (almost) this same message to Lazarus mailing list.
Mostly Lazarus trunk on Manjaro Linux.

ASerge

  • Hero Member
  • *****
  • Posts: 1666
Re: TextHint in TComboBox
« Reply #1 on: August 13, 2020, 09:16:35 pm »
I have a question about TextHint support of TEdit in Win32. The widgetset binding code tests EmulatedTextHintShowing and calls CreateEmulatedTextHintFont from generic LCL code.
Does it mean it actually emulates the feature inside the binding code instead of using a native feature?
For Win32.
1. There is the CanShowEmulatedTextHint function. It return False, because the expression (WidgetSet.GetLCLCapability(lcTextHint) = LCL_CAPABILITY_NO) is false.
2. The default value for the FEmulatedTextHintStatus is the thsHidden value, which is changed only in the ShowEmulatedTextHint function.
3. The ShowEmulatedTextHint function called only when the CanShowEmulatedTextHint function return True, in our case never.
4. The CreateEmulatedTextHintFont function is called only from the ShowEmulatedTextHint function or the from FontChanged method, but under the condition (FEmulatedTextHintStatus <> thsHidden), i.e. never again.
That is, when WidgetSet.GetLCLCapability(lcTextHint) <> LCL_CAPABILITY_NO (= LCL_CAPABILITY_YES), then LCL does not prepare emulation.

 

TinyPortal © 2005-2018