2020-04-09 11:06:15 +00:00
|
|
|
{
|
|
|
|
License: modified LGPL with linking exception (like RTL, FCL and LCL)
|
|
|
|
|
|
|
|
See the file COPYING.modifiedLGPL.txt, included in the Lazarus distribution,
|
|
|
|
for details about the license.
|
|
|
|
|
|
|
|
See also: https://wiki.lazarus.freepascal.org/FPC_modified_LGPL
|
|
|
|
}
|
|
|
|
|
2018-06-26 13:05:22 +00:00
|
|
|
unit mvExtraData;
|
2018-04-16 13:59:19 +00:00
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
2019-05-16 21:37:34 +00:00
|
|
|
Classes, SysUtils, Graphics;
|
2018-04-16 13:59:19 +00:00
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TDrawingExtraData }
|
|
|
|
|
|
|
|
TDrawingExtraData = class
|
|
|
|
private
|
|
|
|
FColor: TColor;
|
|
|
|
FId: integer;
|
|
|
|
procedure SetColor(AValue: TColor);
|
|
|
|
public
|
2019-05-16 21:37:34 +00:00
|
|
|
constructor Create(aId: integer); virtual;
|
2019-01-27 18:44:08 +00:00
|
|
|
property Color: TColor read FColor write SetColor;
|
|
|
|
property Id: integer read FId;
|
2019-05-16 21:37:34 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
TTrackExtraData = class(TDrawingExtraData)
|
|
|
|
private
|
|
|
|
FWidth: Double;
|
|
|
|
procedure SetWidth(AValue: Double);
|
|
|
|
public
|
|
|
|
property Width: Double read FWidth write SetWidth; // Line width in mm
|
|
|
|
end;
|
2018-04-16 13:59:19 +00:00
|
|
|
|
2019-01-27 18:44:08 +00:00
|
|
|
|
2018-04-16 13:59:19 +00:00
|
|
|
implementation
|
|
|
|
|
|
|
|
{ TDrawingExtraData }
|
|
|
|
|
2019-05-16 21:37:34 +00:00
|
|
|
constructor TDrawingExtraData.Create(aId: integer);
|
|
|
|
begin
|
|
|
|
FId := aId;
|
|
|
|
FColor := clRed;
|
|
|
|
end;
|
|
|
|
|
2018-04-16 13:59:19 +00:00
|
|
|
procedure TDrawingExtraData.SetColor(AValue: TColor);
|
|
|
|
begin
|
2019-01-27 18:44:08 +00:00
|
|
|
if FColor = AValue then Exit;
|
|
|
|
FColor := AValue;
|
2018-04-16 13:59:19 +00:00
|
|
|
end;
|
|
|
|
|
2019-05-16 21:37:34 +00:00
|
|
|
|
|
|
|
{ TTrackExtraData }
|
|
|
|
|
|
|
|
procedure TTrackExtraData.SetWidth(AValue: Double);
|
2018-04-16 13:59:19 +00:00
|
|
|
begin
|
2019-05-16 21:37:34 +00:00
|
|
|
if AValue = FWidth then Exit;
|
|
|
|
FWidth := abs(AValue);
|
2018-04-16 13:59:19 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|
|
|
|
|