home *** CD-ROM | disk | FTP | other *** search
/ PSION CD 2 / PsionCDVol2.iso / Programs / 400 / STARTS5.SIS / devkit.SIS / Link (.txt) < prev    next >
Encoding:
EPOC OPL Source  |  1999-02-28  |  2.1 KB  |  87 lines

  1.  
  2.  
  3. rem Link PlugIn for Start5 v2.0
  4. rem V1.00
  5. rem ┬⌐1998 Oliver T├╢lker
  6.  
  7. rem -------------------------------
  8.  
  9. include "systinfo.oxh"
  10.  
  11. const KPluginUpdateRateNever%=0
  12. const KPluginUpdateRateNormal%=1
  13. const KPluginUpdateRateHigh%=2
  14. const KPluginUpdateRateMax%=3 rem not implemented yet
  15. const KPluginHeight%=22 rem all PlugIns have the same height in v2.0PA
  16.  
  17. rem This proc is called when the PlugIn is loaded
  18. proc Link_Load:
  19. endp
  20.  
  21. rem This proc must return the PlugIn's width
  22. proc Link_Width%:
  23.     return 20
  24. endp
  25.  
  26. rem This proc must return one of the constants
  27. rem defined above
  28. proc Link_UpdateRate%:
  29.     return KPluginUpdateRateHigh%
  30. endp
  31.  
  32. rem This is called only once after the PlugIn
  33. rem got its own window. wid% is the WindowID of
  34. rem the PlugIns window.
  35. proc Link_Draw:(wid%)
  36.      Link_Update:(wid%)
  37. endp
  38.  
  39. rem This is called from time to time (depending
  40. rem on the update rate setting). As Start5 and all
  41. rem PlugIns are executed in cooperative multitasking
  42. rem this proc should return as fast as possible.
  43. rem (Normally after max. 1/4 sec.)
  44. proc Link_Update:(wid%)
  45.     LOCAL widb%, linkStatus&
  46.  
  47.     linkStatus&=SIRemoteLinkStatus&:
  48.     widb%=gloadbit(MyDir$+"Plugins\Link.mbm",0, linkStatus&)
  49.     guse wid%
  50.     gat 1,1
  51.     gcopy widb%,0,0,20,20,3
  52.     gclose widb%
  53. endp
  54.  
  55. rem This will be called when the PlugIn is unloaded.
  56. proc Link_Unload:
  57. endp
  58.  
  59. rem Perhaps the most important proc. Called whenever
  60. rem the PlugIns window is tapped. Note that if you
  61. rem stop the program in this proc, Start5 will not
  62. rem react to events.
  63. proc Link_Tapped:
  64.     LOCAL linkStatus&, action$(7)
  65.  
  66.     linkStatus&=SIRemoteLinkStatus&:
  67.     if linkStatus&=0
  68.         action$="ENABLE"
  69.     elseif linkStatus&=1
  70.         action$="DISABLE"
  71.     else
  72.         action$="DISABLE"
  73.     endif
  74.     dinit "Link Plugin V1.0"
  75.     dtext "", "Do you want to "+action$+" the link ?"
  76.     dbuttons "Yes",%y or $100 or $200,"No",-(%n or $100 or $200)
  77.     if dialog=%y
  78.         if action$="ENABLE"
  79.             SIRemoteLinkEnable:
  80.         else
  81.             SIRemoteLinkDisable:
  82.         endif
  83.     endif
  84. endp
  85.  
  86.  
  87.