mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-28 23:56:47 +02:00
lhelp: replace MessageBox, with Form.Modal. FIx IPC hang. issue #0022592
git-svn-id: trunk@38285 -
This commit is contained in:
parent
51fa7f0f40
commit
c4d537e314
@ -36,7 +36,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, SimpleIPC, Laz2_XMLCfg,
|
Classes, SysUtils, SimpleIPC, Laz2_XMLCfg,
|
||||||
FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
Buttons, LCLProc, IpHtml, ComCtrls, ExtCtrls, Menus, LCLType,
|
Buttons, LCLProc, IpHtml, ComCtrls, ExtCtrls, Menus, LCLType, LCLIntf, StdCtrls,
|
||||||
BaseContentProvider, FileContentProvider,
|
BaseContentProvider, FileContentProvider,
|
||||||
ChmContentProvider
|
ChmContentProvider
|
||||||
{$IFDEF USE_LNET}, HTTPContentProvider{$ENDIF};
|
{$IFDEF USE_LNET}, HTTPContentProvider{$ENDIF};
|
||||||
@ -149,11 +149,43 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure THelpForm.AboutItemClick(Sender: TObject);
|
procedure THelpForm.AboutItemClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
f: TForm;
|
||||||
|
l: TLabel;
|
||||||
|
b: TButton;
|
||||||
begin
|
begin
|
||||||
Application.MessageBox('LHelp (CHM file viewer)'#13 +
|
f := TForm.Create(Application);
|
||||||
'Ver. 2009.06.08'#13 +
|
try
|
||||||
'Copyright (C) Andrew Haines',
|
f.Caption := 'About';
|
||||||
'About', 0);
|
f.BorderStyle := bsDialog;
|
||||||
|
f.Position := poMainFormCenter;
|
||||||
|
f.Constraints.MinWidth := 150;
|
||||||
|
f.Constraints.MaxWidth := 250;
|
||||||
|
l := TLabel.Create(f);
|
||||||
|
l.Parent := f;;
|
||||||
|
l.Align := alTop;
|
||||||
|
l.BorderSpacing.Around := 6;
|
||||||
|
l.Caption := 'LHelp (CHM file viewer)' + LineEnding +
|
||||||
|
'Ver. 2009.06.08' + LineEnding +
|
||||||
|
'Copyright (C) Andrew Haines';
|
||||||
|
l.AutoSize := True;
|
||||||
|
l.WordWrap := True;
|
||||||
|
b := TButton.Create(f);
|
||||||
|
b.Parent := f;
|
||||||
|
b.BorderSpacing.Around := 6;
|
||||||
|
b.Anchors := [akTop, akLeft];
|
||||||
|
b.AnchorSide[akTop].Control := l;
|
||||||
|
b.AnchorSide[akTop].Side := asrBottom;
|
||||||
|
b.AnchorSide[akLeft].Control := f;
|
||||||
|
b.AnchorSide[akLeft].Side := asrCenter;
|
||||||
|
b.Caption := 'Ok';
|
||||||
|
b.ModalResult := mrOk;
|
||||||
|
f.AutoSize := False;
|
||||||
|
f.AutoSize := True;
|
||||||
|
f.ShowModal;
|
||||||
|
finally
|
||||||
|
f.free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user