Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : OOPMENU.ZIP
Filename : MENUDEMO.PRG

 
Output of file : MENUDEMO.PRG contained in archive : OOPMENU.ZIP
/*
MenuDemo.prg

Class(y) menu demonstration
*/


PROCEDURE Main
LOCAL oMenuBar, oSaveMenu, oFileMenu, oWindowMenu, oBlockMenu

// to keep the syntax (reasonably) simple, we create the submenus first:
oSaveMenu := PopupMenu():new( { { " ~Document ", { || SaveDoc() } }, ;
{ " ~Text ", { || SaveText() } } ;
} )

oFileMenu := PullDnMenu():new( { { " ~Load ", { || LoadFile() } }, ;
{ " ~Edit ", { || EditFile() } }, ;
{ " ~Save ", oSaveMenu } ;
} )

oWindowMenu := PullDnMenu():new( { { " ~Close ", { || CloseWin() } }, ;
{ " ~Split ", { || SplitWin() } }, ;
{ " ~Next ", { || NextWin() } } ;
} )


oBlockMenu := PullDnMenu():new( { { " Mark ~Line ", { || MarkLine() } }, ;
{ " ~Mark Character ", { || MarkChar() } }, ;
{ " Mark ~Column ", { || MarkCol() } } ;
} )

oMenuBar := MenuBar():new( { { " ~File ", oFileMenu }, ;
{ " ~Window ", oWindowMenu }, ;
{ " ~Block ", oBlockMenu } ;
} )

/*
An alternative technique would be to add items
to the menus one at a time, as follows:

oMenuBar := MenuBar():new

oMenuBar:addItem(" File ", oFileMenu)
oMenuBar:addItem(" Window ", oWindowMenu)
oMenuBar:addItem(" Block ", oBlockMenu)
*/

cls
set wrap on
setcolor('N/W, W/N')

// execute the menu:
oMenuBar:exec()

return




// these are just stubs, so let's cut corners...
procedure SaveDoc; dummy(); return
procedure SaveText; dummy(); return
procedure LoadFile; dummy(); return
procedure EditFile; dummy(); return
procedure CloseWin; dummy(); return
procedure SplitWin; dummy(); return
procedure NextWin; dummy(); return
procedure MarkLine; dummy(); return
procedure MarkChar; dummy(); return
procedure MarkCol; dummy(); return

procedure dummy
@ 24, 0 say procname(1) + ' - press a key...'
inkey(0)
@ 24, 0
return


// menudemo.prg


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : OOPMENU.ZIP
Filename : MENUDEMO.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/