FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Richedit how to highlight a defined word in memofields ?
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Richedit how to highlight a defined word in memofields ?
Posted: Sat Mar 24, 2018 11:07 AM
ukoenig wrote:Crist贸bal,

thank You very much.
That is exactly the solution I've been looking for :-)
A clean textpreview without any flickering.

Now I can finish the forum-sample-import.

regards
Uwe :-)


Ok, Uwe, I am glad that it works correctly and to be able to help you
You can use the DATA nClrKey1 as an array and be able to assign each word a different color, and use in your function THIGHLIGHT as oCode:nClrKey1[ x ]
Remember that there is also the DATA aKeyWords2 and DATA nClrKey2
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: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Richedit how to highlight a defined word in memofields ?
Posted: Sat Mar 24, 2018 11:37 AM
Antonio Linares wrote:Could we create a PRG to import all forums posts to a DBF ? :-)

How to know how many posts a forum has ?

How to know in a specific topic, what the next post ?

Could we have a function ForumGetPost( ... ) that returns an array or an object with ?

1. Title (topic)
2. Date
3. Author
4. Next post in topic
5. Contents
6. Forum that belongs to
7. number of views (?)
8. what else ?

that would be great! :-)


Most of this is already done by Uwe in this topic. viewtopic.php?f=3&t=35170
Not in 1 function.., but very interesting as utility.
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Richedit how to highlight a defined word in memofields ?
Posted: Mon Mar 26, 2018 07:45 AM
Crist贸bal ,

using 2 different keywords and colours is working fine.
I noticed a little problem to display more than one keyword in the same line

Your included functions and new testdata.
http://www.pflegeplus.com/DOWNLOADS/Richedit4.zip



Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Richedit how to highlight a defined word in memofields ?
Posted: Mon Mar 26, 2018 10:56 AM
Uwe, easy, look

Code (fw): Select all Collapse
FUNCTION THIGHLIGHT( nLine, oCode )
LOCAL cLine := ""
LOCAL nAt1  := 0
LOCAL nAt2  := 0
LOCAL nPos1 := 0
LOCAL nPos2 := 0
LOCAL x

//   oCode:GoTo( nLine - 1 )
//   cLine       := Upper( oCode:GetLine( nLine ) )

FOR x = 1 to Len( oCode:aKeyWords1 )
   // Move here
   oCode:GoTo( nLine - 1 )
   cLine       := Upper( oCode:GetLine( nLine ) )
    IF !Empty( oCode:aKeyWords1[ x ] )
        nAt1     := At( Upper( oCode:aKeyWords1[ x ] ), cLine )
        IF nAt1 > 0
            nPos1   := oCode:GetPos() + nAt1 - 1
            nPos2   := nPos1 + Len( oCode:aKeyWords1[ x ] )
            oCode:Colorize( nPos1, nPos2, oCode:nClrKey1[ x ] )
        ENDIF
    ENDIF
NEXT x

RETURN NIL
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: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Richedit how to highlight a defined word in memofields ?
Posted: Mon Mar 26, 2018 12:10 PM
Crist贸bal,

that WORKS :-) :-)
a little change with big result.

thank You very much.

I'm just working on the forum-statistik using You forum-class
It will be a extra folderpage inside the SETUP-section ( a nice idea to complete it :-) )
NO need to start something extra.

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Richedit how to highlight a defined word in memofields ?
Posted: Mon Mar 26, 2018 12:14 PM

Uwe,

Since you see now the position and the count of the colored word into the text, maybe a button above the textfield with the name : "NEXT"

Every time we click on it, the cursor could move to the next colored text insite the textbox. Just a idea, but sure not a need !!

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Richedit how to highlight a defined word in memofields ?
Posted: Tue Mar 27, 2018 07:41 AM

Hey Uwe,

Could you make a pre release where the words are colored ? I use the program for all my search lookups and it would make it better to use.

If you prefer, you can also mail marc(at)maveco.be Thanks.

Marc Venken

Using: FWH 23.08 with Harbour

Continue the discussion