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

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

  
'=======================================================
' Type Objet
' Classe QSkinBtn version 1.0
'=======================================================
     $IFNDEF TRUE
      $DEFINE True 1
     $ENDIF

     $IFNDEF FALSE
      $DEFINE False 0
     $ENDIF

     $IFNDEF boolean
      $DEFINE boolean INTEGER
     $ENDIF

     TYPE QSkinBtn EXTENDS QIMAGE
Private:
      show AS QCANVAS
      Align AS INTEGER
      Stretch AS boolean
      Width AS SHORT
      Height AS SHORT
Public:
      btUp AS QBITMAP
      btDown AS QBITMAP
      btEnable AS QBITMAP
      mode AS SHORT PROPERTY SET SetMode
      down AS boolean PROPERTY SET SetDown
      enabled AS boolean PROPERTY SET SetEnabled

  '=========================================
  ' Proprieté enable
  '=========================================
      PROPERTY SET SetEnabled(value AS boolean)
       QSkinBtn.bmp=QSkinBtn.btEnable.bmp
       QSkinBtn.repaint
       QSkinBtn.Enabled=value
       Super.Enabled=value
      END PROPERTY

  '=========================================
  ' Proprieté enfoncement bouton
  '=========================================
      PROPERTY SET SetDown(value AS boolean)
       IF super.Enabled THEN
        QSkinBtn.Down=value
        IF QSkinBtn.Down THEN
         QSkinBtn.bmp=QSkinBtn.btDown.bmp
        ELSE
         QSkinBtn.bmp=QSkinBtn.btUp.bmp
        END IF
        QSkinBtn.repaint
       END IF
      END PROPERTY

  '=========================================
  ' Proprieté mode de fonctionnement
  '=========================================
      PROPERTY SET SetMode(value AS SHORT)
       QSkinBtn.mode=value
      END PROPERTY


  '=========================================
  ' Evenement enfoncement bouton
  '=========================================
      EVENT OnMouseDown
       QSkinBtn.bmp=QSkinBtn.btDown.bmp
       QSkinBtn.repaint
      END EVENT

  '=========================================
  ' Evenement relachement bouton
  '=========================================
      EVENT OnMouseUp
       IF QSkinBtn.mode=1 OR QSkinBtn.mode=2 THEN
        IF QSkinBtn.Down AND QSkinBtn.mode=2 THEN
         QSkinBtn.bmp=QSkinBtn.btUp.bmp
         QSkinBtn.repaint
         QSkinBtn.Down=false
        ELSE
         QSkinBtn.Down=true
        END IF
       ELSE
        QSkinBtn.bmp=QSkinBtn.btUp.bmp
        QSkinBtn.repaint
        QSkinBtn.Down=false
       END IF
      END EVENT

  '=========================================
  ' Evenement affichage bouton
  '=========================================
      EVENT Show.OnPaint
       IF super.Enabled THEN
        IF QSkinBtn.Down THEN
         QSkinBtn.bmp=QSkinBtn.btDown.bmp
        ELSE
         QSkinBtn.bmp=QSkinBtn.btUp.bmp
        END IF
       ELSE
        QSkinBtn.bmp=QSkinBtn.btEnable.bmp
       END IF
       QSkinBtn.Show.visible=false
      END EVENT

      CONSTRUCTOR
       autosize=true
       show.PARENT=QFORM
       Down=false
       mode=0
       Enabled=true
      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-08-28 18:46:02