RichEdit5 and auto-texts

Re: RichEdit5 and auto-texts

Postby Natter » Sun Sep 29, 2024 12:45 pm

Unfortunately, this resource is still unavailable to me :(
Natter
 
Posts: 1208
Joined: Mon May 14, 2007 9:49 am


Re: RichEdit5 and auto-texts

Postby vilian » Mon Sep 30, 2024 11:49 am

cnavarro wrote:Dear Vilina, please attach your sample


Good Morning Cristobal,

I just changed in your example the arrays content for this:

static aListWords := { { "Action", "Ação" }, { "Palabra", "WORD" }, { "Inicial", "First" }, { "Final", "Last" } }

And created a new class from trichedit5

Code: Select all  Expand view
CLASS TVfaEdit  FROM TRichEdit5
   METHOD KeyDown( nKey, nFlags )
ENDCLASS  

METHOD KeyDown( nKey, nFlags ) CLASS TVfaEdit

   if ( nKey == VK_INSERT  .and. GetKeyState( VK_SHIFT ) .or. ;
        nKey == Asc( "V" ) .and. GetKeyState( VK_CONTROL ) )

      if ! ::lReadOnly
         ::Paste()
         ::PostMsg( FM_CHANGE )
      endif

      return 0
   endif

   if ::lReadOnly
      if nKey == VK_BACK .or. nKey == VK_DELETE .or. nKey == VK_RETURN
         return 0
      endif
   endif

   ::Super:KeyDown( nKey, nFlags )

   // Suggested by the user MaxP (Massimo): 11/22/2019, remove PostMsg
   //::PostMsg( FM_CHANGE )

   // Added by Cristobal Navarro
   if !::lReadOnly
      ::PostMsg( FM_CHANGE )
   endif

   if ::lHighlight
      if nKey == VK_DELETE .or. nKey == VK_BACK
         ::PostMsg( FM_HIGHLIGHT )
      endif
   endif

return nil
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 974
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: RichEdit5 and auto-texts

Postby cnavarro » Wed Oct 02, 2024 1:31 am

Dear Vilian
You have in your program this?
Code: Select all  Expand view


   HB_SETCODEPAGE( "UTF8" )
   Fw_SetUnicode( .T. )

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

Re: RichEdit5 and auto-texts

Postby vilian » Thu Oct 03, 2024 5:59 pm

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 974
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 73 guests