Community
Participate
Working Groups
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.
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.
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.
PRODUCT VERSION: 134 or earlier