Spell CHecker
- TimStone
- Posts: 2954
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Spell CHecker
Many years ago I started integrating the Sentry Spell Checker ( Wintergreen Software ) into my application. They took the same SDK ( 32 bit ) and compiled it for 64bit systems, and then charged a $530 US upgrade fee. That seemed too steep so I have not done it. My clients want a spell checker in the program, so I didn't update my builds to 64 bit.
In doing some research this week, it would appear that Windows has an API that allows us to use the built in spell checker. Has anyone done any implementation of this ? If not, is anyone up to the challenge of making a library for FWH that allows us to use it ?
If I'm being inaccurate, what are others using as a spell checking tool in their programs. Surely your clients want this capability.
Thanks for your input(s).
In doing some research this week, it would appear that Windows has an API that allows us to use the built in spell checker. Has anyone done any implementation of this ? If not, is anyone up to the challenge of making a library for FWH that allows us to use it ?
If I'm being inaccurate, what are others using as a spell checking tool in their programs. Surely your clients want this capability.
Thanks for your input(s).
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- karinha
- Posts: 7932
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Spell CHecker
http://forums.fivetechsupport.com/viewtopic.php?f=6&t=10774&p=241299&hilit=corrector&sid=19ab1244d30a9b39b86a3691ac845e6d&sid=19ab1244d30a9b39b86a3691ac845e6d#p241299
http://fivewin.com.br/index.php?/topic/21809-autocomplete/&/topic/21809-autocomplete/?hl=autocomplete
http://rafaelfranklinmaia.blogspot.com/2009/10/corretor-ortografico-do-word-em.html
http://fivewin.com.br/index.php?/topic/26963-validar-um-texto-digitado-pelo-usu%C3%A1rio/
Regards.
http://fivewin.com.br/index.php?/topic/21809-autocomplete/&/topic/21809-autocomplete/?hl=autocomplete
http://rafaelfranklinmaia.blogspot.com/2009/10/corretor-ortografico-do-word-em.html
http://fivewin.com.br/index.php?/topic/26963-validar-um-texto-digitado-pelo-usu%C3%A1rio/
Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- TimStone
- Posts: 2954
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: Spell CHecker
I reviewed those but they all seem to go back to the same option which is to create a document in Word.
I add text to a memofield, press a spell check button, and the SDK checks the contents and allows for corrections. Having to go to Word intruduces a whole new layer of difficulty, especially since many of my clients do not have it.
Perhaps others have explored this.
I add text to a memofield, press a spell check button, and the SDK checks the contents and allows for corrections. Having to go to Word intruduces a whole new layer of difficulty, especially since many of my clients do not have it.
Perhaps others have explored this.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- Antonio Linares
- Site Admin
- Posts: 42513
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 73 times
- Contact:
Re: Spell CHecker
Dear Tim,
https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/SpellCheckerClient/cpp
File to compile:
https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/SpellCheckerClient/cpp/SampleSpellingClient.cpp
It seems as this is what we need to start building it
https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/SpellCheckerClient/cpp
File to compile:
https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/SpellCheckerClient/cpp/SampleSpellingClient.cpp
It seems as this is what we need to start building it
- Antonio Linares
- Site Admin
- Posts: 42513
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 73 times
- Contact:
Re: Spell CHecker
Much simpler ![Smile :-)](./images/smilies/icon_smile.gif)
It seems as all we need is to send a certain message to a RichEdit control:
IMF_SPELLCHECKING
Windows 8: If this flag is set, the rich edit control turns on spell checking. This option is turned off by default (0).
https://docs.microsoft.com/en-us/windows/win32/controls/em-setlangoptions
https://docs.microsoft.com/en-us/windows/win32/controls/em-getlangoptions
![Smile :-)](./images/smilies/icon_smile.gif)
It seems as all we need is to send a certain message to a RichEdit control:
IMF_SPELLCHECKING
Windows 8: If this flag is set, the rich edit control turns on spell checking. This option is turned off by default (0).
https://docs.microsoft.com/en-us/windows/win32/controls/em-setlangoptions
https://docs.microsoft.com/en-us/windows/win32/controls/em-getlangoptions
Re: Spell CHecker
Checked with TRichEdt class and run ok
Thanks Antonio
Code: Select all | Expand
#define EM_GETLANGOPTIONS (WM_USER + 121)
#define EM_SETLANGOPTIONS (WM_USER + 120)
#define IMF_SPELLCHECKING 0x0800
MENUITEM "EM_GETLANGOPTIONS" ACTION MsgInfo( SendMessage( oRtf:hWnd, EM_GETLANGOPTIONS, 0, 0 ) )
MENUITEM "EM_SETLANGOPTIONS" ACTION MsgInfo( SendMessage( oRtf:hWnd, EM_SETLANGOPTIONS, 0, IMF_SPELLCHECKING ) )
Thanks Antonio
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- TimStone
- Posts: 2954
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: Spell CHecker
Can you be more specific where you implemented this ? I wanted to test it with RichEdit5 but am not sure to what .prg, and where, you are adding this ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Re: Spell CHecker
Try with this sample
https://bitbucket.org/fivetech/fivewin- ... strtf5.zip
1.- Open any .rtf file
2.- MENU - FILE - EM_SETLANGOPTIONS
3.- Write in your document any word in spanish or other language or any word incorrect
Tell me if run ok for you
https://bitbucket.org/fivetech/fivewin- ... strtf5.zip
1.- Open any .rtf file
2.- MENU - FILE - EM_SETLANGOPTIONS
3.- Write in your document any word in spanish or other language or any word incorrect
Tell me if run ok for you
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- TimStone
- Posts: 2954
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: Spell CHecker
Thank you. When doing step 2, nothing displays to "set".
When I type in an error, it shows the line underneath the mispelled word but there is no dictionary or spelling correction offered.
You mentioned using an .RTF file. In the past, RichEdit was supposed to work with MEMO ( .FPT ) fields but I never was successful with that. Is that a possiblility now, or would we need to only use .rtf files? My goal has been to take "boring" text stored in the .fpt files, be able to make them "look nicer" in RTF, and keep them stored in the .FPT file. Initially that file would be a mix of plain text and RTF. I was told it was possible, but never got it to save.
Thanks for responding.
When I type in an error, it shows the line underneath the mispelled word but there is no dictionary or spelling correction offered.
You mentioned using an .RTF file. In the past, RichEdit was supposed to work with MEMO ( .FPT ) fields but I never was successful with that. Is that a possiblility now, or would we need to only use .rtf files? My goal has been to take "boring" text stored in the .fpt files, be able to make them "look nicer" in RTF, and keep them stored in the .FPT file. Initially that file would be a mix of plain text and RTF. I was told it was possible, but never got it to save.
Thanks for responding.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- Antonio Linares
- Site Admin
- Posts: 42513
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 73 times
- Contact:
Re: Spell CHecker
Dear Tim,
Have you tried to left click on such line ?
When I type in an error, it shows the line underneath the mispelled word but there is no dictionary or spelling correction offered.
Have you tried to left click on such line ?
- TimStone
- Posts: 2954
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: Spell CHecker
I have tried all combinations of clicks, right, left, single, double. It sees the word misspelled but offers no dictionary options are displayed.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- TimStone
- Posts: 2954
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: Spell CHecker
I would like to clarify my questions:
1). The spell checker, in this example, does underline inorrectly spelled words, but it does not provide any alternatives.
2) What is the purpose of SET_LANG_OPTIONS
3). The same capability for checking spelling does not seem to apply to the FUNCTION. Is it doable ?
4). Can this work with existing .FPT files to retrieve and save RichText formatted text ?
Thank you.
1). The spell checker, in this example, does underline inorrectly spelled words, but it does not provide any alternatives.
2) What is the purpose of SET_LANG_OPTIONS
3). The same capability for checking spelling does not seem to apply to the FUNCTION. Is it doable ?
4). Can this work with existing .FPT files to retrieve and save RichText formatted text ?
Thank you.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Spell CHecker
1). The spell checker, in this example, does underline inorrectly spelled words, but it does not provide any alternatives.
Yes.
2) What is the purpose of SET_LANG_OPTIONS
There are many options that can be set.
For list, please see :https://docs.microsoft.com/en-us/windows/win32/controls/em-getlangoptions
Out of all the options, only the IMF_SPELLCHECKING option is useful to us.
In case you are programming for touch keyboard, other option IMF_TKBAUTOCORRECTION may interest you.
3). The same capability for checking spelling does not seem to apply to the FUNCTION. Is it doable ?
Which Function?
4). Can this work with existing .FPT files to retrieve and save RichText formatted text ?
Yes.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- TimStone
- Posts: 2954
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: Spell CHecker
I was told to build testrtf5.prg in the last Samples folder. I did that. ( 64 bit )
GET or SET Language Options show me blank screens.
I tried putting in IMF_SPELLCHECKING=1 which I assume would turn it on, but it doesn't save the value.
Again, I'm working with FWH64, Harbour64, and MSVS 2022 in Windows 11.
GET or SET Language Options show me blank screens.
I tried putting in IMF_SPELLCHECKING=1 which I assume would turn it on, but it doesn't save the value.
Again, I'm working with FWH64, Harbour64, and MSVS 2022 in Windows 11.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Re: Spell CHecker
hi,
this line in Sample "enable" Spellchecker
as you can see you need SendMessage() to "enable" it
p.s. work also with HMG and Xbase++ but IMF_TKBAUTOCORRECTION only with Table-PC
GET or SET Language Options show me blank screens.
this line in Sample "enable" Spellchecker
Code: Select all | Expand
MENUITEM "EM_SETLANGOPTIONS" ;
ACTION ( SendMessage( oRtf:hWnd, EM_SETLANGOPTIONS, 0, nOr( IMF_SPELLCHECKING, IMF_TKBPREDICTION, IMF_TKBAUTOCORRECTION ) ) )
I tried putting in IMF_SPELLCHECKING=1 which I assume would turn it on, but it doesn't save the value.
as you can see you need SendMessage() to "enable" it
p.s. work also with HMG and Xbase++ but IMF_TKBAUTOCORRECTION only with Table-PC
greeting,
Jimmy
Jimmy