-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuHint.pas
94 lines (79 loc) · 2.19 KB
/
uHint.pas
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//------------------------------------------------------------------
// SpellCode - Source code spell checking utility.
// Copyright © 2010 Dilshan R Jayakody. <[email protected]>
// http://code.google.com/p/spellcode
//
// SpellCode is distributed under the MIT license.
//------------------------------------------------------------------
unit uHint;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TfmHint = class(TForm)
shpMain: TShape;
btnClose: TSpeedButton;
lblWord: TLabel;
lstSugs: TListBox;
btnAdd: TSpeedButton;
btnIgnore: TSpeedButton;
btnOK: TSpeedButton;
btnIgnoreAll: TSpeedButton;
procedure btnIgnoreClick(Sender: TObject);
procedure btnOKClick(Sender: TObject);
procedure btnCloseClick(Sender: TObject);
procedure btnAddClick(Sender: TObject);
procedure FormKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormShow(Sender: TObject);
procedure btnIgnoreAllClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fmHint: TfmHint;
implementation
{$R *.dfm}
procedure TfmHint.btnIgnoreClick(Sender: TObject);
begin
ModalResult := mrCancel;
end;
procedure TfmHint.btnOKClick(Sender: TObject);
begin
ModalResult := mrOK;
end;
procedure TfmHint.btnCloseClick(Sender: TObject);
begin
ModalResult := mrNo;
end;
procedure TfmHint.btnAddClick(Sender: TObject);
begin
ModalResult := mrYes;
end;
procedure TfmHint.FormKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if(Key = 119) then
ModalResult := mrCancel
else if(Key = 13) then
ModalResult := mrOK
else if(Key = 27) then
ModalResult := mrNo
else if(Key = 45) then
ModalResult := mrYes
else if(Key = 120) then
ModalResult := mrYesToAll
end;
procedure TfmHint.FormShow(Sender: TObject);
begin
btnOK.Enabled := (lstSugs.Items.Count > 0);
lstSugs.Enabled := btnOK.Enabled;
end;
procedure TfmHint.btnIgnoreAllClick(Sender: TObject);
begin
ModalResult := mrYesToAll;
end;
end.