Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Resizing Nightmares(Having trouble implementing non-default behavior when resizing)
Resizing Nightmares [message #1803816] Mon, 11 March 2019 12:27
Mark Mising name is currently offline Mark Mising nameFriend
Messages: 73
Registered: July 2009
Location: Ohio, USA
Member
In a Shell, I have a ScrolledComposite which contains a Composite which contains a vertical RowLayout of StyledText widgets. When launched, the enclosing Shell window is auto-sized to the contents of the ScrolledComposite which tightly wraps the Composite (which is auto-sized to the contents of the StyledText). When I shrink the enclosing Shell window from the initial size, the scrollbars appear and I can use them to reveal the hidden parts of my content. When I expand the window beyond it's initial size, then there is simply empty space filling in the gaps. This is all behaving as designed, I think, but not according to the behavior I want.

The behavior I want is that when the Shell window is shrunk horizontally, it forces all the content to shrink accordingly, including the StyledText widgets, causing them to line-wrap. If any of them line-wrap, the Composite containing them should grow vertically even though the ScrolledComposite doesn't grow vertically, thus only the vertical scrollbar appears. I want the horizontal shrinking of the Composite to continue only to a certain minimum width, then the horizontal scrollbar appears.

Another behavior I want is the initial width of the Composite (and thus, the StyledText widgets) to be fixed, not fit-to-contents.

That said, I've had a devil of a time over the last week getting this to work the way I desire. I've tried other layouts (RowLayout, GridLayout, FillLayout, and FormLayout) and while some of them have given me partially what I want (e.g., FormLayout lets the StyleText widgets resize, but doesn't let the scrollbars kick in when the wrapping causes vertical growth), none of them give me everything I want.

So, I figured that before I waste another week without results, I'd ask the really smart people on this forum for their advice.

What is the recommended approach to getting what I want while minimizing the amount of custom code needed to implement this behavior??

Mark
Previous Topic:Using XWorker to develop SWT & RAP Programs
Next Topic:launching the web browser
Goto Forum:
  


Current Time: Mon May 06 16:44:23 GMT 2024

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

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

Back to the top