Problem with justify in TPrintPreview

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Problem with justify in TPrintPreview

Postby Seb@stieN » October 24th, 2003, 3:52 pm

If i open a RTF file with JUSTIFY paragraphe the preview don't justify can u help me?
Seb@stieN
Active Member
Active Member
 
Posts: 10
Joined: May 28th, 2003, 7:41 pm

Postby Kambiz » October 24th, 2003, 7:13 pm

I checked it out with v4.30 of TPrintPreview, and there was no pronlem.
Could you please post your RTF file here?
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby Seb@stieN » October 27th, 2003, 11:05 am

I you're General Demo with sample file it's Ok
but
IN RichText Demo it's not OK the text it's not JUSTIFY with you're sample file. WHY and EXISTING A SOLUTION ? ? ?
Seb@stieN
Active Member
Active Member
 
Posts: 10
Joined: May 28th, 2003, 7:41 pm

Postby Seb@stieN » October 27th, 2003, 4:37 pm

To fix this problem i found a solution but it not very good but it work in version >2
IN
Code: Select all
PaintRichText

I ADD Declaration
Code: Select all
const
  EM_SETTYPOGRAPHYOPTIONS = WM_USER + 202;
  TO_ADVANCEDTYPOGRAPHY   = 1;

AND
Code: Select all
SendMessage(RichEdit.Handle, EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY, TO_ADVANCEDTYPOGRAPHY);

BEFORE
Code: Select all
Range.chrg.cpMin := SendMessage(RichEdit.Handle, EM_FORMATRANGE, 1, integer(@Range));


---
You can Change
TCustomRichEdit
BY
TCustomMemo
With this change you can use JvRichEdit and LMDRichEdit
Sory for my bad ENGLISH
Seb@stieN
Active Member
Active Member
 
Posts: 10
Joined: May 28th, 2003, 7:41 pm

Postby Kambiz » October 27th, 2003, 11:32 pm

Thanks Sebastian for the fix.

At least on Windows XP there's no problem with rendering justified rich text with the TPrintPreview component. The component doen't render the text itself, and it's the Windows's task to do it. Maybe there's a bug on some versions of common controls, however I don't know about it and it's not my fault, please don't blame me.

In addition, I won't change the parameter's type from TCustomRichEdit to TCustomMemo. A memo control doesn't support EM_FORMATRANGE message. If a rich edit control wrongly drived from a TCustomEdit instead of a TCustomRichEdit, I might not do the same mistake, shall I? If you are sure that the control is a rich edit, type cast it as what it should be, and pass it to the method.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby Seb@stieN » October 28th, 2003, 7:51 am

I don't blame you.
In internet i found Doc in Richedit controle and there are many version.

You can found some Doc :
http://home.att.net/~robertdunn/Yacs.html (for BCB)

You're preview it's very good
Seb@stieN
Active Member
Active Member
 
Posts: 10
Joined: May 28th, 2003, 7:41 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 38 guests

cron