Ignore:
Timestamp:
May 19, 2015, 2:49:23 PM (9 years ago)
Author:
healthsevak
Message:

Added few options to SpellChecker which persists beyond current session

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/Demo/fHunSpell.pas

    r1715 r1718  
    6262    btnAbort: TButton;
    6363    btnUndo: TButton;
     64    cbIgnoreAllCaps: TCheckBox;
     65    cbIgnoreDigit: TCheckBox;
    6466    procedure FormCreate(Sender: TObject);
    6567    procedure btnIgnoreOnceClick(Sender: TObject);
     
    8890    procedure lblDictionariesURLClick(Sender: TObject);
    8991    procedure lstSuggestionsDblClick(Sender: TObject);
     92    procedure cbIgnoreAllCapsClick(Sender: TObject);
     93    procedure cbIgnoreDigitClick(Sender: TObject);
     94    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    9095  private
    9196    { Private declarations }
     
    296301end;
    297302
     303procedure TfrmHunSpell.cbIgnoreAllCapsClick(Sender: TObject);
     304begin
     305  if SpellCheck1.IgnoreAllCaps <> cbIgnoreAllCaps.Checked then
     306    SpellCheck1.IgnoreAllCaps := cbIgnoreAllCaps.Checked;
     307end;
     308
     309procedure TfrmHunSpell.cbIgnoreDigitClick(Sender: TObject);
     310begin
     311  if SpellCheck1.IgnoreWordWithDigits <> cbIgnoreDigit.Checked then
     312    SpellCheck1.IgnoreWordWithDigits := cbIgnoreDigit.Checked;
     313end;
     314
    298315procedure TfrmHunSpell.edtDictionaryEnter(Sender: TObject);
    299316begin
     
    308325     NoEngineOpted := True;
    309326  end;
     327
     328  if cbIgnoreAllCaps.Checked <> SpellCheck1.IgnoreAllCaps then
     329    cbIgnoreAllCaps.Checked := SpellCheck1.IgnoreAllCaps;
     330
     331  if cbIgnoreDigit.Checked <> SpellCheck1.IgnoreWordWithDigits then
     332    cbIgnoreDigit.Checked := SpellCheck1.IgnoreWordWithDigits;
    310333end;
    311334
     
    320343  else
    321344        ShowMessage(TX_SPELL_CANCELLED) ;  }
     345end;
     346
     347procedure TfrmHunSpell.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     348begin
     349  CanClose := (SpellCheck1.SpellCheckState <> ssChecking)
     350               or (SpellCheck1.AbortSpellCheck(True));
     351  if CanClose then
     352     ModalResult := mrCancel;
    322353end;
    323354
Note: See TracChangeset for help on using the changeset viewer.