| View previous topic :: View next topic |
| Author |
Message |
Seb@stieN Member
Joined: 28 May 2003 Posts: 5
|
Posted: 24/10/03 15:52 Post subject: Problem with justify in TPrintPreview |
|
|
| If i open a RTF file with JUSTIFY paragraphe the preview don't justify can u help me? |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 234
|
Posted: 24/10/03 19:13 Post subject: |
|
|
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 |
|
 |
Seb@stieN Member
Joined: 28 May 2003 Posts: 5
|
Posted: 27/10/03 11:05 Post subject: |
|
|
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 |
|
 |
Seb@stieN Member
Joined: 28 May 2003 Posts: 5
|
Posted: 27/10/03 16:37 Post subject: |
|
|
To fix this problem i found a solution but it not very good but it work in version >2
IN
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 BY With this change you can use JvRichEdit and LMDRichEdit
Sory for my bad ENGLISH |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 234
|
Posted: 27/10/03 23:32 Post subject: |
|
|
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 |
|
 |
Seb@stieN Member
Joined: 28 May 2003 Posts: 5
|
Posted: 28/10/03 07:51 Post subject: |
|
|
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 |
|
 |
|