Конференция "FreePascal" » TTreeView.OnChange [Win32]
 
fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution sockets.php on line 83
fsockopen() [function.fsockopen]: unable to connect to www.delphimaster.ru:80 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution) sockets.php on line 83
php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (0) sockets.php on line 85
fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution sockets.php on line 83
fsockopen() [function.fsockopen]: unable to connect to www.delphimaster.ru:80 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution) sockets.php on line 83
php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (0) sockets.php on line 85
  • Ivan © (10.11.18 17:54) [0]

    unit Unit1;

    {$mode objfpc}{$H+}

    interface

    uses
     Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
     ComCtrls, LCLType;

    type

     { TForm1 }

     TForm1 = class(TForm)
       E: TEdit;
       T: TTreeView;
       procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
       procedure TChange(Sender: TObject; Node: TTreeNode);
     private
       { private declarations }
     public
       { public declarations }
     end;

    var
     Form1: TForm1;
     N: Integer=0;

    implementation

    {$R *.lfm}

    { TForm1 }

    procedure TForm1.TChange(Sender: TObject; Node: TTreeNode);
    begin
    E.Text:=Node.Text;
    end;

    procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    begin
     if Shift=[ssCtrl] then
     if Key=VK_N then
     with T do
     begin
     N:=N+1;
     Items.Clear;
     Items.AddChildObject(nil, 'u1', pointer(1));
     Items.AddChildObject(nil, 'u2', pointer(2));
     end;
    end;

    end.



    По событию OnChang названия (текст) узлов показываются в Edit-e только при N=1 (при N>1 не показываются). Почему? Как сделать, чтобы показывались при N>1 ?
  • Ivan © (10.11.18 17:56) [1]
    OnChange
 
Конференция "FreePascal" » TTreeView.OnChange [Win32]
Есть новые Нет новых   [103732   +61][b:0][p:0.002]