|
|
Re: swapping composites [message #449209 is a reply to message #449142] |
Wed, 19 January 2005 15:11 |
Eclipse User |
|
|
|
Originally posted by: betan.us.ibm.com
This is a multipart message in MIME format.
--=_alternative 00536C1D85256F8E_=
Content-Type: text/plain; charset="US-ASCII"
A simpler answer... just use compositeName.setVisibile(false) when you
want to "move" the composite to the "back" and
compositeName2.setVisible(true) to "move" the other composite to the
"front."
--=_alternative 00536C1D85256F8E_=
Content-Type: text/html; charset="US-ASCII"
<br><font size=2 face="sans-serif">A simpler answer... just use compositeName.setVisibile(false)
when you want to "move" the composite to the "back"
and compositeName2.setVisible(true) to "move" the other composite
to the "front."</font>
--=_alternative 00536C1D85256F8E_=--
|
|
|
Re: swapping composites [message #449210 is a reply to message #449209] |
Wed, 19 January 2005 15:20 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
It's even easier. Use a StackLayout on the outer composite, and then set
the layout's topControl field to the control to be on top and then call
layout() on the outer composite.
That is exactly what StackLayout is for, switching in composited.
--
Thanks,
Rich Kulp
|
|
|
|
Re: swapping composites [message #449306 is a reply to message #449129] |
Thu, 20 January 2005 19:53 |
Eclipse User |
|
|
|
Originally posted by: wiz.vball.net
Look at StackLayout
it allows you to create multiple controls that sit on top of each
other and using
stack.topControl = composite1;
or
stack.topControl = composite2;
you can switch between different composites and keep them in memory
(cache)...
you can keep an array of children composites and keep this as your
cache holder with the StackLayout set on the parent component...
then in your next or previous handlers you can check to see where you
are currently in the array and if the cache is full and you need a new
composite then simply remove one from the array (either from beginning
or end of array depending on whether going forward or backward) and
replace it with your new composite.
On Tue, 18 Jan 2005 15:43:58 -0000, "Andy Harrison"
<andyh@agaricus.co.uk> wrote:
>I'm writing a pocket pc application. I have a class which creates a GUI with
>two panels (Composites). The top composite is for displaying the pages from
>a form, the bottom is for next / previous buttons to swap between the pages
>of that form.
>
>I have worked out a procedure for swapping the form in the top panel. I got
>the idea from Snippet98, "Create and dispose of children of a composite.".
>
>when the "next" button is pressed...
>
>1. The next form page (composite) is created and attached to the shell
>2. This new page is passed into an object of the GUI class which:
>2.1. Disposes of the existing "previous" form
>2.2. Attaches new form to the GUI (by calling Composite.setParent)
>2.3. Refreshes the display as required
>
>My question is ... say I want to cache the pages of the form. Is it possible
>to have several Composites ready to drop in, but not visible or attached to
>anything? Say the user presses "previous" button - I can swap in the
>previous page and its state, including any data that was already typed in.
>
>Is this a useful thing to do anyway? I could keep a cache of a certain size
>so as not to use too many resources?
>
>Any comments would be appreciated. I am new to SWT and Java in general, so I
>am experimenting with ideas like this for my application. I did read that it
>is better to have one shell in a pocket pc app and to swap composites around
>(but maybe not like this!).
>
>thanks,
>Andy
>
|
|
|
Powered by
FUDForum. Page generated in 0.02777 seconds