home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2 - Developers' Solutions / Delphi 2 Developers' Solutions.iso / dds / chap11 / howto04 / delphi10 / cciccinf.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-06-12  |  42.4 KB  |  1,140 lines

  1. unit Cciccinf;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, Grids, Outline, CCWSock;
  8.  
  9. type
  10.   TCCICInfoDlg = class(TForm)
  11.     Panel1: TPanel;
  12.     BitBtn1: TBitBtn;
  13.     BitBtn2: TBitBtn;
  14.     Panel4: TPanel;
  15.     ListBox2: TListBox;
  16.     Panel2: TPanel;
  17.     Edit1: TEdit;
  18.     Panel3: TPanel;
  19.     Edit2: TEdit;
  20.     Panel5: TPanel;
  21.     Edit3: TEdit;
  22.     Panel8: TPanel;
  23.     Edit4: TEdit;
  24.     Panel9: TPanel;
  25.     Edit5: TEdit;
  26.     Panel6: TPanel;
  27.     Label1: TLabel;
  28.     Label2: TLabel;
  29.     Button1: TButton;
  30.     Button2: TButton;
  31.     Button3: TButton;
  32.     Button4: TButton;
  33.     ListBox1: TListBox;
  34.     procedure Button1Click(Sender: TObject);
  35.     procedure ListBox2Click(Sender: TObject);
  36.     procedure BitBtn1Click(Sender: TObject);
  37.     procedure BitBtn2Click(Sender: TObject);
  38.     procedure Edit4Exit(Sender: TObject);
  39.     procedure Button2Click(Sender: TObject);
  40.     procedure Button3Click(Sender: TObject);
  41.     procedure Button4Click(Sender: TObject);
  42.     procedure ListBox1DblClick(Sender: TObject);
  43.   private
  44.     { Private declarations }
  45.   public
  46.     { Public declarations }
  47.   end;
  48.  
  49. var
  50.   CCICInfoDlg: TCCICInfoDlg;
  51. const
  52.   LBClickVector : Integer = 0;
  53.   ActiveMailbox : Integer = 0;
  54.  
  55. implementation
  56.  
  57. uses CCICCFrm, CCICCPOP;
  58.  
  59. function inet_addr( IPAddressName : PChar ) :
  60.           Unsigned_Long_Integer; far; external 'WINSOCK';
  61. function gethostbyname( TheName : PChar ) :
  62.           PHost_Entry; far; external 'WINSOCK';
  63.  
  64. {$R *.DFM}
  65. procedure TCCICInfoDlg.Button1Click(Sender: TObject);
  66. var TempSocket : TCCSocket; { Used for IP Address info }
  67.     DataBuffer : array[ 0 .. 256 ] of char;
  68. begin
  69.   case Tag of
  70.     1 : begin  { Get IP Address Mode }
  71.           { Create the dummy socket }
  72.           TempSocket := TCCSocket.Create( Self );
  73.           TempSocket.Parent := Self;
  74.           { Use it to get the info }
  75.           with TempSocket do
  76.           begin
  77.             { Move the IP address into the data buffer }
  78.             StrPCopy( DataBuffer , Edit1.Text );
  79.             { Turn it into a real IP address in binary form }
  80.             Socket_IP_Address.Socket_Address.Full_Internet_Address :=
  81.              inet_addr( DataBuffer );
  82.             { If not found then do remote lookup }
  83.             if Socket_IP_Address.Socket_Address.Full_Internet_Address = INADDR_NONE then
  84.             begin
  85.               { Call blocking function on IP name }
  86.               Socket_Host_Entry := gethostbyname( DataBuffer );
  87.               { If still no good then error out and exit }
  88.               if Socket_Host_Entry = nil then
  89.               begin
  90.                 Edit2.Text := 'Could Not Convert Host Name';
  91.                 Edit3.Text := '';
  92.               end
  93.               else
  94.               begin
  95.                 { Otherwise get the address }
  96.                 Socket_IP_Address.Socket_Address :=
  97.                  Socket_Host_Entry^.Host_Address^^;
  98.                 Edit2.Text :=
  99.                  IntToStr( Socket_IP_Address.Socket_Address.Net_Byte ) + '.' +
  100.                  IntToStr( Socket_IP_Address.Socket_Address.Host_Byte ) + '.' +
  101.                  IntToStr( Socket_IP_Address.Socket_Address.Local_Host_Byte ) +
  102.                  '.' + IntToStr(
  103.                  Socket_IP_Address.Socket_Address.Local_Machine_Byte );
  104.                 Edit3.Text :=
  105.                  IntToStr( Socket_IP_Address.Socket_Address.
  106.                             Full_Internet_Address );
  107.               end;
  108.             end;
  109.           end;
  110.           { Free the dummy socket }
  111.           TempSocket.Free;
  112.         end;
  113.     2 : begin { Anonymous login punch }
  114.           Edit3.Text := 'anonymous';
  115.           CurrentRealPWString := CurrentPassWordString;
  116.           case PasswordControlVector of
  117.             1 : Edit4.Text := CurrentPassWordString;
  118.             2 : Edit4.Text := '**********';
  119.           end;
  120.         end;
  121.     5 : begin { Toggle subscribe/unsubscribe status }
  122.           if Edit3.Text = 'Subscribed' then Edit3.Text := 'UnSubscribed' else
  123.            Edit3.Text := 'Subscribed';
  124.         end;
  125.     7 : begin { Set LBClickVector to 1 to allow clicking to move msg }
  126.           LBClickVector := 1;
  127.           ActiveMailBox := ListBox2.ItemIndex;
  128.         end;
  129.   end;
  130. end;
  131.  
  132. procedure TCCICInfoDlg.ListBox2Click(Sender: TObject);
  133. var TheWorkingList  : TList;
  134.     Counter_1       : Integer;
  135.     WorkingMBRecord : PEMailMailboxRecord;
  136.     Finished        : Boolean;
  137. begin
  138.   { Use Tag vector to find out how to interpret a click }
  139.   case Tag of
  140.     2 : begin
  141.           { If nothing in list box then exit }
  142.           if ListBox2.ItemIndex = -1 then exit;
  143.           { Use the data in the Working FTP Site List TList }
  144.           with PConnectionsRecord(
  145.            TheWorkingFTPSL.Items[ ListBox2.ItemIndex ] )^ do
  146.           begin
  147.               Edit1.Text := CProfile;
  148.               Edit2.Text := CIPAddress;
  149.               Edit3.Text := CUserName;
  150.               CurrentRealPWString := CPassword;
  151.               case PasswordControlVector of
  152.                 1 : Edit4.Text := CPassword;
  153.                 2 : Edit4.Text := '**********';
  154.               end;
  155.               Edit5.Text := CStartDir;
  156.           end;
  157.         end;
  158.     4 : begin
  159.           { If nothing in list box then exit }
  160.           if ListBox2.ItemIndex = -1 then exit;
  161.           { Use the data in the Working FTP Site List TList }
  162.           with PConnectionsRecord(
  163.            TheWorkingNSSL.Items[ ListBox2.ItemIndex ] )^ do
  164.           begin
  165.               Edit1.Text := CProfile;
  166.               Edit2.Text := CIPAddress;
  167.           end;
  168.         end;
  169.     5 : begin
  170.           { If nothing in list box then exit }
  171.           if ListBox2.ItemIndex = -1 then exit;
  172.           { Use the data in the Working FTP Site List TList }
  173.           with PNewsGroupRecord(
  174.            TheWorkingNRCSL.Items[ ListBox2.ItemIndex ] )^ do
  175.           begin
  176.               Edit1.Text := GName;
  177.               Edit2.Text := GRealName;
  178.               if GSubScribed then Edit3.Text := 'Subscribed' else
  179.                Edit3.Text := 'UnSubscribed';
  180.           end;
  181.         end;
  182.     6 : begin
  183.           { If nothing in list box then exit }
  184.           if ListBox2.ItemIndex = -1 then exit;
  185.           { Use the data in the Working POPSMTP Site List TList }
  186.           with PConnectionsRecord(
  187.            TheWorkingEMSL.Items[ ListBox2.ItemIndex ] )^ do
  188.           begin
  189.               Edit1.Text := CProfile;
  190.               Edit2.Text := CIPAddress;
  191.               Edit3.Text := CUserName;
  192.               CurrentEMRealPWString := CPassword;
  193.               case EMPasswordControlVector of
  194.                 1 : Edit4.Text := CPassword;
  195.                 2 : Edit4.Text := '**********';
  196.               end;
  197.               Edit5.Text := CStartDir;
  198.           end;
  199.         end;
  200.     7 : begin
  201.           case LBClickVector of
  202.            0 : begin
  203.                  { If nothing in list box then exit }
  204.                  if ListBox2.ItemIndex = -1 then exit;
  205.                  ActiveMailBox := ListBox2.ItemIndex;
  206.                  { Use the data in the Working FTP Site List TList }
  207.                  with PEMailMailboxRecord(
  208.                   TheWorkingMBSL.Items[ ListBox2.ItemIndex ] )^ do
  209.                  begin
  210.                    Edit1.Text := MBName;
  211.                    ListBox1.Clear;
  212.                    TheWorkingList := TList( MBLTag );
  213.                    if TheWorkingList.Count > 0 then
  214.                    begin
  215.                      for Counter_1 := 0 to TheWorkingList.Count - 1 do
  216.                      begin
  217.                        ListBox1.Items.Add( PEMailMessageRecord(
  218.                         TheWorkingList.Items[ Counter_1 ] )^.MRMessageSubject );
  219.                      end;
  220.                      Listbox1.ItemIndex := 0;
  221.                    end;
  222.                  end;
  223.                end;
  224.            1 : begin
  225.                  { If nothing in list box then exit }
  226.                  if ListBox2.ItemIndex = -1 then exit;
  227.                  WorkingMBRecord := PEMailMailboxRecord(
  228.                   TheWorkingMBSL.Items[ ActiveMailbox ] );
  229.                  TheWorkingList := TList( WorkingMBRecord^.MBLTag );
  230.                  for Counter_1 := 0 to ListBox1.Items.Count - 1 do
  231.                  begin
  232.                    if ListBox1.Selected[ Counter_1 ] then
  233.                    begin
  234.                      ThePOP3SMTPComponent.TransferMessage(
  235.                       PEMailMailboxRecord( TheWorkingMBSL.Items[ ActiveMailBox ] ) ,
  236.                       PEMailMailboxRecord( TheWorkingMBSL.Items[ ListBox2.ItemIndex ] ) ,
  237.                       Counter_1 );
  238.                      PEMailMessageRecord( TheWorkingList.Items[ Counter_1 ] )^.
  239.                       MRMailBoxName := 'Delete Me!';
  240.                    end;
  241.                  end;
  242.                  Counter_1 := 0;
  243.                  Finished := false;
  244.                  while not Finished do
  245.                  begin
  246.                    if Counter_1 < TheWorkingList.Count then
  247.                    begin
  248.                      if PEMailMessageRecord( TheWorkingList.Items[ Counter_1 ] )^.
  249.                       MRMailBoxName = 'Delete Me!' then
  250.                      begin
  251.                        TheWorkingList.Delete( Counter_1 );
  252.                      end
  253.                      else
  254.                      begin
  255.                        Inc( Counter_1 );
  256.                        if Counter_1 >= TheWorkingList.Count then Finished := true;
  257.                      end;
  258.                    end
  259.                    else finished := true;
  260.                  end;
  261.                  WorkingMBRecord^.MBLTag := Longint( TheWorkingList );
  262.                  ListBox2.ItemIndex := ActiveMailbox;
  263.                  LBClickVector := 0;
  264.                  ListBox1.Clear;
  265.                  for Counter_1 := 0 to TheWorkingList.Count - 1 do
  266.                  begin
  267.                    ListBox1.Items.Add( PEMailMessageRecord(
  268.                     TheWorkingList.Items[ Counter_1 ] )^.MRMessageSubject );
  269.                  end;
  270.                  Listbox1.ItemIndex := 0;
  271.               end;
  272.           end;
  273.         end;
  274.     8 : begin
  275.           { If nothing in list box then exit }
  276.           if ListBox2.ItemIndex = -1 then exit;
  277.           { Use the data in the Working FTP Site List TList }
  278.           with PConnectionsRecord(
  279.            TheWorkingCPSL.Items[ ListBox2.ItemIndex ] )^ do
  280.           begin
  281.               Edit1.Text := CProfile;
  282.               Edit2.Text := CIPAddress;
  283.           end;
  284.         end;
  285.   end;
  286. end;
  287.  
  288. { This procedure saves the newly modified list of stuff to its base }
  289. procedure TCCICInfoDlg.BitBtn1Click(Sender: TObject);
  290. var Counter_1  : Integer;            { Loop counter        }
  291.     ThePointer : PConnectionsRecord; { Generic TCR Pointer }
  292.     TheNGRecord : PNewsGroupRecord;
  293.     TheMBRecord : PEMailMailboxRecord;
  294. begin
  295.   { Use the tag vector to find out what to do }
  296.   case Tag of
  297.     2 : begin { Do FTP Site List }
  298.           { dispose the old FTP site list's pointers }
  299.           for Counter_1 := 0 to TheFTPSiteList.Count - 1 do
  300.           begin
  301.             Dispose( PConnectionsRecord( TheFTPSiteList.Items[ Counter_1 ] ));
  302.           end;
  303.           { Clear the lists }
  304.           TheFTPSiteList.Clear;
  305.           CCInetCCForm.ComboBox1.Clear;
  306.           { Add the new info }
  307.           for Counter_1 := 0 to TheWorkingFTPSL.Count - 1 do
  308.           begin
  309.             { Create a new pointer }
  310.             New( ThePointer );
  311.             { Move the data into it }
  312.             ThePointer^ :=
  313.              PConnectionsRecord( TheWorkingFTPSL.Items[ Counter_1 ] )^;
  314.             { Add the item }
  315.             TheFTPSiteList.Add( ThePointer );
  316.             CCINetCCForm.ComboBox1.Items.Add( PConnectionsRecord(
  317.              TheFTPSiteList.Items[ Counter_1 ] )^.CProfile );
  318.           end;
  319.           CCINetCCForm.ComboBox1.ItemIndex := 0;
  320.         end;
  321.     4 : begin { Do NNTP Site List }
  322.           { dispose the old FTP site list's pointers }
  323.           for Counter_1 := 0 to TheNewsServerList.Count - 1 do
  324.           begin
  325.             Dispose( PConnectionsRecord( TheNewsServerList.Items[ Counter_1 ] ));
  326.           end;
  327.           { Clear the lists }
  328.           TheNewsServerList.Clear;
  329.           CCInetCCForm.ComboBox1.Clear;
  330.           { Add the new info }
  331.           for Counter_1 := 0 to TheWorkingNSSL.Count - 1 do
  332.           begin
  333.             { Create a new pointer }
  334.             New( ThePointer );
  335.             { Move the data into it }
  336.             ThePointer^ :=
  337.              PConnectionsRecord( TheWorkingNSSL.Items[ Counter_1 ] )^;
  338.             { Add the item }
  339.             TheNewsServerList.Add( ThePointer );
  340.             CCINetCCForm.ComboBox1.Items.Add( PConnectionsRecord(
  341.              TheNewsServerList.Items[ Counter_1 ] )^.CProfile );
  342.           end;
  343.           CCINetCCForm.ComboBox1.ItemIndex := 0;
  344.         end;
  345.     5 : begin { Do NNTP Newsgroups List }
  346.           { dispose the old NG list's pointers }
  347.           for Counter_1 := 0 to TheNewsRCList.Count - 1 do
  348.           begin
  349.             Dispose( PNewsGroupRecord( TheNewsRCList.Items[ Counter_1 ] ));
  350.           end;
  351.           { Clear the lists }
  352.           TheNewsRCList.Clear;
  353.           { Add the new info }
  354.           for Counter_1 := 0 to TheWorkingNRCSL.Count - 1 do
  355.           begin
  356.             { Create a new pointer }
  357.             New( TheNGRecord );
  358.             { Move the data into it }
  359.             TheNGRecord^ :=
  360.              PNewsGroupRecord( TheWorkingNRCSL.Items[ Counter_1 ] )^;
  361.             { Add the item }
  362.             TheNewsRCList.Add( TheNGRecord );
  363.           end;
  364.         end;
  365.     6 : begin { Do EMail Server List }
  366.           { dispose the old server list's pointers }
  367.           for Counter_1 := 0 to TheEMailServerList.Count - 1 do
  368.           begin
  369.             Dispose( PConnectionsRecord( TheEMailServerList.Items[ Counter_1 ] ));
  370.           end;
  371.           { Clear the lists }
  372.           TheEMailServerList.Clear;
  373.           CCInetCCForm.ComboBox1.Clear;
  374.           { Add the new info }
  375.           for Counter_1 := 0 to TheWorkingEMSL.Count - 1 do
  376.           begin
  377.             { Create a new pointer }
  378.             New( ThePointer );
  379.             { Move the data into it }
  380.             ThePointer^ :=
  381.              PConnectionsRecord( TheWorkingEMSL.Items[ Counter_1 ] )^;
  382.             { Add the item }
  383.             TheEMailServerList.Add( ThePointer );
  384.             CCINetCCForm.ComboBox1.Items.Add( PConnectionsRecord(
  385.              TheEMailServerList.Items[ Counter_1 ] )^.CProfile );
  386.           end;
  387.           CCINetCCForm.ComboBox1.ItemIndex := 0;
  388.         end;
  389.     7 : begin { Do Email mailboxes List }
  390.           { dispose the old NG list's pointers }
  391.           for Counter_1 := 0 to TheEMailMailboxList.Count - 1 do
  392.           begin
  393.             Dispose( PEMailMailboxRecord( TheEMailMailboxList.Items[ Counter_1 ] ));
  394.           end;
  395.           { Clear the lists }
  396.           TheEMailMailboxList.Clear;
  397.           { Add the new info }
  398.           for Counter_1 := 0 to TheWorkingMBSL.Count - 1 do
  399.           begin
  400.             { Create a new pointer }
  401.             New( TheMBRecord );
  402.             { Move the data into it }
  403.             TheMBRecord^ :=
  404.              PEMailMailboxRecord( TheWorkingMBSL.Items[ Counter_1 ] )^;
  405.             { Add the item }
  406.             TheEMailMailboxList.Add( TheMBRecord );
  407.           end;
  408.         end;
  409.     8 : begin { Do EMail Correspondents List }
  410.           { dispose the old correspondents list's pointers }
  411.           for Counter_1 := 0 to TheCorrespondentsList.Count - 1 do
  412.           begin
  413.             Dispose( PConnectionsRecord( TheCorrespondentsList.Items[ Counter_1 ] ));
  414.           end;
  415.           { Clear the lists }
  416.           TheCorrespondentsList.Clear;
  417.           CCInetCCForm.ComboBox2.Clear;
  418.           CCInetCCForm.ComboBox3.Clear;
  419.           { Add the new info }
  420.           for Counter_1 := 0 to TheWorkingCPSL.Count - 1 do
  421.           begin
  422.             { Create a new pointer }
  423.             New( ThePointer );
  424.             { Move the data into it }
  425.             ThePointer^ :=
  426.              PConnectionsRecord( TheWorkingCPSL.Items[ Counter_1 ] )^;
  427.             { Add the item }
  428.             TheCorrespondentsList.Add( ThePointer );
  429.             CCINetCCForm.ComboBox2.Items.Add( PConnectionsRecord(
  430.              TheCorrespondentsList.Items[ Counter_1 ] )^.CProfile );
  431.             CCINetCCForm.ComboBox3.Items.Add( PConnectionsRecord(
  432.              TheCorrespondentsList.Items[ Counter_1 ] )^.CProfile );
  433.           end;
  434.           CCINetCCForm.ComboBox2.ItemIndex := 0;
  435.           CCINetCCForm.ComboBox3.ItemIndex := 0;
  436.         end;
  437.   end;
  438.   { Leave }
  439.   Close;
  440. end;
  441.  
  442. { This method cancels any changes made from entries in current setup & exits}
  443. procedure TCCICInfoDlg.BitBtn2Click(Sender: TObject);
  444. var Counter_1  : Integer;            { Loop counter        }
  445.     ThePointer : PConnectionsRecord; { Generic TCR Pointer }
  446.     TheNGRecord : PNewsGroupRecord;
  447.     TheEMMRecord : PEMailMailboxRecord;
  448. begin
  449.   { Use Tag vector do decide what to reset }
  450.   case Tag of
  451.     2 : begin { Reset FTP Site list }
  452.           { Dispose of all the old pointers }
  453.           for Counter_1 := 0 to TheWorkingFTPSL.Count - 1 do
  454.           begin
  455.             Dispose( PConnectionsRecord( TheWorkingFTPSL.Items[ Counter_1 ] ));
  456.           end;
  457.           { Clear the working list }
  458.           TheWorkingFTPSL.Clear;
  459.           { Clear the listbox }
  460.           ListBox2.Clear;
  461.           { Then rebuild the working list and display listbox }
  462.           for Counter_1 := 0 to TheFTPSiteList.Count - 1 do
  463.           begin
  464.             { Create the record }
  465.             New( ThePointer );
  466.             { Move data in }
  467.             ThePointer^ :=
  468.              PConnectionsRecord( TheFTPSiteList.Items[ Counter_1 ] )^;
  469.             { Add the pointer to the list }
  470.             TheWorkingFTPSL.Add( ThePointer );
  471.             { Add the profile name to the list }
  472.             ListBox2.Items.Add( PConnectionsRecord(
  473.              TheFTPSiteList.Items[ Counter_1 ] )^.CProfile );
  474.           end;
  475.         end;
  476.     4 : begin { Reset NNTP Site list }
  477.           { Dispose of all the old pointers }
  478.           for Counter_1 := 0 to TheWorkingNSSL.Count - 1 do
  479.           begin
  480.             Dispose( PConnectionsRecord( TheWorkingNSSL.Items[ Counter_1 ] ));
  481.           end;
  482.           { Clear the working list }
  483.           TheWorkingNSSL.Clear;
  484.           { Clear the listbox }
  485.           ListBox2.Clear;
  486.           { Then rebuild the working list and display listbox }
  487.           for Counter_1 := 0 to TheNewsServerList.Count - 1 do
  488.           begin
  489.             { Create the record }
  490.             New( ThePointer );
  491.             { Move data in }
  492.             ThePointer^ :=
  493.              PConnectionsRecord( TheNewsServerList.Items[ Counter_1 ] )^;
  494.             { Add the pointer to the list }
  495.             TheWorkingNSSL.Add( ThePointer );
  496.             { Add the profile name to the list }
  497.             ListBox2.Items.Add( PConnectionsRecord(
  498.              TheNewsServerList.Items[ Counter_1 ] )^.CProfile );
  499.           end;
  500.         end;
  501.     5 : begin { Reset NNTP NG list }
  502.           { Dispose of all the old pointers }
  503.           for Counter_1 := 0 to TheWorkingNRCSL.Count - 1 do
  504.           begin
  505.             Dispose( PNewsGroupRecord( TheWorkingNRCSL.Items[ Counter_1 ] ));
  506.           end;
  507.           { Clear the working list }
  508.           TheWorkingNRCSL.Clear;
  509.           { Clear the listbox }
  510.           ListBox2.Clear;
  511.           { Then rebuild the working list and display listbox }
  512.           for Counter_1 := 0 to TheNewsRCList.Count - 1 do
  513.           begin
  514.             { Create the record }
  515.             New( TheNGRecord );
  516.             { Move data in }
  517.             TheNGRecord^ :=
  518.              PNewsGroupRecord( TheNewsRCList.Items[ Counter_1 ] )^;
  519.             { Add the pointer to the list }
  520.             TheWorkingNRCSL.Add( TheNGRecord );
  521.             { Add the profile name to the list }
  522.             ListBox2.Items.Add( PNewsGroupRecord(
  523.              TheNewsRCList.Items[ Counter_1 ] )^.GName );
  524.           end;
  525.         end;
  526.     6 : begin { Reset FTP Site list }
  527.           { Dispose of all the old pointers }
  528.           for Counter_1 := 0 to TheWorkingEMSL.Count - 1 do
  529.           begin
  530.             Dispose( PConnectionsRecord( TheWorkingEMSL.Items[ Counter_1 ] ));
  531.           end;
  532.           { Clear the working list }
  533.           TheWorkingEMSL.Clear;
  534.           { Clear the listbox }
  535.           ListBox2.Clear;
  536.           { Then rebuild the working list and display listbox }
  537.           for Counter_1 := 0 to TheEMailServerList.Count - 1 do
  538.           begin
  539.             { Create the record }
  540.             New( ThePointer );
  541.             { Move data in }
  542.             ThePointer^ :=
  543.              PConnectionsRecord( TheEMailServerList.Items[ Counter_1 ] )^;
  544.             { Add the pointer to the list }
  545.             TheWorkingEMSL.Add( ThePointer );
  546.             { Add the profile name to the list }
  547.             ListBox2.Items.Add( PConnectionsRecord(
  548.              TheEMailServerList.Items[ Counter_1 ] )^.CProfile );
  549.           end;
  550.         end;
  551.     7 : begin { Reset NNTP NG list }
  552.           { Dispose of all the old pointers }
  553.           for Counter_1 := 0 to TheWorkingMBSL.Count - 1 do
  554.           begin
  555.             Dispose( PEMailMailboxRecord( TheWorkingMBSL.Items[ Counter_1 ] ));
  556.           end;
  557.           { Clear the working list }
  558.           TheWorkingMBSL.Clear;
  559.           { Clear the listbox }
  560.           ListBox2.Clear;
  561.           { Then rebuild the working list and display listbox }
  562.           for Counter_1 := 0 to TheEMailMailboxList.Count - 1 do
  563.           begin
  564.             { Create the record }
  565.             New( TheEMMRecord );
  566.             { Move data in }
  567.             TheEMMRecord^ :=
  568.              PEMailMailboxRecord( TheEMailMailboxList.Items[ Counter_1 ] )^;
  569.             { Add the pointer to the list }
  570.             TheWorkingMBSL.Add( TheEMMRecord );
  571.             { Add the profile name to the list }
  572.             ListBox2.Items.Add( PEMailMailboxRecord(
  573.              TheEMailMailboxList.Items[ Counter_1 ] )^.MBName );
  574.           end;
  575.         end;
  576.     8 : begin { Reset FTP Site list }
  577.           { Dispose of all the old pointers }
  578.           for Counter_1 := 0 to TheWorkingCPSL.Count - 1 do
  579.           begin
  580.             Dispose( PConnectionsRecord( TheWorkingCPSL.Items[ Counter_1 ] ));
  581.           end;
  582.           { Clear the working list }
  583.           TheWorkingCPSL.Clear;
  584.           { Clear the listbox }
  585.           ListBox2.Clear;
  586.           { Then rebuild the working list and display listbox }
  587.           for Counter_1 := 0 to TheCorrespondentsList.Count - 1 do
  588.           begin
  589.             { Create the record }
  590.             New( ThePointer );
  591.             { Move data in }
  592.             ThePointer^ :=
  593.              PConnectionsRecord( TheCorrespondentsList.Items[ Counter_1 ] )^;
  594.             { Add the pointer to the list }
  595.             TheWorkingCPSL.Add( ThePointer );
  596.             { Add the profile name to the list }
  597.             ListBox2.Items.Add( PConnectionsRecord(
  598.              TheCorrespondentsList.Items[ Counter_1 ] )^.CProfile );
  599.           end;
  600.         end;
  601.   end;
  602.   { Leave }
  603.   Close;
  604. end;
  605.  
  606. procedure TCCICInfoDlg.Edit4Exit(Sender: TObject);
  607. begin
  608.   { Use tag vector to determine action }
  609.   case Tag of
  610.     2 : begin
  611.           { If Edit4 is modified then mangle pw }
  612.           if Edit4.Modified then
  613.           begin
  614.             { Save pw in either case, but mangle if masked }
  615.             case PasswordControlVector of
  616.               1 : CurrentRealPWString := Edit4.Text;
  617.               2 : begin
  618.                     CurrentRealPWString := Edit4.Text;
  619.                     Edit4.Text := '***********';
  620.                   end;
  621.             end;
  622.           end;
  623.         end;
  624.     6 : begin
  625.           { If Edit4 is modified then mangle pw }
  626.           if Edit4.Modified then
  627.           begin
  628.             { Save pw in either case, but mangle if masked }
  629.             case EMPasswordControlVector of
  630.               1 : CurrentEMRealPWString := Edit4.Text;
  631.               2 : begin
  632.                     CurrentEMRealPWString := Edit4.Text;
  633.                     Edit4.Text := '***********';
  634.                   end;
  635.             end;
  636.           end;
  637.         end;
  638.   end;
  639. end;
  640.  
  641. { Add button; do various add actions }
  642. procedure TCCICInfoDlg.Button2Click(Sender: TObject);
  643. var ThePointer  : PConnectionsRecord; { PCR Pointer }
  644.     TheNGRecord : PNewsGroupRecord;
  645.     TheEMBRecord : PEMailMailboxRecord;
  646.     TempList    : TList;
  647. begin
  648.   { Tag vector control as usual }
  649.   case Tag of
  650.     2 : begin { add new FTP site list entry }
  651.           { Creat new PCR pointer }
  652.           New( ThePointer );
  653.           { Add in the data from the text fields }
  654.           with ThePointer^ do
  655.           begin
  656.             CProfile   := Edit1.Text;
  657.             CIPAddress := Edit2.Text;;
  658.             CUserName  := Edit3.Text;
  659.             { Put in the real pw string }
  660.             CPassword  := CurrentRealPWString;
  661.             CStartDir  := Edit5.Text;
  662.           end;
  663.           { Add pointer to working list }
  664.           TheWorkingFTPSL.Add( ThePointer );
  665.           { Add it to the listbox }
  666.           ListBox2.Items.Add( ThePointer^.CProfile );
  667.           { And set the pointer to it }
  668.           ListBox2.ItemIndex := ListBox2.Items.Count - 1;
  669.         end;
  670.     4 : begin { add new NNTP site list entry }
  671.           { Creat new PCR pointer }
  672.           New( ThePointer );
  673.           { Add in the data from the text fields }
  674.           with ThePointer^ do
  675.           begin
  676.             CProfile   := Edit1.Text;
  677.             CIPAddress := Edit2.Text;;
  678.             CUserName  := '';
  679.             CPassword  := '';
  680.             CStartDir  := '';
  681.           end;
  682.           { Add pointer to working list }
  683.           TheWorkingNSSL.Add( ThePointer );
  684.           { Add it to the listbox }
  685.           ListBox2.Items.Add( ThePointer^.CProfile );
  686.           { And set the pointer to it }
  687.           ListBox2.ItemIndex := ListBox2.Items.Count - 1;
  688.         end;
  689.     5 : begin { add new NNTP newsgroup list entry }
  690.           { Creat new PCR pointer }
  691.           New( TheNGRecord );
  692.           TempList := TList.Create;
  693.           { Add in the data from the text fields }
  694.           with TheNGRecord^ do
  695.           begin
  696.             GName     := Edit1.Text;
  697.             GRealName := Edit2.Text;;
  698.             if Edit3.Text = 'UnSubscribed' then GSubscribed := false else
  699.              GSubScribed := true;
  700.             GLowest              := 0;
  701.             GHighest             := 0;
  702.             GTotalNew            := 0;
  703.             GTotalAvailable      := 0;
  704.             GLowestAvailable     := 0;
  705.             GHighestAvailable    := 0;
  706.             GPostable            := true;
  707.             GTotalArticles       := 0;
  708.             GTotalUnReadArticles := 0;
  709.             GIDNumber            := TheWorkingNRCSL.Count + 1;
  710.             GFileName            := 'NL' + IntToStr( WhichServer ) + 'G' +
  711.                                     IntToStr( GIDNumber) + '.NGR';
  712.             GLTag                := Longint( TempList );
  713.           end;
  714.           { Add pointer to working list }
  715.           TheWorkingNRCSL.Add( TheNGRecord );
  716.           { Add it to the listbox }
  717.           ListBox2.Items.Add( TheNGRecord^.GName );
  718.           { And set the pointer to it }
  719.           ListBox2.ItemIndex := ListBox2.Items.Count - 1;
  720.         end;
  721.     6 : begin { add new EMail server list entry }
  722.           { Creat new PCR pointer }
  723.           New( ThePointer );
  724.           { Add in the data from the text fields }
  725.           with ThePointer^ do
  726.           begin
  727.             CProfile   := Edit1.Text;
  728.             CIPAddress := Edit2.Text;;
  729.             CUserName  := Edit3.Text;
  730.             { Put in the real pw string }
  731.             CPassword  := CurrentEMRealPWString;
  732.             CStartDir  := Edit5.Text;
  733.           end;
  734.           { Add pointer to working list }
  735.           TheWorkingEMSL.Add( ThePointer );
  736.           { Add it to the listbox }
  737.           ListBox2.Items.Add( ThePointer^.CProfile );
  738.           { And set the pointer to it }
  739.           ListBox2.ItemIndex := ListBox2.Items.Count - 1;
  740.         end;
  741.     7 : begin { add new mailbox list entry }
  742.           { Creat new PCR pointer }
  743.           New( TheEMBRecord );
  744.           TempList := TList.Create;
  745.           { Add in the data from the text fields }
  746.           with TheEMBRecord^ do
  747.           begin
  748.             MBName        := Edit1.Text;
  749.             MBIDNumber    := TheWorkingMBSL.Count + 1;
  750.             MBMaxMsgNumber := 0;
  751.             MBTotal       := 0;
  752.             MBUnReadTotal := 0;
  753.             MBUnSentTotal := 0;
  754.             MBMsgFileName := 'MB' + IntToStr( MBIDNumber ) + '.MBX';
  755.             MBLTag        := Longint( TempList );
  756.           end;
  757.           { Add pointer to working list }
  758.           TheWorkingMBSL.Add( TheEMBRecord );
  759.           { Add it to the listbox }
  760.           ListBox2.Items.Add( TheEMBRecord^.MBName );
  761.           { And set the pointer to it }
  762.           ListBox2.ItemIndex := ListBox2.Items.Count - 1;
  763.           ListBox2Click( Self );
  764.         end;
  765.     8 : begin { add new correspondents list entry }
  766.           { Creat new PCR pointer }
  767.           New( ThePointer );
  768.           { Add in the data from the text fields }
  769.           with ThePointer^ do
  770.           begin
  771.             CProfile   := Edit1.Text;
  772.             CIPAddress := Edit2.Text;
  773.           end;
  774.           { Add pointer to working list }
  775.           TheWorkingCPSL.Add( ThePointer );
  776.           { Add it to the listbox }
  777.           ListBox2.Items.Add( ThePointer^.CProfile );
  778.           { And set the pointer to it }
  779.           ListBox2.ItemIndex := ListBox2.Items.Count - 1;
  780.         end;
  781.   end;
  782. end;
  783.  
  784. { This is the modify button }
  785. procedure TCCICInfoDlg.Button3Click(Sender: TObject);
  786. begin
  787.   { Use Tag vector as usual }
  788.   case Tag of
  789.     2 : begin
  790.           { if nothing to modify the exit }
  791.           if ListBox2.ItemIndex = -1 then exit;
  792.           { get record of current listbox pointer & put in data }
  793.           with PConnectionsRecord(
  794.            TheWorkingFTPSL.Items[ ListBox2.ItemIndex ] )^ do
  795.           begin
  796.             CProfile   := Edit1.Text;
  797.             CIPAddress := Edit2.Text;;
  798.             CUserName  := Edit3.Text;
  799.             { Put in the real pw string }
  800.             CPassword  := CurrentRealPWString;
  801.             CStartDir  := Edit5.Text;
  802.           end;
  803.           { Make sure the display matches the edit control }
  804.           ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
  805.         end;
  806.     4 : begin
  807.           { if nothing to modify the exit }
  808.           if ListBox2.ItemIndex = -1 then exit;
  809.           { get record of current listbox pointer & put in data }
  810.           with PConnectionsRecord(
  811.            TheWorkingNSSL.Items[ ListBox2.ItemIndex ] )^ do
  812.           begin
  813.             CProfile   := Edit1.Text;
  814.             CIPAddress := Edit2.Text;
  815.             CUserName  := '';
  816.             CPassword  := '';
  817.             CStartDir  := '';
  818.           end;
  819.           { Make sure the display matches the edit control }
  820.           ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
  821.         end;
  822.     5 : begin
  823.           { if nothing to modify the exit }
  824.           if ListBox2.ItemIndex = -1 then exit;
  825.           { get record of current listbox pointer & put in data }
  826.           with PNewsGroupRecord(
  827.            TheWorkingNRCSL.Items[ ListBox2.ItemIndex ] )^ do
  828.           begin
  829.             GName     := Edit1.Text;
  830.             GRealName := Edit2.Text;;
  831.             if Edit3.Text = 'UnSubscribed' then GSubscribed := false else
  832.              GSubScribed := true;
  833.           end;
  834.           { Make sure the display matches the edit control }
  835.           ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
  836.         end;
  837.     6 : begin
  838.           { if nothing to modify the exit }
  839.           if ListBox2.ItemIndex = -1 then exit;
  840.           { get record of current listbox pointer & put in data }
  841.           with PConnectionsRecord(
  842.            TheWorkingEMSL.Items[ ListBox2.ItemIndex ] )^ do
  843.           begin
  844.             CProfile   := Edit1.Text;
  845.             CIPAddress := Edit2.Text;;
  846.             CUserName  := Edit3.Text;
  847.             { Put in the real pw string }
  848.             CPassword  := CurrentEMRealPWString;
  849.             CStartDir  := Edit5.Text;
  850.           end;
  851.           { Make sure the display matches the edit control }
  852.           ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
  853.         end;
  854.     7 : begin
  855.           { if nothing to modify the exit }
  856.           if ListBox2.ItemIndex = -1 then exit;
  857.           { get record of current listbox pointer & put in data }
  858.           with PEMailMailboxRecord(
  859.            TheWorkingMBSL.Items[ ListBox2.ItemIndex ] )^ do
  860.           begin
  861.             MBName     := Edit1.Text;
  862.           end;
  863.           { Make sure the display matches the edit control }
  864.           ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
  865.           ListBox2Click( Self );
  866.         end;
  867.     8 : begin
  868.           { if nothing to modify the exit }
  869.           if ListBox2.ItemIndex = -1 then exit;
  870.           { get record of current listbox pointer & put in data }
  871.           with PConnectionsRecord(
  872.            TheWorkingCPSL.Items[ ListBox2.ItemIndex ] )^ do
  873.           begin
  874.             CProfile   := Edit1.Text;
  875.             CIPAddress := Edit2.Text;;
  876.           end;
  877.           { Make sure the display matches the edit control }
  878.           ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
  879.         end;
  880.   end;
  881. end;
  882.  
  883. { This is the delete button }
  884. procedure TCCICInfoDlg.Button4Click(Sender: TObject);
  885. var MessageString : String; { String holder }
  886. begin
  887.   { Use tag control vector }
  888.   case Tag of
  889.     2 : begin
  890.           { If nothing to delete then leave }
  891.           if Listbox2.Itemindex = -1 then exit;
  892.           { Set up display }
  893.           MessageString := 'Delete Entry ' + Edit1.Text + '?';
  894.           { Display message box and get result }
  895.           if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
  896.            = mrYes then
  897.           begin
  898.             { if ok delete then remove item from working sl }
  899.             TheWorkingFTPSL.Delete( ListBox2.ItemIndex );
  900.             { delete from listbox }
  901.             ListBox2.Items.Delete( ListBox2.ItemIndex );
  902.             { If nothing left set itemindex and clear edits }
  903.             if ListBox2.Items.Count = 0 then
  904.             begin
  905.               ListBox2.ItemIndex := -1;
  906.               Edit1.Text := '';
  907.               Edit2.Text := '';
  908.               Edit3.Text := '';
  909.               Edit4.Text := '';
  910.               Edit5.Text := '';
  911.             end
  912.             else
  913.             begin
  914.               { Reset listbox pointer }
  915.               ListBox2.ItemIndex  := 0;
  916.               { and reset display to new item }
  917.               with PConnectionsRecord(
  918.                TheWorkingFTPSL.Items[ ListBox2.ItemIndex ] )^ do
  919.               begin
  920.                 Edit1.Text := CProfile;
  921.                 Edit2.Text := CIPAddress;
  922.                 Edit3.Text := CUserName;
  923.                 CurrentRealPWString := CPassword;
  924.                 case PasswordControlVector of
  925.                   1 : Edit4.Text := CPassword;
  926.                   2 : Edit4.Text := '**********';
  927.                 end;
  928.                 Edit5.Text := CStartDir;
  929.               end;
  930.             end;
  931.           end;
  932.         end;
  933.     4 : begin
  934.           { If nothing to delete then leave }
  935.           if Listbox2.Itemindex = -1 then exit;
  936.           { Set up display }
  937.           MessageString := 'Delete Entry ' + Edit1.Text + '?';
  938.           { Display message box and get result }
  939.           if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
  940.            = mrYes then
  941.           begin
  942.             { if ok delete then remove item from working sl }
  943.             TheWorkingNSSL.Delete( ListBox2.ItemIndex );
  944.             { delete from listbox }
  945.             ListBox2.Items.Delete( ListBox2.ItemIndex );
  946.             { If nothing left set itemindex and clear edits }
  947.             if ListBox2.Items.Count = 0 then
  948.             begin
  949.               ListBox2.ItemIndex := -1;
  950.               Edit1.Text := '';
  951.               Edit2.Text := '';
  952.               Edit3.Text := '';
  953.               Edit4.Text := '';
  954.               Edit5.Text := '';
  955.             end
  956.             else
  957.             begin
  958.               { Reset listbox pointer }
  959.               ListBox2.ItemIndex  := 0;
  960.               { and reset display to new item }
  961.               with PConnectionsRecord(
  962.                TheWorkingNSSL.Items[ ListBox2.ItemIndex ] )^ do
  963.               begin
  964.                 Edit1.Text := CProfile;
  965.                 Edit2.Text := CIPAddress;
  966.               end;
  967.             end;
  968.           end;
  969.         end;
  970.     5 : begin
  971.           { If nothing to delete then leave }
  972.           if Listbox2.Itemindex = -1 then exit;
  973.           { Set up display }
  974.           MessageString := 'Delete Entry ' + Edit1.Text + '?';
  975.           { Display message box and get result }
  976.           if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
  977.            = mrYes then
  978.           begin
  979.             { if ok delete then remove item from working sl }
  980.             TheWorkingNRCSL.Delete( ListBox2.ItemIndex );
  981.             { delete from listbox }
  982.             ListBox2.Items.Delete( ListBox2.ItemIndex );
  983.             { If nothing left set itemindex and clear edits }
  984.             if ListBox2.Items.Count = 0 then
  985.             begin
  986.               ListBox2.ItemIndex := -1;
  987.               Edit1.Text := '';
  988.               Edit2.Text := '';
  989.               Edit3.Text := '';
  990.               Edit4.Text := '';
  991.               Edit5.Text := '';
  992.             end
  993.             else
  994.             begin
  995.               { Reset listbox pointer }
  996.               ListBox2.ItemIndex  := 0;
  997.               { and reset display to new item }
  998.               with PNewsGroupRecord(
  999.                TheWorkingNRCSL.Items[ ListBox2.ItemIndex ] )^ do
  1000.               begin
  1001.                 Edit1.Text := GName;
  1002.                 Edit2.Text := GRealName;
  1003.                 if not GSubscribed then Edit3.Text := 'UnSubscribed' else
  1004.                  Edit3.Text := 'SubScribed';
  1005.               end;
  1006.             end;
  1007.           end;
  1008.         end;
  1009.     6 : begin
  1010.           { If nothing to delete then leave }
  1011.           if Listbox2.Itemindex = -1 then exit;
  1012.           { Set up display }
  1013.           MessageString := 'Delete Entry ' + Edit1.Text + '?';
  1014.           { Display message box and get result }
  1015.           if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
  1016.            = mrYes then
  1017.           begin
  1018.             { if ok delete then remove item from working sl }
  1019.             TheWorkingEMSL.Delete( ListBox2.ItemIndex );
  1020.             { delete from listbox }
  1021.             ListBox2.Items.Delete( ListBox2.ItemIndex );
  1022.             { If nothing left set itemindex and clear edits }
  1023.             if ListBox2.Items.Count = 0 then
  1024.             begin
  1025.               ListBox2.ItemIndex := -1;
  1026.               Edit1.Text := '';
  1027.               Edit2.Text := '';
  1028.               Edit3.Text := '';
  1029.               Edit4.Text := '';
  1030.               Edit5.Text := '';
  1031.             end
  1032.             else
  1033.             begin
  1034.               { Reset listbox pointer }
  1035.               ListBox2.ItemIndex  := 0;
  1036.               { and reset display to new item }
  1037.               with PConnectionsRecord(
  1038.                TheWorkingEMSL.Items[ ListBox2.ItemIndex ] )^ do
  1039.               begin
  1040.                 Edit1.Text := CProfile;
  1041.                 Edit2.Text := CIPAddress;
  1042.                 Edit3.Text := CUserName;
  1043.                 CurrentEMRealPWString := CPassword;
  1044.                 case EMPasswordControlVector of
  1045.                   1 : Edit4.Text := CPassword;
  1046.                   2 : Edit4.Text := '**********';
  1047.                 end;
  1048.                 Edit5.Text := CStartDir;
  1049.               end;
  1050.             end;
  1051.           end;
  1052.         end;
  1053.     7 : begin
  1054.           { If nothing to delete then leave }
  1055.           if Listbox2.Itemindex = -1 then exit;
  1056.           { Set up display }
  1057.           MessageString := 'Delete Entry ' + Edit1.Text + '?';
  1058.           { Display message box and get result }
  1059.           if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
  1060.            = mrYes then
  1061.           begin
  1062.             { if ok delete then remove item from working sl }
  1063.             TheWorkingMBSL.Delete( ListBox2.ItemIndex );
  1064.             { delete from listbox }
  1065.             ListBox2.Items.Delete( ListBox2.ItemIndex );
  1066.             { If nothing left set itemindex and clear edits }
  1067.             if ListBox2.Items.Count = 0 then
  1068.             begin
  1069.               ListBox2.ItemIndex := -1;
  1070.               Edit1.Text := '';
  1071.               Edit2.Text := '';
  1072.               Edit3.Text := '';
  1073.               Edit4.Text := '';
  1074.               Edit5.Text := '';
  1075.             end
  1076.             else
  1077.             begin
  1078.               { Reset listbox pointer }
  1079.               ListBox2.ItemIndex  := 0;
  1080.               { and reset display to new item }
  1081.               with PEmailmailboxRecord(
  1082.                TheWorkingMBSL.Items[ ListBox2.ItemIndex ] )^ do
  1083.               begin
  1084.                 Edit1.Text := MBName;
  1085.               end;
  1086.             end;
  1087.           end;
  1088.         end;
  1089.     8 : begin
  1090.           { If nothing to delete then leave }
  1091.           if Listbox2.Itemindex = -1 then exit;
  1092.           { Set up display }
  1093.           MessageString := 'Delete Entry ' + Edit1.Text + '?';
  1094.           { Display message box and get result }
  1095.           if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
  1096.            = mrYes then
  1097.           begin
  1098.             { if ok delete then remove item from working sl }
  1099.             TheWorkingCPSL.Delete( ListBox2.ItemIndex );
  1100.             { delete from listbox }
  1101.             ListBox2.Items.Delete( ListBox2.ItemIndex );
  1102.             { If nothing left set itemindex and clear edits }
  1103.             if ListBox2.Items.Count = 0 then
  1104.             begin
  1105.               ListBox2.ItemIndex := -1;
  1106.               Edit1.Text := '';
  1107.               Edit2.Text := '';
  1108.               Edit3.Text := '';
  1109.               Edit4.Text := '';
  1110.               Edit5.Text := '';
  1111.             end
  1112.             else
  1113.             begin
  1114.               { Reset listbox pointer }
  1115.               ListBox2.ItemIndex  := 0;
  1116.               { and reset display to new item }
  1117.               with PConnectionsRecord(
  1118.                TheWorkingCPSL.Items[ ListBox2.ItemIndex ] )^ do
  1119.               begin
  1120.                 Edit1.Text := CProfile;
  1121.                 Edit2.Text := CIPAddress;
  1122.               end;
  1123.             end;
  1124.           end;
  1125.         end;
  1126.   end;
  1127. end;
  1128.  
  1129. procedure TCCICInfoDlg.ListBox1DblClick(Sender: TObject);
  1130. begin
  1131.   case Tag of
  1132.     5 : begin
  1133.           if ListBox1.ItemIndex <> -1 then
  1134.            Edit2.Text := ListBox1.Items[ Listbox1.ItemIndex ];
  1135.         end;
  1136.   end;
  1137. end;
  1138.  
  1139. end.
  1140.