home *** CD-ROM | disk | FTP | other *** search
- {$X+}
- program TestCase;
-
- uses Dos, Memory, Objects, Drivers, Views, Menus, Dialogs, App, StdDlg;
-
- Const
- cmTry = 150;
- cmButton = 151;
-
- type
- TListboxRec = record
- PS : PStringCollection;
- Focused : Integer;
- end;
- type
- TMyApp = object(TApplication)
- constructor Init;
- procedure InitStatusLine; virtual;
- procedure HandleEvent(var Event: TEvent); virtual;
- end;
-
- var
- MyApp: TMyApp;
- Dialog : PDialog;
-
- constructor TMyApp.Init;
- var
- R : Trect;
- begin
- TApplication.Init;
- end;
-
- procedure TMyApp.InitStatusLine;
- var R: TRect;
- begin
- GetExtent(R);
- R.A.Y := R.B.Y - 1;
- StatusLine := New(PStatusLine, Init(R,
- NewStatusDef(0, $FFFF,
- NewStatusKey('~Alt-X~ Exit', kbAltX, cmQuit,
- NewStatusKey('~F9~ Try dialog', kbF9, cmTry,
- nil)),
- nil)
- ));
- end;
-
- (*----Insert MakeDialog here----*)
-
- procedure TMyApp.HandleEvent(var Event: TEvent);
- begin
- TApplication.HandleEvent(Event);
-
- if (Event.What = evCommand) and (Event.Command = cmTry) then
- begin
- Dialog := MakeDialog;
- DeskTop^.ExecView(Dialog);
- Dispose(Dialog, Done);
- ClearEvent(Event);
- end;
- end;
-
- begin
- MyApp.Init;
- MyApp.Run;
- MyApp.Done;
- end.
-
-