RichEdit5 and auto-texts

User avatar
vilian
Posts: 984
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

RichEdit5 and auto-texts

Post by vilian »

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
User avatar
Antonio Linares
Site Admin
Posts: 42268
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: RichEdit5 and auto-texts

Post by Antonio Linares »

Dear Vilian,

What do you mean with auto-text ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 984
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: RichEdit5 and auto-texts

Post 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?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: RichEdit5 and auto-texts

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
vilian
Posts: 984
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: RichEdit5 and auto-texts

Post by vilian »

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
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: RichEdit5 and auto-texts

Post by karinha »

Maybe:

https://regexr.com/

Sds,

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
vilian
Posts: 984
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: RichEdit5 and auto-texts

Post by vilian »

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
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: RichEdit5 and auto-texts

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
vilian
Posts: 984
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: RichEdit5 and auto-texts

Post by vilian »

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
User avatar
cnavarro
Posts: 6552
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: RichEdit5 and auto-texts

Post 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
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
User avatar
vilian
Posts: 984
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: RichEdit5 and auto-texts

Post 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 ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
cnavarro
Posts: 6552
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: RichEdit5 and auto-texts

Post by cnavarro »

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
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: RichEdit5 and auto-texts

Post 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 :(
User avatar
cnavarro
Posts: 6552
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: RichEdit5 and auto-texts

Post 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
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
Post Reply