MG: fixed examples

git-svn-id: trunk@3583 -
This commit is contained in:
lazarus 2002-10-30 13:44:29 +00:00
parent e5283fc1bb
commit acfed31bc8
9 changed files with 52 additions and 79 deletions

View File

@ -162,7 +162,7 @@ end;
procedure TForm1.FormDestroy(Sender : TObject);
begin
// Application.Terminate;
end;
procedure TForm1.button1MouseDown(Sender: TObject; Button: TMouseButton;

View File

@ -162,8 +162,7 @@ end;
procedure TForm1.FormKill(Sender : TObject);
Begin
// Free;
Application.terminate;
End;
{------------------------------------------------------------------------------}
@ -414,6 +413,9 @@ end.
{
$Log$
Revision 1.6 2002/10/30 13:44:29 lazarus
MG: fixed examples
Revision 1.5 2002/10/29 08:22:32 lazarus
MG: added interfaces unit

View File

@ -166,7 +166,7 @@ end;
procedure TForm1.FormKill(Sender : TObject);
Begin
// Application.terminate;
End;
{------------------------------------------------------------------------------}
@ -377,7 +377,7 @@ end;
{------------------------------------------------------------------------------}
procedure TForm1.mnuQuitClicked(Sender : TObject);
begin
Application.Terminate;
Close;
end;
{------------------------------------------------------------------------------}
@ -389,6 +389,9 @@ end.
{
$Log$
Revision 1.8 2002/10/30 13:44:29 lazarus
MG: fixed examples
Revision 1.7 2002/10/29 08:22:32 lazarus
MG: added interfaces unit

View File

@ -114,14 +114,14 @@ end;
procedure TSampleDialogs.FormDestroy(Sender : TObject);
begin
Application.Terminate;
end;
procedure TSampleDialogs.buttonClick(Sender : TObject);
begin
case TButton(Sender).Tag of
1 : Application.Terminate;
1 : Close;
2 : with TOpenDialog.Create(Self) do
begin
Filter := '*.pp';

View File

@ -1,9 +1,6 @@
{ $Id$ }
{
/***************************************************************************
main.pp - Toolbar
-------------------
TMain is the application toolbar window.
Initial Revision : Sun Mar 28 23:15:32 CST 1999
@ -47,13 +44,11 @@ type
Button3: TButton;
Button4: TButton;
grpTst : TGroupBox;
mnuBarMain: TMenuBar;
mnuFile: TMenu;
mnuFile: TMainMenu;
itmFileQuit: TMenuItem;
CheckBox1 : TCheckBox;
constructor Create(AOwner: TComponent); override;
procedure LoadMainMenu;
Procedure FormKill(Sender : TObject);
procedure mnuQuitClicked(Sender : TObject);
protected
procedure Button1CLick(Sender : TObject);
@ -101,17 +96,10 @@ End;
{------------------------------------------------------------------------------}
procedure TForm1.FormKill(Sender : TObject);
Begin
Application.terminate;
End;
{------------------------------------------------------------------------------}
procedure TForm1.LoadMainMenu;
begin
OnDestroy := @FormKill;
{ set the height and width }
Height := 350;
Width := 700;
@ -183,31 +171,19 @@ Button4.Show;
Button4.Caption := 'Hide';
Button4.OnClick := @Button4Click;
mnuFile := TMenu.Create(nil);
mnuFile := TMainMenu.Create(Self);
itmFileQuit := TMenuItem.Create(nil);
itmFileQuit := TMenuItem.Create(Self);
itmFileQuit.Caption := 'Quit';
itmFileQuit.OnClick := @mnuQuitClicked;
// itmFileQuit.Show;
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;
{------------------------------------------------------------------------------}
procedure TForm1.mnuQuitClicked(Sender : TObject);
begin
Application.Terminate;
Close;
end;
{------------------------------------------------------------------------------}

View File

@ -25,7 +25,7 @@ unit HelloForm;
interface
uses SysUtils, Classes, Forms, Buttons, Controls, Graphics;
uses SysUtils, Classes, Forms, Buttons;
type
THello = class(TForm)
@ -63,24 +63,7 @@ begin
end;
procedure THello.button1Click(Sender : TObject);
var
Bitmap : TBitmap;
S : TFileStream;
Dir : String;
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;
end;
@ -89,6 +72,9 @@ end.
{ =============================================================================
$Log$
Revision 1.7 2002/10/30 13:44:29 lazarus
MG: fixed examples
Revision 1.6 2002/10/29 19:33:42 lazarus
MG: removed interfaces

View File

@ -268,7 +268,7 @@ end;
{------------------------------------------------------------------------------}
procedure TForm1.mnuQuitClicked(Sender : TObject);
begin
Application.Terminate;
Close;
end;
{------------------------------------------------------------------------------}

View File

@ -2870,7 +2870,7 @@ end;
procedure TForm1.QuitClick(Sender : TObject);
begin
Application.Terminate;
Close;
end;
Destructor TForm1.Destroy;
@ -2879,6 +2879,9 @@ begin
end;
{
$Log$
Revision 1.10 2002/10/30 13:44:29 lazarus
MG: fixed examples
Revision 1.9 2002/10/29 08:22:33 lazarus
MG: added interfaces unit

View File

@ -289,7 +289,7 @@ end;
{------------------------------------------------------------------------------}
procedure TForm1.mnuQuitClicked(Sender : TObject);
begin
Application.Terminate;
Close;
end;
{------------------------------------------------------------------------------}
@ -300,6 +300,9 @@ begin
end.
{
$Log$
Revision 1.7 2002/10/30 13:44:29 lazarus
MG: fixed examples
Revision 1.6 2002/10/30 12:37:25 lazarus
MG: mouse cursors are now allocated on demand