Dear Antonio (or dear all)
I wish as U some questions on trichedit class only 8 small question ...
because I need it for a application and I compiled the testrtf,prg to see what I have and I rewrite a small rtfpad (from testrtf.prg)

I add a second bar down the first and not when I open a file rtf ( as testrtf.prg)
1. question
on testrtf.prg there is a save function
the file can be txt or rtf
cFile := Upper( cFile ) + If( ! "." $ cFile, If( nGetFileFilter() == 1, ".RTF", ".TXT" ), "" )
but on tichedit class I not found the possibility to set the format of the file
on include there are also
#define SF_TEXT 1
#define SF_RTF 2
but I not found any sample on testrtf to use or save a rtf file into txt
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 Question
I wish create a lines as this picture

and on testrtf.rtf I found also there is the possibility to insert also Hyperlink but I not found the methods on trichedit class
I thinked to create these new methods
seeing the METHOD SetAttribute on trichedit class
then I not found RESetAttribute( ::hWnd, nMask, nEffects, lOnOff ) to make RESetAttribute2( ::hWnd, nMask, nEffects, lOnOff )
perhaps Antonio can Help us
---------------------------------------------------------------------------------------------------------------------------------------------
3 Question
I wish set the paragraph of the text but I not found a sample into testrtf.prg
but I found some methods :
aIndent := ortf:GetIndent() give me the left , right and first line ( izquierda,derecha,primeralinea)
ortf:GetParagraph() give me two parametes before and after
ortf:GetAlign() give me the type of align
On winword I have this dialog

then I thinked to create this dialog

with ortf:GetParagraph() I have two parameters but I need the spaces I found (tab spaces) how I can make ?
---------------------------------------------------------------------------------------------------------------------------------------------
4 Question
I found on testrtf.prg the find function
ok . I can find a word but...
how I can replace a word with another ?
and if I must replace all same words with another ?
wich is the method make it ?
I need it also to make a procedure of merge with fields from a dbf
---------------------------------------------------------------------------------------------------------------------------------------------
5 Question
I can change the color of the text with ortf:SetTextColor( ChooseColor( ncolor ) )
but I not have the ncolor current of the text how I can found it ?
---------------------------------------------------------------------------------------------------------------------------------------------
6 Question
When I open a rtf file ( as you can see on first picture of this message ) I see the file into the window main
but how I can show the file as our rpreview ( type printer layout ) as we see it on winword or wordpad application ?
---------------------------------------------------------------------------------------------------------------------------------------------
7 Question
I remember there was a function called SHFileProperty() and I found also a sample on .\samples of fwh
I need it to show the property of the file from rtfpad , why this function there was not on new fwh release ?
---------------------------------------------------------------------------------------------------------------------------------------------
8 Question
How I can insert object into rtfile sample I need to insert tables or excel or another object from a extern application ?
thanks
I wish as U some questions on trichedit class only 8 small question ...
because I need it for a application and I compiled the testrtf,prg to see what I have and I rewrite a small rtfpad (from testrtf.prg)

I add a second bar down the first and not when I open a file rtf ( as testrtf.prg)
1. question
on testrtf.prg there is a save function
static function Save()
聽 聽local cFile := cGetFile( "Rich Text Format (*.rtf) |*.rtf|" + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "Only Text Format (*.txt) |*.txt", ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "Please write a filename", nGetFileFilter(),, .t. )
聽 聽if !Empty( cFile )
聽 聽 聽 cFile := Upper( cFile ) + If( ! "." $ cFile, If( nGetFileFilter() == 1, ".RTF", ".TXT" ), "" )
聽 聽 聽 oRTF:SaveToRTFFile( cFile )
聽 聽 聽 oRTF:SetClear()
聽 聽endif
return nilthe file can be txt or rtf
cFile := Upper( cFile ) + If( ! "." $ cFile, If( nGetFileFilter() == 1, ".RTF", ".TXT" ), "" )
but on tichedit class I not found the possibility to set the format of the file
on include there are also
#define SF_TEXT 1
#define SF_RTF 2
but I not found any sample on testrtf to use or save a rtf file into txt
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 Question
I wish create a lines as this picture

