Advertisement
Guest User

Untitled

a guest
May 20th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 18.58 KB | None | 0 0
  1. unit UnitIncidenceMatrix;
  2.  
  3. interface
  4.  
  5. uses
  6.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  7.   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.Grids,
  8.   Vcl.Menus, Vcl.ExtCtrls;
  9.  
  10.  
  11. type
  12.    TMatrix = array of array of Integer;
  13.  
  14. type
  15.   TFindPathForm = class(TForm)
  16.     Label1: TLabel;
  17.     edtCountOfNodes: TEdit;
  18.     UpDown1: TUpDown;
  19.     btCreateMatrix: TButton;
  20.     sgIncidenceMatrix: TStringGrid;
  21.     Label2: TLabel;
  22.     Label3: TLabel;
  23.     cbFirstNode: TComboBox;
  24.     cbSecondNode: TComboBox;
  25.     Label4: TLabel;
  26.     btAddAdge: TButton;
  27.     btCreateGraph: TButton;
  28.     PopupMenu1: TPopupMenu;
  29.     pmForSG: TPopupMenu;
  30.     ItemAddNode: TMenuItem;
  31.     ItemDeleteNode: TMenuItem;
  32.     InputFile: TOpenDialog;
  33.     SaveFile: TSaveDialog;
  34.     MainMenu: TMainMenu;
  35.     N1: TMenuItem;
  36.     InputData: TMenuItem;
  37.     SaveData: TMenuItem;
  38.     N2: TMenuItem;
  39.     ItemExit: TMenuItem;
  40.     N3: TMenuItem;
  41.     AboutAuthor: TMenuItem;
  42.     AboutProgramm: TMenuItem;
  43.     btClear: TButton;
  44.     pbGraph: TPaintBox;
  45.     Label5: TLabel;
  46.     btFindPath: TButton;
  47.     lResultPath: TLabel;
  48.     procedure btCreateMatrixClick(Sender: TObject);
  49.     procedure edtCountOfNodesKeyPress(Sender: TObject; var Key: Char);
  50.     procedure btAddAdgeClick(Sender: TObject);
  51.     procedure ClearStringGrid;
  52.     procedure ItemDeleteNodeClick(Sender: TObject);
  53.     procedure ItemAddNodeClick(Sender: TObject);
  54.     procedure AboutAuthorClick(Sender: TObject);
  55.     procedure AboutProgrammClick(Sender: TObject);
  56.     procedure btClearClick(Sender: TObject);
  57.     procedure InputDataClick(Sender: TObject);
  58.     procedure FormCreate(Sender: TObject);
  59.     procedure btCreateGraphClick(Sender: TObject);
  60.     procedure btFindPathClick(Sender: TObject);
  61.     procedure SaveDataClick(Sender: TObject);
  62.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  63.     procedure ItemExitClick(Sender: TObject);
  64.   private
  65.     { Private declarations }
  66.     xCentre, yCentre, Radius, CircleRadius: Integer;
  67.     procedure CreateNodes;
  68.     procedure DrawGraph;
  69.     procedure DrawNodes;
  70.     function IsPathExists: Boolean;
  71.     function IsConnectedGraph(MyGraph: TMatrix): Boolean;
  72.     procedure CreatePath(MyGraph: TMatrix);
  73.   public
  74.     { Public declarations }
  75.   end;
  76.  
  77. const
  78.    CellWidth = 29;
  79.    CellHeight = 29;
  80.  
  81. var
  82.    FindPathForm: TFindPathForm;
  83.    MyNodes: array of TPoint;
  84.  
  85. implementation
  86.  
  87. {$R *.dfm}
  88.  
  89. procedure TFindPathForm.btClearClick(Sender: TObject);
  90. begin
  91.    ClearStringGrid;
  92.    pbGraph.Canvas.Brush.Color := clSilver;
  93.    pbGraph.Canvas.FillRect(Rect(0, 0, pbGraph.Width, pbGraph.Height));
  94.    edtCountOfNodes.Clear;
  95.    sgIncidenceMatrix.RowCount := 1;
  96.    sgIncidenceMatrix.ColCount := 1;
  97.    sgIncidenceMatrix.Width := CellWidth;
  98.    sgIncidenceMatrix.Height := CellHeight;
  99.    cbFirstNode.Clear;
  100.    cbSecondNode.Clear;
  101.    lResultPath.Caption := '';
  102. end;
  103.  
  104. procedure TFindPathForm.btCreateMatrixClick(Sender: TObject);
  105. var
  106.    Count, i, j : Integer;
  107. begin
  108.    SaveData.Enabled := False;
  109.    ClearStringGrid;
  110.    pbGraph.Canvas.Brush.Color := clSilver;
  111.    pbGraph.Canvas.FillRect(Rect(0, 0, pbGraph.Width, pbGraph.Height));
  112.    if (edtCountOfNodes.Text <> '0') and (edtCountOfNodes.Text <> '') then
  113.    begin
  114.       cbFirstNode.Clear;
  115.       cbSecondNode.Clear;
  116.       Count := StrToInt(edtCountOfNodes.Text) + 1;
  117.       sgIncidenceMatrix.Width := Count * CellWidth;
  118.       sgIncidenceMatrix.Height := Count * CellHeight;
  119.       sgIncidenceMatrix.RowCount := Count;
  120.       sgIncidenceMatrix.ColCount := Count;
  121.       for i := 0 to Count - 1 do
  122.       begin
  123.          sgIncidenceMatrix.Cells[i, 0] := IntToStr(i);
  124.          sgIncidenceMatrix.Cells[0, i] := IntToStr(i);
  125.       end;
  126.       sgIncidenceMatrix.Cells[0, 0] := '';
  127.       for i := 1 to Count - 1 do
  128.       begin
  129.          cbFirstNode.Items.Add(IntToStr(i));
  130.          cbSecondNode.Items.Add(IntToStr(i));
  131.       end;
  132.    end
  133.    else
  134.       MessageBox(Handle, PChar('Допустипое количество городов от 1 до 9'),
  135.          PChar(''), MB_ICONSTOP + MB_OK);
  136. end;
  137.  
  138. procedure TFindPathForm.btFindPathClick(Sender: TObject);
  139. const
  140.    MsgNoPath = 'Эйлеров путь не может быть найден, т.к. кол-во нечетных вершин не ' +
  141.    'соответствуе условию! (2-е - эйлеров путь, 0 - эйлеров цикл)';
  142.    MsgNoCennected = 'Элеров путь не может быть найден, т.к. граф не является связанным';
  143.    MsgEmptyGraph = 'Граф не построен!';
  144. var
  145.    Count, i, j: Integer;
  146.    Graph: TMatrix;
  147. begin
  148.    if sgIncidenceMatrix.RowCount > 1 then
  149.    begin
  150.       Count := sgIncidenceMatrix.RowCount - 1;
  151.       SetLength(Graph, Count + 1, Count + 1);
  152.       for i := 1 to Count do
  153.          for j := 1 to Count do
  154.             Graph[i, j] := 0;
  155.       for i := 1 to Count do
  156.          for j := 1 to Count do
  157.          begin
  158.             if sgIncidenceMatrix.Cells[j, i] = '+' then
  159.                Graph[i, j] := 1;
  160.          end;
  161.       if IsConnectedGraph(Graph) then
  162.          if IsPathExists then
  163.          begin
  164.             CreatePath(Graph);
  165.             SaveData.Enabled := True;
  166.          end
  167.          else
  168.             MessageBox(Handle, MsgNoPath, 'Ошибка!', MB_ICONSTOP + MB_OK)
  169.       else
  170.          MessageBox(handle, MsgNoCennected, 'Внимание!', MB_ICONINFORMATION + MB_OK);
  171.    end
  172.    else
  173.       MessageBox(Handle, MsgEmptyGraph, 'Внимание!', MB_OK);
  174. end;
  175.  
  176. procedure TFindPathForm.InputDataClick(Sender: TObject);
  177. var
  178.    Input : TextFile;
  179.    Count, i, j, First, Second: Integer;
  180.    IsCorrect : Boolean;
  181. begin
  182.    btClearClick(Sender);
  183.    if InputFile.Execute then
  184.    begin
  185.       AssignFile(Input, InputFile.FileName);
  186.       Reset(Input);
  187.       if EoF(Input) then
  188.       begin
  189.          MessageBox(Handle, PChar('Файл не содержит необходимые данные!'),
  190.             PChar('Ошибка!'), MB_ICONERROR + MB_OK);
  191.          CloseFile(Input);
  192.          InputDataClick(Sender);
  193.       end
  194.       else
  195.       begin
  196.          Readln(Input);
  197.          if EoF(Input) then
  198.             MessageBox(Handle, PChar('В файле отсутвуют элементы массива!'),
  199.                PChar('Ошибка!'), MB_ICONERROR + MB_OK)
  200.          else
  201.          begin
  202.             Reset(Input);
  203.             try
  204.                Readln(Input, Count);
  205.                IsCorrect := True;
  206.                if (Count > 0) and (Count < 10) then
  207.                begin
  208.                   edtCountOfNodes.Text := IntToStr(Count);
  209.                   btCreateMatrixClick(Sender);
  210.                end
  211.                else
  212.                   IsCorrect := False;
  213.                i := 1;
  214.                while (not EoF(Input)) and IsCorrect do
  215.                begin
  216.                   Read(Input, First);
  217.                   Readln(Input, Second);
  218.                   if (First > 0) and (First < Count) and (Second > 0) and (Second < Count) then
  219.                   begin
  220.                      if First <> Second then
  221.                      begin
  222.                         sgIncidenceMatrix.Cells[First, Second] := '+';
  223.                         sgIncidenceMatrix.Cells[Second, First] := '+'
  224.                      end
  225.                      else
  226.                         IsCorrect := False;
  227.                   end
  228.                   else
  229.                      IsCorrect := False;
  230.                end;
  231.                if IsCorrect then
  232.                   CloseFile(Input)
  233.                else
  234.                begin
  235.                   CloseFile(Input);
  236.                   btClearClick(Sender);
  237.                   MessageBox(Handle, PChar('Присутсвуют некорректные данные!'),
  238.                      PChar('Ошибка!'), MB_ICONERROR + MB_OK);
  239.                end;
  240.             except
  241.                btClearClick(Sender);
  242.                MessageBox(Handle, PChar('В файле присутсвуют данные несоответствующего типа!'),
  243.                   PChar('Ошибка!'), MB_ICONERROR + MB_OK);
  244.                CloseFile(Input);
  245.                InputDataClick(Sender);
  246.             end;
  247.          end;
  248.       end;
  249.    end;
  250. end;
  251.  
  252.  
  253. function TFindPathForm.IsConnectedGraph(MyGraph: TMatrix): Boolean;
  254. var
  255.    Visited: array of Boolean;
  256.    Count, i, j: Integer;
  257.    IsConnected: Boolean;
  258. procedure DFS(v: Integer);
  259. var
  260.    i: Integer;
  261. begin
  262.    Visited[v] := True;
  263.    for i := 1 to Count do
  264.    begin
  265.       if (MyGraph[v, i] = 1) and (not Visited[i]) then
  266.          DFS(i);
  267.    end;
  268. end;
  269. begin
  270.    Count := Length(MyGraph[1]) - 1;
  271.    SetLength(Visited, Count + 1);
  272.    for i := 1 to Count do
  273.       Visited[i] := False;
  274.    DFS(1);
  275.    IsConnected := True;
  276.    for i := 1 to Count do
  277.       if Visited[i] = False then
  278.          IsConnected := False;
  279.    Result := IsConnected;
  280. end;
  281.  
  282. function TFindPathForm.IsPathExists: Boolean;
  283. var
  284.    MyArr: array of Byte;
  285.    i, j, Count, OddCount: Integer;
  286. begin
  287.    Count := sgIncidenceMatrix.RowCount - 1;
  288.    SetLength(MyArr, Count + 1);
  289.    for i := 1 to Count do
  290.          MyArr[i] := 0;
  291.    for i := 1 to Count do
  292.    begin
  293.       for j := 1 to Count do
  294.          if sgIncidenceMatrix.Cells[j, i] = '+' then
  295.             Inc(MyArr[i]);
  296.    end;
  297.    OddCount := 0;
  298.    for i := 1 to Count do
  299.       if (MyArr[i] mod 2) = 1 then
  300.          Inc(OddCount);
  301.    Result := (OddCOunt = 2) or (OddCount = 0);
  302. end;
  303.  
  304. procedure TFindPathForm.ItemAddNodeClick(Sender: TObject);
  305. var
  306.    ACol, Arow : Integer;
  307. begin
  308.    ARow := sgIncidenceMatrix.Selection.Top;
  309.    ACol := sgIncidenceMatrix.Selection.Left;
  310.    if (ACol > 0) and (ARow > 0) and (ARow <> ACol) then
  311.       if (sgIncidenceMatrix.Cells[ACol, ARow] = '') then
  312.       begin
  313.          sgIncidenceMatrix.Cells[ACol, ARow] := '+';
  314.          sgIncidenceMatrix.Cells[ARow, ACol] := '+';
  315.       end
  316.       else
  317.          MessageBox(Handle, PChar('Между этими вершинами уже есть ребро'),
  318.             PChar('Внимание!'), MB_OK + MB_ICONSTOP);
  319. end;
  320.  
  321. procedure TFindPathForm.ItemDeleteNodeClick(Sender: TObject);
  322. var
  323.    ACol, Arow : Integer;
  324. begin
  325.    ACol := sgIncidenceMatrix.Selection.Left;
  326.    ARow := sgIncidenceMatrix.Selection.Top;
  327.    if (ACol > 0) and (ARow > 0) then
  328.       if (sgIncidenceMatrix.Cells[ACol, ARow] = '+') then
  329.       begin
  330.          sgIncidenceMatrix.Cells[ACol, ARow] := '';
  331.          sgIncidenceMatrix.Cells[ARow, ACol] := '';
  332.       end
  333.       else
  334.          MessageBox(Handle, PChar('Выбрана пустая клетка'), PChar('Внимание!'), MB_OK + MB_ICONSTOP);
  335. end;
  336.  
  337. procedure TFindPathForm.ItemExitClick(Sender: TObject);
  338. begin
  339.    Close;
  340. end;
  341.  
  342. procedure TFindPathForm.SaveDataClick(Sender: TObject);
  343. const
  344.    MsgRewrite = 'Желаете перезаписать Файл?';
  345. var
  346.    Output: TextFile;
  347.    Count, i, j: Integer;
  348. begin
  349.    if SaveFile.Execute then
  350.    begin
  351.       if MessageBox(Handle, MsgRewrite, 'Внимание!', MB_ICONINFORMATION + MB_YESNO) = mrYes then
  352.       begin
  353.          AssignFile(Output, SaveFIle.FileName);
  354.          Rewrite(Output);
  355.          Writeln(Output, 'Матрица смежности: '#13#10);
  356.          Count := sgIncidenceMatrix.RowCount - 1;
  357.          for i := 1 to Count do
  358.          begin
  359.             for j := 1 to Count do
  360.             begin
  361.                if sgIncidenceMatrix.Cells[j, i] = '+' then
  362.                   Write(Output, 1, '  ')
  363.                else
  364.                   Write(Output, 0, '  ');
  365.             end;
  366.             Writeln(Output);
  367.          end;
  368.          Writeln(Output, lResultPath.Caption);
  369.          CloseFile(Output);
  370.       end;
  371.    end;
  372. end;
  373.  
  374. procedure TFindPathForm.ClearStringGrid;
  375. var
  376.    i, j : Integer;
  377. begin
  378.    for j := 1 to sgIncidenceMatrix.RowCount do
  379.       for i := 1 to sgIncidenceMatrix.ColCount do
  380.          sgIncidenceMatrix.Cells[i, j] := '';
  381. end;
  382.  
  383. procedure TFindPathForm.CreateNodes;
  384. const
  385.    MaxAngel = 2 * Pi;
  386. var
  387.    Count, i: Integer;
  388.    DeltaX, DeltaY, DeltaAngel, Angel: Real;
  389. begin
  390.    Count := sgIncidenceMatrix.RowCount - 1;
  391.    if Count > 0 then
  392.    begin
  393.       SetLength(MyNodes, Count);
  394.       DeltaAngel := MaxAngel / Count;
  395.       for i := 1 to Count do
  396.       begin
  397.          Angel := i * DeltaAngel;
  398.          if (Angel > Pi/2 ) or (Angel < 3*Pi/2)  then
  399.             DeltaX := (-1) * Radius * Cos(Angel)
  400.          else
  401.             DeltaX := Radius * Cos(Angel);
  402.          if (Angel > Pi) or (Angel < 2*Pi) then
  403.             DeltaY := (-1) * Radius * Sin(Angel)
  404.          else
  405.             DeltaY := Radius * Sin(Angel);
  406.          MyNodes[i - 1].X := xCentre - Round(DeltaX);
  407.          MyNodes[i - 1].Y := yCentre - Round(DeltaY);
  408.       end;
  409.    end
  410.    else
  411.       MessageBox(Handle, 'Число вершин не задано!', 'Внимание!', MB_ICONINFORMATION + MB_OK);
  412. end;
  413.  
  414. procedure TFindPathForm.CreatePath(MyGraph: TMatrix);
  415. var
  416.    Stack: array of Byte;
  417.    Top, Count: Byte;
  418.   i: Integer;
  419. procedure Search(v: Byte);
  420. var
  421.    i: Integer;
  422. begin
  423.    for i := 1 to Count do
  424.       if MyGraph[v, i] = 1 then
  425.       begin
  426.          MyGraph[v, i] := 0;
  427.          MyGraph[i, v] := 0;
  428.          Search(i);
  429.       end;
  430.    Inc(Top);
  431.    SetLength(Stack, Length(Stack) + 1);
  432.    Stack[Top] := v;
  433. end;
  434. begin
  435.    Count := Length(MyGraph[1]) - 1;
  436.    SetLength(Stack, 1);
  437.    for i := 1 to Count do
  438.       Stack[i] := 0;
  439.    Top := 0;
  440.    Search(1);
  441.    if Stack[1] = Stack[Top] then
  442.       lResultPath.Caption := 'Цикл : '
  443.    else
  444.       lResultPath.Caption := 'Путь : ';
  445.    for i := Top downto 1 do
  446.    begin
  447.       lResultPath.Caption := lResultPath.Caption + IntToStr(Stack[i]);
  448.       if i <> 1 then
  449.          lResultPath.Caption := lResultPath.Caption + ' -> '
  450.       else
  451.          lResultPath.Caption := lResultPath.Caption + ';';
  452.       with pbGraph.Canvas do
  453.       begin
  454.          Pen.Color := clRed;
  455.          Pen.Width := 3;
  456.          if i <> 1 then
  457.          begin
  458.             MoveTo(MyNodes[Stack[i] - 1].X, MyNodes[Stack[i] - 1].Y);
  459.             LineTo(MyNodes[Stack[i - 1] - 1].X, MyNodes[Stack[i - 1] - 1].Y);
  460.          end;
  461.       end;
  462.    end;
  463.    DrawNodes;
  464. end;
  465.  
  466. procedure TFindPathForm.DrawGraph;
  467. var
  468.    Count, i, j: Integer;
  469.    StartX, StartY, FinishX, FinishY: Integer;
  470.    Str: String;
  471. begin
  472.    pbGraph.Canvas.Brush.Color := clSilver;
  473.    pbGraph.Canvas.FillRect(Rect(0, 0, pbGraph.Width, pbGraph.Height));
  474.    Count := sgIncidenceMatrix.RowCount - 1;
  475.    with pbGraph.Canvas do
  476.    begin
  477.       Pen.Color := clBlack;
  478.       Pen.Width := 3;
  479.       i := 1;
  480.       while i < Count do
  481.       begin
  482.          j := i + 1;
  483.          while j < Count + 1 do
  484.          begin
  485.             if sgIncidenceMatrix.Cells[j, i] = '+' then
  486.             begin
  487.                StartX := MyNodes[j - 1].X;
  488.                StartY := MyNodes[j - 1].Y;
  489.                FinishX := MyNodes[i - 1].X;
  490.                FinishY := MyNodes[i - 1].Y;
  491.                MoveTo(StartX, StartY);
  492.                LineTo(FinishX, FinishY);
  493.             end;
  494.             Inc(j);
  495.          end;
  496.          Inc(i);
  497.       end;
  498.       Pen.Color := clBlue;
  499.       Pen.Width := 4;
  500.       for i := 0 to Count - 1 do
  501.       begin
  502.          Str := IntToStr(i + 1);
  503.          Ellipse(MyNodes[i].X - CircleRadius, MyNodes[i].Y - CircleRadius,
  504.             MyNodes[i].X + CircleRadius, MyNodes[i].Y + CircleRadius);
  505.          TextOut(MyNodes[i].X - TextWidth(Str) div 2,
  506.             MyNodes[i].Y - TextHeight(Str) div 2, Str);
  507.       end;
  508.    end;
  509. end;
  510.  
  511. procedure TFindPathForm.DrawNodes;
  512. var
  513.    Count, i, j: Integer;
  514.    Str: String;
  515. begin
  516.    Count := sgIncidenceMatrix.RowCount - 1;
  517.    with pbGraph.Canvas do
  518.    begin
  519.       Pen.Color := clBlue;
  520.       Pen.Width := 4;
  521.       for i := 0 to Count - 1 do
  522.       begin
  523.          Str := IntToStr(i + 1);
  524.          Ellipse(MyNodes[i].X - CircleRadius, MyNodes[i].Y - CircleRadius,
  525.             MyNodes[i].X + CircleRadius, MyNodes[i].Y + CircleRadius);
  526.          TextOut(MyNodes[i].X - TextWidth(Str) div 2,
  527.             MyNodes[i].Y - TextHeight(Str) div 2, Str);
  528.       end;
  529.    end;
  530. end;
  531.  
  532. procedure TFindPathForm.AboutAuthorClick(Sender: TObject);
  533. begin
  534.    MessageBox(Handle, PChar('Программу разработал Быховец Илья (гр. 851001)'),
  535.             PChar(''), MB_ICONSTOP + MB_OK);
  536. end;
  537.  
  538. procedure TFindPathForm.AboutProgrammClick(Sender: TObject);
  539. const
  540.    MsgTask = 'Найти эйлеров цикл в графе, заданном матрицей смежности. ' +
  541.       'Эйлеровым путем в графе называется произвольный путь, проходящий ' +
  542.       'через каждое ребро графа в точности один раз. Проверить, есть ли ' +
  543.       'путь по теореме Эйлера. Граф визуализировать. Если есть путь, выделить цветом.';
  544. begin
  545.    MessageBox(Handle, PChar(MsgTask), PChar('Описание!'), MB_ICONSTOP + MB_OK);
  546. end;
  547.  
  548. procedure TFindPathForm.btAddAdgeClick(Sender: TObject);
  549. var
  550.    i, j : Integer;
  551. begin
  552.    if (cbFirstNode.Text <> '') and (cbSecondNode.Text <> '') then
  553.    begin
  554.       if cbFirstNode.Text <> cbSecondNode.Text then
  555.       begin
  556.          i := StrToInt(cbSecondNode.Text);
  557.          j := StrToInt(cbFirstNode.Text);
  558.          if sgIncidenceMatrix.Cells[i, j] = '' then
  559.          begin
  560.             sgIncidenceMatrix.Cells[i, j] := '+';
  561.             sgIncidenceMatrix.Cells[j, i] := '+';
  562.          end
  563.          else
  564.             MessageBox(Handle, PChar('Такое ребро уже существует!'),
  565.             PChar('Внимание!'), MB_ICONSTOP + MB_OK);
  566.       end
  567.       else
  568.          MessageBox(Handle, PChar('Нельзя построить петлю!'),
  569.             PChar('Внимание!'), MB_ICONSTOP + MB_OK);
  570.    end
  571.    else
  572.       MessageBox(Handle, PChar('Есть пустые поля!'),
  573.          PChar('Внимание!'), MB_ICONSTOP + MB_OK);
  574. end;
  575.  
  576. procedure TFindPathForm.edtCountOfNodesKeyPress(Sender: TObject; var Key: Char);
  577. const
  578.    ENTER = #13;
  579. begin
  580.    if (Key = ENTER) and (edtCountOfNodes.Text <> '') then
  581.       btCreateMatrix.Click;
  582. end;
  583.  
  584. procedure TFindPathForm.btCreateGraphClick(Sender: TObject);
  585. begin
  586.    CreateNodes;
  587.    DrawGraph;
  588. end;
  589.  
  590. procedure TFindPathForm.FormClose(Sender: TObject; var Action: TCloseAction);
  591. begin
  592.    if MessageBox(Handle, 'Вы уверены?', 'Внимание!', MB_ICONERROR + MB_YESNO) = mrNo then
  593.       Action := TCloseAction.caNone;
  594. end;
  595.  
  596. procedure TFindPathForm.FormCreate(Sender: TObject);
  597. begin
  598.    xCentre := 215;
  599.    yCentre := 233;
  600.    CircleRadius := 20;
  601.    Radius := 150;
  602. end;
  603.  
  604. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement