Index: cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/Demo/fHunSpell.dfm
===================================================================
--- cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/Demo/fHunSpell.dfm	(revision 1717)
+++ cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/Demo/fHunSpell.dfm	(revision 1718)
@@ -16,4 +16,5 @@
   OnActivate = FormActivate
   OnClose = FormClose
+  OnCloseQuery = FormCloseQuery
   OnCreate = FormCreate
   PixelsPerInch = 96
@@ -197,7 +198,7 @@
   object RichEdit1: TRichEdit
     Left = 3
-    Top = 57
+    Top = 76
     Width = 726
-    Height = 205
+    Height = 186
     Lines.Strings = (
       'Type orr Paste heree the text '
@@ -228,4 +229,22 @@
     OnClick = btnCloseClick
   end
+  object cbIgnoreAllCaps: TCheckBox
+    Left = 131
+    Top = 54
+    Width = 178
+    Height = 17
+    Caption = 'Ignore words in &UpperCase'
+    TabOrder = 6
+    OnClick = cbIgnoreAllCapsClick
+  end
+  object cbIgnoreDigit: TCheckBox
+    Left = 339
+    Top = 53
+    Width = 166
+    Height = 17
+    Caption = 'Ignore words with &digits'
+    TabOrder = 7
+    OnClick = cbIgnoreDigitClick
+  end
   object OpenDialog1: TOpenDialog
     DefaultExt = '*.Dict'
Index: cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/Demo/fHunSpell.pas
===================================================================
--- cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/Demo/fHunSpell.pas	(revision 1717)
+++ cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/Demo/fHunSpell.pas	(revision 1718)
@@ -62,4 +62,6 @@
     btnAbort: TButton;
     btnUndo: TButton;
+    cbIgnoreAllCaps: TCheckBox;
+    cbIgnoreDigit: TCheckBox;
     procedure FormCreate(Sender: TObject);
     procedure btnIgnoreOnceClick(Sender: TObject);
@@ -88,4 +90,7 @@
     procedure lblDictionariesURLClick(Sender: TObject);
     procedure lstSuggestionsDblClick(Sender: TObject);
+    procedure cbIgnoreAllCapsClick(Sender: TObject);
+    procedure cbIgnoreDigitClick(Sender: TObject);
+    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
   private
     { Private declarations }
@@ -296,4 +301,16 @@
 end;
 
+procedure TfrmHunSpell.cbIgnoreAllCapsClick(Sender: TObject);
+begin
+  if SpellCheck1.IgnoreAllCaps <> cbIgnoreAllCaps.Checked then
+    SpellCheck1.IgnoreAllCaps := cbIgnoreAllCaps.Checked;
+end;
+
+procedure TfrmHunSpell.cbIgnoreDigitClick(Sender: TObject);
+begin
+  if SpellCheck1.IgnoreWordWithDigits <> cbIgnoreDigit.Checked then
+    SpellCheck1.IgnoreWordWithDigits := cbIgnoreDigit.Checked;
+end;
+
 procedure TfrmHunSpell.edtDictionaryEnter(Sender: TObject);
 begin
@@ -308,4 +325,10 @@
      NoEngineOpted := True;
   end;
+
+  if cbIgnoreAllCaps.Checked <> SpellCheck1.IgnoreAllCaps then
+    cbIgnoreAllCaps.Checked := SpellCheck1.IgnoreAllCaps;
+
+  if cbIgnoreDigit.Checked <> SpellCheck1.IgnoreWordWithDigits then
+    cbIgnoreDigit.Checked := SpellCheck1.IgnoreWordWithDigits;
 end;
 
@@ -320,4 +343,12 @@
   else
         ShowMessage(TX_SPELL_CANCELLED) ;  }
+end;
+
+procedure TfrmHunSpell.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+begin
+  CanClose := (SpellCheck1.SpellCheckState <> ssChecking)
+               or (SpellCheck1.AbortSpellCheck(True));
+  if CanClose then
+     ModalResult := mrCancel;
 end;
 
Index: cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaHunSpellChecker.dproj
===================================================================
--- cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaHunSpellChecker.dproj	(revision 1717)
+++ cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaHunSpellChecker.dproj	(revision 1718)
@@ -38,7 +38,4 @@
       
       
-      
-      
-      
       <Excluded_Packages Name="C:\Documents and Settings\All Users\Documents\RAD Studio\5.0\Bpl\XWB_R2007.bpl">VistA RPC Broker Runtime Package</Excluded_Packages>
       <Excluded_Packages Name="E:\WVEHR\branches\HealthSevak-CPRS\BDK50\Packages\XWB_D2007.bpl">File E:\WVEHR\branches\HealthSevak-CPRS\BDK50\Packages\XWB_D2007.bpl not found</Excluded_Packages>
