Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Layout Problems
Layout Problems [message #814436] Tue, 06 March 2012 12:55 Go to next message
Matthias F is currently offline Matthias F
Messages: 15
Registered: June 2011
Junior Member
Hi, I am having some problems with a swt layout and was hoping someone can give me a hint.

I have a FormPage with some sections. The FormPage body has a GridLayout with 1 column. One of the sections uses GridData.FILL_BOTH. The others only fill horizontal.
The section's client has a FillLayout and a FigureCanvas is drawn inside.

When I open the FormPage every thing is fine. The section is as big as it should be and the canvas fills the section. I can add figures to the canvas and the canvas gets scrollbars when there are too many figures inside.

However, when I open the formpage when there already are many figures inside the canvas then the whole section gets bigger and the scrollbars are attached to the formpage.

I guess this happens because the canvas calculates its size using the preffered size of the figures and the hints. As long as the hints are bigger on startup, everything is fine.

All I want is that the canvas always has the same size, as the sections or as the the sections above.

I have attached two images. I hope they show the issue.

  • Attachment: false.jpg
    (Size: 26.46KB, Downloaded 77 times)
  • Attachment: ok.jpg
    (Size: 21.82KB, Downloaded 73 times)
Re: Layout Problems [message #814462 is a reply to message #814436] Tue, 06 March 2012 13:33 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph Keimel
Messages: 353
Registered: December 2010
Location: Germany
Senior Member
imho the FigureCanvas needs to be scrollable, i. e. Subclass of ScrolledComposite.
Re: Layout Problems [message #814465 is a reply to message #814462] Tue, 06 March 2012 13:38 Go to previous message
Matthias F is currently offline Matthias F
Messages: 15
Registered: June 2011
Junior Member
The FigureCanvas is scrollable. When more figures are added to the canvas so the initial size is to small, the scrollbars become visible and only the canvas is scrollable. So when the section already has scrollbars and then figures are added to the canvas, there are two scrollbars. One for the canvas and one for the section...
Previous Topic:Text control + VerifyListener => Undo broken?
Next Topic:SWT Browser User-agent
Goto Forum:
  


Current Time: Thu Sep 18 18:06:28 GMT 2014

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

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