TYPE QCOLORBUTTON EXTENDS QPANEL
SndFreq AS INTEGER
SndDur AS SINGLE
CONSTRUCTOR
Height = 26
Width = 26
BevelInner = 2
COLOR = &HEEEEEE
Cursor = -21
END CONSTRUCTOR
EVENT OnMouseDown
QCOLORBUTTON.BorderStyle = 1
QCOLORBUTTON.CAPTION = " " + QCOLORBUTTON.CAPTION
IF QCOLORBUTTON.SndFreq = 0 AND QCOLORBUTTON.SndDur = 0 THEN
SOUND(5000,.5)
ELSE
SOUND(QCOLORBUTTON.SndFreq,QCOLORBUTTON.SndDur)
END IF
END EVENT
EVENT OnMouseUp
QCOLORBUTTON.BorderStyle = 0
QCOLORBUTTON.CAPTION = QCOLORBUTTON.CAPTION - " "
END EVENT
END TYPE
CREATE Form AS QFORM
Center
CREATE Fake AS QCOLORBUTTON
Left = 40
Top = 40
CAPTION = "A"
END CREATE
END CREATE
Form.SHOWMODAL
|