unit Unit4;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls;

type

  { TForm4 }

  TForm4 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Edit1: TEdit;
    ListBox1: TListBox;
    Panel1: TPanel;
    Panel2: TPanel;
    Splitter1: TSplitter;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Edit1Change(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private

  public

  end;

var
  Form4: TForm4;

implementation
 uses Unit1;
{$R *.lfm}

{ TForm4 }

procedure TForm4.FormActivate(Sender: TObject);
begin
 ListBox1.Items.LoadFromFile(ExtractFileDir(pr_path) + st_p + 'key_java.ini');
end;

procedure TForm4.Button1Click(Sender: TObject);
begin
 ListBox1.Sorted:=True;
end;

procedure TForm4.Button2Click(Sender: TObject);
begin
 ListBox1.Items.SaveToFile(ExtractFileDir(pr_path) + st_p + 'key_java.ini');
end;

procedure TForm4.Button3Click(Sender: TObject);
begin
 ListBox1.Items.Add(Edit1.Text);
end;

procedure TForm4.Button4Click(Sender: TObject);
begin
 ListBox1.DeleteSelected;
end;

procedure TForm4.Button5Click(Sender: TObject);
begin
  Form1.SynCompletion1.ItemList.LoadFromFile(ExtractFileDir(pr_path) + st_p + 'key_java.ini');
  Close;
end;

procedure TForm4.Button6Click(Sender: TObject);
begin
 ListBox1.ItemIndex:=ListBox1.Items.IndexOf(Edit1.Text);
end;

procedure TForm4.Edit1Change(Sender: TObject);
begin
  ListBox1.ItemIndex:=ListBox1.Items.IndexOf(Edit1.Text);
end;

end.

