FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

DRAWING

Display icons


Here's an FN I got from someone else (don't remember who):

CLEAR LOCAL
  DIM plotRect&,alignment,transform,iconID
LOCAL FN PlotIconID(plotRect&, alignment, transform, iconID)
'transform 0 = normal,1 = grayed, 2 = pattern over lay 3 = pattern only
  ` SUBQ.L #2,sp ;clear space for result
  ` MOVE.L ^plotRect&,-(sp) ;rect address
  ` MOVE.W ^alignment,-(sp) ;icon suite res ID
  ` MOVE.W ^transform,-(sp) ;selector
  ` MOVE.W ^iconID,-(sp) ;handle address
  ` DC.W $303C,$0500,$ABC9 ;trap number
  ` MOVE.W (sp)+,D0 ;add result of function to stack
END FN

I call it using something like this:

oldRes = FN CURRESFILE
CALL USERESFILE (ref%)
CALL SETRECT (RECT%(0),15,10,47,42)
LONG IF SYSTEM(_sysVers) > 699
  FN PlotIconID(@RECT%(0), alignment, 0, 1001) 'draw icl4 or icl8 icons
XELSE
  icnH& = FN GET1RESOURCE (_"ICN#", 1001) ' draw B/W ICN# for System 6

  LONG IF icnH& <> 0
    CALL PLOTICON (RECT%(0), icnH&)
    CALL RELEASERESOURCE (icnH&)
  END IF
  END IF
CALL USERESFILE (oldRes)

Al Staffieri Jr.