home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SAMPLES / TESTPOP.PRG < prev    next >
Text File  |  1994-06-07  |  2KB  |  63 lines

  1. #include "FiveWin.ch"
  2.  
  3. static oWnd, oMenu
  4.  
  5. //----------------------------------------------------------------------------//
  6.  
  7. function Main()
  8.  
  9.  DEFINE WINDOW oWnd ;
  10.     FROM 1, 1 TO 20, 65 ;
  11.     TITLE "FiveWin - Testing Popup Menus"
  12.  
  13.  SET MESSAGE OF oWnd TO "Press Mouse Left Button to activate the Popup"
  14.  
  15.  ACTIVATE WINDOW oWnd ;
  16.     ON CLICK ShowPopUp( nRow, nCol )
  17.  
  18. return nil
  19.  
  20. //----------------------------------------------------------------------------//
  21.  
  22. function BuildPopup()
  23.  
  24.    local oMenu
  25.  
  26.    MENU oMenu POPUP                             // Creating a POPUP
  27.       MENUITEM "Open"
  28.       MENU
  29.          MENUITEM "New" MESSAGE "New whatever..."
  30.          SEPARATOR
  31.          MENUITEM "Get" ;
  32.             MESSAGE "Get whatever..." ;
  33.             ACTION cGetFile( "Clipper DataBase (*.dbf) | *.dbf |" + ;
  34.                              "Paradox DataBase (*.db) | *.db",;
  35.                              "Please Select" )
  36.       ENDMENU
  37.       MENUITEM "Close"
  38.       MENU
  39.          MENUITEM "New..."
  40.          SEPARATOR
  41.          MENUITEM "Old..."
  42.       ENDMENU
  43.       MENUITEM "Select" MESSAGE "Select whatever..."
  44.       MENUITEM "All" ACTION MsgInfo( "Todo" ) MESSAGE "Everything"
  45.       SEPARATOR
  46.       MENUITEM "More..." ACTION MsgInfo( "More" ) ;
  47.          MESSAGE "This is just an example"
  48.    ENDMENU
  49.  
  50. return oMenu
  51.  
  52. //----------------------------------------------------------------------------//
  53.  
  54. function ShowPopup( nRow, nCol )
  55.  
  56.    DEFAULT oMenu := BuildPopup()
  57.  
  58.    ACTIVATE POPUP oMenu WINDOW oWnd AT nRow, nCol
  59.  
  60. return nil
  61.  
  62. //----------------------------------------------------------------------------//
  63.