DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with justify in TPrintPreview

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
Seb@stieN
Member


Joined: 28 May 2003
Posts: 5

PostPosted: 24/10/03 15:52    Post subject: Problem with justify in TPrintPreview Reply with quote

If i open a RTF file with JUSTIFY paragraphe the preview don't justify can u help me?
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 234

PostPosted: 24/10/03 19:13    Post subject: Reply with quote

I checked it out with v4.30 of TPrintPreview, and there was no pronlem.
Could you please post your RTF file here?
Back to top
View user's profile Send e-mail Visit poster's website
Seb@stieN
Member


Joined: 28 May 2003
Posts: 5

PostPosted: 27/10/03 11:05    Post subject: Reply with quote

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 ? ? ?
Back to top
View user's profile
Seb@stieN
Member


Joined: 28 May 2003
Posts: 5

PostPosted: 27/10/03 16:37    Post subject: Reply with quote

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

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

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

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


---
You can Change
Quote:
TCustomRichEdit
BY
Quote:
TCustomMemo
With this change you can use JvRichEdit and LMDRichEdit
Sory for my bad ENGLISH
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 234

PostPosted: 27/10/03 23:32    Post subject: Reply with quote

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.
Back to top
View user's profile Send e-mail Visit poster's website
Seb@stieN
Member


Joined: 28 May 2003
Posts: 5

PostPosted: 28/10/03 07:51    Post subject: Reply with quote

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
Back to top
View user's profile
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group