home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / programming / basic / newiconsblitz / nibexamples / ascii / nib_exampletchk.asc < prev   
Encoding:
Text File  |  1999-05-14  |  2.0 KB  |  108 lines

  1. ;
  2. ; Example of Icon type-checking V1.00 (25/04/1999)
  3. ; (C) Robert Hutchinson 1999!
  4. ; Satanic Dreams Software 1999! [Loki^SD]
  5. ;
  6. ; Feel free to use this example any way you like ;)
  7. ; Please email me with any bug reports or changes please:
  8. ;
  9. ;   loki@sdsoft.freeserve.co.uk
  10. ;
  11. ; This example will use the NewIcon images if availible and
  12. ; will fallback on the Standard images otherwise. NI
  13. ; image viewing can be overridden by setting #NIB_OVERRIDE=1
  14. ;
  15. ; Requirements:
  16. ;
  17. ;   o NewIconsBlitz installed correctly (see docs)
  18. ;   o The NIB_Single_Include.BB2 include (provided)
  19. ;   o newicon.library (V4 preferably!)
  20. ;
  21. ; BTW - This is how your program SHOULD function ;)
  22. ;       (Of course depending on what you are doing ;))
  23. ;
  24.  
  25. #NIB_OVERRIDE=0
  26.  
  27. WbToScreen 0
  28. WBenchToFront_
  29.  
  30.   XINCLUDE "/NIBIncludes/NIB_Include.BB2"
  31.  
  32.   ;--- Check our libraries
  33.   ;
  34.   If NIBCheckLibs{}=False
  35.     NPrint "Incorrect or non-present newicon.library/icon.library!"
  36.     End
  37.   EndIf
  38.  
  39.   If NIBOpenIcon{0,"YAM:YAM"}=False
  40.     NPrint "Cant Load Icon!"
  41.     End
  42.   EndIf
  43.  
  44.   imgs.b=NIBCheckStruct{0}
  45.  
  46.   If imgs=0
  47.     simgs.b=STDCheckStruct{0}
  48.     If simgs=0
  49.       NIBFreeIcon{0}
  50.       End
  51.     EndIf
  52.     UseSTD=1
  53.   EndIf
  54.  
  55.   If #NIB_OVERRIDE=1
  56.     UseSTD=1
  57.   EndIf
  58.  
  59.   If UseSTD=0
  60.     NIBRemapChunkyData{0,#NIB_BOTH,0}
  61.     If imgs=1
  62.       NormONLY=1
  63.     EndIf
  64.     ImgW.w=NIBFindWidth{0}
  65.     ImgH.w=NIBFindHeight{0}
  66.   Else
  67.     If simgs=1
  68.       NormONLY=1
  69.     EndIf
  70.     STDToImages{0}
  71.     ImgW.w=STDFindWidth{0}
  72.     ImgH.w=STDFindHeight{0}
  73.   EndIf
  74.  
  75.   If ImgW=0 OR ImgH=0
  76.     NIBFreeIcon{0}
  77.     End
  78.   EndIf
  79.  
  80.   ;#################################
  81.  
  82.   Window 0,50,50,ImgW+10,(ImgH*imgs)+11,$0,"",0,1
  83.   DefaultOutput
  84.  
  85.   ;#################################
  86.  
  87.   If UseSTD=0
  88.     succ.b=NIBDrawImage{0,#NIB_NORMAL  ,0,5,5}
  89.     If NormONLY=0
  90.       succ.b=NIBDrawImage{0,#NIB_SELECTED,0,5,6+ImgH}
  91.     EndIf
  92.   Else
  93.     succ.b=STDDrawImage{0,#NIB_NORMAL  ,0,5,5}
  94.     If NormONLY=0
  95.       succ.b=STDDrawImage{0,#NIB_SELECTED,0,5,6+ImgH}
  96.     EndIf
  97.   EndIf
  98.  
  99.   MouseWait
  100.  
  101.   NIBFreeImages{0,#NIB_BOTH,0}
  102.   NIBFreeIcon{0}
  103.   CloseWindow 0
  104.  
  105. End
  106.  
  107.  
  108.