[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about Main Dictionaries



Hi Glenn,
further to my question of last week (we've now bought the components and are
very pleased with them), I have a query about MainDictionaries.

How do I activate a main dictionary? I can get them to appear on the list of
main dictionaries, but I cannot get them to be ticked (enabled)
programatically. Here's a snippet of the code I'm using to set up the main
dictionaries. Basically, we need to enable two dictionaries, English and
Technical, by default.

var
  EnglishMainDictionary: TMainDictionary;
  TechnicalMainDictionary: TMainDictionary;

  EnglishDictionary: String;
  TechnicalDictionary: String;
begin
  // Previously, the second entry in the ConfigDictionaryDir property has
been set up with
  // the directory containing the main dictionaries.

  AddictSpell.ConfigDefaultMain.Clear;
  AddictSpell.MainDictionaries.Clear;

  // Function to return the Filename of the English Dictionary into
EnglishDictionary
  GetStandardDictionaryPath('EnglishDictionary', Application,
EnglishDictionary);

  // Function to return the Filename of the Technical Dictionary into
TechnicalDictionary
  GetStandardDictionaryPath('TechnicalDictionary', Application,
TechnicalDictionary);

  // Add the two dictionaries to the Main Dictionary Listing
  AddictSpell.ConfigDefaultMain.Add(EnglishDictionary);
  AddictSpell.ConfigDefaultMain.Add(TechnicalDictionary);

  // Activate the two dictionaries
  EnglishMainDictionary := TMainDictionary.Create;
  EnglishMainDictionary := AddictSpell.GetMainDictionary(EnglishDictionary);
  EnglishMainDictionary.Loaded := True;

  TechnicalMainDictionary := TMainDictionary.Create;
  TechnicalMainDictionary :=
AddictSpell.GetMainDictionary(TechnicalDictionary);
  TechnicalMainDictionary.Loaded := True;

  etc...

This code doesn't enable either of them, but both are in the Main
Dictionaries List. It takes the user to go in and check them to enable them.
Similarily, ActiveCustomDictionary doesn't enable (tick) the custom
dictionary I've set up, but words seem to be saved to it nevertheless.

I get the feeling I'm missing something incredibly basic here, but what
exactly is it?

Best,
Dave


--

Dave Moore
Senior Software Engineer
E.I.M.S. Ltd
E.I.M.S. House
8-10 Yelverton Road
Bournemouth - Dorset
BH1 1DF - United Kingdom
Tel: +44 (0)1202 55 55 33
email : address@hidden
Website: http://www.eims.biz

**********************************************************************
Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver
this message to anyone. In such case, you should destroy this message,
and notify us immediately. The contents of this e-mail or attachment may
contain software viruses which could damage your own computer system.
You should therefore carry out your own virus checks before opening the
attachment. Opinions, conclusions and other information expressed in
this message are not given or endorsed by us unless otherwise indicated
in writing by an authorized representative independently of this
message.
**********************************************************************




Please visit Addict Home Site.