|
Re: Problem with removing/adding controls dynamically from a scrolledForm [message #465654 is a reply to message #465650] |
Fri, 16 December 2005 09:50 |
Eclipse User |
|
|
|
Originally posted by: osipov.appliedtech.ru
I am not sure whether I am answering correctyl. Just guessing, as I don't
know what a ScrolledForm is. Anyway org.eclipse.swt.custom.StackLayout helps
you to hide some things on a composite and show other. Intuitively, it works
like bring to front and back, so to speak.
> Hi,
>
> I have a problem with my ScrolledForm in our application. I can
> dynamically add my sections and controls using
>
> Section section = new Section(...);
>
> and reflow the form. That works.
>
> But how can i remove for example the last section and add another one?
>
> Is this made with disposing or recreating the form, i have no idea.
>
> Thanks for answer
>
|
|
|
|
Re: Problem with removing/adding controls dynamically from a scrolledForm [message #465664 is a reply to message #465654] |
Fri, 16 December 2005 16:45 |
Jeremy Dowdall Messages: 48 Registered: July 2009 |
Member |
|
|
if you want to be able to switch between the two (or more), then
stacklayout is the way to go. if you want to replace a section and get
rid of the old, then you'll need to dispose the old and add the new.
if disposing and adding is messing up the order of sections (say you
want to replace the second section in a vertical list of 5 sections,
disposing it and adding a new one will add a section in position 5) then
you'll have to reset their drawing order. I've been doing this with
setParent() - set the parent of the sections to something else (can't be
null), and then call setParent(originalParent) on the sections in the
correct drawing order...
hope this helps!
Peter Osipov wrote:
> I am not sure whether I am answering correctyl. Just guessing, as I don't
> know what a ScrolledForm is. Anyway org.eclipse.swt.custom.StackLayout helps
> you to hide some things on a composite and show other. Intuitively, it works
> like bring to front and back, so to speak.
>
>>Hi,
>>
>>I have a problem with my ScrolledForm in our application. I can
>>dynamically add my sections and controls using
>>
>>Section section = new Section(...);
>>
>>and reflow the form. That works.
>>
>>But how can i remove for example the last section and add another one?
>>
>>Is this made with disposing or recreating the form, i have no idea.
>>
>>Thanks for answer
>>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03253 seconds