Scrollbar resize on dynamic layout [message #465613] |
Thu, 15 December 2005 23:38 |
Adam 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 |
Adam 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 |
Jeremy Dowdall 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
|
|
|
Powered by
FUDForum. Page generated in 0.03678 seconds