Cryogen2003
Advanced Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору Procedure TdmdMain.SetSpellChecker(IsUse: Boolean); Var Temp: TdxSpellCheckerDictionaryItem; TempPath: String; Begin If IsUse Then Begin Try TempPath := dmdMain.IniOptions.MyDocFolder + ReportLocalDir + DelimChar; dxSpellChecker1.AutoLoadDictionaries := False; dxSpellChecker1.CheckAsYouTypeOptions.Active := False; dxSpellChecker1.DictionaryItems.Clear; {$I-} If (FileExists(TempPath + EnglishAff)) And (FileExists(TempPath + EnglishDic)) Then Begin Temp := dxSpellChecker1.DictionaryItems.Add; Temp.DictionaryTypeClass := TdxOpenOfficeDictionary; TdxOpenOfficeDictionary(Temp.DictionaryType).DictionaryPath := TempPath + EnglishDic; TdxOpenOfficeDictionary(Temp.DictionaryType).GrammarPath := TempPath + EnglishAff; TdxOpenOfficeDictionary(Temp.DictionaryType).Enabled := True; End; If (FileExists(TempPath + RussianAff)) And (FileExists(TempPath + RussianDic)) Then Begin Temp := dxSpellChecker1.DictionaryItems.Add; Temp.DictionaryTypeClass := TdxOpenOfficeDictionary; TdxOpenOfficeDictionary(Temp.DictionaryType).DictionaryPath := TempPath + RussianDic; TdxOpenOfficeDictionary(Temp.DictionaryType).GrammarPath := TempPath + RussianAff; TdxOpenOfficeDictionary(Temp.DictionaryType).Enabled := True; End; If ((FileExists(TempPath + RussianAff)) And (FileExists(TempPath + RussianDic))) Or ((FileExists(TempPath + EnglishAff)) And (FileExists(TempPath + EnglishDic))) Then Begin Temp := dxSpellChecker1.DictionaryItems.Add; Temp.DictionaryTypeClass := TdxUserSpellCheckerDictionary; TdxUserSpellCheckerDictionary(Temp.DictionaryType).Enabled := False; TdxUserSpellCheckerDictionary(Temp.DictionaryType).DictionaryPath := TempPath + UserDic; TdxUserSpellCheckerDictionary(Temp.DictionaryType).Enabled := True; dxSpellChecker1.AutoLoadDictionaries := True; dxSpellChecker1.CheckAsYouTypeOptions.Active := True; dxSpellChecker1.UseThreadedLoad := True; dxSpellChecker1.LoadDictionaries; dxSpellCheckerSpellingOptionsDialogClass := TSpellingOptionsForm; End; {$I+} Except End; End Else Begin dxSpellChecker1.AutoLoadDictionaries := False; dxSpellChecker1.CheckAsYouTypeOptions.Active := False; dxSpellChecker1.DictionaryItems.Clear; dxSpellChecker1.UnloadDictionaries; End; End; |