home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / easygui_os12 / examples / easyplugins / iconbox_os12_demo.e < prev    next >
Encoding:
Text File  |  2000-06-06  |  1.8 KB  |  81 lines

  1.  
  2. /*
  3.  
  4.     iconbox_demo: part of EasyPLUGINs package
  5.  
  6. */
  7.  
  8. OPT PREPROCESS
  9.  
  10. -> RST: Added conditional EASY_OS12 support
  11. #define EASY_OS12
  12.  
  13. #ifdef EASY_OS12
  14.   MODULE 'tools/easygui_os12', 'easyplugins/iconbox_os12','hybrid/utility'
  15. #endif
  16. #ifndef EASY_OS12
  17.   OPT OSVERSION=37
  18.   MODULE 'tools/easygui', 'easyplugins/iconbox', 'utility'
  19. #endif
  20.  
  21. MODULE 'icon', 'utility/tagitem'
  22.  
  23. DEF iconbox:PTR TO iconbox_plugin, disabled=FALSE, selected=FALSE
  24.  
  25. PROC main() HANDLE
  26.  
  27.     IF (iconbase:=OpenLibrary('icon.library', 0))=NIL THEN Raise("iclb")
  28. #ifdef EASY_OS12
  29.     openUtility()
  30. #endif
  31. #ifndef EASY_OS12
  32.     IF (utilitybase:=OpenLibrary('utility.library', 37))=NIL THEN Raise("utlb")
  33. #endif
  34.  
  35.     NEW iconbox.iconbox([PLA_IconBox_IconName, 'Sys:Disk',
  36.                          TAG_DONE])
  37.  
  38.     easyguiA('iconbox_plugin example',  [ROWS,
  39.                                             [BEVELR,
  40.                                                 [PLUGIN, NIL, iconbox]
  41.                                             ],
  42.                                             [COLS,
  43.                                                 [CHECK, {toggle_disabled}, '_Disabled?', disabled, FALSE, -1, "d"],
  44.                                                 [CHECK, {toggle_selected}, '_Selected?', selected, FALSE, -1, "s"]
  45.                                             ]
  46.                                         ])
  47.  
  48. EXCEPT DO
  49.  
  50.     END iconbox
  51.  
  52. #ifdef EASY_OS12
  53.     closeUtility()
  54. #endif
  55. #ifndef EASY_OS12
  56.     IF utilitybase THEN CloseLibrary(utilitybase)
  57. #endif
  58.     IF iconbase THEN CloseLibrary(iconbase)
  59.  
  60. ENDPROC
  61.  
  62. PROC toggle_disabled()
  63.  
  64.     IF disabled=FALSE THEN disabled:=TRUE ELSE disabled:=FALSE
  65.  
  66.     iconbox.set(PLA_IconBox_Disabled, disabled)
  67.  
  68. ENDPROC
  69.  
  70. PROC toggle_selected()
  71.  
  72.     IF selected=FALSE THEN selected:=TRUE ELSE selected:=FALSE
  73.  
  74.     iconbox.set(PLA_IconBox_ShowSelected, selected)
  75.  
  76. ENDPROC
  77.  
  78.  
  79.  
  80.  
  81.