Guidance
指路人
g.yi.org
software / rapidq / Examples / QObject / Object / QAnim.inc

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'=======================================================
' Type Objet
' Classe QAnim Version 1.0
'=======================================================
     $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

  '=====================================
  ' proprieté start/stop animation
  '=====================================
      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

  '=====================================
  ' proprieté couleur de fond
  '=====================================
      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

  '=========================================
  ' proprieté utilisation du masque image
  '=========================================
      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

  '=====================================
  ' proprieté largeur image
  '=====================================
      PROPERTY SET SetWidth(width AS SHORT)
       super.width=width
       QAnim.ImageList.Width=width
      END PROPERTY

  '=====================================
  ' proprieté hauteur image
  '=====================================
      PROPERTY SET SetHeight(height AS SHORT)
       super.height=height
       QAnim.ImageList.Height=height
      END PROPERTY

  '=====================================
  ' proprieté vitesse animation
  '=====================================
      PROPERTY SET SetSpeed(speed AS LONG)
       QAnim.TIMER.Interval=speed
      END PROPERTY

  '=====================================
  ' proprieté index image
  '=====================================
      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

  '=====================================
  ' evenement timer
  '=====================================
      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
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-04-22 16:39:52