Page 1 of 2
RichEdit5 and auto-texts
Posted: Thu Sep 19, 2024 2:40 pm
by vilian
Hi Guys,
Do you know if is possible to do auto-texts with this class ?
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 6:53 am
by Antonio Linares
Dear Vilian,
What do you mean with auto-text ?
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 10:57 am
by vilian
Antonio,
While the user is typing a text I would like to check the words inside a list and in case I find it, I would like to replace the word found for another text. Is it possible?
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 3:05 pm
by karinha
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 5:03 pm
by vilian
Dear Karinha,
Thank you, but I'm trying to do this with RICHEDIT 5, not with Word.
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 5:49 pm
by karinha
Maybe:
https://regexr.com/
Sds,
Regards, saludos.
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 6:22 pm
by vilian
Sorry my friend, but I didn't understand how could it help me to do auto-texts with Richedit5 ?
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 6:38 pm
by karinha
Vilian, if you have the text in Rich, just shoot it into the Word corrector. Or is it no use?
Vilian, si tienes el texto en Rich, simplemente dispáralo en el corrector de Word. ¿O no sirve de nada?
Regards, saludos.
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 6:57 pm
by vilian
But the user doesn't have Word installed in your computer. Because this, I'm trying to do this trought Richedit5
Re: RichEdit5 and auto-texts
Posted: Sat Sep 21, 2024 9:17 am
by cnavarro
Dear Vilian
Please test this sample
https://bitbucket.org/fivetech/fivewin- ... strtf7.prg
I hope you have understood what you are
saying
I have built an initial example that still has some details that do not work correctly: for the word to be replaced, a space must be pressed at the end and it does not take into account that you press ENTER / RETURN without first pressing the space key, but I want to make sure that I have understood your problem well and help you focus your development based on this example
You will also probably have to modify the Keydown method of the TRichEdt5 class by adding the following:
Code: Select all | Expand
METHOD KeyDown( nKey, nFlags ) CLASS TRichEdit5
.../...
// Suggested by the user MaxP (Massimo): 11/22/2019, remove PostMsg
//::PostMsg( FM_CHANGE )
// Added by Cristobal Navarro
if !::lReadOnly
::PostMsg( FM_CHANGE )
endif
.../...
Return nil
At the beginning of the example there is an array with the words to search for and the value to replace.
I look forward to your comments
Regards
Re: RichEdit5 and auto-texts
Posted: Mon Sep 23, 2024 11:18 am
by vilian
Dear Cristobal,
Thank you, your example does almost everything I needed. There is only a problem. I included in the array of words
{ "Action", "Ação" }, the first time this word is replaced, everything is fine. From the second ahead the word is staying like this:
Ação
Ação
Do you know why ?
Re: RichEdit5 and auto-texts
Posted: Sat Sep 28, 2024 11:16 pm
by cnavarro
Dear Vilina, please attach your sample
Re: RichEdit5 and auto-texts
Posted: Sun Sep 29, 2024 6:22 am
by Natter
Hi, Cristobal !
When I try to download your example, I get the following message
"
Error when establishing a secure connection"
I'm also very interested in the topic of auto-text. About 5 years ago I tried to do something like this for TGet/TMultiGet, but it was slow
Re: RichEdit5 and auto-texts
Posted: Sun Sep 29, 2024 11:48 am
by cnavarro
Natter wrote:Hi, Cristobal !
When I try to download your example, I get the following message
"
Error when establishing a secure connection"
I'm also very interested in the topic of auto-text. About 5 years ago I tried to do something like this for TGet/TMultiGet, but it was slow
I download it without problem,
Try again
https://bitbucket.org/fivetech/fivewin- ... strtf7.prg
Re: RichEdit5 and auto-texts
Posted: Sun Sep 29, 2024 12:38 pm
by Enrico Maria Giordano
cnavarro wrote:I download it without problem
Me too.