source: cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/Demo/Unit1.pas@ 1710

Last change on this file since 1710 was 1693, checked in by healthsevak, 10 years ago

Committing the files for first time to this new branch

File size: 1.1 KB
Line 
1unit Unit1;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Variants, Classes, Graphics,
7 Forms, Dialogs, SpellCheck, Controls,
8 StdCtrls;
9
10type
11 TForm1 = class(TForm)
12 Label1: TLabel;
13 Edit1: TEdit;
14 Button1: TButton;
15 ListBox1: TListBox;
16 procedure FormCreate(Sender: TObject);
17 procedure Button1Click(Sender: TObject);
18 private
19 { Private declarations }
20 SpellCheck1: TSpellCheck;
21 public
22 { Public declarations }
23 end;
24
25var
26 Form1: TForm1;
27
28implementation
29
30{$R *.dfm}
31
32procedure TForm1.Button1Click(Sender: TObject);
33begin
34 ListBox1.Clear;
35 if SpellCheck1.IsMisspelled(Edit1.Text) then
36 SpellCheck1.GetSuggestions(Edit1.Text, ListBox1.Items)
37 else
38 ShowMessage(Edit1.Text+' is not misspelled');
39end;
40
41procedure TForm1.FormCreate(Sender: TObject);
42begin
43 SpellCheck1 := TSpellCheck.Create(Self);
44 SpellCheck1.AffFileName := ExtractFilePath(Application.ExeName)+'dict\en_GB.aff';
45 SpellCheck1.DictFileName := ExtractFilePath(Application.ExeName)+'dict\en_GB.dic';
46 SpellCheck1.Active := True;
47end;
48
49end.
Note: See TracBrowser for help on using the repository browser.