Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » Spelling Dictionary?
Spelling Dictionary? [message #21843] Mon, 08 June 2009 10:33 Go to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Spelling works fine in UWord, but not in my app that uses RichEdit. The toolbar appears just fine however the Language Selection combo box is empty. On UWord it contains EN-GB and EN-US.

Thanks,

Jeremy
Re: Spelling Dictionary? [message #21848 is a reply to message #21843] Mon, 08 June 2009 11:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jeremy_c wrote on Mon, 08 June 2009 04:33

Spelling works fine in UWord, but not in my app that uses RichEdit. The toolbar appears just fine however the Language Selection combo box is empty. On UWord it contains EN-GB and EN-US.

Thanks,

Jeremy



You have to copy .scd files from theide directory to your app dir.

Mirek
Re: Spelling Dictionary? [message #21849 is a reply to message #21848] Mon, 08 June 2009 11:40 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
luzr wrote on Mon, 08 June 2009 05:09


You have to copy .scd files from theide directory to your app dir.




Hm, that makes no difference. My .exe is in the same dir as the UWord.exe. (Just hitting CTRL+F5 right now to run them).

Jeremy
Re: Spelling Dictionary? [message #21865 is a reply to message #21849] Mon, 08 June 2009 18:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jeremy_c wrote on Mon, 08 June 2009 05:40

luzr wrote on Mon, 08 June 2009 05:09


You have to copy .scd files from theide directory to your app dir.




Hm, that makes no difference. My .exe is in the same dir as the UWord.exe. (Just hitting CTRL+F5 right now to run them).



Ah, I see.

Language is a text attribute (like font), with default value "None".

You have to set it to en-us.

Mirek
Re: Spelling Dictionary? [message #21867 is a reply to message #21865] Mon, 08 June 2009 19:41 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Ok, this is working now, thanks. Is this the right way to handle this problem?

String content = GetFromDb(); // dummy function for example sake

if (content.Find("[%EN-US") == -1)
{
    content = "[%EN-US " + content " +]");
    UpdateDb(content); // dummy function again
}

editor.SetData(content);


That seems a bit unintuitive. It is nice, however, that each document can contain it's own language attributes, however, I would think maybe RichEdit should contain a default language setting that if the doc does not specify, use it? i.e.

editor.SetDefaultLanguage("EN-US");


?

Jeremy
Re: Spelling Dictionary? [message #21869 is a reply to message #21867] Mon, 08 June 2009 19:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jeremy_c wrote on Mon, 08 June 2009 13:41

Ok, this is working now, thanks. Is this the right way to handle this problem?

String content = GetFromDb(); // dummy function for example sake

if (content.Find("[%EN-US") == -1)
{
    content = "[%EN-US " + content " +]");
    UpdateDb(content); // dummy function again
}

editor.SetData(content);


That seems a bit unintuitive. It is nice, however, that each document can contain it's own language attributes, however, I would think maybe RichEdit should contain a default language setting that if the doc does not specify, use it? i.e.

editor.SetDefaultLanguage("EN-US");


?

Jeremy



Well, obviously, the problem is the default language. I usually solve it by SetQTF("[%EN-US ") (actually, CS-CZ Smile in default constructor. In that case, if text is being created, it will get "EN-US" langauge.

Mirek
Re: Spelling Dictionary? [message #21871 is a reply to message #21869] Mon, 08 June 2009 19:50 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
I'm not sure what you mean by calling SetQtf("[%EN-US"); in the default constructor. The default of what? And isn't that a incomplete Qtf call? Also, what about the data that already exists in the editor or a language setting that may be present in the doc?

Sorry for so many questions, I'm just trying to get my hands around this fantastic control!

Jeremy
Re: Spelling Dictionary? [message #21874 is a reply to message #21871] Mon, 08 June 2009 23:04 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jeremy_c wrote on Mon, 08 June 2009 13:50

I'm not sure what you mean by calling SetQtf("



OK. Typical situation, you have DB app that processes some texts. In the process, there has to be some phase that some text is NEW. Perhaps you will have some dialog/window that will implement inserting new text. This way, you can tell that the language of first empty paragraph of text is en-us. Anything else you will write there will be en-us, until you will change it using language control in the toolbar.

That way, unless you change the language deliberately, all your text will inherit en-us.

Quote:


And isn't that a incomplete Qtf call?



QTF officially tolerates missing ']' Smile

Quote:


Also, what about the data that already exists in the editor or a language setting that may be present in the doc?



Well, that might be a sort of trouble. I would recommend "repair procedure" to the database if it is already in use and important. OTOH, if you are fixed in en-us, maybe ugly patch adding "[%en-us " before any stored text would do too...

Mirek

[Updated on: Mon, 08 June 2009 23:04]

Report message to a moderator

Previous Topic: Editor Toolbar
Next Topic: Spelling Button on RichEdit
Goto Forum:
  


Current Time: Fri Apr 19 21:56:03 CEST 2024

Total time taken to generate the page: 1.97452 seconds