Bug 4820 - StyledText with style SINGLE does not handle CR/LF well (1GJM2Z5)
Summary: StyledText with style SINGLE does not handle CR/LF well (1GJM2Z5)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-11 14:23 EDT by Carolyn MacLeod CLA
Modified: 2001-10-29 16:41 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2001-10-11 14:23:33 EDT
Open the SWT Control example.
	Go to the Text page.
	The widget on the bottom is a StyledText.
	Click on the SINGLE radio.
	Note that the text used to populate the single line text widgets actually has 2 lines.
	Note that the second line is sort-of there in the StyledText - but it is invisible.
	(You can actually move the caret through the text, but the text (One, Two, Three) is not there).
	In addition, you can drag-scroll the text down until you see nothing, but you cannot drag-scroll
	the text back up, because there is no actual selection. You have to place the caret in the invisible
	section and then use the up arrow in order to see the quick brown fox text (line 1) again.

	The odd behavior is the same on Windows and Linux.

	Perhaps StyledText in SINGLE mode should treat CR and LF the same way that Text treats them,
	i.e. just show the black box character(s) and pretend they have no special meaning.

	I do not think this is high priority as very few people will ever use StyledText in SINGLE mode,
	but it should probably be fixed someday.

NOTES:

LK (06/09/2001 11:51:55)
	We actually did look into how other text widgets handle this.  I think we followed
	what RichText did.
Comment 1 Knut Radloff CLA 2001-10-15 13:44:38 EDT
The fact that you can place the caret in the invisible text wouldn't worry me 
much because a StyledText in single line mode would normally be sized so that 
only the single line is visible. However, it is clearly wrong that you can drag 
scroll down to the invisible text.
Note that I can drag scroll back up.
Comment 2 Knut Radloff CLA 2001-10-15 14:32:17 EDT
Fixed in > 2.004 (Eclipse). When in single line mode mouse clicks place the 
caret on the first line only, line down will not work (and thus mouse drag 
select will stay on the first line) and content end will be the equivalent of 
line end.
Comment 3 DJ Houghton CLA 2001-10-29 16:41:05 EST
PRODUCT VERSION:
	134 or earlier