home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Club Elmshorn Atari PD
/
CCE_PD.iso
/
pc
/
0600
/
CCE_0632.ZIP
/
CCE_0632
/
GOBJ_111.ZIP
/
GOBJECTS.111
/
SOURCE
/
BEISPIEL
/
BEISPL01.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-03-03
|
2KB
|
70 lines
program Beispiel; {$X+} { Beispiel Nr.1 }
uses
OTypes,OProcs,OWindows;
type
TMyApplication = object(TApplication)
procedure InitMainWindow; virtual;
end;
PBeispielWindow = ^TBeispielWindow;
TBeispielWindow = object(TWindow)
Veraendert: boolean;
constructor Init(AParent: PWindow; ATitle: string);
function CanClose: boolean; virtual;
procedure WMButton(mX,mY,BStat,KStat,Clicks: integer); virtual;
end;
var
MyApp: TMyApplication;
procedure TMyApplication.InitMainWindow;
begin
new(PBeispielWindow,Init(nil,'ObjectGEM-Beispielprogramm'));
if (MainWindow=nil) or (ChkError<em_OK) then
Status:=em_InvalidMainWindow
end;
constructor TBeispielWindow.Init(AParent: PWindow; ATitle: string);
begin
if not(inherited Init(AParent,ATitle)) then fail;
Veraendert:=false
end;
function TBeispielWindow.CanClose: boolean;
var valid: boolean;
begin
valid:=inherited CanClose;
if valid and Veraendert then
valid:=(Application^.Alert(@self,1,WAIT,
' Die Grafik wurde verändert!| Wollen Sie sie speichern?',
'&Ja| &Nein ')=2);
CanClose:=valid
end;
procedure TBeispielWindow.WMButton(mX,mY,BStat,KStat,Clicks: integer);
begin
if bTst(BStat,1) then
Application^.Alert(@self,1,NOTE,'Sie haben links geklickt.',' &OK ');
if bTst(BStat,2) then
Application^.Alert(@self,1,NOTE,'Sie haben rechts geklickt.',' &OK ')
end;
begin
MyApp.Init('BSPL','Beispiel');
MyApp.Run;
MyApp.Done
end.