Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Scrollbar resize on dynamic layout
Scrollbar resize on dynamic layout [message #465613] Thu, 15 December 2005 23:38 Go to next message
Adam is currently offline AdamFriend
Messages: 8
Registered: July 2009
Junior Member
Hello,
I've seen a few posts related to this but no solution, so I wanted
to ask a specific question:
I am dynamically adding components to an eclipse form. When
components are added past the visible, the scrollbar doesn't
change/appear until I manually resize the window.
I would like to be able to just call the method to resize and have
this work automatically, of course. I have tried layout() on the
parent, and the form, as well as redraw(), changed(), and maybe even a
few more things;) Also, it would be really nice not to have the
components that I'm adding require a handle to the top form.

thanks!
adam
Re: Scrollbar resize on dynamic layout [message #465640 is a reply to message #465613] Thu, 15 December 2005 23:46 Go to previous messageGo to next message
Adam is currently offline AdamFriend
Messages: 8
Registered: July 2009
Junior Member
ok - so I just found reflow() on the form. Is this the preferred
method? I don't like having the children know about form, but at least
it works. At any rate, maybe this will help someone else.

adam

Adam wrote:
> Hello,
> I've seen a few posts related to this but no solution, so I wanted to
> ask a specific question:
> I am dynamically adding components to an eclipse form. When
> components are added past the visible, the scrollbar doesn't
> change/appear until I manually resize the window.
> I would like to be able to just call the method to resize and have
> this work automatically, of course. I have tried layout() on the
> parent, and the form, as well as redraw(), changed(), and maybe even a
> few more things;) Also, it would be really nice not to have the
> components that I'm adding require a handle to the top form.
>
> thanks!
> adam
Re: Scrollbar resize on dynamic layout [message #465665 is a reply to message #465640] Fri, 16 December 2005 17:04 Go to previous message
Jeremy Dowdall is currently offline Jeremy DowdallFriend
Messages: 48
Registered: July 2009
Member
rather than passing handles all over, I started registering listeners:

for simple controls, such as a multi-line textbox, I have my form listen
for modify events, then calculate the height of the new text and
determine if a reflow is necessary.
when adding entire composites with lots of controls each, I ended up
extending the composite class and adding functionality so it could
monitor the sizes of its own controls and then fire a property change
event when they outgrew its current size - naturally, the form is
listening for this event and calls reflow if necessary.

the children aren't exactly "ignorant" of what's going on, but they
don't have to know about the form and, more importantaly, don't have
access to it, which gives all of my sizing/resizing a single top-down
command direction that has been much easier to debug and maintain
(somewhat like the request / command structure in GEF if you're looking
for more reading :) )


Adam wrote:
> ok - so I just found reflow() on the form. Is this the preferred
> method? I don't like having the children know about form, but at least
> it works. At any rate, maybe this will help someone else.
>
> adam
>
> Adam wrote:
>
>> Hello,
>> I've seen a few posts related to this but no solution, so I wanted
>> to ask a specific question:
>> I am dynamically adding components to an eclipse form. When
>> components are added past the visible, the scrollbar doesn't
>> change/appear until I manually resize the window.
>> I would like to be able to just call the method to resize and have
>> this work automatically, of course. I have tried layout() on the
>> parent, and the form, as well as redraw(), changed(), and maybe even a
>> few more things;) Also, it would be really nice not to have the
>> components that I'm adding require a handle to the top form.
>>
>> thanks!
>> adam
Previous Topic:Problem with removing/adding controls dynamically from a scrolledForm
Next Topic:JFace Document Class Missing
Goto Forum:
  


Current Time: Sun Aug 25 10:01:30 GMT 2019

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

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

Back to the top