I have a richedit control with n 9 lines
I wish select one line but not with the mouse but select by a listbox
and focus only that line I tried making a Colorizeline(nLine,oRtf) function but it not run ok
any solution please ?
I wish select one line but not with the mouse but select by a listbox
and focus only that line I tried making a Colorizeline(nLine,oRtf) function but it not run ok
any solution please ?
#include "FiveWin.ch"
#include "constant.ch"
#include "RichEdit.ch"
Function test()
Local oLbx
local oDlg
local oRtf
Local cText:= "Test test test test test test test test test test test test "+CRLF+;
"Test test test test test test test test test test test test"+CRLF+;
"Test test test test test test test test test test test"+CRLF+;
"Test test test test test test test test test test"+CRLF+;
"Test test test test test test test test test "+CRLF+;
"Test test test test test test test test test "+CRLF+;
"Test test test test test test test"+CRLF+;
"Test test test test test test test"+CRLF+;
"Test test test test test test test"
local uTemp := If( ! Empty( cText ), cText, '' )
Local nBottom_c := 15
Local nRight_c := 75
Local nWidth_c := Max( nRight_c * DLG_CHARPIX_W, 180 )
Local nHeight_c := nBottom_c * DLG_CHARPIX_H
Local hDLL
local alevel := {"1","2","3","4","5","6","7","8","9"}
local nlevel := 1
Local oFontPreview:=TFont():New( GetSysFont(), -3, 5)
DEFINE DIALOG oDlg FROM 6, 6 TO 37, 71 ;
TITLE "test :"
oDlg:lTruePixel := .f.
hDLL = LoadLibrary( "Riched20.dll" )
@ 15, 71 RICHEDIT oRtf VAR uTemp OF oDlg PIXEL SIZE 175, 90 FONT oFontPreview NOBORDER NO SCROLL
@ 1,1 LISTBOX oLbx VAR nlevel ITEMS alevel OF oDlg size 20,100;
on change ( oRtf:goto( nlevel) , ;
Colorizeline(nLevel,oRtf) )
ACTIVATE DIALOG oDlg CENTER
oFontPreview:End()
if hDLL != nil
FreeLibrary( hDLL )
endif
return nil
//--------------------------------------------------------------------//
Function Colorizeline(nLine,oRtf)
oRtf:goto( nLine)
for nLine := 0 to nline
oRtf:HighLightLine( nLine )
SysRefresh()
next
return niSince from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com