Changeset 562 for Common


Ignore:
Timestamp:
May 27, 2023, 11:00:20 AM (19 months ago)
Author:
chronos
Message:
  • Modified: Updated Common packages.
Location:
Common
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • Common/UAboutDialog.pas

    r558 r562  
    5050
    5151end.
    52 
  • Common/UDataFile.pas

    r559 r562  
    109109
    110110end.
    111 
  • Common/UDebugLog.pas

    r558 r562  
    1 unit UDebugLog; 
     1unit UDebugLog;
    22
    33interface
     
    134134
    135135end.
    136 
  • Common/UDelay.pas

    r558 r562  
    7171
    7272end.
    73 
  • Common/UFindFile.pas

    r560 r562  
    143143    SysUtils.FindClose(Rec);
    144144  end;
    145 end; 
     145end;
    146146
    147147end.
    148 
  • Common/UFormAbout.lfm

    r548 r562  
    11object FormAbout: TFormAbout
    22  Left = 1014
    3   Height = 402
     3  Height = 349
    44  Top = 577
    5   Width = 702
     5  Width = 609
    66  Caption = 'About'
    7   ClientHeight = 402
    8   ClientWidth = 702
    9   DesignTimePPI = 144
    10   OnCreate = FormCreate
     7  ClientHeight = 349
     8  ClientWidth = 609
     9  DesignTimePPI = 125
    1110  OnShow = FormShow
    1211  Position = poScreenCenter
    13   LCLVersion = '2.0.10.0'
     12  LCLVersion = '2.2.4.0'
    1413  object LabelDescription: TLabel
    15     Left = 30
    16     Height = 24
    17     Top = 135
    18     Width = 642
     14    Left = 26
     15    Height = 22
     16    Top = 117
     17    Width = 557
    1918    Align = alTop
    20     BorderSpacing.Left = 30
    21     BorderSpacing.Right = 30
    22     BorderSpacing.Bottom = 30
     19    BorderSpacing.Left = 26
     20    BorderSpacing.Right = 26
     21    BorderSpacing.Bottom = 26
    2322    Caption = 'Description'
    2423    ParentColor = False
     
    2726  end
    2827  object LabelContent: TLabel
    29     Left = 30
    30     Height = 24
    31     Top = 189
    32     Width = 642
     28    Left = 26
     29    Height = 22
     30    Top = 165
     31    Width = 557
    3332    Align = alTop
    34     BorderSpacing.Around = 30
     33    BorderSpacing.Around = 26
    3534    Caption = '   '
    3635    ParentColor = False
     
    3938  object PanelTop: TPanel
    4039    Left = 0
    41     Height = 135
     40    Height = 117
    4241    Top = 0
    43     Width = 702
     42    Width = 609
    4443    Align = alTop
    4544    BevelOuter = bvNone
    46     ClientHeight = 135
    47     ClientWidth = 702
     45    ClientHeight = 117
     46    ClientWidth = 609
    4847    FullRepaint = False
    4948    ParentFont = False
    5049    TabOrder = 0
    5150    object LabelAppName: TLabel
    52       Left = 108
    53       Height = 84
    54       Top = 20
    55       Width = 564
     51      Left = 94
     52      Height = 73
     53      Top = 17
     54      Width = 489
    5655      Anchors = [akTop, akLeft, akRight]
    5756      AutoSize = False
    58       BorderSpacing.Around = 30
     57      BorderSpacing.Around = 26
    5958      Caption = 'Title'
    60       Font.Height = -60
     59      Font.Height = -52
    6160      ParentColor = False
    6261      ParentFont = False
     
    6463    end
    6564    object ImageLogo: TImage
    66       Left = 24
    67       Height = 74
    68       Top = 30
    69       Width = 72
     65      Left = 21
     66      Height = 64
     67      Top = 26
     68      Width = 62
    7069      Proportional = True
    7170      Stretch = True
     
    7473  object PanelButtons: TPanel
    7574    Left = 0
    76     Height = 75
    77     Top = 327
    78     Width = 702
     75    Height = 65
     76    Top = 284
     77    Width = 609
    7978    Align = alBottom
    8079    BevelOuter = bvNone
    81     ClientHeight = 75
    82     ClientWidth = 702
     80    ClientHeight = 65
     81    ClientWidth = 609
    8382    TabOrder = 1
    8483    object ButtonHomePage: TButton
    85       Left = 24
    86       Height = 38
    87       Top = 24
    88       Width = 264
     84      Left = 21
     85      Height = 33
     86      Top = 21
     87      Width = 229
    8988      Anchors = [akLeft, akBottom]
    9089      Caption = 'Home page'
     
    9493    end
    9594    object ButtonClose: TButton
    96       Left = 532
    97       Height = 38
    98       Top = 24
    99       Width = 140
     95      Left = 461
     96      Height = 33
     97      Top = 21
     98      Width = 122
    10099      Anchors = [akRight, akBottom]
    101100      Caption = 'Close'
  • Common/UFormAbout.pas

    r560 r562  
    7575
    7676end.
    77 
  • Common/UGenerics.pas

    r560 r562  
    7777
    7878end.
    79 
  • Common/UGeometric.pas

    r558 r562  
    88type
    99  TPointArray = array of TPoint;
     10
     11  { TVector }
     12
     13  TVector = record
     14    Position: TPoint;
     15    Direction: TPoint;
     16    function GetLength: Double;
     17    function GetAngle: Double;
     18    procedure SetLength(Value: Double);
     19    class function Create(P1, P2: TPoint): TVector; static;
     20  end;
    1021
    1122function Distance(P1, P2: TPoint): Integer;
     
    1324function AddPoint(const P1, P2: TPoint): TPoint;
    1425function SubPoint(const P1, P2: TPoint): TPoint;
    15 function PointToLineDistance(const P, V, W: TPoint): Integer;
     26function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer;
    1627function ComparePoint(P1, P2: TPoint): Boolean;
    1728function RotatePoint(Center, P: TPoint; Angle: Double): TPoint;
     
    5061end;
    5162
    52 function PointToLineDistance(const P, V, W: TPoint): Integer;
     63function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer;
    5364var
    5465  l2, t: Double;
     
    6879  if T < 0 then begin
    6980    Result := Distance(P, V);       // Beyond the 'v' end of the segment
    70     exit;
     81    Intersect := V;
     82    Exit;
    7183  end
    7284  else if T > 1 then begin
    7385    Result := Distance(P, W);  // Beyond the 'w' end of the segment
     86    Intersect := W;
    7487    Exit;
    7588  end;
     
    7790  TT.Y := Trunc(V.Y + T * (W.Y - V.Y));
    7891  Result := Distance(P, TT);
     92  Intersect := TT;
    7993end;
    8094
     
    162176end;
    163177
     178{ TVector }
     179
     180function TVector.GetLength: Double;
     181begin
     182  Result := Sqrt(Sqr(Direction.X) + Sqr(Direction.Y));
     183end;
     184
     185function TVector.GetAngle: Double;
     186begin
     187  Result := ArcTan2(Direction.Y, Direction.X);
     188end;
     189
     190procedure TVector.SetLength(Value: Double);
     191var
     192  Angle: Double;
     193begin
     194  Angle := GetAngle;
     195  Direction := Point(Round(Cos(Angle) * Value),
     196    Round(Sin(Angle) * Value));
     197end;
     198
     199class function TVector.Create(P1, P2: TPoint): TVector;
     200begin
     201  Result.Position := P1;
     202  Result.Direction := Point(P2.X - P1.X, P2.Y - P1.Y);
     203end;
    164204
    165205end.
    166 
  • Common/ULanguages.pas

    r558 r562  
    443443
    444444end.
    445 
  • Common/ULastOpenedList.pas

    r558 r562  
    194194
    195195end.
    196 
  • Common/UMemory.pas

    r560 r562  
    120120
    121121end.
    122 
  • Common/UMetaCanvas.pas

    r558 r562  
    6363
    6464  TCanvasPolygon = class(TCanvasObject)
     65    Pen: TPen;
     66    Brush: TBrush;
     67    Points: array of TPoint;
     68    procedure Paint(Canvas: TCanvas); override;
     69    procedure Zoom(Factor: Double); override;
     70    procedure Move(Delta: TPoint); override;
     71    constructor Create;
     72    destructor Destroy; override;
     73  end;
     74
     75  { TCanvasPolyline }
     76
     77  TCanvasPolyline = class(TCanvasObject)
     78    Pen: TPen;
     79    Brush: TBrush;
     80    Points: array of TPoint;
     81    procedure Paint(Canvas: TCanvas); override;
     82    procedure Zoom(Factor: Double); override;
     83    procedure Move(Delta: TPoint); override;
     84    constructor Create;
     85    destructor Destroy; override;
     86  end;
     87
     88  { TCanvasPolyBezier }
     89
     90  TCanvasPolyBezier = class(TCanvasObject)
    6591    Pen: TPen;
    6692    Brush: TBrush;
     
    133159    procedure DoMoveTo(X, Y: Integer); override;
    134160    procedure DoLineTo(X, Y: Integer); override;
     161    procedure DoPolyline(const Points: array of TPoint); override;
     162    procedure DoPolyBezier(Points: PPoint; NumPts: Integer;
     163      Filled: Boolean = False; Continuous: Boolean = False); override;
    135164  public
    136165    Objects: TCanvasObjects;
     
    141170    procedure TextOut(X,Y: Integer; const Text: String); override;
    142171    procedure Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean = False); override;
     172    procedure Polyline(Points: PPoint; NumPts: Integer); override;
     173    procedure PolyBezier(Points: PPoint; NumPts: Integer;
     174      Filled: Boolean = False; Continuous: Boolean = True); override;
    143175    procedure Ellipse(x1, y1, x2, y2: Integer); override;
    144176    procedure StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic); override;
     
    161193  UGeometric, LCLIntf;
    162194
     195{ TCanvasPolyBezier }
     196
     197procedure TCanvasPolyBezier.Paint(Canvas: TCanvas);
     198begin
     199  Canvas.Pen.Assign(Pen);
     200  Canvas.Brush.Assign(Brush);
     201  Canvas.PolyBezier(Points);
     202end;
     203
     204procedure TCanvasPolyBezier.Zoom(Factor: Double);
     205var
     206  I: Integer;
     207begin
     208  for I := 0 to High(Points) do
     209    Points[I] := Point(Trunc(Points[I].X * Factor),
     210      Trunc(Points[I].Y * Factor));
     211  Pen.Width := Trunc(Pen.Width * Factor);
     212end;
     213
     214procedure TCanvasPolyBezier.Move(Delta: TPoint);
     215var
     216  I: Integer;
     217begin
     218  for I := 0 to High(Points) do
     219    Points[I] := AddPoint(Points[I], Delta);
     220end;
     221
     222constructor TCanvasPolyBezier.Create;
     223begin
     224  Pen := TPen.Create;
     225  Brush := TBrush.Create;
     226end;
     227
     228destructor TCanvasPolyBezier.Destroy;
     229begin
     230  FreeAndNil(Brush);
     231  FreeAndNil(Pen);
     232  inherited;
     233end;
     234
     235{ TCanvasPolyline }
     236
     237procedure TCanvasPolyline.Paint(Canvas: TCanvas);
     238begin
     239  Canvas.Pen.Assign(Pen);
     240  Canvas.Brush.Assign(Brush);
     241  Canvas.Polyline(Points);
     242end;
     243
     244procedure TCanvasPolyline.Zoom(Factor: Double);
     245var
     246  I: Integer;
     247begin
     248  for I := 0 to High(Points) do
     249    Points[I] := Point(Trunc(Points[I].X * Factor),
     250      Trunc(Points[I].Y * Factor));
     251  Pen.Width := Trunc(Pen.Width * Factor);
     252end;
     253
     254procedure TCanvasPolyline.Move(Delta: TPoint);
     255var
     256  I: Integer;
     257begin
     258  for I := 0 to High(Points) do
     259    Points[I] := AddPoint(Points[I], Delta);
     260end;
     261
     262constructor TCanvasPolyline.Create;
     263begin
     264  Pen := TPen.Create;
     265  Brush := TBrush.Create;
     266end;
     267
     268destructor TCanvasPolyline.Destroy;
     269begin
     270  FreeAndNil(Brush);
     271  FreeAndNil(Pen);
     272  inherited;
     273end;
     274
    163275{ TCanvasPie }
    164276
     
    304416destructor TCanvasPolygon.Destroy;
    305417begin
    306   Brush.Free;
    307   Pen.Free;
     418  FreeAndNil(Brush);
     419  FreeAndNil(Pen);
    308420  inherited;
    309421end;
     
    511623    APoints[I] := Points[I];
    512624  DoPolygon(APoints);
     625end;
     626
     627procedure TMetaCanvas.Polyline(Points: PPoint; NumPts: Integer);
     628var
     629  APoints: array of TPoint;
     630  I: Integer;
     631begin
     632  APoints := nil;
     633  SetLength(APoints, NumPts);
     634  for I := 0 to High(APoints) do
     635    APoints[I] := Points[I];
     636  DoPolyline(APoints);
     637end;
     638
     639procedure TMetaCanvas.PolyBezier(Points: PPoint; NumPts: Integer;
     640  Filled: Boolean; Continuous: Boolean);
     641begin
     642  DoPolyBezier(Points, NumPts, Filled, Continuous);
    513643end;
    514644
     
    580710end;
    581711
     712procedure TMetaCanvas.DoPolyline(const Points: array of TPoint);
     713var
     714  NewObj: TCanvasPolyline;
     715  I: Integer;
     716begin
     717  NewObj := TCanvasPolyline.Create;
     718  NewObj.Brush.Assign(Brush);
     719  NewObj.Pen.Assign(Pen);
     720  SetLength(NewObj.Points, Length(Points));
     721  for I := 0 to High(Points) do
     722    NewObj.Points[I] := Points[I];
     723  Objects.Add(NewObj);
     724end;
     725
     726procedure TMetaCanvas.DoPolyBezier(Points: PPoint; NumPts: Integer;
     727  Filled: Boolean; Continuous: Boolean);
     728var
     729  NewObj: TCanvasPolyBezier;
     730  I: Integer;
     731begin
     732  NewObj := TCanvasPolyBezier.Create;
     733  NewObj.Brush.Assign(Brush);
     734  NewObj.Pen.Assign(Pen);
     735  SetLength(NewObj.Points, NumPts);
     736  for I := 0 to High(NewObj.Points) do
     737    NewObj.Points[I] := Points[I];
     738  Objects.Add(NewObj);
     739end;
     740
    582741procedure TMetaCanvas.FillRect(const ARect: TRect);
    583742begin
     
    664823
    665824end.
    666 
  • Common/UPersistentForm.pas

    r558 r562  
    11unit UPersistentForm;
    2 
    3 // Date: 2020-11-26
    42
    53interface
     
    2119    procedure SaveControl(Control: TControl);
    2220  public
    23     FormNormalSize: TRect;
    2421    FormRestoredSize: TRect;
    2522    FormWindowState: TWindowState;
     
    155152    RootKey := RegistryContext.RootKey;
    156153    OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True);
    157     // Normal size
    158     FormNormalSize.Left := ReadIntegerWithDefault('NormalLeft', FormNormalSize.Left);
    159     FormNormalSize.Top := ReadIntegerWithDefault('NormalTop', FormNormalSize.Top);
    160     FormNormalSize.Right := ReadIntegerWithDefault('NormalWidth', FormNormalSize.Right - FormNormalSize.Left)
    161       + FormNormalSize.Left;
    162     FormNormalSize.Bottom := ReadIntegerWithDefault('NormalHeight', FormNormalSize.Bottom - FormNormalSize.Top)
    163       + FormNormalSize.Top;
     154
    164155    // Restored size
    165156    FormRestoredSize.Left := ReadIntegerWithDefault('RestoredLeft', FormRestoredSize.Left);
     
    169160    FormRestoredSize.Bottom := ReadIntegerWithDefault('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top)
    170161      + FormRestoredSize.Top;
     162
    171163    // Other state
    172164    FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(FormWindowState)));
     
    183175    RootKey := RegistryContext.RootKey;
    184176    OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True);
    185     // Normal state
    186     WriteInteger('NormalWidth', FormNormalSize.Right - FormNormalSize.Left);
    187     WriteInteger('NormalHeight', FormNormalSize.Bottom - FormNormalSize.Top);
    188     WriteInteger('NormalTop', FormNormalSize.Top);
    189     WriteInteger('NormalLeft', FormNormalSize.Left);
    190     // Restored state
     177
     178    // Restored size
    191179    WriteInteger('RestoredWidth', FormRestoredSize.Right - FormRestoredSize.Left);
    192180    WriteInteger('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top);
    193181    WriteInteger('RestoredTop', FormRestoredSize.Top);
    194182    WriteInteger('RestoredLeft', FormRestoredSize.Left);
     183
    195184    // Other state
    196185    WriteInteger('WindowState', Integer(FormWindowState));
     
    257246begin
    258247  Self.Form := Form;
     248
    259249  // Set default
    260   FormNormalSize := Bounds((Screen.Width - Form.Width) div 2,
    261     (Screen.Height - Form.Height) div 2, Form.Width, Form.Height);
    262250  FormRestoredSize := Bounds((Screen.Width - Form.Width) div 2,
    263251    (Screen.Height - Form.Height) div 2, Form.Width, Form.Height);
     
    267255  LoadFromRegistry(RegistryContext);
    268256
    269   if not EqualRect(FormNormalSize, FormRestoredSize) or
    270     DefaultMaximized then begin
     257  if (FormWindowState = wsMaximized) or DefaultMaximized then begin
    271258    // Restore to maximized state
    272259    Form.WindowState := wsNormal;
     
    277264    // Restore to normal state
    278265    Form.WindowState := wsNormal;
    279     if FEntireVisible then FormNormalSize := CheckEntireVisible(FormNormalSize)
     266    if FEntireVisible then FormRestoredSize := CheckEntireVisible(FormRestoredSize)
    280267      else if FMinVisiblePart > 0 then
    281     FormNormalSize := CheckPartVisible(FormNormalSize, FMinVisiblePart);
    282     if not EqualRect(FormNormalSize, Form.BoundsRect) then
    283       Form.BoundsRect := FormNormalSize;
     268        FormRestoredSize := CheckPartVisible(FormRestoredSize, FMinVisiblePart);
     269    if not EqualRect(FormRestoredSize, Form.BoundsRect) then
     270      Form.BoundsRect := FormRestoredSize;
    284271  end;
    285272  if FormFullScreen then SetFullScreen(True);
     
    290277begin
    291278  Self.Form := Form;
    292   FormNormalSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height);
    293   if not FormFullScreen then
    294     FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
    295       Form.RestoredHeight);
    296   FormWindowState := Form.WindowState;
     279  if not FormFullScreen then begin
     280    FormWindowState := Form.WindowState;
     281    if FormWindowState = wsMaximized then begin
     282      FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
     283        Form.RestoredHeight);
     284    end else
     285    if FormWindowState = wsNormal then begin
     286      FormRestoredSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height);
     287    end;
     288  end;
    297289  SaveToRegistry(RegistryContext);
    298290  SaveControl(Form);
     
    312304  if State then begin
    313305    FormFullScreen := True;
    314     FormNormalSize := Form.BoundsRect;
    315     FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
    316       Form.RestoredHeight);
     306    if Form.WindowState = wsMaximized then begin
     307      FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
     308        Form.RestoredHeight);
     309    end else
     310    if Form.WindowState = wsNormal then begin
     311      FormRestoredSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height);
     312    end;
    317313    FormWindowState := Form.WindowState;
     314    Form.WindowState := wsMaximized;
     315    Form.WindowState := wsNormal;
    318316    ShowWindow(Form.Handle, SW_SHOWFULLSCREEN);
    319317    {$IFDEF WINDOWS}
     
    327325    ShowWindow(Form.Handle, SW_SHOWNORMAL);
    328326    if FormWindowState = wsNormal then begin
    329       Form.BoundsRect := FormNormalSize;
     327      Form.WindowState := wsNormal;
     328      Form.BoundsRect := FormRestoredSize;
    330329    end else
    331330    if FormWindowState = wsMaximized then begin
     
    337336
    338337end.
    339 
  • Common/UPixelPointer.pas

    r558 r562  
    1515  private
    1616    procedure SetRGB(AValue: Cardinal);
    17     function GetRGB: Cardinal;   
     17    function GetRGB: Cardinal;
    1818  public
    1919    property RGB: Cardinal read GetRGB write SetRGB;
     
    310310end;
    311311
    312 
    313312end.
    314 
  • Common/UPool.pas

    r560 r562  
    199199
    200200end.
    201 
  • Common/UPrefixMultiplier.pas

    r558 r562  
    3131  (
    3232    (ShortText: 'y'; FullText: 'yocto'; Value: 1e-24),
    33           (ShortText: 'z'; FullText: 'zepto'; Value: 1e-21),
     33      (ShortText: 'z'; FullText: 'zepto'; Value: 1e-21),
    3434    (ShortText: 'a'; FullText: 'atto'; Value: 1e-18),
    3535    (ShortText: 'f'; FullText: 'femto'; Value: 1e-15),
     
    5252  (
    5353    (ShortText: 'ys'; FullText: 'yocto'; Value: 1e-24),
    54           (ShortText: 'zs'; FullText: 'zepto'; Value: 1e-21),
     54      (ShortText: 'zs'; FullText: 'zepto'; Value: 1e-21),
    5555    (ShortText: 'as'; FullText: 'atto'; Value: 1e-18),
    5656    (ShortText: 'fs'; FullText: 'femto'; Value: 1e-15),
     
    124124
    125125end.
    126 
  • Common/UResetableThread.pas

    r560 r562  
    295295
    296296end.
    297 
  • Common/UStringTable.pas

    r558 r562  
    6969end;
    7070
    71 
    7271end.
    73 
  • Common/USyncCounter.pas

    r560 r562  
    7878
    7979end.
    80 
  • Common/UTestCase.pas

    r559 r562  
    127127
    128128end.
    129 
  • Common/UTheme.pas

    r558 r562  
    186186end;
    187187
    188 
    189188end.
  • Common/UThreading.pas

    r560 r562  
    366366
    367367end.
    368 
  • Common/UTranslator.pas

    r558 r562  
    569569end;
    570570
    571 
    572571end.
    573 
  • Common/UURI.pas

    r560 r562  
    347347
    348348end.
    349 
  • Common/UXMLUtils.pas

    r558 r562  
    1414procedure WriteString(Node: TDOMNode; Name: string; Value: string);
    1515procedure WriteDateTime(Node: TDOMNode; Name: string; Value: TDateTime);
     16procedure WriteDouble(Node: TDOMNode; Name: string; Value: Double);
    1617function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer;
    1718function ReadInt64(Node: TDOMNode; Name: string; DefaultValue: Int64): Int64;
     
    1920function ReadString(Node: TDOMNode; Name: string; DefaultValue: string): string;
    2021function ReadDateTime(Node: TDOMNode; Name: string; DefaultValue: TDateTime): TDateTime;
     22function ReadDouble(Node: TDOMNode; Name: string; DefaultValue: Double): Double;
    2123procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string);
    2224
    2325
    2426implementation
     27
     28function ReadDouble(Node: TDOMNode; Name: string; DefaultValue: Double): Double;
     29var
     30  NewNode: TDOMNode;
     31begin
     32  Result := DefaultValue;
     33  NewNode := Node.FindNode(DOMString(Name));
     34  if Assigned(NewNode) then
     35    Result := StrToFloat(string(NewNode.TextContent));
     36end;
    2537
    2638procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string);
     
    200212end;
    201213
     214procedure WriteDouble(Node: TDOMNode; Name: string; Value: Double);
     215var
     216  NewNode: TDOMNode;
     217begin
     218  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     219  NewNode.TextContent := DOMString(FloatToStr(Value));
     220  Node.AppendChild(NewNode);
     221end;
     222
    202223function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer;
    203224var
     
    252273
    253274end.
    254 
Note: See TracChangeset for help on using the changeset viewer.