Page 2 of 2

Re: RichEdit5 and auto-texts

Posted: Sun Sep 29, 2024 12:45 pm
by Natter
Unfortunately, this resource is still unavailable to me :(

Re: RichEdit5 and auto-texts

Posted: Sun Sep 29, 2024 1:33 pm
by Enrico Maria Giordano

Re: RichEdit5 and auto-texts

Posted: Mon Sep 30, 2024 11:49 am
by vilian
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

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

Re: RichEdit5 and auto-texts

Posted: Wed Oct 02, 2024 1:31 am
by cnavarro
Dear Vilian
You have in your program this?

Code: Select all | Expand


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

 

Re: RichEdit5 and auto-texts

Posted: Thu Oct 03, 2024 5:59 pm
by vilian
Dear Cristobal,

Yes. Here is my complete code:

https://drive.google.com/file/d/1BitXsw ... drive_link