FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour RichEdit5 and auto-texts
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
RichEdit5 and auto-texts
Posted: Thu Sep 19, 2024 02:40 PM

Hi Guys,

Do you know if is possible to do auto-texts with this class ?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 06:53 AM

Dear Vilian,

What do you mean with auto-text ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 10:57 AM

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?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 03:05 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 05:03 PM
Dear Karinha,

Thank you, but I'm trying to do this with RICHEDIT 5, not with Word.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 05:49 PM
Maybe:

https://regexr.com/

Sds,

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 06:22 PM
Sorry my friend, but I didn't understand how could it help me to do auto-texts with Richedit5 ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 06:38 PM

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.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: RichEdit5 and auto-texts
Posted: Fri Sep 20, 2024 06:57 PM
But the user doesn't have Word installed in your computer. Because this, I'm trying to do this trought Richedit5
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: RichEdit5 and auto-texts
Posted: Sat Sep 21, 2024 09:17 AM
Dear Vilian
Please test this sample
https://bitbucket.org/fivetech/fivewin-contributions/downloads/testrtf7.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 (fw): Select all Collapse
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
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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: RichEdit5 and auto-texts
Posted: Mon Sep 23, 2024 11:18 AM
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 ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: RichEdit5 and auto-texts
Posted: Sat Sep 28, 2024 11:16 PM

Dear Vilina, please attach your sample

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
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: RichEdit5 and auto-texts
Posted: Sun Sep 29, 2024 06:22 AM
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 :(
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: RichEdit5 and auto-texts
Posted: Sun Sep 29, 2024 11:48 AM
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-contributions/downloads/testrtf7.prg
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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: RichEdit5 and auto-texts
Posted: Sun Sep 29, 2024 12:38 PM
cnavarro wrote:I download it without problem
Me too.