Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 133098 - CCombo's dropdown causes Shell's drop shadow to disappear
Summary: CCombo's dropdown causes Shell's drop shadow to disappear
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-23 23:34 EST by Setya Nugdjaja CLA
Modified: 2013-05-24 11:21 EDT (History)
2 users (show)

See Also:


Attachments
Screenshot before the CCombo's dropdown shown (4.46 KB, image/png)
2006-03-23 23:38 EST, Setya Nugdjaja CLA
no flags Details
Screenshot after the CCombo's dropdown shown (146.02 KB, image/png)
2006-03-23 23:41 EST, Setya Nugdjaja CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Setya Nugdjaja CLA 2006-03-23 23:34:15 EST
I created shell with SWT.TOOL style to create drop shadow effect, when I put CCombo and click to show its dropdown, the shell's drop shadow effect suddenly disappears. If you click outside the shell then click the shell again the drop shadow shows up again.

I have workaround about this issue by adding SWT.ON_TOP on the shell but when the shell is on focus and I minimize the application, the shell keeps showing up. I don't want this behaviour.

Regards,

Setya
Comment 1 Setya Nugdjaja CLA 2006-03-23 23:38:09 EST
Created attachment 36866 [details]
Screenshot before the CCombo's dropdown shown
Comment 2 Setya Nugdjaja CLA 2006-03-23 23:41:49 EST
Created attachment 36867 [details]
Screenshot after the CCombo's dropdown shown
Comment 3 Steve Northover CLA 2006-03-30 10:36:08 EST
What an interesting bug.
Comment 4 Steve Northover CLA 2007-04-18 03:51:02 EDT
WORKSFORME.  Please reopen with code that fails or edit this code so it fails:

import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.*;

public class PR_133098 {
	public static void main(String[] args) {
		Display display = new Display();
		final Shell shell = new Shell(display, SWT.TOOL);
		shell.setLayout(new FillLayout());
		CCombo combo = new CCombo (shell, SWT.NONE);
		combo.setItems (new String [] {"FRED", "JOE", "MARY"});
		combo.select (1);
		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}
Comment 5 Jan Krakora CLA 2013-05-24 11:21:30 EDT
I believe he was talking about this:

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Test {

	public static void main(String[] args) {
		Display display = new Display();
		final Shell rootShell = new Shell(display);
		
		final Shell toolShell = new Shell(rootShell, SWT.TOOL);
		toolShell.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
		
		CCombo combo = new CCombo (toolShell, SWT.BORDER);
		combo.setItems (new String [] {"FRED", "JOE", "MARY"});
		combo.setBounds(50, 40, combo.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, combo.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
		combo.select(1);
		
		toolShell.setSize(150, 120);
		toolShell.open();
		
		rootShell.addControlListener(new ControlListener() {
			
			@Override
			public void controlResized(ControlEvent e) {
				x();
			}
			
			@Override
			public void controlMoved(ControlEvent e) {
				x();
			}
			
			private void x() {
				Rectangle rootBounds = rootShell.getBounds();
				int centerX = rootBounds.x + rootBounds.width / 2;
				int centerY = rootBounds.y + rootBounds.height / 2;
				
				toolShell.setLocation(
						centerX - toolShell.getBounds().width / 2, 
						centerY - toolShell.getBounds().height / 2
				);
			}
			
		});
		rootShell.setSize(400, 300);
		rootShell.open();
		
		while (!rootShell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}

}