File: messagedialogsfrm.pas

package info (click to toggle)
lazarus 4.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 275,760 kB
  • sloc: pascal: 2,341,904; xml: 509,420; makefile: 348,726; cpp: 93,608; sh: 3,387; java: 609; perl: 297; sql: 222; ansic: 137
file content (50 lines) | stat: -rw-r--r-- 988 bytes parent folder | download | duplicates (3)
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.