Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions Source/simba.dtmeditor.pas
Original file line number Diff line number Diff line change
Expand Up @@ -524,18 +524,29 @@ procedure TSimbaDTMEditorForm.PointEditChanged(Sender: TObject);
Tol: Single;
Point: TDTMPoint;
begin
if (ListBox.ItemIndex > -1) and (TEdit(Sender).Text <> '') then
begin
Point := GetPoint(ListBox.ItemIndex);
if (ListBox.ItemIndex = -1) or (TEdit(Sender).Text = '') then
Exit;

X := StrToIntDef(EditPointX.Text, Point.X);
Y := StrToIntDef(EditPointY.Text, Point.Y);
Col := StrToIntDef(EditPointColor.Text, Point.Color);
Tol := StrToFloatDef(EditPointTolerance.Text, Point.Tolerance);
Point := GetPoint(ListBox.ItemIndex);

X := Point.X;
Y := Point.Y;
Col := Point.Color;
Tol := Point.Tolerance;
Size := Point.AreaSize;

if Sender = EditPointX then
X := StrToIntDef(EditPointX.Text, Point.X)
else if Sender = EditPointY then
Y := StrToIntDef(EditPointY.Text, Point.Y)
else if Sender = EditPointColor then
Col := StrToColor(EditPointColor.Text)
else if Sender = EditPointTolerance then
Tol := StrToFloatDef(EditPointTolerance.Text, Point.Tolerance)
else if Sender = EditPointSize then
Size := StrToIntDef(EditPointSize.Text, Point.AreaSize);

EditPoint(ListBox.ItemIndex, X, Y, Col, Tol, Size);
end;
EditPoint(ListBox.ItemIndex, X, Y, Col, Tol, Size);
end;

procedure TSimbaDTMEditorForm.ClientImageClear(Sender: TObject);
Expand Down
Loading