@@ -51,6 +48,6 @@
       <MainSource>MainSource</MainSource>
     </DelphiCompile>
-    <DCCReference Include="Demo\rtl.dcp" />
-    <DCCReference Include="Demo\vcl.dcp" />
+    <DCCReference Include="C:\Documents and Settings\sunil\rtl.dcp" />
+    <DCCReference Include="C:\Documents and Settings\sunil\vcl.dcp" />
     <DCCReference Include="skaSpellCheck.pas" />
     <DCCReference Include="uHunSpellLib.pas" />
Index: cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaSpellCheck.pas
===================================================================
--- cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaSpellCheck.pas	(revision 1717)
+++ cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaSpellCheck.pas	(revision 1718)
@@ -81,4 +81,6 @@
     FOnAbort  : TNotifyEvent;
     FOnStateChange  : TStateChangeEvent;
+    FIgnoreWordWdigits: boolean;
+    FIgnoreCaps: boolean;
 
     function AddCustomWord(aWord: String; isInternal: Boolean = False): Boolean;
@@ -86,4 +88,5 @@
     Function CurrentWordDetail(WithPosition: Boolean= True): String;
     function GetActive: Boolean;
+    procedure GetOptions;
     function GetStatus: TSpellState;
     procedure Initialize;
@@ -93,4 +96,5 @@
     procedure SetDictFileName(const Value: string);
     procedure SetHighLightEdit(const Value: TEdit);
+    procedure SetOptions;
     procedure SetSourceEdit(const Value: TRichEdit);
     Function ShowMisSpelledWord:boolean;
@@ -100,4 +104,6 @@
     procedure SaveForUndo(const Ignoring: Boolean=False);
     procedure InformStatusChange;
+    procedure SetIgnoreCaps(const Value: boolean);
+    procedure SetIgnoreWordWdigits(const Value: boolean);
   public
     constructor Create(AOwner: TComponent); overload; override;
@@ -129,4 +135,6 @@
     property Active: Boolean read GetActive write SetActive;
     property AffixFileName: string read FAffixFileName write SetAffixFileName;
+    property IgnoreAllCaps: boolean read FIgnoreCaps write SetIgnoreCaps default true;
+    property IgnoreWordWithDigits:boolean read FIgnoreWordWdigits write SetIgnoreWordWdigits default true;
     property CustDictionaryFile: String read FCustom write SetCustomDict;
     property DictionaryFileName:string read FDictFileName write SetDictFileName;
@@ -162,5 +170,5 @@
     CurrentMe: TskaHunSpellChecker;
 implementation
-   uses messages, Dialogs, RichEdit, SHFolder,  uHunSpellLib;
+   uses messages, Dialogs, RichEdit, SHFolder,  uHunSpellLib, Registry;
 
 procedure Register;
@@ -184,10 +192,10 @@
                                                   [mbYes, mbNo],0, mbNo) = 6);
 
-  if Result and (FUndoList.Count > 0) then
-  begin
+  if Result  then
+  begin
+    if FUndoList.Count > 0 then
        SourceTextControl.Text := FUndoList[0];
-       FUndoList.Clear;
-       FUndoList.Add(SourceTextControl.Text);
-  end;
+    FUndoList.Clear;
+    FUndoList.Add(SourceTextControl.Text);
    FIgnore.Clear;
    FStatus := ssCancelled;
@@ -195,4 +203,5 @@
    if Assigned(OnAbort) then
      OnAbort(Self);
+  end;
 end;
 
@@ -363,4 +372,12 @@
    FUndoList := TStringList.Create;
 
+   if csDesigning in componentState then
+   begin
+   IgnoreAllCaps := True;
+   IgnoreWordWithDigits := True;
+   end
+   else
+     GetOptions;
+
    FStatus := ssInActive;
    WaitForUser := False;
@@ -380,5 +397,5 @@
   Result := '$$' + CurrentWord + '$$';
   if WithPosition then
-    Result := '$$' + IntToStr(FoundAt+1) + Result;
+    Result :='$$' + IntToStr(CurrentLine) + '$$' + IntToStr(FoundAt+1) + Result;
 end;
 
@@ -396,4 +413,5 @@
     except
     end;
+    SetOptions;
   finally
     FCustDict.Free;
@@ -410,4 +428,38 @@
 begin
   Result := (FpointerHunLib <> nil);
