
{*******************************************************}
{                                                       }
{       Graphics Vision Example program                 }
{                                                       }
{       Copyright (c) 1996 Stefan Milius                }
{                                                       }
{*******************************************************}

(* Application with standard statusline and a menubar *)

Uses Objects, Drivers, GVViews, GVMenus, GVApp;

type

  TDemoApp = object(TApplication)
               procedure InitMenuBar; virtual;
             end;

(***************************** TDemoApp object ******************************)

procedure TDemoApp.InitMenuBar;
var R: TRect;
Begin
  Main^.GetExtent(R);
  R.B.Y := 21;
  MenuBar := New(PMenuBar, Init(R, NewMenu(
    NewSubMenu('~F~ile', 0, NewMenu(
      NewItem('Open ~t~ext...', 'F3', kbF3, 101, 0,
      NewItem('Open ~b~itmap...', 'F4', kbF4, 102, 0,
      NewLine(
      NewItem('~C~hange directory...', '', kbNoKey, 103, 0,
      NewLine(
      NewItem('D~O~S shell', '', kbNoKey, 104, 0,
      NewItem('~Q~uit', 'Alt+X', kbAltX, cmQuit, 0, nil)))))))),
    NewSubMenu('~W~indows', 0, NewMenu(
      StdWindowMenuItems(
      NewLine(
      NewItem('Window ~l~ist...', 'Alt+0', kbAlt0, 105, 0,
      NewItem('Desktop ~m~ap', 'Alt+Minus', kbAltMinus, 106, 0, nil))))),
    nil)))));
End;

var App: TDemoApp;

Begin
  App.Init;
  App.Run;
  App.Done;
End.
