TYPE QDiamondBxSm EXTENDS QCANVAS
CAPTION AS STRING
Checked AS INTEGER
HiLightColor AS INTEGER
SUB DrawComponent
IF QDiamondBxSm.Checked THEN
QDiamondBxSm.Line(QDiamondBxSm.Height/2,2,2,QDiamondBxSm.Height/2,0)
QDiamondBxSm.Line(2,QDiamondBxSm.Height/2,QDiamondBxSm.Height/2,QDiamondBxSm.Height-2,0)
QDiamondBxSm.Line(QDiamondBxSm.Height/2,2,QDiamondBxSm.Height-2,QDiamondBxSm.Height/2,0)
QDiamondBxSm.Line(QDiamondBxSm.Height-2,QDiamondBxSm.Height/2,QDiamondBxSm.Height/2,QDiamondBxSm.Height-2,0)
QDiamondBxSm.Paint(QDiamondBxSm.Height/2, QDiamondBxSm.Height/2, QDiamondBxSm.HiLightColor, 0)
QDiamondBxSm.Line(QDiamondBxSm.Height/2,2,QDiamondBxSm.Height-2,QDiamondBxSm.Height/2,hilightcolor)
QDiamondBxSm.Line(QDiamondBxSm.Height-2,QDiamondBxSm.Height/2,QDiamondBxSm.Height/2,QDiamondBxSm.Height-2,hilightcolor)
ELSE
QDiamondBxSm.Line(QDiamondBxSm.Height/2,2,2,QDiamondBxSm.Height/2,0)
QDiamondBxSm.Line(2,QDiamondBxSm.Height/2,QDiamondBxSm.Height/2,QDiamondBxSm.Height-2,0)
QDiamondBxSm.Line(QDiamondBxSm.Height/2,2,QDiamondBxSm.Height-2,QDiamondBxSm.Height/2,0)
QDiamondBxSm.Line(QDiamondBxSm.Height-2,QDiamondBxSm.Height/2,QDiamondBxSm.Height/2,QDiamondBxSm.Height-2,0)
QDiamondBxSm.Paint(QDiamondBxSm.Height/2, QDiamondBxSm.Height/2, &HBBBBBB, 0)
QDiamondBxSm.Line(QDiamondBxSm.Height/2,2,2,QDiamondBxSm.Height/2,&HFFFFFF)
QDiamondBxSm.Line(2,QDiamondBxSm.Height/2,QDiamondBxSm.Height/2,QDiamondBxSm.Height-2,&HFFFFFF)
END IF
QDiamondBxSm.TextOut(QDiamondBxSm.Height + 5, QDiamondBxSm.Height/2-QDiamondBxSm.Height/4, QDiamondBxSm.CAPTION, 0, -1)
END SUB
EVENT OnClick
IF QDiamondBxSm.Checked THEN
QDiamondBxSm.Checked = 0
ELSE
QDiamondBxSm.Checked = 1
END IF
QDiamondBxSm.DrawComponent
END EVENT
EVENT OnPaint
QDiamondBxSm.DrawComponent
END EVENT
CONSTRUCTOR
Height = 20
Width = 100
HiLightColor = &H00FF00
CAPTION = "Small Diamond"
Checked = 0
END CONSTRUCTOR
END TYPE
|
|