home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_PAS
/
KEYCTRL.ZIP
/
DEMOKEYC.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-01-07
|
2KB
|
88 lines
Program DemoKeyC;
{$F+}
uses objects,drivers,views,menus,app,
dialogs,editors,KeyCtrl,DKeyCtrl,CmKey;
type TDemoKeyCtrlApp=object(tapplication)
constructor init;
procedure handleevent(var event:tevent); virtual;
procedure InitMenubar; virtual;
procedure InitStatusline;Virtual;
Procedure demo;
end;
Procedure TDemoKeyCtrlApp.Initstatusline;
var r:Trect;
begin
getextent(r);
R.a.y:=r.b.y-1;
Statusline:=New(Pstatusline,Init(R,
Newstatusdef(0,$Ffff,StdStatusKeys(
NewStatusKey('~Alt-X~ Exit', kbAltX, cmQuit,
NewStatuskey('~F1~ Demo KeyCtrl',kbf1,cmdemo,
nil))),nil)));
end;
procedure TDemoKeyCtrlapp.Demo;
var PDemoDialog :PkeyCtrlDialog;
begin
if wincount<WinMax then
begin
PDemodialog:=New(PKeyCtrldialog,init);
insertwindow(Pdemodialog);
end;
end;
procedure TDemoKeyCtrlapp.handleevent(var event:tevent);
begin
if event.what = evcommand then
if event.command=cmdemo then
begin
clearevent(event);
demo;
end;
inherited handleevent(event);
end;
function StdDemoKeyCtrlMenuItems(Next: PMenuItem): PMenuItem;
begin
StdDemoKeyCtrlMenuItems :=
newitem('~D~emo KeyCtrl','',kbnokey,cmdemo,hcnocontext,
newitem('~E~xit','Alt+X',kbaltx,cmquit,hcnocontext,
next));
end;
Procedure TDemoKeyCtrlApp.initmenuBar;
var r:trect;
begin
getextent(r);
r.b.y:=r.a.y+1;
menubar:=new(pmenubar,init(r,newmenu(
newsubmenu('~D~emo',hcnocontext,newmenu(
stdDemoKeyCtrlmenuitems(nil)),
nil))));
end;
constructor TDemoKeyCtrlApp.init;
begin
inherited init;
end;
var DemoKeyCtrl_app:TDemoKeyCtrlApp;
begin
DemoKeyCtrl_app.init;
DemoKeyCtrl_app.run;
DemoKeyCtrl_app.done;
end.