Wordwrap -> Different ways to wrap ??

General TRichView support forum. Please post your questions here
Post Reply
Bonny
Posts: 10
Joined: Mon Jun 04, 2007 1:58 pm

Wordwrap -> Different ways to wrap ??

Post by Bonny »

Hi,


By default, RichViewEdit does do a wordwrap. It wraps whole words to the next line.

I would like to see the behaviour where a word is just cut in half (whenever the cursor reaches the end of the component's area) and typing continues at the next line.
(This is common behaviour for Microsoft's RichText)

Is there a way to get this behaviour with RichViewEdit?

I found the option "rvpaoNoWrap" but then the user can simply continue typing beyond the component's area.


Thanks for all replies,

Bonny
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, richviewedit cannot break words automatically
Bonny
Posts: 10
Joined: Mon Jun 04, 2007 1:58 pm

Post by Bonny »

Thank you for your reply.

Do you think this would be easy to implement?
I would like to have your opinion on this.


Regards,

Bonny
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

do you mean implementation of grammatically correct word breaking?
Bonny
Posts: 10
Joined: Mon Jun 04, 2007 1:58 pm

Post by Bonny »

No.

For example I have a textbox which can only show 10 characters (in some given width). Then if I type "ABCD EFGHIJKLMNOP" then I want the text box to display:

ABCD EFGHI
JKLMNOP

So it doesnt wrap "EFGHIJKLMNOP" to next line, but simply stops at the end of the top line, and continues at 2nd line.


Would this be possible with TRichView?
Would this be "easy" to add to TRichView?


Regards,
Bonny Gijzen
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TRichView breaks words which are wider than the document width. But at first it attempts to break line on spaces.
In your example, it will break after ABCD, and then, if necessary, it will break inside EFGHIJKLMNOP.
As I understand, you want an option for breaking in arbitrary place. Can you explain when it may be needed?
Bonny
Posts: 10
Joined: Mon Jun 04, 2007 1:58 pm

Post by Bonny »

Hi,

>In your example, it will break after ABCD, and then, if necessary, it will break inside EFGHIJKLMNOP

Correct, but I don't want it to break after ABCD.
I want it to break after "ABCD EFGHI".

In our software (currently using MS RichText) we would like the user to type and position the text as user sees fit, without any forced word-wrap whatsoever.

The software is used to control a LED display with same dimensions (width and height in characters).


So would such a wrap be possible within TRichView ?

Ideally, it would be a generic update to TRichView, so it has 3 kinds of wordwrap modes:

1) Wrap at some delimiter (like space or comma)
2) Wrap at end (right side) of edit box (this is what I need)
3) No wrap (just continue typing and Hscrollbar appears)


Rgs Bonny,,
Bonny
Posts: 10
Joined: Mon Jun 04, 2007 1:58 pm

Post by Bonny »

up
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I'll add it in the next update.
Bonny
Posts: 10
Joined: Mon Jun 04, 2007 1:58 pm

Post by Bonny »

Thank you for your support.

We will do more tests when your new version is released.


Regards,

Bonny
Bonny
Posts: 10
Joined: Mon Jun 04, 2007 1:58 pm

Post by Bonny »

Additional information:

I noticed there is an option called "MaxLength"
If I set that to value 13, then I can only type 13 characters and then it breaks to next line.

At first this looked very promising for my "no word break" request.
I simply calculate how many characters are visible, 13 in my case, so after 13 characters it simply breaks to new line. GREAT!

BUT, after more testing 2 issues arrised:

1) Still RichViewEdit does do word breaking when I type a space.
2) In Arabic language, there are some characters which are stored as 2 bytes (both in ascii as in unicode). So when typing that character I could only type it 6 times (and not 13!)

So this is not suitable for me. I must have a break procedure which uses the true right edge of the component (instead of counting chars).

This is just for your reference.


Regards and thanks so far,

Bonny
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Updated version with the new option RichViewWrapAnywhere is uploaded.
Post Reply