Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Z-Order of child widgets of a canvas
Z-Order of child widgets of a canvas [message #446051] Tue, 16 November 2004 22:49 Go to next message
Oliver Andrich is currently offline Oliver AndrichFriend
Messages: 18
Registered: July 2009
Junior Member
Hi,

I just toying around with SWT to evaluate its usage for our commercial
software and wether it is portable from SWING to SWT. After solving my
fonts issues at least for the Win32 platform, I have one last problem
left - Z-ordering the child widgets of a composite/canvas/etc.

I have a bunch of composites representing the layout elements on a page,
which itself is also represented by a composite. Now I like to achieve
something similar like in Swing. Newly added elements are added at the
front of the array of all child elements and are visible on the top.

By manipulating this array or something similar, I want to put the
composite on a lower "layer", so it is cover by other composites on a
higher layer.

Is this possible to achive in any easy way? I am already thinking about
having a bunch of composites inside the page composite to represent the
layers, and then moving the page element composites from one layer to
the next.

Any easier idea is highly appreciated. :)

Best regards,
Oliver
--
Oliver Andrich - http://fitheach.geekgoth.de/
Re: Z-Order of child widgets of a canvas [message #446052 is a reply to message #446051] Tue, 16 November 2004 23:01 Go to previous messageGo to next message
Oliver Andrich is currently offline Oliver AndrichFriend
Messages: 18
Registered: July 2009
Junior Member
Hi,

I have found the answer myself. Sometimes reading the API to the end
helps. Sorry. moveAbove and moveBelow are exactly what I was looking for.

Bye,
Oliver
--
Oliver Andrich - http://fitheach.geekgoth.de/
Re: Z-Order of child widgets of a canvas [message #446124 is a reply to message #446052] Wed, 17 November 2004 15:20 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
See also StackLayout in org.eclipse.swt.custom.

"Oliver Andrich" <fitheach@gmx.net> wrote in message
news:cne0t3$1fn$1@www.eclipse.org...
> Hi,
>
> I have found the answer myself. Sometimes reading the API to the end
> helps. Sorry. moveAbove and moveBelow are exactly what I was looking for.
>
> Bye,
> Oliver
> --
> Oliver Andrich - http://fitheach.geekgoth.de/
Re: Z-Order of child widgets of a canvas [message #446126 is a reply to message #446124] Wed, 17 November 2004 15:36 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Note that StackLayout uses setVisible rather than moveAbove and moveBelow.
The problem with just changing the z-order is that even though a widget is
totally obscured by another widget, it can still take focus and be part of
tab traversal , mnemonic interaction etc. It can be very confusing to the
user if a widget they can not see has focus and is affecting the UI
behaviour.

"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:cnfq90$pc6$1@www.eclipse.org...
> See also StackLayout in org.eclipse.swt.custom.
>
> "Oliver Andrich" <fitheach@gmx.net> wrote in message
> news:cne0t3$1fn$1@www.eclipse.org...
>> Hi,
>>
>> I have found the answer myself. Sometimes reading the API to the end
>> helps. Sorry. moveAbove and moveBelow are exactly what I was looking for.
>>
>> Bye,
>> Oliver
>> --
>> Oliver Andrich - http://fitheach.geekgoth.de/
>
>
Re: Z-Order of child widgets of a canvas [message #446136 is a reply to message #446126] Wed, 17 November 2004 17:12 Go to previous message
Oliver Andrich is currently offline Oliver AndrichFriend
Messages: 18
Registered: July 2009
Junior Member
Hi Veronika,

it is absolutely necessary to use moveAbove and Co. cause I am about to
move a big newspaper layout application to SWT. There an article, a
photo or ad is represent by a COmposite. These items can be layered and
also display elements according to certain rules. But may thanks for
your advice. With this I am capable of moving to SWT and also
reimplement all the features we have wrestled from Swing. :)

Best regards,
Oliver

Veronika Irvine schrieb:
> Note that StackLayout uses setVisible rather than moveAbove and moveBelow.
> The problem with just changing the z-order is that even though a widget is
> totally obscured by another widget, it can still take focus and be part of
> tab traversal , mnemonic interaction etc. It can be very confusing to the
> user if a widget they can not see has focus and is affecting the UI
> behaviour.
>
> "Veronika Irvine" <veronika_irvine@oti.com> wrote in message
> news:cnfq90$pc6$1@www.eclipse.org...
>
>>See also StackLayout in org.eclipse.swt.custom.
>>
>>"Oliver Andrich" <fitheach@gmx.net> wrote in message
>>news:cne0t3$1fn$1@www.eclipse.org...
>>
>>>Hi,
>>>
>>>I have found the answer myself. Sometimes reading the API to the end
>>>helps. Sorry. moveAbove and moveBelow are exactly what I was looking for.
>>>
>>>Bye,
>>>Oliver
>>>--
>>>Oliver Andrich - http://fitheach.geekgoth.de/
>>
>>
>
>


--
Oliver Andrich - http://fitheach.geekgoth.de/
Previous Topic:Can I get mouse position inside widget
Next Topic:SWT and Swing controls on SWT Composite
Goto Forum:
  


Current Time: Sat Oct 31 02:05:21 GMT 2020

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

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

Back to the top