- unit DoubleSpeed; // Composant créé par Guy ® 2007 - paounet@free.fr
- interface
- uses SysUtils,Classes,Controls,Buttons,Graphics,ExtCtrls;
- type
- TCaption=String; // Propriété Caption2 rajoutée au Composant
- TAbout=String; // Propriété About rajoutée au composant
- THint=String; // Propriété Hint2 rajoutée au composant
- TDoubleSpeed = class(TSpeedButton)
- private { Déclarations privées }
- FCaption:TCaption;FAbout:TAbout;FHint:THint; // Variables utilisées
- //Surcharge de la méthode OnClick du composant DoubleSpeed
- protected { Déclarations protégées }
- public { Déclarations publiques }
- Constructor Create (Aowner:Tcomponent);Override;
- Destructor Destroy;override;
- published { Déclarations publiées }
- // Propriété ABout rajoutée en lecture seule
- Property Hint;
- Property Tag;
- Property Font;
- Property About:TAbout read FAbout;
- Property Caption2:TCaption read FCaption write FCaption;
- Property Hint2:THint read FHint write FHint;
- Procedure Click;override; //Surchage du OnClick
- end;
- procedure Register;
- implementation
- // Création Composant TDoubleSpeed
- constructor TDoubleSpeed.Create(Aowner:TComponent);
- begin
- inherited Create(Aowner);FAbout:='@ Guy Bidi 2007';
- AllowAllUp:=True;GroupIndex:=4;ShowHint:=True;
- end;
- Procedure TDoubleSpeed.Click; // Surchage du OnClick de DoubleSpeed
- Var T1,T2:String;
- Begin
- Tag:=Not(Tag); // Changement du Tag(0,-1) au Click du composant
- T1:=Caption;Caption:=Caption2;Caption2:=T1;
- T2:=Hint;Hint:=Hint2;Hint2:=T2;
- If Assigned(OnClick) then OnClick(Self); //Réactive le Click Normal
- End;
- destructor TDoubleSpeed.Destroy; // Destruction du Composant
- begin
- inherited Destroy;
- end;
- procedure Register; // Enregistrement du composant dans la Palette Guy
- begin
- RegisterComponents('Guy',[TDoubleSpeed]);
- end;
- end.
unit DoubleSpeed; // Composant créé par Guy ® 2007 - paounet@free.fr
interface
uses SysUtils,Classes,Controls,Buttons,Graphics,ExtCtrls;
type
TCaption=String; // Propriété Caption2 rajoutée au Composant
TAbout=String; // Propriété About rajoutée au composant
THint=String; // Propriété Hint2 rajoutée au composant
TDoubleSpeed = class(TSpeedButton)
private { Déclarations privées }
FCaption:TCaption;FAbout:TAbout;FHint:THint; // Variables utilisées
//Surcharge de la méthode OnClick du composant DoubleSpeed
protected { Déclarations protégées }
public { Déclarations publiques }
Constructor Create (Aowner:Tcomponent);Override;
Destructor Destroy;override;
published { Déclarations publiées }
// Propriété ABout rajoutée en lecture seule
Property Hint;
Property Tag;
Property Font;
Property About:TAbout read FAbout;
Property Caption2:TCaption read FCaption write FCaption;
Property Hint2:THint read FHint write FHint;
Procedure Click;override; //Surchage du OnClick
end;
procedure Register;
implementation
// Création Composant TDoubleSpeed
constructor TDoubleSpeed.Create(Aowner:TComponent);
begin
inherited Create(Aowner);FAbout:='@ Guy Bidi 2007';
AllowAllUp:=True;GroupIndex:=4;ShowHint:=True;
end;
Procedure TDoubleSpeed.Click; // Surchage du OnClick de DoubleSpeed
Var T1,T2:String;
Begin
Tag:=Not(Tag); // Changement du Tag(0,-1) au Click du composant
T1:=Caption;Caption:=Caption2;Caption2:=T1;
T2:=Hint;Hint:=Hint2;Hint2:=T2;
If Assigned(OnClick) then OnClick(Self); //Réactive le Click Normal
End;
destructor TDoubleSpeed.Destroy; // Destruction du Composant
begin
inherited Destroy;
end;
procedure Register; // Enregistrement du composant dans la Palette Guy
begin
RegisterComponents('Guy',[TDoubleSpeed]);
end;
end.