je pense que je vien de trouvé une solution pour le survole du curseur.
voila comment, j'ai modifié ça:
et j'ai ajouté ça
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 procedure PlayButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if PlayButtonLabel[TLabel(Sender).Tag].Enabled then PlayButtonImage[TLabel(Sender).Tag].Left:=-64 end; procedure PlayButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin PlayButtonImage[TLabel(Sender).Tag].Left:=-32 end; procedure PlayButtonLabelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if PlayButtonImage[TLabel(Sender).Tag].Left <> -96 then PlayButtonImage[TLabel(Sender).Tag].Left := -256 PlayButtonImage[TLabel(Sender).Tag].Left := 0 end;
et ça aussi
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin PlayButtonImage[TLabel(Sender).Tag].Left := -32 end;
la le bouton play se change dans les 3 cas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107 begin MouseLabel := TLabel.Create(WizardForm) MouseLabel.Width := WizardForm.Width MouseLabel.Height := WizardForm.Height MouseLabel.Autosize := False MouseLabel.Transparent := True MouseLabel.OnMouseMove := @MouseMove MouseLabel.Parent := WizardForm PlayPanel:=TPanel.Create(WizardForm) PlayPanel.Left:=10 PlayPanel.Top:=WizardForm.ClientHeight - 38 PlayPanel.Width:=ScaleY(31) PlayPanel.Height:=ScaleX(33) PlayPanel.Parent:=WizardForm PlayButtonPanel[APlayButtonIndex]:=PlayPanel PlayImage:=TBitmapImage.Create(WizardForm) PlayImage.Width:=96 PlayImage.Height:=33 PlayImage.Enabled:=False PlayImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\_MusicPlayButton.bmp')) PlayImage.Parent:=PlayPanel PlayImage.ReplaceColor:=$E2E2E2 PlayImage.ReplaceWithColor:=clBtnFace PlayButtonImage[APlayButtonIndex]:=PlayImage with TLabel.Create(WizardForm) do begin Tag:=APlayButtonIndex Parent:=PlayPanel Width:=PlayPanel.Width Height:=PlayPanel.Height Transparent:=True Cursor := crHand OnClick:=@PlayButtonOnClick OnDblClick:=@PlayButtonOnClick OnMouseDown:=@PlayButtonLabelMouseDown OnMouseUp:=@PlayButtonLabelMouseUp OnMouseMove := @PlayButtonLabelMouseMove end PlayLabl:=TLabel.Create(WizardForm) PlayLabl.Left:=23 PlayLabl.Top:=5 PlayLabl.Autosize:=True PlayLabl.Alignment:=taCenter PlayLabl.Transparent:=True PlayLabl.Font.Color:=clWhite PlayLabl.Parent:=PlayPanel PlayLabl.OnClick:=@PlayButtonOnClick PlayLabl.Hint := 'Play Music' PlayLabl.ShowHint := True PlayLabl.OnDblClick:=@PlayButtonOnClick PlayLabl.OnMouseDown:=@PlayButtonLabelMouseDown PlayLabl.OnMouseUp:=@PlayButtonLabelMouseUp PlayButtonLabel[APlayButtonIndex]:=PlayLabl end Begin StopPanel:=TPanel.Create(WizardForm) StopPanel.Left:=43 StopPanel.Top:=WizardForm.ClientHeight - 38 StopPanel.Width:=ScaleY(31) StopPanel.Height:=ScaleX(33) StopPanel.Parent:=WizardForm StopButtonPanel[AStopButtonIndex]:=StopPanel StopImage:=TBitmapImage.Create(WizardForm) StopImage.Width:=96 StopImage.Height:=33 StopImage.Enabled:=False StopImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\_MusicStopButton.bmp')) StopImage.Parent:=StopPanel StopImage.ReplaceColor:=$E2E2E2 StopImage.ReplaceWithColor:=clBtnFace StopButtonImage[AStopButtonIndex]:=StopImage with TLabel.Create(WizardForm) do begin Tag:=AStopButtonIndex Parent:=StopPanel Width:=StopPanel.Width Height:=StopPanel.Height Transparent:=True Cursor := crHand OnClick:=@StopButtonOnClick OnDblClick:=@StopButtonOnClick OnMouseDown:=@StopButtonLabelMouseDown OnMouseUp:=@StopButtonLabelMouseUp end StopLabl:=TLabel.Create(WizardForm) StopLabl.Left:=23 StopLabl.Top:=5 StopLabl.Autosize:=True StopLabl.Alignment:=taCenter StopLabl.Transparent:=True StopLabl.Hint := 'Stop Music' StopLabl.ShowHint := True StopLabl.Font.Color:=clWhite StopLabl.Parent:=StopPanel StopLabl.OnClick:=@StopButtonOnClick StopLabl.OnDblClick:=@StopButtonOnClick StopLabl.OnMouseDown:=@StopButtonLabelMouseDown StopLabl.OnMouseUp:=@StopButtonLabelMouseUp StopButtonLabel[AStopButtonIndex]:=StopLabl end
Waw
je vais dormir 24h (trés fatigué) aprés je vais reprendre pour réglé le 3ème problème
du bouton Play/Pause
Partager