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

CONTROLS

Fix buttons' background


I have four buttons that I animate but with the new systems the background of the buttons are no longer white so I can't just erase before I redraw. How can I get the color of the button so I can paint that color before I redraw the button?

George Hacker Adams


Ok, George. I'm slow, but I finally have a clear understanding of what is going on. My recommendation is probably going to be unexpected: I would suggest that you do not use buttons.

Create a picture of the button pressed and popped up. This is a list of things that you will track manually...

FN drawButton

-------------

If the button is pressed, draw the pressed picture, otherwise draw the popped picture

FN updateWindow

-------------

Call FN drawButton along with your other window update calls.

FN clickButton

-------------

Track the mouse in and out of the button's rect. Call FN drawButton during this tracking

FN idleButton

-------------


rgn& = FN NEWRGN
CALL GETCLIP(rgn&)
' Assume that "t" of t,l,b,r is control rect

' want to redraw the beveled edges, just the center.
CALL INSETRECT(t,4,4) Dont

CALL CLIPRECT(t)
FN drawButton
CALL SETCLIP(rgn&)
CALL DISPOSERGN(rgn&)

STAZ ~)~