home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a009 / 6.ddi / SAMPLE.LIF / ODEMO1.PRG < prev    next >
Encoding:
Text File  |  1991-04-14  |  1.5 KB  |  76 lines

  1. /***
  2. *  Odemo1.prg
  3. *  Demo of simple menu using the OMENU system.
  4. *
  5. *  Copyright (c) 1990 Nantucket Corp.  All rights reserved.
  6. *  Craig Ogg
  7. *
  8. *  Note: Create with RMAKE OMENU1.RMK
  9. *
  10. */
  11.  
  12. #include "Omenu.ch" 
  13. #include "Inkey.ch"
  14.  
  15. // Menu Options
  16. #define F_EXIT      1
  17. #define A_LIST     11
  18. #define E_ADD      21
  19. #define E_PRINT    22
  20.  
  21. STATIC hBar
  22. STATIC hFileMenu, hAcctMenu, hGLMenu
  23.  
  24. FUNCTION Main
  25.    LOCAL nChoice
  26.  
  27.    hBar := BarNew()
  28.  
  29.    hFileMenu := MenuNew("~File")
  30.    hAcctMenu := MenuNew("~Accounts")
  31.    hGLMenu   := MenuNew("~General Ledger")
  32.  
  33.    PromptAdd( hFileMenu, F_EXIT,  "E~xit  " )
  34.  
  35.    PromptAdd( hAcctMenu, A_LIST,  "~List  " )
  36.  
  37.    PromptAdd( hGLMenu,   E_ADD,   "~Add Entries" )
  38.    PromptAdd( hGLMenu,   E_PRINT, "~Print Entries  ")
  39.  
  40.    MenuAdd( hBar, hFileMenu )
  41.    MenuAdd( hBar, hAcctMenu )
  42.    MenuAdd( hBar, hGLMenu )
  43.  
  44.    CLS
  45.    @ MAXROW(), 0 SAY "Press <F10> or Alt-<highlighted letter> to activate menu..."
  46.  
  47.    BarActivate( hBar )     
  48.    nChoice := BarMenuChoice( hBar )
  49.    DO WHILE nChoice != F_EXIT
  50.       DO CASE
  51.       CASE nChoice == A_LIST
  52.          BarDisplay(hBar)
  53.          @ 12,0
  54.          @ 12,0 SAY "Account List..."
  55.  
  56.       CASE nChoice == E_ADD
  57.          CLS
  58.          BarDisplay(hBar)
  59.          @ 12,0
  60.          @ 12,0 SAY "Add Entries..."
  61.  
  62.       CASE nChoice == E_PRINT
  63.          CLS
  64.          BarDisplay(hBar)
  65.          @ 12,0
  66.          @ 12,0 SAY "Print Entries..."
  67.  
  68.       ENDCASE
  69.  
  70.       BarActivate( hBar )
  71.       nChoice := BarMenuChoice( hBar )
  72.    ENDDO
  73.  
  74.    RETURN NIL
  75.  
  76.