$IFNDEF TRUE
$DEFINE True 1
$ENDIF
$IFNDEF FALSE
$DEFINE False 0
$ENDIF
$IFNDEF boolean
$DEFINE boolean INTEGER
$ENDIF
TYPE QTextBtn EXTENDS QLABEL
DownColor AS LONG
UpColor AS LONG PROPERTY SET SetUpColor
mode AS SHORT PROPERTY SET SetMode
down AS boolean PROPERTY SET SetDown
enabled AS boolean PROPERTY SET SetEnabled
PROPERTY SET SetUpColor(value AS LONG)
QTextBtn.UpColor=value
QTextBtn.font.COLOR=QTextBtn.UpColor
END PROPERTY
PROPERTY SET SetDown(value AS boolean)
IF super.Enabled THEN
QTextBtn.Down=value
IF QTextBtn.Down THEN
QTextBtn.font.COLOR=QTextBtn.DownColor
ELSE
QTextBtn.font.COLOR=QTextBtn.UpColor
END IF
END IF
END PROPERTY
PROPERTY SET SetMode(value AS SHORT)
QTextBtn.mode=value
END PROPERTY
EVENT OnMouseDown
QTextBtn.font.COLOR=QTextBtn.DownColor
END EVENT
EVENT OnMouseUp
IF QTextBtn.mode=1 OR QTextBtn.mode=2 THEN
IF QTextBtn.Down AND QTextBtn.mode=2 THEN
QTextBtn.font.COLOR=QTextBtn.UpColor
QTextBtn.Down=false
ELSE
QTextBtn.Down=true
END IF
ELSE
QTextBtn.font.COLOR=QTextBtn.UpColor
QTextBtn.Down=false
END IF
END EVENT
CONSTRUCTOR
Transparent=true
autosize=true
Down=false
mode=0
cursor=-21
UpColor=&h0
DownColor=&h0
END CONSTRUCTOR
END TYPE
|