$RESOURCE btn_BMP AS "Boutons.bmp"
$RESOURCE btn_BMP1 AS "Boutons_Plat.bmp"
DIM ico_BMP AS QBITMAP
WITH ico_BMP
.Width = 18
.Height = 18
.Circle (1,1,17,17, -1, &HFFAADD)
.Line(6,4,6,7,0)
.Line(7,4,7,7,0)
.Line(10,4,10,7,0)
.Line(11,4,11,7,0)
.Line(5,10,5,10,0)
.Line(12,10,12,10,0)
.Line(4,9,4,9,0)
.Line(13,9,13,9,0)
.Line(6,11,11,11,0)
END WITH
$INCLUDE "QTButton87.inc"
DECLARE SUB Boutons_Click(Sender AS QTButton)
DECLARE SUB Boutons_MouseMove(X AS INTEGER, Y AS INTEGER, Shift AS INTEGER, Sender AS QBUTTON)
DECLARE SUB QBouton_MouseMove(X AS INTEGER, Y AS INTEGER, Shift AS INTEGER, Sender AS QBUTTON)
DECLARE SUB QBouton_MouseUp(btn AS INTEGER, X AS INTEGER, Y AS INTEGER, Shift AS INTEGER, Sender AS QBUTTON)
DECLARE SUB Enjolivure_Click(Sender AS QTButton)
CREATE Form AS QFORM
CAPTION = "Examples de QTButton Examples"
ClientWidth = 329
ClientHeight = 260
Center
CREATE TButton AS QTButton
Left = 8
Top = 8
NumBMPs =4
CAPTION = "Sélectionné"
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton2 AS QTButton
Left = 8
Top = 38
CAPTION = "Normal"
NumBMPs =4
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton3 AS QTButton
Enabled = 0
Left = 8
Top = 68
NumBMPs =4
CAPTION = "Désactivé"
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton4 AS QTButton
Default = 1
Left = 8
Top = 98
CAPTION = "Défaut"
NumBMPs =4
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton5 AS QTButton
Default = 1
Left = 8
Top = 128
CAPTION = "&Sous-ligné"
NumBMPs =4
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
Hint = "Appuyez simultanément ALT+S pour voir ce qui arrivera"
ShowHint = 1
END CREATE
CREATE TButton6 AS QTButton
Left = 98
Top = 8
Height = 60
NumBMPs =4
CAPTION = "Multi-Lignes" +CHR$(10) +"Retaillé" +CHR$(10) +"Multi-Lines"
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
Hint = "Pour créer un effet multi-lignes ajoutez chr$(10) " +CHR$(10) +_
"entre les mots où vous voulez créer l'effet."
ShowHint = 1
END CREATE
CREATE TButton7 AS QTButton
Left = 98
Top = 98
Height = 20
Width = 20
CAPTION = "..."
NumBMPs =4
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton8 AS QTButton
Left = 128
Top = 98
Height = 20
Width = 20
NumBMPs =4
Hint = "Vide"
ShowHint = 1
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton9 AS QTButton
BMP = ico_BMP.BMP
Spacing = 1
Left = 158
Top = 98
Height = 20
Width = 20
NumBMPs =4
Hint = "Avec uniquement une image"
ShowHint = 1
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton10 AS QTButton
kind = 2
Left = 188
Top = 8
NumBMPs =4
CAPTION = "Fermer"
Hint = "Un QTButton avec Kind = 1"
ShowHint = 1
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton11 AS QBUTTON
kind = 2
Left = 188
Top = 38
CAPTION = "Fermer"
Hint = "Un bouton classic avec Kind = 1"
ShowHint = 1
OnMouseMove = QBouton_MouseMove
OnMouseUp = QBouton_MouseUp
OnClick = Boutons_Click
END CREATE
CREATE TButton12 AS QBUTTON
Left = 188
Top = 68
CAPTION = "&Classique"
Hint = "Un bouton classic"
ShowHint = 1
OnMouseMove = QBouton_MouseMove
OnMouseUp = QBouton_MouseUp
OnClick = Boutons_Click
END CREATE
CREATE TButton13 AS QTButton
Left = 188
Top = 98
BMP = ico_BMP.BMP
NumBMPs = 4
CAPTION = "Bitmap"
Hint = "Un bouton avec une image"
ShowHint = 1
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton14 AS QTButton
Layout = 2
Left = 188
Top = 128
BMP = ico_BMP.BMP
Height = 40
Spacing = 3
NumBMPs = 4
CAPTION = "Au dessus"
Hint = "Un bouton avec une image placée au dessus du texte"
ShowHint = 1
OnClick = Boutons_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton15 AS QTButton
Layout = 2
Left = 302
Top = 8
Height = 20
Width = 20
Spacing = 3
NumBMPs = 4
Font.Bold = 1
CAPTION = ">"
Hint = "Alterner l'enjolivure"
ShowHint = 1
OnClick = Enjolivure_Click
OnMouseMove = Boutons_MouseMove
END CREATE
CREATE TButton16 AS QTButton
Left = 288
Top = 48
Width = 23
Height = 22
NumBMPs = 4
GroupIndex = 1
END CREATE
CREATE TButton17 AS QTButton
Left = 288
Top = 72
Width = 23
Height = 22
NumBMPs = 4
GroupIndex = 1
END CREATE
CREATE TButton18 AS QTButton
Left = 288
Top = 96
Width = 23
Height = 22
NumBMPs = 4
GroupIndex = 1
END CREATE
CREATE TButton19 AS QTButton
Left = 288
Top = 128
Width = 23
Height = 22
NumBMPs = 4
GroupIndex = 2
END CREATE
CREATE TButton20 AS QTButton
Left = 288
Top = 152
Width = 23
Height = 22
NumBMPs = 4
GroupIndex = 2
END CREATE
CREATE Image AS QIMAGE
AutoSize = 1
Top = 128
Left = 98
BMP = QTBtnBMP.BMP
END CREATE
CREATE Label1 AS QLABEL
Top = 158
Left = 8
CAPTION = "Image du bouton / Button bitmap :"
END CREATE
CREATE Image1 AS QIMAGE
AutoSize = 1
Top = 174
Left = 8
BMP = QTBtnBMP.BMP
END CREATE
END CREATE
SUB Boutons_Click
SHOWMESSAGE "Vous avez cliqué sur le bouton : " +sender.CAPTION +CHR$(10)+_
"You've clicked on button : " +sender.CAPTION
Image1.BMP = Sender.BMP
END SUB
SUB Boutons_MouseMove
SELECT CASE Sender.Handle
CASE TButton.Handle: TButton.InheritOnMouseMove(x,y,shift)
CASE TButton2.Handle: TButton2.InheritOnMouseMove(x,y,shift)
CASE TButton3.Handle: TButton3.InheritOnMouseMove(x,y,shift)
CASE TButton4.Handle: TButton4.InheritOnMouseMove(x,y,shift)
CASE TButton5.Handle: TButton5.InheritOnMouseMove(x,y,shift)
CASE TButton6.Handle: TButton6.InheritOnMouseMove(x,y,shift)
CASE TButton7.Handle: TButton7.InheritOnMouseMove(x,y,shift)
CASE TButton8.Handle: TButton8.InheritOnMouseMove(x,y,shift)
CASE TButton9.Handle: TButton9.InheritOnMouseMove(x,y,shift)
CASE TButton10.Handle: TButton10.InheritOnMouseMove(x,y,shift)
CASE TButton13.Handle: TButton13.InheritOnMouseMove(x,y,shift)
CASE TButton14.Handle: TButton14.InheritOnMouseMove(x,y,shift)
CASE TButton15.Handle: TButton15.InheritOnMouseMove(x,y,shift)
END SELECT
Image1.BMP = Sender.BMP
END SUB
SUB QBouton_MouseMove
IF (X < 0) OR (Y < 0) OR (X > sender.Width) _
OR (Y > Sender.Height) THEN
ReleaseCapture_QTBtn
Sender.Font.Bold = 0
Sender.Font.COLOR = -2147483630
ELSEIF GetCapture_QTBtn() <> Sender.Handle THEN
SetCapture_QTBtn Sender.Handle
Sender.Font.Bold = 1
Sender.Font.COLOR = -2147483635
Image1.BMP = Sender.BMP
END IF
END SUB
SUB QBouton_MouseUp
ReleaseCapture_QTBtn
Sender.Font.Bold = 0
Sender.Font.COLOR = -2147483630
END SUB
SUB Enjolivure_Click(Sender AS QTButton)
STATIC curSkin AS INTEGER
IF curSkin < 1 THEN
QTBtnBMP.BMPHandle = btn_BMP1
curSkin = 1
ELSE
QTBtnBMP.BMPHandle = btn_BMP
curSkin = 0
END IF
TButton.ReDraw
TButton2.ReDraw
TButton3.ReDraw
TButton4.ReDraw
TButton5.ReDraw
TButton6.ReDraw
TButton7.ReDraw
TButton8.ReDraw
TButton9.ReDraw
TButton10.ReDraw
TButton13.ReDraw
TButton14.ReDraw
TButton15.ReDraw
END SUB
Form.SHOWMODAL
|
|