1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
unit MessageDialogsFrm;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, LazLogger;
type
{ TMainForm }
TMainForm = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
MainForm: TMainForm;
implementation
{$R *.lfm}
{ TMainForm }
procedure TMainForm.FormCreate(Sender: TObject);
begin
Button1.Left := (Width - Button1.Width) div 2;
Button1.Top := (Height - Button1.Height) div 2;
end;
procedure TMainForm.Button1Click(Sender: TObject);
begin
ShowMessage('First simple test!');
DebugLn('Go to second dialog');
MessageDlg('Caption', 'Two buttons now ...', mtError, [mbOK, mbCancel], 0);
MessageDlg('Warning, not fully implemented', mtWarning, [mbYes, mbNo, mbOK, mbCancel], 0);
ShowMessageFmt('The show will end now'+LineEnding+'%s'+LineEnding+'Good bye!!!', [MainForm.Caption]);
close;
end;
end.
|