Richedit enhancement

Post Reply
Gianni
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am

Richedit enhancement

Post by Gianni »

Hi Antonio,
are you thinking about implementing "PARAFORMAT" indenting in richedit control ?

Ciao
Gianni
Last edited by Gianni on Thu Jun 12, 2008 7:17 am, edited 1 time in total.
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Gianni,

the structure PARAFORMAT is already supported, see method ::SetParaFormat ()
kind regards
Stefan
Gianni
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am

Post by Gianni »

Stefan,

where is ::SetParaFormat () method?
I cannot found it in my Trichedi.prg
My version is FWH 8.05

Regards
Last edited by Gianni on Thu Jun 12, 2008 7:17 am, edited 1 time in total.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Gianni,

Here you have an example of its use in Class TRichEdit:

Code: Select all

METHOD SetAlign( nAlign ) CLASS TRichEdit

   DEFAULT nAlign := PFA_LEFT

   RESetParaFormat( ::hWnd, nAlign )

   ::Change()

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Gianni
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am

Post by Gianni »

Thanks Antonio, but I already know this.
I'm not talking about "align" support, but "indenting" support; so I can implement a ruler like "WordPad".
At this time there is no support for "paraformat" member in bold:
typedef struct _paraformat {
UINT cbSize;
DWORD dwMask;
WORD wNumbering;
WORD wReserved;
LONG dxStartIndent;
LONG dxRightIndent;
LONG dxOffset;

WORD wAlignment;
SHORT cTabCount;
LONG rgxTabs[MAX_TAB_STOPS];

} PARAFORMAT;
Another question:
If I open, for example, fiveodbc.rtf included in folder samples, all grids are wrong. Have you this problem too?
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Gianni wrote:Stefan,

where is ::SetParaFormat () method?
I cannot found it in my Trichedi.prg
Oops, should be ReSetParaFormat () as Antonbio said. Sorry.
kind regards
Stefan
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Gianni,

Grids seem ok here:
Image

You can easily modify RESETPARAFORMAT() to support those struct members:

Code: Select all

HB_FUNC( RESETPARAFORMAT )
{
   PARAFORMAT pf;

   memset( ( char * ) &pf, 0, sizeof( pf ) );

   pf.cbSize = sizeof( pf );
   pf.dwMask = PFM_ALIGNMENT;
   pf.wAlignment |= hb_parnl( 2 );

   hb_retl( SendMessage( ( HWND ) hb_parnl( 1 ), EM_SETPARAFORMAT, 0,
                         ( LPARAM ) &pf ) );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
Gianni
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am

Post by Gianni »

Antonio Linares wrote:Gianni,

Grids seem ok here:
Image
this seems ok, but if you go a little forward (about half rtf) you can see another grid, with longer text inside, that don't resize its height to contain all text. Compare it opening same rtf with WordPad

Antonio Linares wrote:You can easily modify RESETPARAFORMAT() to support those struct members:

Code: Select all

HB_FUNC( RESETPARAFORMAT )
{
   PARAFORMAT pf;

   memset( ( char * ) &pf, 0, sizeof( pf ) );

   pf.cbSize = sizeof( pf );
   pf.dwMask = PFM_ALIGNMENT;
   pf.wAlignment |= hb_parnl( 2 );

   hb_retl( SendMessage( ( HWND ) hb_parnl( 1 ), EM_SETPARAFORMAT, 0,
                         ( LPARAM ) &pf ) );
}
Thanks.
So, are you not implementing anything about this in near future?

Regards
Gianni
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Gianni,

We are going to provide new enhancements for Class TRichEdit, and we will probably implement this too :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Gianni
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am

Post by Gianni »

Great!!!
I will waiting for it.

Many thanks
Ciao
Gianni
Post Reply