Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem with removing/adding controls dynamically from a scrolledForm
Problem with removing/adding controls dynamically from a scrolledForm [message #465650] Fri, 16 December 2005 08:32 Go to next message
Roger Dudler is currently offline Roger DudlerFriend
Messages: 5
Registered: July 2009
Junior Member
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 #465654 is a reply to message #465650] Fri, 16 December 2005 09:50 Go to previous messageGo to next message
Eclipse UserFriend
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 #465658 is a reply to message #465654] Fri, 16 December 2005 11:57 Go to previous messageGo to next message
Roger Dudler is currently offline Roger DudlerFriend
Messages: 5
Registered: July 2009
Junior Member
Hmm, that would be one possibility, I think I will try this.
Re: Problem with removing/adding controls dynamically from a scrolledForm [message #465664 is a reply to message #465654] Fri, 16 December 2005 16:45 Go to previous message
Jeremy Dowdall is currently offline Jeremy DowdallFriend
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
>>
>
>
>
>
Previous Topic:TreeView and grid ...
Next Topic:Scrollbar resize on dynamic layout
Goto Forum:
  


Current Time: Sun Dec 08 18:49:10 GMT 2024

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

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

Back to the top