Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » how to auto resizing composite
how to auto resizing composite [message #437222] Fri, 23 September 2005 13:19 Go to next message
Eclipse UserFriend
Originally posted by: bdberry.us.ibm.com

I have a TabFolder that contains a ScrolledComposite which contains a
Composite that contains a Group which then contains my GUI controls (ie
buttons, text boxes etc). Right now I am using a GridLayout and
GridData at each level and I am specifying GridData.widthHint to get the
size I want on the screen. How can I have the contents of the TabFolder
resize in proportion to the EditorPart when the user resizes the screen
or maximizes the editor? Currently, when the window is resized the GUI
elements stay in the same spot without moving.
Re: how to auto resizing composite [message #437224 is a reply to message #437222] Fri, 23 September 2005 13:39 Go to previous messageGo to next message
arne anka is currently offline arne ankaFriend
Messages: 133
Registered: July 2009
Senior Member
if i understand right:

GridData gd=new GridData();
gd.verticalAlignment = GridData.FILL;
gd.horizontalAlignment = GridData.FILL;
gd.grabExcessHorizontalSpace = true;//maybe not necessary
gd.grabExcessVerticalSpace = true;//maybe not necessary

and don't forget to say your ScrolledComposite

scroll.setExpandHorizontal(true);
scroll.setExpandVertical(true);
scroll.setMinSize(xx, yy);//maybe not necessary
Re: how to auto resizing composite [message #437227 is a reply to message #437224] Fri, 23 September 2005 16:21 Go to previous message
Ben Brown is currently offline Ben BrownFriend
Messages: 23
Registered: July 2009
Junior Member
Yeah Arne has it right, I was doing something that sounds almost exactly
what you are trying to do. One of the problems that I was having though
was that I was setting the scroll.setExpandHorizontal(true) before I had
populated the composite. This was causing the composite to expand to
fill the scrolled composite, but when the scrolled composite would
shrink the composite would not give up its excess horizontal space, a
very vexing problem. So just as a word of caution set the expand
horizontal to true after you're done with the underlying composite.

arne anka wrote:
> if i understand right:
>
> GridData gd=new GridData();
> gd.verticalAlignment = GridData.FILL;
> gd.horizontalAlignment = GridData.FILL;
> gd.grabExcessHorizontalSpace = true;//maybe not necessary
> gd.grabExcessVerticalSpace = true;//maybe not necessary
>
> and don't forget to say your ScrolledComposite
>
> scroll.setExpandHorizontal(true);
> scroll.setExpandVertical(true);
> scroll.setMinSize(xx, yy);//maybe not necessary
Previous Topic:editorpart menuManager
Next Topic:Missing customized icon in program launcher
Goto Forum:
  


Current Time: Sat Dec 14 13:26:49 GMT 2024

Powered by FUDForum. Page generated in 0.02839 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top