Page 1 of 1
Wordwrap -> Different ways to wrap ??
Posted: Mon Jun 04, 2007 2:05 pm
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
Posted: Mon Jun 04, 2007 5:59 pm
by Sergey Tkachenko
Sorry, richviewedit cannot break words automatically
Posted: Tue Jun 05, 2007 8:16 am
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
Posted: Tue Jun 05, 2007 6:26 pm
by Sergey Tkachenko
do you mean implementation of grammatically correct word breaking?
Posted: Tue Jun 19, 2007 12:06 pm
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
Posted: Wed Jun 20, 2007 1:12 pm
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?
Posted: Fri Jun 22, 2007 7:36 am
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,,
Posted: Tue Jun 26, 2007 11:31 am
by Bonny
up
Posted: Tue Jul 03, 2007 4:46 pm
by Sergey Tkachenko
I'll add it in the next update.
Posted: Wed Jul 04, 2007 11:18 am
by Bonny
Thank you for your support.
We will do more tests when your new version is released.
Regards,
Bonny
Posted: Fri Jul 06, 2007 7:54 am
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
Posted: Tue Jul 10, 2007 2:27 pm
by Sergey Tkachenko
Updated version with the new option RichViewWrapAnywhere is uploaded.