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

Added few options to SpellChecker which persists beyond current session

Location:
cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/Demo
Files:
3 edited

Legend:

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

    r1715 r1718  
    1616  OnActivate = FormActivate
    1717  OnClose = FormClose
     18  OnCloseQuery = FormCloseQuery
    1819  OnCreate = FormCreate
    1920  PixelsPerInch = 96
     
    197198  object RichEdit1: TRichEdit
    198199    Left = 3
    199     Top = 57
     200    Top = 76
    200201    Width = 726
    201     Height = 205
     202    Height = 186
    202203    Lines.Strings = (
    203204      'Type orr Paste heree the text '
     
    228229    OnClick = btnCloseClick
    229230  end
     231  object cbIgnoreAllCaps: TCheckBox
     232    Left = 131
     233    Top = 54
     234    Width = 178
     235    Height = 17
     236    Caption = 'Ignore words in &UpperCase'
     237    TabOrder = 6
     238    OnClick = cbIgnoreAllCapsClick
     239  end
     240  object cbIgnoreDigit: TCheckBox
     241    Left = 339
     242    Top = 53
     243    Width = 166
     244    Height = 17
     245    Caption = 'Ignore words with &digits'
     246    TabOrder = 7
     247    OnClick = cbIgnoreDigitClick
     248  end
    230249  object OpenDialog1: TOpenDialog
    231250    DefaultExt = '*.Dict'
  • 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.