source: cprs/branches/HealthSevak-CPRS/CPRS-Chart/fSpellNotify.pas@ 1706

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

Committing the files for first time to this new branch

File size: 1.9 KB
Line 
1unit fSpellNotify;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 Dialogs, StdCtrls, uConst, ExtCtrls;
8
9type
10 TfrmSpellNotify = class(TForm)
11 lblMain: TLabel;
12 tmrMain: TTimer;
13 lblOptions: TLabel;
14 procedure FormCreate(Sender: TObject);
15 procedure FormShow(Sender: TObject);
16 procedure Refocus(Sender: TObject);
17 procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
18 Shift: TShiftState; X, Y: Integer);
19 private
20 FSpellCheck: boolean;
21 FEditControl: TCustomMemo;
22 FFirst: boolean;
23 procedure WMMove(var Message: TWMMove); message WM_MOVE;
24 procedure UMDoSpellCheck(var Message: TMessage); message UM_MISC;
25 public
26 property SpellCheck: boolean read FSpellCheck write FSpellCheck;
27 property EditControl: TCustomMemo read FEditControl write FEditControl;
28 end;
29
30implementation
31
32uses uSpell, ORFn;
33
34{$R *.dfm}
35
36procedure TfrmSpellNotify.Refocus(Sender: TObject);
37begin
38 RefocusSpellCheckWindow;
39end;
40
41procedure TfrmSpellNotify.FormCreate(Sender: TObject);
42begin
43 FFirst := True;
44end;
45
46procedure TfrmSpellNotify.FormMouseDown(Sender: TObject; Button: TMouseButton;
47 Shift: TShiftState; X, Y: Integer);
48begin
49 RefocusSpellCheckWindow;
50end;
51
52procedure TfrmSpellNotify.FormShow(Sender: TObject);
53begin
54 if FFirst then
55 begin
56 FFirst := False;
57 if not SpellCheck then
58 begin
59 lblMain.Caption := 'Grammar Check Running';
60 lblOptions.Visible := false;
61 end;
62 PostMessage(Handle, UM_MISC, 0, 0);
63 end;
64 RefocusSpellCheckWindow;
65end;
66
67procedure TfrmSpellNotify.UMDoSpellCheck(var Message: TMessage);
68begin
69 InternalSpellCheck(SpellCheck, EditControl);
70 ModalResult := mrOK;
71end;
72
73procedure TfrmSpellNotify.WMMove(var Message: TWMMove);
74begin
75 inherited;
76 RefocusSpellCheckWindow;
77end;
78
79end.
Note: See TracBrowser for help on using the repository browser.