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
| procedure TW_Scores.ColorierTab(Control: TCustomTabControl;
TabIndex: Integer; const Rect: TRect; Active: Boolean);
{============================================================}
var iLong, ihaut, iLargeur, iHauteur: integer; AEcrire: string;
begin
with (control as TCustomTabControl) do
begin
case tabindex of
0 : Canvas.Brush.Color:=clBlack;
1..MaxColorsDef : Canvas.Brush.Color:=UserColors[TabIndex];
else Canvas.Brush.Color:=FixedColors[TabIndex];//clInfoBK;//window;
end;
Canvas.FillRect(Rect);
AEcrire:=(control as TTabControl).Tabs[TabIndex];
if tabIndex=0 then
begin
Canvas.Font.Color:=clWhite;
Canvas.TextOut(Rect.Left, Rect.Top , AEcrire);
end
else begin
iLong:=canvas.TextWidth(AEcrire);
iHaut:=canvas.Textheight(AEcrire);
iLargeur:=(control as TTabControl).TabWidth;
ihauteur:=(control as TTabControl).TabHeight;
Canvas.Font.Color:=clBlack;
Canvas.TextOut(Rect.Left+((iLargeur-ilong-2) div 2),
Rect.Top +((iHauteur-ihaut-0) div 2),
AEcrire );
end;
end;
end; |
Partager