Community
Participate
Working Groups
StyledText should support objects such as images or widgets embedded in the text. The text should flow around the objects (that is, it is not sufficient for an object to change the height of the row where it is anchored and force the remaining text down).
A nice enhancement is support of images as links. This means: 1) Image links participate in tabbing order 2) Focus indication is drown around them when in focus 3) Mouse changes when over the image link 4) Image can be changed when mouse is over ('hover' image) 5) The same event is fired as for textual links for enter, exit and activation. Also, image should be selectable with the rest of the text. It should be ignored in simple text clipboard content type but added in RTF content type.
Post 3.1.
*** Bug 103508 has been marked as a duplicate of this bug. ***
fixed in head > 20051122 we changed StyleRange to be a subclass of TextStyle, the new fields are Font font; int rise; GlyphMetrics metrics; StyledText still don't have javadoc for these new features but TextStyle and TextLayout are ready (java doc + snippets). The code is still very new and we are aware of some redraw problems, any help testing/fixing is welcome. Soon I'll add javadoc and snippets to the SWT homepage. --- The embedded images/controls use StyleRange#metrics; StyledText#addPaintObjectListener() PaintObjectEvent PaintObjectListener --- Dejan, I moved your comments to bug 83408, I think they belong there.
The size of embedded controls\objects should be configurable. Taking the control tag support in FormText as a reference then the equivalent functionality would be to have width and height attributes on the control tag.
The height and width are already configurable. See: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet212.java?rev=HEAD&content-type=text/vnd.viewcvs-markup StyleRange style = new StyleRange (); style.start = offset; style.length = 1; Rectangle rect = image.getBounds(); style.metrics = new GlyphMetrics(rect.height, 0, rect.width); styledText.setStyleRange(style);