Page 1 of 1

Richedit enhancement

Posted: Tue Jun 10, 2008 5:15 pm
by Gianni
Hi Antonio,
are you thinking about implementing "PARAFORMAT" indenting in richedit control ?

Ciao
Gianni

Posted: Wed Jun 11, 2008 7:38 am
by StefanHaupt
Gianni,

the structure PARAFORMAT is already supported, see method ::SetParaFormat ()

Posted: Wed Jun 11, 2008 7:50 am
by Gianni
Stefan,

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

Regards

Posted: Wed Jun 11, 2008 2:21 pm
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


Posted: Wed Jun 11, 2008 3:12 pm
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?

Posted: Thu Jun 12, 2008 7:52 am
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.

Posted: Thu Jun 12, 2008 8:52 am
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 ) );
}

Posted: Thu Jun 12, 2008 10:03 am
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

Posted: Thu Jun 12, 2008 10:30 am
by Antonio Linares
Gianni,

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

Posted: Thu Jun 12, 2008 11:32 am
by Gianni
Great!!!
I will waiting for it.

Many thanks
Ciao
Gianni