You've already forked lazarus-ccr
* Use TControl.Font/Caption
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1442 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -113,8 +113,6 @@ type
|
|||||||
FEndColor: TColor;
|
FEndColor: TColor;
|
||||||
// FCenter: Boolean;
|
// FCenter: Boolean;
|
||||||
FNumberOfColors: TNumberOfColors;
|
FNumberOfColors: TNumberOfColors;
|
||||||
FFont : TFont;
|
|
||||||
FCaption : TCaption;
|
|
||||||
FTextTop : Integer;
|
FTextTop : Integer;
|
||||||
FTextLeft: Integer;
|
FTextLeft: Integer;
|
||||||
FSubCaption: TSubCaption;
|
FSubCaption: TSubCaption;
|
||||||
@ -129,14 +127,14 @@ type
|
|||||||
procedure SetEndColor(Value: TColor);
|
procedure SetEndColor(Value: TColor);
|
||||||
procedure SetFlatBorder(const Value: Boolean);
|
procedure SetFlatBorder(const Value: Boolean);
|
||||||
procedure SetNumberOfColors(Value: TNumberOfColors);
|
procedure SetNumberOfColors(Value: TNumberOfColors);
|
||||||
procedure SetFont(AFont: TFont);
|
|
||||||
procedure SetCaption(const Value: String);
|
|
||||||
procedure SetSubCaption(const Value: TSubCaption);
|
procedure SetSubCaption(const Value: TSubCaption);
|
||||||
procedure SetTextTop(Value: Integer);
|
procedure SetTextTop(Value: Integer);
|
||||||
procedure SetTextLeft(Value: Integer);
|
procedure SetTextLeft(Value: Integer);
|
||||||
{ Fill procedure }
|
{ Fill procedure }
|
||||||
procedure GradientFill;
|
procedure GradientFill;
|
||||||
protected
|
protected
|
||||||
|
procedure CMFontChanged(var Message: TLMessage); message CM_FONTCHANGED;
|
||||||
|
procedure CMTextChanged(var Message: TLMessage); message CM_TEXTCHANGED;
|
||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
procedure SetAlignment(Value: TAlignment);
|
procedure SetAlignment(Value: TAlignment);
|
||||||
procedure SetLayout(Value: TTextLayout);
|
procedure SetLayout(Value: TTextLayout);
|
||||||
@ -158,9 +156,6 @@ type
|
|||||||
{ Number of colors to use in the fill (1 - 256) - default is 255. If 1 }
|
{ Number of colors to use in the fill (1 - 256) - default is 255. If 1 }
|
||||||
{ then it uses the Begin Color. }
|
{ then it uses the Begin Color. }
|
||||||
property NumberOfColors: TNumberOfColors read FNumberOfColors write SetNumberOfColors default 255;
|
property NumberOfColors: TNumberOfColors read FNumberOfColors write SetNumberOfColors default 255;
|
||||||
{ Enable standard properties }
|
|
||||||
property Font: TFont read FFont write SetFont;
|
|
||||||
property Caption: String read FCaption write SetCaption;
|
|
||||||
property TextTop: Integer read FTextTop write SetTextTop default 0;
|
property TextTop: Integer read FTextTop write SetTextTop default 0;
|
||||||
property TextLeft: Integer read FTextLeft write SetTextLeft default 0;
|
property TextLeft: Integer read FTextLeft write SetTextLeft default 0;
|
||||||
property SubCaption: TSubCaption read FSubCaption write SetSubCaption;
|
property SubCaption: TSubCaption read FSubCaption write SetSubCaption;
|
||||||
@ -292,23 +287,14 @@ begin
|
|||||||
FBorderColor := clWhite;
|
FBorderColor := clWhite;
|
||||||
FDirection := fdLeftToRight;
|
FDirection := fdLeftToRight;
|
||||||
FNumberOfColors:= 255;
|
FNumberOfColors:= 255;
|
||||||
//FTextLeft:= 0;
|
//FTextLeft := 0;
|
||||||
//FTextTop:= 0;
|
//FTextTop := 0;
|
||||||
FFont := TFont.Create;
|
|
||||||
FFont.Style:= [fsbold];
|
|
||||||
FFont.OnChange := OnFontChanged;
|
|
||||||
|
|
||||||
FSubCaption := TSubCaption.Create(Self);
|
FSubCaption := TSubCaption.Create(Self);
|
||||||
//Caption := Name;
|
|
||||||
//FCaption := AOwner.Name;
|
|
||||||
//ShowMessage((AOwner as TComponent).);
|
|
||||||
//FCaption:= 'test';
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomNetGradient.Destroy;
|
destructor TCustomNetGradient.Destroy;
|
||||||
begin
|
begin
|
||||||
FSubCaption.Destroy;
|
FSubCaption.Destroy;
|
||||||
FFont.Destroy;
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -350,26 +336,6 @@ begin
|
|||||||
Changed;
|
Changed;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Set the Font
|
|
||||||
procedure TCustomNetGradient.SetFont(AFont: TFont);
|
|
||||||
begin
|
|
||||||
if AFont <> FFont then
|
|
||||||
begin
|
|
||||||
FFont.Assign(AFont);
|
|
||||||
Changed;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// Set the Caption on NG
|
|
||||||
procedure TCustomNetGradient.SetCaption(const Value: String);
|
|
||||||
begin
|
|
||||||
if Value <> FCaption then
|
|
||||||
begin
|
|
||||||
FCaption := Value;
|
|
||||||
Changed;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomNetGradient.SetSubCaption(const Value: TSubCaption);
|
procedure TCustomNetGradient.SetSubCaption(const Value: TSubCaption);
|
||||||
begin
|
begin
|
||||||
@ -544,7 +510,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Canvas.Font.Assign(FFont);
|
Canvas.Font.Assign(Font);
|
||||||
TS := Canvas.TextStyle;
|
TS := Canvas.TextStyle;
|
||||||
TS.Alignment := FAlignment;
|
TS.Alignment := FAlignment;
|
||||||
TS.Layout := FLayout;
|
TS.Layout := FLayout;
|
||||||
@ -598,6 +564,12 @@ begin
|
|||||||
{ Release the working bitmap resources }
|
{ Release the working bitmap resources }
|
||||||
WorkBmp.Free;
|
WorkBmp.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomNetGradient.CMFontChanged(var Message: TLMessage);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
Changed;
|
||||||
|
end;
|
||||||
|
|
||||||
{ Set the fill direction }
|
{ Set the fill direction }
|
||||||
procedure TCustomNetGradient.SetFillDirection(Value: TFillDirection);
|
procedure TCustomNetGradient.SetFillDirection(Value: TFillDirection);
|
||||||
@ -646,6 +618,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomNetGradient.CMTextChanged(var Message: TLMessage);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
Changed;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomNetGradient.WMEraseBkgnd(var Message: TLMEraseBkgnd);
|
procedure TCustomNetGradient.WMEraseBkgnd(var Message: TLMEraseBkgnd);
|
||||||
begin
|
begin
|
||||||
// Do nothing. Just to avoid flicker.
|
// Do nothing. Just to avoid flicker.
|
||||||
|
Reference in New Issue
Block a user