I have some issue with
THintWindow.
1. In Linux (Mint Cinnamon):
1.1.
LineEnding + LineEnding is rendered as a single line endings, insted of two line endings.
HintWindow.Caption := 'Line 1' + LineEnding + LineEnding + 'Line 2';
The good thing is that I have found a workarond - I added a space between the
LineEndings.
HintWindow.Caption := 'Line 1' + LineEnding + ' ' + LineEnding + 'Line 2';
Is it a bug, shall I report it? In windows it works fine.
1.2. The text in
HintWindow is vertically aligned in the centre. Is it possible to align it to the top? Unlike
TLabel, there is no
.Layout property.
In Windows the text is aligned to the top.
2. In Windows
2.1.
THintWindow steals the focus, so the main form loses focus, when it is shown.
Can this behaviour be prevented?
TForm(aOwner).SetFocus; did not help.
In Linux the focus is not stolen. Could there be a bug in some of the OSes?
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
HintWindow : THintWindow;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
HintWindow.top := self.top + 20 ;
HintWindow.left := self.left + 20;
HintWindow.Show;
HintWindow.Caption := 'Line 1' + LineEnding + LineEnding + 'Line 2';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
HintWindow.top := self.top + 20 ;
HintWindow.left := self.left + 20;
HintWindow.Show;
HintWindow.Caption := 'Line 1' + LineEnding + ' ' + LineEnding + 'Line 2';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
HintWindow := THintWindow.Create(Self);
HintWindow.Width := 100;
HintWindow.Height := 100;
HintWindow.
end;
end.