Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Layout Problems
Layout Problems [message #814436] Tue, 06 March 2012 07:55 Go to next message
Eclipse UserFriend
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: ok.jpg
    (Size: 21.82KB, Downloaded 194 times)
  • Attachment: false.jpg
    (Size: 26.46KB, Downloaded 191 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
Eclipse UserFriend
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
Eclipse UserFriend
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: Tue Jul 22 18:52:27 EDT 2025

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

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

Back to the top