Index: cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaSpellCheck.pas
===================================================================
--- cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaSpellCheck.pas	(revision 1715)
+++ 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
