1) In a row, within a column of xBrowse and possible, in a sentence put a word in bold?
Sample: "Teste de mensagem para xbrowser"
#include "fivewin.ch
//----------------------------------------------------------------------------//
function XbrHilite
local oDlg, oBrw, oFont, oBold
local cWordHL := PadR( "ONE", 10 )
local aData := ;
{ { 1, "One day" } ;
, { 2, "Good one" } ;
, { 3, "There is none" } ;
, { 4, "This is clone" } ;
, { 5, "This one is good" } ;
}
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-16
DEFINE FONT oBold NAME "VERDANA" SIZE 0,-16 BOLD UNDERLINE
DEFINE DIALOG oDlg SIZE 500,250 PIXEL TRUEPIXEL FONT oFont
@ 20,20 GET cWordHL SIZE 200,28 PIXEL OF oDlg VALID ( oBrw:Refresh(), .t. )
@ 55,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg DATASOURCE aData AUTOCOLS ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:nStretchCol := 2
:aCols[ 2 ]:bPaintText := <|oCol, hDC, cText, aRect, aColors|
FW_SayTextHilite( hDC, cText, aRect, oFont, aColors[ 1 ], aColors[ 2 ], ;
{ { AllTrim( cWordHL ), oBold, CLR_HRED, CLR_HGREEN } } )
return nil
>
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont, oBold
return nil
//----------------------------------------------------------------------------//
oliveiros junior wrote:Mr. Nages,
I ask if it would be possible at runtime to fill the array with the words for highlighting?
Att.,
Oliveiros Junkor
oliveiros junior wrote:Mr. Nages,
Another thing, when using FW_SayTextHilite in multilines he doesn't respect the line break, he writes everything in succession.
Ex: Linha1
Linha2
After FW_SayTextHilite
Linha1Linha2
Att.,
Oliveiros Junior
oliveiros junior wrote:Mr. Nages,
just one more thing: if we put an image in the bottom of the browser, when the word in hilite is at the beginning of the sentence it shows well, but if it is in the middle of the sentence, it puts a white background, not respecting the image of the.
Att.,
Oliveiros Junior
You keep aHilite as static variable.
Fill the array with { { <word>, oFont, [nTxtClr],[nBkClr] } }
Then call oBrw:Refresh()
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 83 guests