$IFNDEF TRUE
$DEFINE True 1
$ENDIF
$IFNDEF FALSE
$DEFINE False 0
$ENDIF
$IFNDEF boolean
$DEFINE boolean INTEGER
$ENDIF
TYPE QFlashLabel EXTENDS QLABEL
Private:
TIMER AS QTIMER
Public:
LightColor AS LONG
DarkColor AS LONG PROPERTY SET SetDarkColor
Flash AS boolean PROPERTY SET SetFlash
State AS SHORT PROPERTY SET SetState
Speed AS LONG PROPERTY SET SetSpeed
PROPERTY SET SetDarkColor(COLOR AS LONG)
QFlashLabel.DarkColor=COLOR
QFlashLabel.font.COLOR=QFlashLabel.DarkColor
END PROPERTY
PROPERTY SET SetState(state AS SHORT)
QFlashLabel.State=state
IF QFlashLabel.State=1 THEN
QFlashLabel.font.COLOR=QFlashLabel.LightColor
ELSE
QFlashLabel.font.COLOR=QFlashLabel.DarkColor
END IF
END PROPERTY
PROPERTY SET SetFlash(flash AS boolean)
QFlashLabel.Flash=flash
IF QFlashLabel.Flash THEN
QFlashLabel.TIMER.Enabled=true
ELSE
QFlashLabel.TIMER.Enabled=false
QFlashLabel.State=0
QFlashLabel.font.COLOR=QFlashLabel.DarkColor
END IF
END PROPERTY
PROPERTY SET SetSpeed(speed AS LONG)
QFlashLabel.TIMER.Interval=speed
QFlashLabel.Speed=speed
END PROPERTY
EVENT TIMER.OnTimer
IF QFlashLabel.State THEN
QFlashLabel.State=false
QFlashLabel.font.COLOR=QFlashLabel.DarkColor
ELSE
QFlashLabel.State=true
QFlashLabel.font.COLOR=QFlashLabel.LightColor
END IF
END EVENT
CONSTRUCTOR
TIMER.Enabled=false
TIMER.Interval=1000
Speed=1000
Transparent=true
autosize=true
DarkColor=&h0
LightColor=&h0
State=0
END CONSTRUCTOR
END TYPE
|