mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-26 03:28:08 +01:00
MG: fixed examples
git-svn-id: trunk@3583 -
This commit is contained in:
parent
e5283fc1bb
commit
acfed31bc8
@ -162,7 +162,7 @@ end;
|
|||||||
|
|
||||||
procedure TForm1.FormDestroy(Sender : TObject);
|
procedure TForm1.FormDestroy(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
// Application.Terminate;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.button1MouseDown(Sender: TObject; Button: TMouseButton;
|
procedure TForm1.button1MouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
|||||||
@ -162,8 +162,7 @@ end;
|
|||||||
|
|
||||||
procedure TForm1.FormKill(Sender : TObject);
|
procedure TForm1.FormKill(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
// Free;
|
|
||||||
Application.terminate;
|
|
||||||
End;
|
End;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -414,6 +413,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.6 2002/10/30 13:44:29 lazarus
|
||||||
|
MG: fixed examples
|
||||||
|
|
||||||
Revision 1.5 2002/10/29 08:22:32 lazarus
|
Revision 1.5 2002/10/29 08:22:32 lazarus
|
||||||
MG: added interfaces unit
|
MG: added interfaces unit
|
||||||
|
|
||||||
|
|||||||
@ -166,7 +166,7 @@ end;
|
|||||||
|
|
||||||
procedure TForm1.FormKill(Sender : TObject);
|
procedure TForm1.FormKill(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
// Application.terminate;
|
|
||||||
End;
|
End;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -377,7 +377,7 @@ end;
|
|||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
procedure TForm1.mnuQuitClicked(Sender : TObject);
|
procedure TForm1.mnuQuitClicked(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
Application.Terminate;
|
Close;
|
||||||
end;
|
end;
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
@ -389,6 +389,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.8 2002/10/30 13:44:29 lazarus
|
||||||
|
MG: fixed examples
|
||||||
|
|
||||||
Revision 1.7 2002/10/29 08:22:32 lazarus
|
Revision 1.7 2002/10/29 08:22:32 lazarus
|
||||||
MG: added interfaces unit
|
MG: added interfaces unit
|
||||||
|
|
||||||
|
|||||||
@ -114,14 +114,14 @@ end;
|
|||||||
|
|
||||||
procedure TSampleDialogs.FormDestroy(Sender : TObject);
|
procedure TSampleDialogs.FormDestroy(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
Application.Terminate;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSampleDialogs.buttonClick(Sender : TObject);
|
procedure TSampleDialogs.buttonClick(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
case TButton(Sender).Tag of
|
case TButton(Sender).Tag of
|
||||||
1 : Application.Terminate;
|
1 : Close;
|
||||||
2 : with TOpenDialog.Create(Self) do
|
2 : with TOpenDialog.Create(Self) do
|
||||||
begin
|
begin
|
||||||
Filter := '*.pp';
|
Filter := '*.pp';
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
{ $Id$ }
|
{ $Id$ }
|
||||||
{
|
{
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
main.pp - Toolbar
|
|
||||||
-------------------
|
|
||||||
TMain is the application toolbar window.
|
|
||||||
|
|
||||||
|
|
||||||
Initial Revision : Sun Mar 28 23:15:32 CST 1999
|
Initial Revision : Sun Mar 28 23:15:32 CST 1999
|
||||||
@ -47,13 +44,11 @@ type
|
|||||||
Button3: TButton;
|
Button3: TButton;
|
||||||
Button4: TButton;
|
Button4: TButton;
|
||||||
grpTst : TGroupBox;
|
grpTst : TGroupBox;
|
||||||
mnuBarMain: TMenuBar;
|
mnuFile: TMainMenu;
|
||||||
mnuFile: TMenu;
|
|
||||||
itmFileQuit: TMenuItem;
|
itmFileQuit: TMenuItem;
|
||||||
CheckBox1 : TCheckBox;
|
CheckBox1 : TCheckBox;
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
procedure LoadMainMenu;
|
procedure LoadMainMenu;
|
||||||
Procedure FormKill(Sender : TObject);
|
|
||||||
procedure mnuQuitClicked(Sender : TObject);
|
procedure mnuQuitClicked(Sender : TObject);
|
||||||
protected
|
protected
|
||||||
procedure Button1CLick(Sender : TObject);
|
procedure Button1CLick(Sender : TObject);
|
||||||
@ -101,17 +96,10 @@ End;
|
|||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
procedure TForm1.FormKill(Sender : TObject);
|
|
||||||
Begin
|
|
||||||
Application.terminate;
|
|
||||||
End;
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
procedure TForm1.LoadMainMenu;
|
procedure TForm1.LoadMainMenu;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
OnDestroy := @FormKill;
|
|
||||||
|
|
||||||
{ set the height and width }
|
{ set the height and width }
|
||||||
Height := 350;
|
Height := 350;
|
||||||
Width := 700;
|
Width := 700;
|
||||||
@ -183,31 +171,19 @@ Button4.Show;
|
|||||||
Button4.Caption := 'Hide';
|
Button4.Caption := 'Hide';
|
||||||
Button4.OnClick := @Button4Click;
|
Button4.OnClick := @Button4Click;
|
||||||
|
|
||||||
mnuFile := TMenu.Create(nil);
|
mnuFile := TMainMenu.Create(Self);
|
||||||
|
|
||||||
itmFileQuit := TMenuItem.Create(nil);
|
itmFileQuit := TMenuItem.Create(Self);
|
||||||
itmFileQuit.Caption := 'Quit';
|
itmFileQuit.Caption := 'Quit';
|
||||||
itmFileQuit.OnClick := @mnuQuitClicked;
|
itmFileQuit.OnClick := @mnuQuitClicked;
|
||||||
// itmFileQuit.Show;
|
|
||||||
|
|
||||||
mnuFile.Items.Add(itmFileQuit);
|
mnuFile.Items.Add(itmFileQuit);
|
||||||
|
|
||||||
mnuBarMain := TMenuBar.Create(self);
|
|
||||||
{
|
|
||||||
mnuBarMain.Height := 25;
|
|
||||||
mnuBarMain.Width := Width;
|
|
||||||
mnuBarMain.Top := 0;
|
|
||||||
mnuBarMain.Left := 0;
|
|
||||||
}
|
|
||||||
mnuBarMain.Show;
|
|
||||||
|
|
||||||
mnuBarMain.AddMenu('File',mnuFile);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
procedure TForm1.mnuQuitClicked(Sender : TObject);
|
procedure TForm1.mnuQuitClicked(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
Application.Terminate;
|
Close;
|
||||||
end;
|
end;
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ unit HelloForm;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses SysUtils, Classes, Forms, Buttons, Controls, Graphics;
|
uses SysUtils, Classes, Forms, Buttons;
|
||||||
|
|
||||||
type
|
type
|
||||||
THello = class(TForm)
|
THello = class(TForm)
|
||||||
@ -63,24 +63,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure THello.button1Click(Sender : TObject);
|
procedure THello.button1Click(Sender : TObject);
|
||||||
var
|
|
||||||
Bitmap : TBitmap;
|
|
||||||
S : TFileStream;
|
|
||||||
Dir : String;
|
|
||||||
begin
|
begin
|
||||||
Dir := '..' + PathDelim + 'Images' + PathDelim;
|
|
||||||
With TPixmap.Create do begin
|
|
||||||
LoadFromFile(Dir + 'splash_logo.xpm');
|
|
||||||
S := TFileStream.Create(Dir + 'splash_logo.bmp', fmCreate or fmOpenWrite);
|
|
||||||
SaveToStream(S);
|
|
||||||
S.Free;
|
|
||||||
end;
|
|
||||||
Bitmap := TBitmap.Create;
|
|
||||||
Bitmap.LoadFromFile(Dir + 'splash_logo.bmp');
|
|
||||||
S := TFileStream.Create(Dir + 'splash_logo.bmp', fmCreate or fmOpenWrite);
|
|
||||||
Bitmap.SaveToStream(S);
|
|
||||||
S.Free;
|
|
||||||
Bitmap.Free;
|
|
||||||
close;
|
close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -89,6 +72,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.7 2002/10/30 13:44:29 lazarus
|
||||||
|
MG: fixed examples
|
||||||
|
|
||||||
Revision 1.6 2002/10/29 19:33:42 lazarus
|
Revision 1.6 2002/10/29 19:33:42 lazarus
|
||||||
MG: removed interfaces
|
MG: removed interfaces
|
||||||
|
|
||||||
|
|||||||
@ -268,7 +268,7 @@ end;
|
|||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
procedure TForm1.mnuQuitClicked(Sender : TObject);
|
procedure TForm1.mnuQuitClicked(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
Application.Terminate;
|
Close;
|
||||||
end;
|
end;
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
|||||||
@ -2870,7 +2870,7 @@ end;
|
|||||||
|
|
||||||
procedure TForm1.QuitClick(Sender : TObject);
|
procedure TForm1.QuitClick(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
Application.Terminate;
|
Close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Destructor TForm1.Destroy;
|
Destructor TForm1.Destroy;
|
||||||
@ -2879,6 +2879,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.10 2002/10/30 13:44:29 lazarus
|
||||||
|
MG: fixed examples
|
||||||
|
|
||||||
Revision 1.9 2002/10/29 08:22:33 lazarus
|
Revision 1.9 2002/10/29 08:22:33 lazarus
|
||||||
MG: added interfaces unit
|
MG: added interfaces unit
|
||||||
|
|
||||||
|
|||||||
@ -289,7 +289,7 @@ end;
|
|||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
procedure TForm1.mnuQuitClicked(Sender : TObject);
|
procedure TForm1.mnuQuitClicked(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
Application.Terminate;
|
Close;
|
||||||
end;
|
end;
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
@ -300,6 +300,9 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.7 2002/10/30 13:44:29 lazarus
|
||||||
|
MG: fixed examples
|
||||||
|
|
||||||
Revision 1.6 2002/10/30 12:37:25 lazarus
|
Revision 1.6 2002/10/30 12:37:25 lazarus
|
||||||
MG: mouse cursors are now allocated on demand
|
MG: mouse cursors are now allocated on demand
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user