RichEdit5 and auto-texts

RichEdit5 and auto-texts

Postby vilian » Thu Sep 19, 2024 2: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
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: RichEdit5 and auto-texts

Postby Antonio Linares » Fri Sep 20, 2024 6:53 am

Dear Vilian,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RichEdit5 and auto-texts

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

Re: RichEdit5 and auto-texts

Postby karinha » Fri Sep 20, 2024 3:05 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: RichEdit5 and auto-texts

Postby vilian » Fri Sep 20, 2024 5: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
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: RichEdit5 and auto-texts

Postby karinha » Fri Sep 20, 2024 5:49 pm

Maybe:

https://regexr.com/

Sds,

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: RichEdit5 and auto-texts

Postby vilian » Fri Sep 20, 2024 6: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
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: RichEdit5 and auto-texts

Postby karinha » Fri Sep 20, 2024 6: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
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: RichEdit5 and auto-texts

Postby vilian » Fri Sep 20, 2024 6: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
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: RichEdit5 and auto-texts

Postby cnavarro » Sat Sep 21, 2024 9:17 am

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 view

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

Re: RichEdit5 and auto-texts

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

Re: RichEdit5 and auto-texts

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

Re: RichEdit5 and auto-texts

Postby Natter » Sun Sep 29, 2024 6: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 :(
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: RichEdit5 and auto-texts

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

Re: RichEdit5 and auto-texts

Postby Enrico Maria Giordano » Sun Sep 29, 2024 12:38 pm

cnavarro wrote:I download it without problem


Me too.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests

cron