112 lines
2.7 KiB
Plaintext
112 lines
2.7 KiB
Plaintext
unit DLiteInfo;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
|
|
Tocsg.Controls, Vcl.AppEvnts;
|
|
|
|
type
|
|
TDlgLiteInfo = class(TForm)
|
|
lbTitle: TLabel;
|
|
spMain: TShape;
|
|
mmInfo: TMemo;
|
|
ApplicationEvents: TApplicationEvents;
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
procedure FormDeactivate(Sender: TObject);
|
|
procedure FormShow(Sender: TObject);
|
|
procedure spMainMouseDown(Sender: TObject; Button: TMouseButton;
|
|
Shift: TShiftState; X, Y: Integer);
|
|
procedure ApplicationEventsIdle(Sender: TObject; var Done: Boolean);
|
|
procedure mmInfoMouseDown(Sender: TObject; Button: TMouseButton;
|
|
Shift: TShiftState; X, Y: Integer);
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
// procedure CreateParams(var Params: TCreateParams); override;
|
|
procedure SetInfo(sTitle: String; aList: TStringList);
|
|
end;
|
|
|
|
var
|
|
DlgLiteInfo: TDlgLiteInfo;
|
|
|
|
implementation
|
|
|
|
uses
|
|
Tocsg.Strings;
|
|
|
|
{$R *.dfm}
|
|
|
|
//procedure TDlgLiteInfo.CreateParams(var Params: TCreateParams);
|
|
//begin
|
|
// inherited CreateParams(Params);
|
|
// Params.WindowClass.Style := Params.WindowClass.Style or CS_DROPSHADOW;
|
|
//end;
|
|
|
|
procedure TDlgLiteInfo.ApplicationEventsIdle(Sender: TObject;
|
|
var Done: Boolean);
|
|
begin
|
|
ApplicationEvents.OnIdle := nil;
|
|
HideCaret(mmInfo.Handle);
|
|
end;
|
|
|
|
procedure TDlgLiteInfo.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
begin
|
|
AnimateWindow(Handle, 200, AW_BLEND or AW_HIDE);
|
|
Action := caFree;
|
|
end;
|
|
|
|
procedure TDlgLiteInfo.FormDeactivate(Sender: TObject);
|
|
begin
|
|
Close;
|
|
end;
|
|
|
|
procedure TDlgLiteInfo.FormShow(Sender: TObject);
|
|
begin
|
|
AnimateWindow(Handle, 200, AW_BLEND);
|
|
end;
|
|
|
|
procedure TDlgLiteInfo.mmInfoMouseDown(Sender: TObject; Button: TMouseButton;
|
|
Shift: TShiftState; X, Y: Integer);
|
|
begin
|
|
Close;
|
|
end;
|
|
|
|
procedure TDlgLiteInfo.SetInfo(sTitle: String; aList: TStringList);
|
|
const
|
|
DEF_LB_HEIGHT = 15;
|
|
DEF_FORM_HEIGHT = 100;
|
|
var
|
|
i: Integer;
|
|
begin
|
|
lbTitle.Caption := sTitle;
|
|
|
|
// if aList.Count = 0 then
|
|
// begin
|
|
// lbInfo.Caption := '';
|
|
// exit;
|
|
// end;
|
|
|
|
// for i := 0 to aList.Count - 1 do
|
|
// aList[i] := InsertPointString2(#13#10, aList[i], 50);
|
|
|
|
mmInfo.Text := aList.Text;
|
|
if mmInfo.Lines.Count > 3 then
|
|
mmInfo.ScrollBars := TScrollStyle.ssVertical;
|
|
// Height := Height + ((aList.Count - 1) * 20);
|
|
// lbInfo.Caption := aList.Text;
|
|
// Height := DEF_FORM_HEIGHT + (lbInfo.Height - DEF_LB_HEIGHT);
|
|
|
|
Application.ProcessMessages;
|
|
end;
|
|
|
|
procedure TDlgLiteInfo.spMainMouseDown(Sender: TObject; Button: TMouseButton;
|
|
Shift: TShiftState; X, Y: Integer);
|
|
begin
|
|
Close;
|
|
end;
|
|
|
|
end.
|