View Issue Details

IDProjectCategoryView StatusLast Update
0035967LazarusWidgetsetpublic2019-08-23 16:16
ReporterAlexey Tor.Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version2.0.3 (SVN)Product Build 
Target VersionFixed in Version 
Summary0035967: TMemo.TextHint don't work on Win32
Descriptionsubj. It works ok on Linux, but TextHint is always hidden on win32. Whether control focused or not focused.
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

jamie philbrook

2019-08-15 22:58

reporter   ~0117692

Works here with 2.0.4 Lazarus.

Alexey Tor.

2019-08-18 12:39

reporter   ~0117724

I tested r61720 on two PCs. win10.

Serge Anvarov

2019-08-21 00:20

reporter   ~0117755

In Win32, the TextHint property has built-in support, but not for multiline edit (TMemo): https://docs.microsoft.com/en-us/windows/win32/controls/em-setcuebanner

jamie philbrook

2019-08-21 01:50

reporter   ~0117757

@Serge Anvarov
   Those are CUE BANNERS, they are not the same as HintText. Although they kind of work the same way in general.

   He asked for Hint TExt, it works on my end, he claims it does not for a memo

   I also just tested it on my old W2K using Delphi, it works there, too.

 So maybe he should clarify his statement a little more.

Alexey Tor.

2019-08-22 11:34

reporter   ~0117781

I wrote about TextHint property

Bart Broersma

2019-08-22 22:18

developer   ~0117785

Confirmed.
I'm not sure wether this is by design or not.
On Windows TextHint is set by the WS, which AFAIK does not support that for a memo?

Dmitry Boyarintsev

2019-08-22 22:59

developer   ~0117786

Last edited: 2019-08-22 22:59

View 2 revisions

@jamie philbrook
do you have a screen shot of working TextHint for TMemo on Windows?

as Serge Anvarov states the TextHint is not supported for TMemo by WinAPI.

jamie philbrook

2019-08-23 00:26

reporter   ~0117787

The issue here is it's improperly named, it should of been named "CueBanner" which is what it is..

  I was using the published Hint and of course that works. But this TextHint isn't published in Tmemo, at least its not on my system and most likely for good reason.
  
 Texthint (CueBanner) Works only in non-multiline Edit controls and if you use a TEDIT the property is published and it does work.

 I don't know what to tell you, ether don't worry about it and wait for windows to support it or emulate it ?

Serge Anvarov

2019-08-23 16:16

reporter   ~0117798

I don't see a good solution other than {$IFDEF WINDOWS} to use withing some methods.

In your program you can do so:
[code]
//...uses ..., LCLType,...
type
  TMemo = class(StdCtrls.TMemo)
  protected
    function CanShowEmulatedTextHint: Boolean; override;
    procedure InitializeWnd; override;
    procedure SetTextHint(const AValue: TTranslateString); override;
  end;

  TForm1 = class(TForm)
//...
uses Win32Proc;
//...
function TMemo.CanShowEmulatedTextHint: Boolean;
var
  SaveComCtlVersion: Cardinal;
begin
  SaveComCtlVersion := ComCtlVersion;
  ComCtlVersion := 0;
  try
    Result := inherited;
  finally
    ComCtlVersion := SaveComCtlVersion;
  end;
end;
//...
[/code]
And in the same way to write all three methods.
Reset variable ComCtlVersion force LCL to believe that the system doesn't support property TextHint and will be used an emulation.

Issue History

Date Modified Username Field Change
2019-08-15 21:44 Alexey Tor. New Issue
2019-08-15 22:58 jamie philbrook Note Added: 0117692
2019-08-18 12:39 Alexey Tor. Note Added: 0117724
2019-08-21 00:20 Serge Anvarov Note Added: 0117755
2019-08-21 01:50 jamie philbrook Note Added: 0117757
2019-08-22 11:34 Alexey Tor. Note Added: 0117781
2019-08-22 22:18 Bart Broersma Status new => confirmed
2019-08-22 22:18 Bart Broersma LazTarget => -
2019-08-22 22:18 Bart Broersma Note Added: 0117785
2019-08-22 22:59 Dmitry Boyarintsev Note Added: 0117786
2019-08-22 22:59 Dmitry Boyarintsev Note Edited: 0117786 View Revisions
2019-08-23 00:26 jamie philbrook Note Added: 0117787
2019-08-23 16:16 Serge Anvarov Note Added: 0117798