Richedit enhancement

Richedit enhancement

Postby Gianni » Tue Jun 10, 2008 5:15 pm

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.
Gianni
 
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am

Postby StefanHaupt » Wed Jun 11, 2008 7:38 am

Gianni,

the structure PARAFORMAT is already supported, see method ::SetParaFormat ()
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Postby Gianni » Wed Jun 11, 2008 7:50 am

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.
Gianni
 
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am

Postby Antonio Linares » Wed Jun 11, 2008 2:21 pm

Gianni,

Here you have an example of its use in Class TRichEdit:
Code: Select all  Expand view  RUN
METHOD SetAlign( nAlign ) CLASS TRichEdit

   DEFAULT nAlign := PFA_LEFT

   RESetParaFormat( ::hWnd, nAlign )

   ::Change()

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Gianni » Wed Jun 11, 2008 3:12 pm

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?
Gianni
 
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am

Postby StefanHaupt » Thu Jun 12, 2008 7:52 am

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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Postby Antonio Linares » Thu Jun 12, 2008 8:52 am

Gianni,

Grids seem ok here:
Image

You can easily modify RESETPARAFORMAT() to support those struct members:
Code: Select all  Expand view  RUN
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Gianni » Thu Jun 12, 2008 10:03 am

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  Expand view  RUN
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
Gianni
 
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am

Postby Antonio Linares » Thu Jun 12, 2008 10:30 am

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Gianni » Thu Jun 12, 2008 11:32 am

Great!!!
I will waiting for it.

Many thanks
Ciao
Gianni
Gianni
 
Posts: 30
Joined: Fri Oct 07, 2005 6:58 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 57 guests