You've already forked lazarus-ccr
* Extract DB properties from TNetGradient and create TDBGradient
* Implement FlatBorder, BorderColor, BorderWidth git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1075 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -56,6 +56,8 @@ type
|
|||||||
|
|
||||||
TMargin = 0..MaxInt;
|
TMargin = 0..MaxInt;
|
||||||
|
|
||||||
|
TPointArray = array of TPoint;
|
||||||
|
|
||||||
TCustomNetGradient = class;
|
TCustomNetGradient = class;
|
||||||
|
|
||||||
TSubCaption = class(TPersistent)
|
TSubCaption = class(TPersistent)
|
||||||
@@ -92,6 +94,8 @@ type
|
|||||||
|
|
||||||
{ TNetGradient }
|
{ TNetGradient }
|
||||||
|
|
||||||
|
{ TCustomNetGradient }
|
||||||
|
|
||||||
TCustomNetGradient = class(TCustomControl)
|
TCustomNetGradient = class(TCustomControl)
|
||||||
private
|
private
|
||||||
//*** Enzo *** Bordi
|
//*** Enzo *** Bordi
|
||||||
@@ -100,13 +104,11 @@ type
|
|||||||
|
|
||||||
//*** Emzp *** Allineamento Caption
|
//*** Emzp *** Allineamento Caption
|
||||||
FAlignment : TAlignment;
|
FAlignment : TAlignment;
|
||||||
|
FBorderColor: TColor;
|
||||||
|
FFlatBorder: Boolean;
|
||||||
FLayout : TTextLayout;
|
FLayout : TTextLayout;
|
||||||
|
|
||||||
//*** Enzo *** Data Source - Field
|
|
||||||
FDataLink : TFieldDataLink;
|
|
||||||
|
|
||||||
//FMargin: TMargin;
|
//FMargin: TMargin;
|
||||||
|
|
||||||
{ Variables for properties }
|
{ Variables for properties }
|
||||||
FDirection: TFillDirection;
|
FDirection: TFillDirection;
|
||||||
FBeginColor: TColor;
|
FBeginColor: TColor;
|
||||||
@@ -117,16 +119,17 @@ type
|
|||||||
FCaption : TCaption;
|
FCaption : TCaption;
|
||||||
FTextTop : Integer;
|
FTextTop : Integer;
|
||||||
FTextLeft: Integer;
|
FTextLeft: Integer;
|
||||||
|
|
||||||
FSubCapField: Boolean;
|
|
||||||
FSubCaption: TSubCaption;
|
FSubCaption: TSubCaption;
|
||||||
FUpdateCount: Integer;
|
FUpdateCount: Integer;
|
||||||
procedure OnFontChanged(Sender: TObject);
|
procedure OnFontChanged(Sender: TObject);
|
||||||
procedure Changed;
|
procedure Changed;
|
||||||
|
function GetBorderPoints(const R: TRect): TPointArray;
|
||||||
|
procedure SetBorderColor(const Value: TColor);
|
||||||
{ Procedures for setting property values }
|
{ Procedures for setting property values }
|
||||||
procedure SetFillDirection(Value: TFillDirection);
|
procedure SetFillDirection(Value: TFillDirection);
|
||||||
procedure SetBeginColor(Value: TColor);
|
procedure SetBeginColor(Value: TColor);
|
||||||
procedure SetEndColor(Value: TColor);
|
procedure SetEndColor(Value: TColor);
|
||||||
|
procedure SetFlatBorder(const Value: Boolean);
|
||||||
procedure SetNumberOfColors(Value: TNumberOfColors);
|
procedure SetNumberOfColors(Value: TNumberOfColors);
|
||||||
procedure SetFont(AFont: TFont);
|
procedure SetFont(AFont: TFont);
|
||||||
procedure SetCaption(const Value: String);
|
procedure SetCaption(const Value: String);
|
||||||
@@ -134,42 +137,22 @@ type
|
|||||||
procedure SetTextLeft(Value: Integer);
|
procedure SetTextLeft(Value: Integer);
|
||||||
{ Fill procedure }
|
{ Fill procedure }
|
||||||
procedure GradientFill;
|
procedure GradientFill;
|
||||||
|
|
||||||
//*** Enzo *** Data Source
|
|
||||||
|
|
||||||
function GetSubCapField: Boolean;
|
|
||||||
Procedure SetSubCapField(Value:Boolean);
|
|
||||||
|
|
||||||
procedure SetDataField (const Value : String);
|
|
||||||
function GetDataField: String;
|
|
||||||
|
|
||||||
function GetDataSource: TDataSource;
|
|
||||||
procedure SetDataSource (Value: TDataSource);
|
|
||||||
|
|
||||||
function GetField: TField;
|
|
||||||
|
|
||||||
procedure DataChange(Sender: TObject);
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
|
|
||||||
procedure SetAlignment(Value: TAlignment);
|
procedure SetAlignment(Value: TAlignment);
|
||||||
procedure SetLayout(Value: TTextLayout); virtual;
|
procedure SetLayout(Value: TTextLayout); virtual;
|
||||||
|
|
||||||
procedure SetBevelInner(Value: TLabelBevel);
|
procedure SetBevelInner(Value: TLabelBevel);
|
||||||
procedure SetBevelOuter(Value: TLabelBevel);
|
procedure SetBevelOuter(Value: TLabelBevel);
|
||||||
|
|
||||||
// procedure DataChange(Sender:TObject);
|
|
||||||
property CaptionAlignment: TAlignment read FAlignment write SetAlignment;
|
property CaptionAlignment: TAlignment read FAlignment write SetAlignment;
|
||||||
property CaptionLayout: TTextLayout read FLayout write SetLayout default tlCenter;
|
property CaptionLayout: TTextLayout read FLayout write SetLayout default tlCenter;
|
||||||
|
|
||||||
property BevelInner: TLabelBevel read FBevelInner write SetBevelInner default bvNone;
|
property BevelInner: TLabelBevel read FBevelInner write SetBevelInner default bvNone;
|
||||||
property BevelOuter: TLabelBevel read FBevelOuter write SetBevelOuter default bvRaised;
|
property BevelOuter: TLabelBevel read FBevelOuter write SetBevelOuter default bvRaised;
|
||||||
|
|
||||||
{ Starting color of fill }
|
{ Starting color of fill }
|
||||||
property BeginColor: TColor read FBeginColor write SetBeginColor default clBlue;
|
property BeginColor: TColor read FBeginColor write SetBeginColor default clBlue;
|
||||||
|
property BorderColor: TColor read FBorderColor write SetBorderColor default clWhite;
|
||||||
{ Ending color of fill }
|
{ Ending color of fill }
|
||||||
property EndColor: TColor read FEndColor write SetEndColor default clBlack;
|
property EndColor: TColor read FEndColor write SetEndColor default clBlack;
|
||||||
|
property FlatBorder: Boolean read FFlatBorder write SetFlatBorder;
|
||||||
{ Direction of fill }
|
{ Direction of fill }
|
||||||
property FillDirection: TFillDirection read FDirection write SetFillDirection default fdLeftToRight;
|
property FillDirection: TFillDirection read FDirection write SetFillDirection default fdLeftToRight;
|
||||||
{ 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 }
|
||||||
@@ -177,15 +160,9 @@ type
|
|||||||
property NumberOfColors: TNumberOfColors read FNumberOfColors write SetNumberOfColors default 255;
|
property NumberOfColors: TNumberOfColors read FNumberOfColors write SetNumberOfColors default 255;
|
||||||
{ Enable standard properties }
|
{ Enable standard properties }
|
||||||
property Font: TFont read FFont write SetFont;
|
property Font: TFont read FFont write SetFont;
|
||||||
|
|
||||||
property Caption: String read FCaption write SetCaption;
|
property Caption: String read FCaption write SetCaption;
|
||||||
property TextTop: Integer read FTextTop write SetTextTop;
|
property TextTop: Integer read FTextTop write SetTextTop;
|
||||||
property TextLeft: Integer read FTextLeft write SetTextLeft;
|
property TextLeft: Integer read FTextLeft write SetTextLeft;
|
||||||
property SubCapField: Boolean read FSubCapField write SetSubCapField default false;
|
|
||||||
|
|
||||||
property DataField: String Read GetDataField write SetDataField;
|
|
||||||
property DataSource: TDataSource read GetDataSource write SetDataSource;
|
|
||||||
|
|
||||||
property SubCaption: TSubCaption read FSubCaption;
|
property SubCaption: TSubCaption read FSubCaption;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@@ -201,20 +178,75 @@ type
|
|||||||
property BevelInner;
|
property BevelInner;
|
||||||
property BevelOuter;
|
property BevelOuter;
|
||||||
property BeginColor;
|
property BeginColor;
|
||||||
|
property BorderColor;
|
||||||
property EndColor;
|
property EndColor;
|
||||||
|
property FlatBorder;
|
||||||
property FillDirection;
|
property FillDirection;
|
||||||
property NumberOfColors;
|
property NumberOfColors;
|
||||||
property Font;
|
property Font;
|
||||||
property Caption;
|
property Caption;
|
||||||
property TextTop;
|
property TextTop;
|
||||||
property TextLeft;
|
property TextLeft;
|
||||||
property SubCapField;
|
|
||||||
property DataField;
|
|
||||||
property DataSource;
|
|
||||||
property SubCaption;
|
property SubCaption;
|
||||||
//default properties
|
//default properties
|
||||||
property Align;
|
property Align;
|
||||||
property BorderSpacing;
|
property BorderSpacing;
|
||||||
|
property BorderWidth;
|
||||||
|
property DragCursor;
|
||||||
|
property DragMode;
|
||||||
|
property Enabled;
|
||||||
|
property ParentShowHint;
|
||||||
|
property PopupMenu;
|
||||||
|
property ShowHint;
|
||||||
|
property Visible;
|
||||||
|
property OnClick;
|
||||||
|
property OnDblClick;
|
||||||
|
property OnDragDrop;
|
||||||
|
property OnDragOver;
|
||||||
|
property OnEndDrag;
|
||||||
|
property OnMouseDown;
|
||||||
|
property OnMouseMove;
|
||||||
|
property OnMouseUp;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TDBNetGradient }
|
||||||
|
|
||||||
|
TDBNetGradient = class (TCustomNetGradient)
|
||||||
|
private
|
||||||
|
FDataLink : TFieldDataLink;
|
||||||
|
FSubCapField: Boolean;
|
||||||
|
procedure DataChange(Sender: TObject);
|
||||||
|
function GetDataField: String;
|
||||||
|
function GetDataSource: TDataSource;
|
||||||
|
procedure SetDataField(const Value: String);
|
||||||
|
procedure SetDataSource(Value: TDataSource);
|
||||||
|
public
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
destructor Destroy; override;
|
||||||
|
published
|
||||||
|
property DataField: String read GetDataField write SetDataField;
|
||||||
|
property DataSource: TDataSource read GetDataSource write SetDataSource;
|
||||||
|
property SubCapField: Boolean read FSubCapField write FSubCapField default false;
|
||||||
|
|
||||||
|
property CaptionAlignment;
|
||||||
|
property CaptionLayout;
|
||||||
|
property BevelInner;
|
||||||
|
property BevelOuter;
|
||||||
|
property BeginColor;
|
||||||
|
property BorderColor;
|
||||||
|
property EndColor;
|
||||||
|
property FlatBorder;
|
||||||
|
property FillDirection;
|
||||||
|
property NumberOfColors;
|
||||||
|
property Font;
|
||||||
|
property Caption;
|
||||||
|
property TextTop;
|
||||||
|
property TextLeft;
|
||||||
|
property SubCaption;
|
||||||
|
//default properties
|
||||||
|
property Align;
|
||||||
|
property BorderSpacing;
|
||||||
|
property BorderWidth;
|
||||||
property DragCursor;
|
property DragCursor;
|
||||||
property DragMode;
|
property DragMode;
|
||||||
property Enabled;
|
property Enabled;
|
||||||
@@ -250,6 +282,7 @@ begin
|
|||||||
Width := 400;
|
Width := 400;
|
||||||
FBeginColor := clSilver;
|
FBeginColor := clSilver;
|
||||||
FEndColor := $00A56D39;
|
FEndColor := $00A56D39;
|
||||||
|
FBorderColor := clWhite;
|
||||||
FDirection := fdLeftToRight;
|
FDirection := fdLeftToRight;
|
||||||
FNumberOfColors:= 255;
|
FNumberOfColors:= 255;
|
||||||
//FTextLeft:= 0;
|
//FTextLeft:= 0;
|
||||||
@@ -263,23 +296,12 @@ begin
|
|||||||
//FCaption := AOwner.Name;
|
//FCaption := AOwner.Name;
|
||||||
//ShowMessage((AOwner as TComponent).);
|
//ShowMessage((AOwner as TComponent).);
|
||||||
//FCaption:= 'test';
|
//FCaption:= 'test';
|
||||||
|
|
||||||
//*** Enzo ***
|
|
||||||
FDataLink := TFieldDataLink.Create;
|
|
||||||
FDataLink.Control := Self;
|
|
||||||
FDataLink.OnDataChange := DataChange;
|
|
||||||
(*
|
|
||||||
FDataLink.OnUpdateData := @UpdateData;
|
|
||||||
FDataLink.OnActiveChange := @ActiveChange;
|
|
||||||
FDataLink.OnLayoutChange := @LayoutChange;
|
|
||||||
*)
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomNetGradient.Destroy;
|
destructor TCustomNetGradient.Destroy;
|
||||||
begin
|
begin
|
||||||
FSubCaption.Destroy;
|
FSubCaption.Destroy;
|
||||||
FFont.Destroy;
|
FFont.Destroy;
|
||||||
FDataLink.Destroy;
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -303,6 +325,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomNetGradient.SetFlatBorder(const Value: Boolean);
|
||||||
|
begin
|
||||||
|
if FFlatBorder <> Value then
|
||||||
|
begin
|
||||||
|
FFlatBorder := Value;
|
||||||
|
Changed;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ Set the number of colors to be used in the fill }
|
{ Set the number of colors to be used in the fill }
|
||||||
procedure TCustomNetGradient.SetNumberOfColors(Value: TNumberOfColors);
|
procedure TCustomNetGradient.SetNumberOfColors(Value: TNumberOfColors);
|
||||||
begin
|
begin
|
||||||
@@ -503,13 +534,24 @@ begin
|
|||||||
Canvas.Draw(0, 0, WorkBmp);
|
Canvas.Draw(0, 0, WorkBmp);
|
||||||
|
|
||||||
// <TextOut>
|
// <TextOut>
|
||||||
Canvas.Brush.Style:= bsClear;
|
//Canvas.Brush.Style:= bsClear;
|
||||||
Canvas.Font.Assign(FFont);
|
Canvas.Font.Assign(FFont);
|
||||||
|
|
||||||
//Canvas.Textout(FTextLeft, FTextTop, FCaption); *** Enzo *** Implemetation
|
//Canvas.Textout(FTextLeft, FTextTop, FCaption); *** Enzo *** Implemetation
|
||||||
|
if FFlatBorder then
|
||||||
Canvas.Frame3D(Rp, 1,FBevelOuter);
|
begin
|
||||||
Canvas.Frame3d(rp, 1, FBevelInner);
|
Canvas.Pen.Width := BorderWidth;
|
||||||
|
Canvas.Pen.EndCap := pecSquare;
|
||||||
|
Canvas.Pen.Color := FBorderColor;
|
||||||
|
//see if there's a better way of drawing a rectangle since
|
||||||
|
// in BorderWidth >= 3 glitches occurs
|
||||||
|
Canvas.Polyline(GetBorderPoints(rp));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Canvas.Frame3D(rp, 1, FBevelOuter);
|
||||||
|
Canvas.Frame3D(rp, 1, FBevelInner);
|
||||||
|
end;
|
||||||
|
|
||||||
if Caption <> '' then begin
|
if Caption <> '' then begin
|
||||||
Font.Assign(Self.Font);
|
Font.Assign(Self.Font);
|
||||||
@@ -650,74 +692,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//*** Enzo ***
|
|
||||||
|
|
||||||
function TCustomNetGradient.GetSubCapField: Boolean;
|
|
||||||
begin
|
|
||||||
Result := FSubCapField;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomNetGradient.SetSubCapField(Value: Boolean);
|
|
||||||
begin
|
|
||||||
FSubCapField := Value;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TCustomNetGradient.GetDataField: STring;
|
|
||||||
begin
|
|
||||||
Result := FDataLink.FieldName;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomNetGradient.SetDataField (const Value: string);
|
|
||||||
begin
|
|
||||||
FDataLink.FieldName := Value;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TCustomNetGradient.GetDataSource: TDataSource;
|
|
||||||
begin
|
|
||||||
Result := FDataLink.DataSource;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomNetGradient.SetDataSource (Value: TDataSource);
|
|
||||||
|
|
||||||
procedure ChangeDataSource(AControl: TControl; Link: TDataLink;
|
|
||||||
NewDataSource: TDataSource);
|
|
||||||
begin
|
|
||||||
if Link.DataSource=NewDataSource then exit;
|
|
||||||
if Link.DataSource<>nil then
|
|
||||||
Link.DataSource.RemoveFreeNotification(AControl);
|
|
||||||
Link.DataSource:=NewDataSource;
|
|
||||||
if Link.DataSource<>nil then
|
|
||||||
Link.DataSource.FreeNotification(AControl);
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
|
||||||
//* enzo
|
|
||||||
//FDataLink.DataSource := Value;
|
|
||||||
ChangeDataSource(Self, FDataLink, Value);
|
|
||||||
// useless e
|
|
||||||
{if Value <> nil then
|
|
||||||
Value.FreeNotification (Value);}
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TCustomNetGradient.GetField: TField;
|
|
||||||
begin
|
|
||||||
Result := FDataLink.Field;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// data link event handler
|
|
||||||
procedure TCustomNetGradient.DataChange (Sender: TObject);
|
|
||||||
begin
|
|
||||||
if FDataLink.DataSet.Active = true then begin
|
|
||||||
//enzo
|
|
||||||
if FSubCapField = False Then begin
|
|
||||||
Caption := FDataLink.Field.AsString;
|
|
||||||
end else begin
|
|
||||||
fSubCaption.SetCaption( FDataLink.Field.DisplayText);
|
|
||||||
//fSubCaption.SetCaption( FDataLink.Field.AsString);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomNetGradient.OnFontChanged(Sender: TObject);
|
procedure TCustomNetGradient.OnFontChanged(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Changed;
|
Changed;
|
||||||
@@ -736,6 +710,38 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomNetGradient.GetBorderPoints(const R: TRect): TPointArray;
|
||||||
|
var
|
||||||
|
Offset, Fix: Integer;
|
||||||
|
begin
|
||||||
|
Offset := BorderWidth div 2;
|
||||||
|
Fix := BorderWidth mod 2;
|
||||||
|
SetLength(Result, 5);
|
||||||
|
Result[0].x := R.Left + BorderWidth - Offset - Fix;
|
||||||
|
Result[0].y := R.Top + BorderWidth - Offset - Fix;
|
||||||
|
|
||||||
|
Result[1].x := R.Right - BorderWidth + Offset;
|
||||||
|
Result[1].y := R.Top + BorderWidth - Offset - Fix;
|
||||||
|
|
||||||
|
Result[2].x := R.Right - BorderWidth + Offset;
|
||||||
|
Result[2].y := R.Bottom - BorderWidth + Offset;
|
||||||
|
|
||||||
|
Result[3].x := R.Left + BorderWidth - Offset - Fix;
|
||||||
|
Result[3].y := R.Bottom - BorderWidth + Offset;
|
||||||
|
|
||||||
|
Result[4].x := R.Left + BorderWidth - Offset - Fix;
|
||||||
|
Result[4].y := R.Top + BorderWidth - Offset - Fix;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomNetGradient.SetBorderColor(const Value: TColor);
|
||||||
|
begin
|
||||||
|
if FBorderColor <> Value then
|
||||||
|
begin
|
||||||
|
FBorderColor := Value;
|
||||||
|
Changed;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomNetGradient.EndUpdate;
|
procedure TCustomNetGradient.EndUpdate;
|
||||||
begin
|
begin
|
||||||
if FUpdateCount > 0 then
|
if FUpdateCount > 0 then
|
||||||
@@ -810,4 +816,77 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDBNetGradient.DataChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FDataLink.DataSet.Active then
|
||||||
|
begin
|
||||||
|
if not FSubCapField then
|
||||||
|
begin
|
||||||
|
Caption := FDataLink.Field.DisplayText;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
fSubCaption.SetCaption( FDataLink.Field.DisplayText);
|
||||||
|
//fSubCaption.SetCaption( FDataLink.Field.AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDBNetGradient.GetDataField: String;
|
||||||
|
begin
|
||||||
|
Result := FDataLink.FieldName;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDBNetGradient.SetDataField (const Value: string);
|
||||||
|
begin
|
||||||
|
FDataLink.FieldName := Value;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDBNetGradient.GetDataSource: TDataSource;
|
||||||
|
begin
|
||||||
|
Result := FDataLink.DataSource;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDBNetGradient.SetDataSource (Value: TDataSource);
|
||||||
|
|
||||||
|
procedure ChangeDataSource(AControl: TControl; Link: TDataLink;
|
||||||
|
NewDataSource: TDataSource);
|
||||||
|
begin
|
||||||
|
if Link.DataSource=NewDataSource then exit;
|
||||||
|
if Link.DataSource<>nil then
|
||||||
|
Link.DataSource.RemoveFreeNotification(AControl);
|
||||||
|
Link.DataSource:=NewDataSource;
|
||||||
|
if Link.DataSource<>nil then
|
||||||
|
Link.DataSource.FreeNotification(AControl);
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
//* enzo
|
||||||
|
//FDataLink.DataSource := Value;
|
||||||
|
ChangeDataSource(Self, FDataLink, Value);
|
||||||
|
// useless e
|
||||||
|
{if Value <> nil then
|
||||||
|
Value.FreeNotification (Value);}
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TDBNetGradient.Create(AOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited Create(AOwner);
|
||||||
|
//*** Enzo ***
|
||||||
|
FDataLink := TFieldDataLink.Create;
|
||||||
|
FDataLink.Control := Self;
|
||||||
|
FDataLink.OnDataChange := DataChange;
|
||||||
|
(*
|
||||||
|
FDataLink.OnUpdateData := @UpdateData;
|
||||||
|
FDataLink.OnActiveChange := @ActiveChange;
|
||||||
|
FDataLink.OnLayoutChange := @LayoutChange;
|
||||||
|
*)
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TDBNetGradient.Destroy;
|
||||||
|
begin
|
||||||
|
FDataLink.Destroy;
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Reference in New Issue
Block a user