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 07:55 Go to next message
Matthias F is currently offline Matthias F
Messages: 12
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 75 times)
  • Attachment: ok.jpg
    (Size: 21.82KB, Downloaded 70 times)
Re: Layout Problems [message #814462 is a reply to message #814436] Tue, 06 March 2012 08:33 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph Keimel
Messages: 332
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 08:38 Go to previous message
Matthias F is currently offline Matthias F
Messages: 12
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: Mon Jul 28 16:38:40 EDT 2014

Powered by FUDForum. Page generated in 0.03149 seconds