;
; Example of NewIcon image viewing ONLY! V1.00 (27/04/1999)
; (C) Robert Hutchinson 1999!
; Satanic Dreams Software 1999! [Loki^SD]
;
; Feel free to use this example any way you like ;)
;
; Please email me with any bug reports or changes please:
;
;   loki@sdsoft.freeserve.co.uk
;
; This can be used as an example of forcing the use of NewIcon
; images even when there is both data within the icon object.
;
; Requirements:
;
;   o NewIconsBlitz installed correctly (see docs)
;   o The NIB_Single_Include.BB2 include (provided)
;   o newicon.library (V4 preferably!)
;

WbToScreen 0
WBenchToFront_

  XINCLUDE "/NIBIncludes/NIB_Include.BB2"

  ;--- Check our libraries
  ;
  If NIBCheckLibs{}=False
    NPrint "Incorrect or non-present newicon.library/icon.library!"
    End
  EndIf

  ;--- Load files
  ;
  If NIBOpenIcon{0,"YAM:YAM"}       = False Then badicon=1
  If NIBOpenIcon{1,"YAM:YAM.Guide"} = False Then badicon=1
  If badicon=1
    NPrint "Cant load file(s)!"
    End

  EndIf

  ;--- Check the loaded data..
  ;
  imgs0.b=NIBCheckStruct{0}
  imgs1.b=NIBCheckStruct{1}
  If imgs0=0 OR imgs1=0
    NIBFreeIcon{0}
    NIBFreeIcon{1}
    NPrint "No NewIcon data!"
    End
  EndIf

  ;--- Remap the chunky data to the images...
  ;
  NIBRemapChunkyData{0,#NIB_BOTH,0}
  NIBRemapChunkyData{1,#NIB_BOTH,0}

  ;--- Find the largest height...
  ;
  DefHeight1.w=NIBFindHeight{0}
  DefHeight2.w=NIBFindHeight{1}
  If DefHeight1>DefHeight2
    NewDef=DefHeight1
  Else
    NewDef=DefHeight2
  EndIf

  ;--- Find the widths....
  ;
  DefWidth1.w=NIBFindWidth{0}
  DefWidth2.w=NIBFindWidth{1}

  ;--- Our window....
  ;
  Window 0,50,50,((DefWidth1+DefWidth2)+13),(NewDef*2)+13,$1000,"",0,1
  DefaultOutput

  ;--- Draw our images...
  ;    By this point we KNOW we have the data to draw, so no error
  ;    check required.
  ;
  succ.b=NIBDrawImage{0,#NIB_NORMAL  ,0,5,5}
  succ.b=NIBDrawImage{0,#NIB_SELECTED,0,5,NewDef+8}
  succ.b=NIBDrawImage{1,#NIB_NORMAL  ,0,DefWidth1+8,5}
  succ.b=NIBDrawImage{1,#NIB_SELECTED,0,DefWidth1+8,NewDef+8}

  ;--- Wait for the mouse button hit
  ;
  MouseWait

  ;--- Free the images...
  ;
  NIBFreeImages{0,#NIB_BOTH,0}
  NIBFreeImages{1,#NIB_BOTH,0}

  ;--- Free the icons...
  ;
  NIBFreeIcon{0}
  NIBFreeIcon{1}

  ;--- Free the window..
  ;
  CloseWindow 0

End