and on testrtf.rtf I found also there is the possibility to insert also Hyperlink but I not found the methods on trichedit class
I thinked to create these new methods
seeing the METHOD SetAttribute on trichedit class
聽 聽METHOD SetAttribute2( lUpp, lSup, lSub, lOnOff )
聽 聽METHOD SetUpperCaps( lOnOff ) INLINE ::SetAttribute2( .T.,,,,, 聽lOnOff )
聽 聽METHOD SetSupScript( lOnOff ) INLINE ::SetAttribute2( , .T.,,,, lOnOff )
聽 聽METHOD SetSubScript( lOnOff ) INLINE ::SetAttribute2( ,, .T.,,, lOnOff )
聽 聽METHOD SetHiddenTxt( lOnOff ) INLINE ::SetAttribute2( ,,, .T.,, lOnOff )
聽 聽METHOD SetHyperLink( lOnOff ) INLINE ::SetAttribute2( ,,,, .T., lOnOff )
METHOD SetAttribute2( lUpper, lSuper, lSub, lHidden, lLink, lOnOff ) CLASS TRichEdit
聽 聽LOCAL nMask, nEffects
聽 聽DEFAULT lUpper 聽:= .F., ;
聽 聽 聽 聽 聽 聽lSuper 聽:= .F., ;
聽 聽 聽 聽 聽 聽lSub 聽 聽:= .F., ;
聽 聽 聽 聽 聽 聽lHidden := .F., ;
聽 聽 聽 聽 聽 聽lLink 聽 := .F., ;
聽 聽 聽 聽 聽 聽lOnOff 聽:= .T.
聽 聽if ( lUpper .or. lHidden ) .and. ! ::lRE30
聽 聽 聽 RETURN NIL
聽 聽endif
聽 聽nMask := nOr( If( lUpper, 聽CFM_ALLCAPS, 聽 聽 0 ), ;
聽 聽 聽 聽 聽 聽 聽 聽 聽If( lSuper, 聽CFM_SUPERSCRIPT, 0 ), If( lSub, 聽CFM_SUBSCRIPT, 0 ), ;
聽 聽 聽 聽 聽 聽 聽 聽 聽If( lHidden, CFM_HIDDEN, 聽 聽 聽0 ), If( lLink, CFM_LINK, 聽 聽 聽0 ) )
聽 聽nEffects := nOr( If( lUpper, 聽CFE_ALLCAPS, 聽 聽 0 ), ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 If( lSuper, 聽CFE_SUPERSCRIPT, 0 ), If( lSub, 聽CFE_SUBSCRIPT, 0 ), ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 If( lHidden, CFE_HIDDEN, 聽 聽 聽0 ), If( lLink, CFE_LINK, 聽 聽 聽0 ) )
聽 聽RESetAttribute2( ::hWnd, nMask, nEffects, lOnOff )
RETURN NILthen I not found RESetAttribute( ::hWnd, nMask, nEffects, lOnOff ) to make RESetAttribute2( ::hWnd, nMask, nEffects, lOnOff )
perhaps Antonio can Help us
---------------------------------------------------------------------------------------------------------------------------------------------
3 Question
I wish set the paragraph of the text but I not found a sample into testrtf.prg
but I found some methods :
aIndent := ortf:GetIndent() give me the left , right and first line ( izquierda,derecha,primeralinea)
ortf:GetParagraph() give me two parametes before and after
ortf:GetAlign() give me the type of align
On winword I have this dialog

then I thinked to create this dialog

with ortf:GetParagraph() I have two parameters but I need the spaces I found (tab spaces) how I can make ?
---------------------------------------------------------------------------------------------------------------------------------------------
4 Question
I found on testrtf.prg the find function
ok . I can find a word but...
how I can replace a word with another ?
and if I must replace all same words with another ?
wich is the method make it ?
I need it also to make a procedure of merge with fields from a dbf
---------------------------------------------------------------------------------------------------------------------------------------------
5 Question
I can change the color of the text with ortf:SetTextColor( ChooseColor( ncolor ) )
but I not have the ncolor current of the text how I can found it ?
---------------------------------------------------------------------------------------------------------------------------------------------
6 Question
When I open a rtf file ( as you can see on first picture of this message ) I see the file into the window main
but how I can show the file as our rpreview ( type printer layout ) as we see it on winword or wordpad application ?
---------------------------------------------------------------------------------------------------------------------------------------------
7 Question
I remember there was a function called SHFileProperty() and I found also a sample on .\samples of fwh
I need it to show the property of the file from rtfpad , why this function there was not on new fwh release ?
---------------------------------------------------------------------------------------------------------------------------------------------
8 Question
How I can insert object into rtfile sample I need to insert tables or excel or another object from a extern application ?
thanks
Since 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
