home *** CD-ROM | disk | FTP | other *** search
/ PSION CD 2 / PsionCDVol2.iso / Programs / 464 / Popup.SIS / example.opl (.txt) < prev    next >
Encoding:
EPOC OPL Source  |  1999-09-10  |  3.0 KB  |  107 lines

  1.  
  2.  
  3. REM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  4. REM !                                                     !
  5. REM !                      POPUP DEMO                     !
  6. REM !                                                     !
  7. REM !                  (c) 1999 M.O'Neill                 !
  8. REM !                                                     !
  9. REM !       http://www.i27.com       popup@i27.com        !
  10. REM !                                                     !
  11. REM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  12.  
  13. REM **************************Start**************************
  14. PROC start:
  15.     GLOBAL PopPath$(255)
  16.     
  17. REM remember to place PopUp.OPM and SCROLL.MBM in the same
  18. REM folder as your application!!!
  19.  
  20.     PopPath$="\System\OPM\PopUp.OPM"
  21.     IF EXIST("C:"+PopPath$)
  22.         PopPath$="C:"+PopPath$
  23.     ELSEIF EXIST("D:"+PopPath$)
  24.         PopPath$="D:"+PopPath$
  25.     ELSE
  26.         BUSY "Cannot find PopUp.OPM - please install PopUp.SIS...",0
  27.         PAUSE 80
  28.         STOP
  29.     ENDIF
  30.  
  31.     LOADM PopPath$        REM load the PopUp Module!!
  32.     
  33.     gAT 50,80  :    gPRINT "Press any key for a popup demonstration"
  34.     gAT 50,100 :    gPRINT "with a 13 point Times font, (fontn%=9)"
  35.     gAT 50,120 :    gPRINT "and an 80 pixel PopUp height..."
  36.     GET
  37.     Main:    
  38. ENDP
  39.  
  40. REM ***************************Main**************************
  41. PROC Main:
  42.     LOCAL p$(255)
  43.     
  44. REM set the path to where this app ran from, else dat$ must
  45. REM contain the FULL path to the temporary file
  46.  
  47.     SETPATH CMD$(1)
  48.     
  49. REM call the popup procedure, place return value into variable
  50. REM where "temp.dat" is the name of your temporary database
  51.  
  52.     p$=PUCreatePopup$:(60,52,1,80,"temp.dat",1,9)
  53.  
  54. REM (optional) check if a system command was been sent
  55. REM whilst PopUp was active...
  56.     
  57.     IF p$="_PUSysCommand_X_" 
  58.         REM or "_PUSysCommand_C_" or "_PUSysCommand_O_"
  59.         REM do your System Command handling here!
  60.         PRINT CHR$(7)
  61.         gIPRINT "System Command X was sent!"
  62.         PAUSE 80
  63.         STOP
  64.     ENDIF
  65.     
  66. REM else, once you've got the result, do what you want with it!
  67.  
  68.     IF p$<>""            REM if PopUp wasn't cancelled...
  69.         gCLS
  70.         gAT 200,20  : gPRINT "You selected "+CHR$(34)+p$+CHR$(34)
  71.         AT 5,5
  72.         gAT 200,60  : gPRINT "Press any key for a popup demonstration",
  73.         gAT 200,80  : gPRINT "with the DEFAULT PopUp font, (fontn%=0)"
  74.         gAT 200,100 : gPRINT "and a MAXIMUM HEIGHT (hi%=gHEIGHT-5) PopUp..."
  75.         GET
  76.     ELSE                    REM PopUp was cancelled...
  77.         gCLS
  78.         gAT 220,120
  79.         gPRINT "PopUp was cancelled..."
  80.         GET
  81.         STOP
  82.     ENDIF
  83.     
  84. REM or find out which record number it was instead...
  85.  
  86.     p$=PUCreatePopup$:(0,0,0,gHEIGHT-5,"temp.dat",0,0)
  87.     IF p$="_PUSysCommand_X_" 
  88.         PRINT CHR$(7)
  89.         gIPRINT "System Command X was sent!"
  90.         PAUSE 80
  91.         STOP
  92.     ELSEIF p$<>""            REM if PopUp wasn't cancelled...
  93.         gCLS
  94.         gAT 200,120 :gPRINT "You selected record number",p$
  95.         gAT 200,140 :gPRINT "Press any key to close..."
  96.         GET
  97.     ELSE                    REM PopUp was cancelled...
  98.         gCLS
  99.         gAT 220,120
  100.         gPRINT "PopUp was cancelled..."
  101.         GET
  102.         STOP
  103.     ENDIF
  104. ENDP
  105.  
  106.  
  107.