SWT_AWT bridge Mac OS X - component ordering issue with FormLayout [message #543812] |
Wed, 30 June 2010 16:05 |
No real name Messages: 4 Registered: October 2009 |
Junior Member |
|
|
I'm using SWT_AWT bridge to mix SWT and AWT controls in Eclipse 3.6.
The parent composite that the controls are going into uses FormLayout, and I am putting smaller SWT composites on top of the AWT control, which fills the entire parent composite.
In Windows, this works perfectly and the SWT controls are always on top.
In OS X 10.6, the SWT controls are draw behind the AWT control which is not acceptable. I can see them when I resize the window.
Here's the code, just to give you an idea of what is going on. The two composites created first manage their own layoutdata within the parent as they can be shown or hidden.
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FormLayout());
{
m_FeaturedDataComposite = new FeaturedDataComposite(container, SWT.NONE, this,
m_Listeners, Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
m_FeaturedDataComposite.setTopOffset(20);
m_FeaturedDataComposite.setRightOffset(20);
}
{
m_LayersListComposite = new LayerListComposite(container, SWT.NONE, this, this, this,
m_Listeners);
}
{
Composite globeContainer = new Composite(container, SWT.EMBEDDED | SWT.DOUBLE_BUFFERED);
FormData formData = new FormData();
formData.left = new FormAttachment(0);
formData.right = new FormAttachment(100);
formData.top = new FormAttachment(0);
formData.bottom = new FormAttachment(100);
globeContainer.setLayoutData(formData);
globeContainer.setLayout(new FillLayout());
java.awt.Frame worldFrame = SWT_AWT.new_Frame(globeContainer);
// This is to stop the AWT canvas from flickering...
// needed for placing SWT controls on top of AWT controls.
try
{
System.setProperty("sun.awt.noerasebackground","true");
}
catch (NoSuchMethodError error) {}
Panel panel = new Panel();
panel.setLayout(new BorderLayout());
panel.setBounds(0, 0, worldFrame.getSize().width, worldFrame.getSize().height);
panel.add((WorldWindowGLCanvas)m_Globe, BorderLayout.CENTER);
m_StatusBar = new StatusBarNative();
((StatusBar)m_StatusBar).setEventSource(m_Globe);
panel.add(m_StatusBar, BorderLayout.PAGE_END);
worldFrame.add(panel);
}
Any ideas?
[Updated on: Wed, 30 June 2010 16:23] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03613 seconds