summaryrefslogtreecommitdiff
path: root/examples/windoze/delphi20/multimo4/Searchdlg.pas
blob: 1cf83fc1ff7106198cf05260c0dc36f918c126bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
unit searchdlg;

interface

uses
  SWKey, Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TSearchForm = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    ListBox1: TListBox;
    Label1: TLabel;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure ListBox1DblClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SearchForm: TSearchForm;

implementation

uses LogoMain;

{$R *.DFM}

procedure TSearchForm.Button2Click(Sender: TObject);
begin
	Close;
end;

procedure TSearchForm.Button1Click(Sender: TObject);
var
	results:TSWKey;
begin
        ListBox1.Clear;
	results := SwordAppForm.mrtWebster.Search(PChar(Edit1.Text));
	while (results.Error = 0) do
	begin
		ListBox1.Items.Add(results.text);
		results.Inc;
	end;
end;

procedure TSearchForm.ListBox1DblClick(Sender: TObject);
begin
     SwordAppForm.vkcommonkey.text := ListBox1.items[listbox1.itemindex];
     SwordAppForm.lblTextKeyText.Caption := SwordAppForm.vkCommonKey.Text;
     SwordAppForm.edTextBox.Display;
     SwordAppForm.edCommentBox.Text      := SwordAppForm.mrcMHC.Text;
end;

end.