$IFNDEF TRUE
$DEFINE True 1
$ENDIF
$IFNDEF FALSE
$DEFINE False 0
$ENDIF
$IFNDEF boolean
$DEFINE boolean INTEGER
$ENDIF
TYPE QAnim EXTENDS QIMAGE
PRIVATE:
TIMER AS QTIMER
PUBLIC:
Speed AS LONG PROPERTY SET SetSpeed
ImageList AS QIMAGELIST
Index AS SHORT PROPERTY SET SetIndex
Width AS SHORT PROPERTY SET SetWidth
Height AS SHORT PROPERTY SET SetHeight
BackColor AS LONG PROPERTY SET SetBackColor
Masked AS boolean PROPERTY SET SetMasked
Move AS boolean PROPERTY SET SetMove
PROPERTY SET SetMove(move AS boolean)
IF move THEN
IF QAnim.ImageList.Count>0 THEN
QAnim.TIMER.Enabled=true
QAnim.Move=true
END IF
ELSE
QAnim.TIMER.Enabled=false
QAnim.Move=false
QAnim.Index--
END IF
END PROPERTY
PROPERTY SET SetBackColor(backcolor AS LONG)
QAnim.ImageList.bkcolor=backcolor
IF QAnim.ImageList.Count>0 AND QAnim.visible=true THEN
QAnim.bmp=QAnim.ImageList.GetBMP(QAnim.Index)
IF QAnim.visible=false THEN QAnim.visible=true
QAnim.repaint
END IF
END PROPERTY
PROPERTY SET SetMasked(masked AS boolean)
QAnim.ImageList.masked=masked
IF QAnim.ImageList.Count>0 AND QAnim.visible=true THEN
QAnim.bmp=QAnim.ImageList.GetBMP(QAnim.Index)
IF QAnim.visible=false THEN QAnim.visible=true
QAnim.repaint
END IF
END PROPERTY
PROPERTY SET SetWidth(width AS SHORT)
super.width=width
QAnim.ImageList.Width=width
END PROPERTY
PROPERTY SET SetHeight(height AS SHORT)
super.height=height
QAnim.ImageList.Height=height
END PROPERTY
PROPERTY SET SetSpeed(speed AS LONG)
QAnim.TIMER.Interval=speed
END PROPERTY
PROPERTY SET SetIndex(index AS SHORT)
IF QAnim.ImageList.Count>0 THEN
QAnim.Index=index
QAnim.bmp=QAnim.ImageList.GetBMP(index)
IF QAnim.visible=false THEN QAnim.visible=true
QAnim.repaint
END IF
END PROPERTY
EVENT TIMER.OnTimer
IF QAnim.Index>QAnim.ImageList.Count-1 THEN QAnim.Index=0
QAnim.bmp=QAnim.ImageList.GetBMP(QAnim.Index)
IF QAnim.visible=false THEN QAnim.visible=true
QAnim.repaint
QAnim.Index++
END EVENT
CONSTRUCTOR
TIMER.Enabled=false
TIMER.Interval=200
Visible=false
Index=0
Move=false
ImageList.masked=false
END CONSTRUCTOR
END TYPE
|