home *** CD-ROM | disk | FTP | other *** search
- ''
- '' $Id: EmBDemo.bas,v 1.2 1994/03/16 12:12:38 alex Rel $
- ''
- '' Demonstration of a BOOPSI private image class
- ''
- '' Derived from Commodore-Amiga example (c) Copyright 1992 Commodore-Amiga, Inc.
- ''
-
- DEFINT A-Z
-
- 'REM $INCLUDE Graphics.bh
- 'REM $INCLUDE Intuition.bh
- 'REM $INCLUDE Utility.bh
- 'REM $INCLUDE Exec.bc
- 'REM $INCLUDE Hardware.bc
-
- REM $INCLUDE BLib/BOOPSISupport.bas
- REM $INCLUDE BLib/GfxMacros.bas
-
- REM $INCLUDE EmBClass.bas ' the private image class implementation
-
- LIBRARY OPEN "graphics.library", LIBRARY_MINIMUM&
- LIBRARY OPEN "intuition.library", 36
- LIBRARY OPEN "utility.library", LIBRARY_MINIMUM&
-
- DIM SHARED tl&(40) ' Generic TagList
-
- CONST XPOS = 40
- CONST YPOS = 20
- CONST XPOS2 = 70
-
- SUB main
- STATIC EmBClass& ' Black-box abstract class handle
- STATIC drinfo&
- STATIC myimage&
-
- EmBClass& = initEmBClass&
-
- ' create an image from my private class
- TAGLIST VARPTR(tl&(0)), _
- IA_Width&, 20, _
- IA_Height&, 10, _
- TAG_END&
- myimage& = NewObjectA&(EmBClass&, NULL&, VARPTR(tl&(0)))
-
- drinfo& = GetScreenDrawInfo&(PEEKL(WINDOW(7) + WScreen))
-
- ' draw the image
- DrawImageState WINDOW(8), myimage&, XPOS, YPOS, IDS_NORMAL&, drinfo&
-
- ' draw the image
- DrawImageState WINDOW(8), myimage&, XPOS2, YPOS, IDS_SELECTED&, drinfo&
-
- SLEEP
-
- FreeScreenDrawInfo PEEKL(WINDOW(7) + WScreen), drinfo&
-
- DisposeObject myimage&
- IF freeEmBClass&(EmBClass&) = FALSE& THEN
- PRINT "PANIC: exiting with class not freed!"
- END IF
- END SUB
-
- main
- END
-