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

 
Output of file : POPUPMEN.PRG contained in archive : OOPMENU.ZIP
/*
PopupMenu.prg - Class(y) popup menu class

Copyright (c) 1991 Chris Muller and Anton van Straaten
*/

#include "class(y).ch"


CREATE CLASS PopupMenu FROM BaseMenu
VAR width

PROTECTED:
METHOD initWin
METHOD menuTop, menuLeft

EXPORT:
METHOD addItem
METHOD childRow, childCol
END CLASS


// pass parameters up to superclass (will not be necessary in Class(y) 2.0)
CONSTRUCTOR new( aItems ), ( aItems )
RETURN


METHOD PROCEDURE initWin
LOCAL bottom := ::menuTop + len( ::items ) + 1
LOCAL right := ::menuLeft + ::width + 1
::window := Window():new( ::menuTop, ::menuLeft, bottom, right, ::colorSpec )
// display window and draw frame.
::window:show:frame()
RETURN


METHOD menuTop
RETURN ::parent:childRow()


METHOD menuLeft
RETURN ::parent:childCol()


METHOD childRow
RETURN ::window:top + ::currPos + 1


METHOD childCol
RETURN ::window:left + 1


METHOD PROCEDURE addItem( cLabel, oAction, isActive )
LOCAL nRow
LOCAL nItemNo := LEN( ::items ) + 1

// establish relative screen row for new option
IF nItemNo == 1
nRow := 1
ELSE
nRow := ATail(::items):nextRow
END

::addNewItem( nRow, 1, cLabel, oAction, isActive )

IF ::width == NIL
// initialize ::width here, since when addItem is invoked by BaseMenu's
// constructor, the body of Menu's constructor has not yet executed.
::width := 0
END

::width := MAX( ::width, ::items[nItemNo]:len )
RETURN


// eof popupmenu.prg


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : OOPMENU.ZIP
Filename : POPUPMEN.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/