+end;
+
+procedure TskaHunSpellChecker.GetOptions;
+var
+reg:TRegistry;
+begin
+ reg:=TRegistry.Create;
+ try
+ reg.RootKey := HKEY_CURRENT_USER;
+
+ //first get the dicationary file name
+  Reg.OpenKey('\software\'+ ChangeFileExt(Application.ExeName,'') + '\skaHunSpellCheckOptions',True);
+  if reg.ValueExists('DicFileName')  then
+    DictionaryFileName:=Reg.readString('DicFileName')
+  else
+    Reg.WriteString('DicFileName',DictionaryFileName);
+
+ //IgnoreAllCaps  ?
+ if reg.ValueExists('IgnoreAllCaps')  then
+    IgnoreAllCaps:=Reg.readBool('IgnoreAllCaps')
+  else
+    Reg.WriteBool('IgnoreAllCaps',IgnoreAllCaps);
+
+
+  //IgnoreWordsWithDigits  ?
+ if reg.ValueExists('IgnoreWordWithDigits')  then
+    IgnoreWordWithDigits:=Reg.readBool('IgnoreWordWithDigits')
+  else
+    Reg.WriteBool('IgnoreWordWithDigits',IgnoreWordWithDigits);
+
+ finally
+    Reg.Free;
+ end;
+
 end;
 
@@ -472,4 +524,33 @@
      TextOut(dcForHndl, VisPoint.x, VisPoint.y, pchar(CurrentWord), WordLength);
    end;
+
+   function WordIsIgnorable: Boolean;
+   var
+     i: Integer;
+   begin
+     if IgnoreAllCaps then
+     begin
+       Result := True;
+        for i := 1 to WordLength do
+        begin
+          Result := Result and (ord(CurrentWord[i]) in [65..90]);
+        end;
+        if Result then
+          exit;
+     end;
+
+
+
+     if IgnoreWordWithDigits then
+     begin
+       Result := False;
+        for i := 1 to WordLength do
+        begin
+          Result := Result or (ord(CurrentWord[i]) in [48..57]);
+          if Result then
+            break;
+        end;
+     end;
+   end;
 begin
   Result := False;
@@ -529,7 +610,10 @@
         WordPos           := i-WordLength;
         CurrentWord          := copy(CurrentText, WordPos, WordLength);
-        If ((FIgnore.IndexOf(CurrentWordDetail(True))< 0)  //SingelIgnore
+       // if WordIsCorrect then
+       if (((FIgnore.IndexOf(CurrentWordDetail(True))< 0)  //SingelIgnore
               and (FIgnore.IndexOf(CurrentWordDetail(False))< 0) //IgnoreAll
-              and (IsMisspelled(CurrentWord))) Then
+              and (IsMisspelled(CurrentWord))))
+              and (not WordIsIgnorable) then
+
         begin
            GetSuggestions(CurrentWord, SuggestionList.Items);
@@ -764,4 +848,51 @@
 end;
 
+procedure TskaHunSpellChecker.SetIgnoreCaps(const Value: boolean);
+begin
+  if (FIgnoreCaps = Value) then
+    exit;
+
+  FIgnoreCaps := Value;
+  if SpellCheckState = ssChecking then
+    ReStart;
+end;
+
+procedure TskaHunSpellChecker.SetIgnoreWordWdigits(const Value: boolean);
+begin
+  if (FIgnoreWordWdigits = Value) then
+    exit;
+
+  FIgnoreWordWdigits := Value;
+  if SpellCheckState = ssChecking then
+    ReStart;
+
+end;
+
+procedure TskaHunSpellChecker.SetOptions;
+var
+reg:TRegistry;
+begin
+ reg:=TRegistry.Create;
+ try
+ reg.RootKey := HKEY_CURRENT_USER;
+
+
+  Reg.OpenKey('\software\'+ ChangeFileExt(Application.ExeName,'') + '\skaHunSpellCheckOptions',True);
+
+  //first save the dicationary file name
+  Reg.WriteString('DicFileName',DictionaryFileName);
+
+ //IgnoreAllCaps  ?
+ Reg.WriteBool('IgnoreAllCaps',IgnoreAllCaps);
+
+
+  //IgnoreWordsWithDigits  ?
+ Reg.WriteBool('IgnoreWordWithDigits',IgnoreWordWithDigits);
+
+ finally
+    Reg.Free;
+ end;
+end;
+
 Function RichEditWndProc(handle:HWnd;uMsg,wParam,lParam:longint):longint stdcall;
 begin
