Home » U++ Library support » RichText,QTF,RTF... » Spelling Dictionary?
Spelling Dictionary? [message #21843] |
Mon, 08 June 2009 10:33  |
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 #21869 is a reply to message #21867] |
Mon, 08 June 2009 19:46   |
 |
mirek
Messages: 14255 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 in default constructor. In that case, if text is being created, it will get "EN-US" langauge.
Mirek
|
|
|
|
Re: Spelling Dictionary? [message #21874 is a reply to message #21871] |
Mon, 08 June 2009 23:04  |
 |
mirek
Messages: 14255 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 ']' 
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
|
|
|
Goto Forum:
Current Time: Sat Apr 26 15:04:11 CEST 2025
Total time taken to generate the page: 0.00626 seconds
|