mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-06 15:40:33 +01:00
+ new sample to show Message dialogs
stoppok git-svn-id: trunk@209 -
This commit is contained in:
parent
cee16124c1
commit
461f8e25db
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -46,6 +46,7 @@ examples/hello.pp svneol=native#text/pascal
|
||||
examples/helloform.pp svneol=native#text/pascal
|
||||
examples/listboxtest.pp svneol=native#text/pascal
|
||||
examples/memotest.pp svneol=native#text/pascal
|
||||
examples/messagedialogs.pp svneol=native#text/pascal
|
||||
examples/notebk.pp svneol=native#text/pascal
|
||||
examples/notebku.pp svneol=native#text/pascal
|
||||
examples/notebooktest.pp svneol=native#text/pascal
|
||||
|
||||
81
examples/messagedialogs.pp
Normal file
81
examples/messagedialogs.pp
Normal file
@ -0,0 +1,81 @@
|
||||
{ ***************************************************************************
|
||||
MessageDialogs - example
|
||||
------------------------
|
||||
|
||||
Just a simple example to show & verify functionality of the lazarus
|
||||
functions to deal with message dialogs.
|
||||
|
||||
by Stefan Hille <stoppok@osibisa.ms.sub.org>
|
||||
|
||||
****************************************************************************
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
}
|
||||
Program MessagDialogs;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
uses classes, forms, dialogs, buttons;
|
||||
|
||||
type
|
||||
TMainForm = class(TForm)
|
||||
private
|
||||
protected
|
||||
public
|
||||
button1 : TButton;
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure button1Click(Sender : TObject);
|
||||
end;
|
||||
|
||||
var
|
||||
MainForm : TMainForm;
|
||||
|
||||
constructor TMainForm.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
Caption := 'Message Show';
|
||||
Width := 200;
|
||||
Height := 75;
|
||||
Left := 200;
|
||||
Top := 200;
|
||||
|
||||
button1 := TButton.Create(Self);
|
||||
button1.OnClick := @button1click;
|
||||
button1.Parent := Self;
|
||||
button1.left := (width - 85) div 2 ;
|
||||
button1.top := (height - 32) div 2;
|
||||
button1.width := 85;
|
||||
button1.height := 32;
|
||||
button1.caption := 'Start Show';
|
||||
button1.Show;
|
||||
end;
|
||||
|
||||
procedure TMainForm.Button1Click(Sender : TObject);
|
||||
begin
|
||||
ShowMessage ('First simple test!');
|
||||
MessageDlg ('Two buttons now...', mtError, [mbOK,mbCancel], 0);
|
||||
MessageDlg ('Warning, not fully implemented', mtWarning, [mbYes, mbNo, mbOK,mbCancel], 0);
|
||||
ShowMessageFmt ('The show will end now'+#13+'%s', [MainForm.Caption]);
|
||||
close;
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.Run;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.1 2001/03/03 00:51:54 lazarus
|
||||
+ new sample to show Message dialogs
|
||||
stoppok
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user