FormLayout in Editor [message #294198] |
Sun, 06 November 2005 13:27 |
Eclipse User |
|
|
|
Originally posted by: bbieth.free.fr
Hello,
I got several problem in designing an Editor :
Here is what I want to do :
http://perso.wiskee.com/temp/layout.jpg
On the rigth side, there is a section which contain a FormText.
When I set a long text, the text area grow horizontaly, and my editor
looks ugly :
http://perso.wiskee.com/temp/big-editor.jpg
(the cursor is in the middle because the main section has the same width
than the comment section ...)
Here is the code :
....
private Section commentSection;
private FormText txtComment;
....
// make the comment section
// ------------------------------------------------------------ ------
commentSection= toolkit.createSection( parent, SWT.NONE );
commentSection.setText( Messages.Section_Commentaire.msg() );
toolkit.createCompositeSeparator( commentSection);
// my comment section doesn't have a vertical scroll bar for now
// but doesn't matter
txtComment = toolkit.createFormText( commentSection, true );
commentSection.setClient( txtComment );
....
// set the form data of the comment section
// ------------------------------------------------------------ ------
fd = new FormData();
fd.top = new FormAttachment( mainSection, 10, SWT.BOTTOM );
fd.left = new FormAttachment( 0, 10 );
fd.right = new FormAttachment( mainSection, 0, SWT.RIGHT );
commentSection.setLayoutData( fd );
// set the text
// ------------------------------------------------------------ ------
txtComment.setText( "very long text ...", true, true );
// reflow
// ------------------------------------------------------------ ------
form.reflow( true );
// => the reflow lead to the oversize
Any idea ?
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.25716 seconds