Bug 4554 - Combo selection scrolls for certain fonts (1G1AD9Y)
Summary: Combo selection scrolls for certain fonts (1G1AD9Y)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-11 14:18 EDT by Carolyn MacLeod CLA
Modified: 2002-08-15 17:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2001-10-11 14:18:51 EDT
1) Execute the following class.
	2) Drop down the combo box and select the value "1.2"
	3) Notice that all you can see is ".2"

[
package test;

import com.ibm.swt.*;
import com.ibm.swt.graphics.*;
import com.ibm.swt.widgets.*;

public class PR_1G1AD9Y {

	public static void main(String[] args) {
		
		Shell shell= new Shell();
		Display display = shell.getDisplay();	
		Combo combo = new Combo(shell, SWT.NULL);
		Font font = new Font(display, "Times", 20, 0);
		combo.setFont(font);
		combo.setItems (new String [] {
			"0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "1",
			"1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2",
			"3", "4", "5", "6", "7", "8", "9", "10"});
		combo.select(combo.indexOf("1"));
		combo.pack ();
				
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) display.sleep();
		}
		font.dispose();
	}

}
]

NOTES:
	CM (9/14/00 5:18:13 PM)
		The value is scrolled to the right - if you move the text cursor
		to the left you can see the beginning of the "1.2".

	CM (9/14/00 5:19:32 PM)
		If you set SWT.READ_ONLY when you create the combo, then the bogus behavior
		does not happen (because there is no text cursor).

	CM (9/14/00 5:21:11 PM)
		This is not a problem for courier, Script, and Ariel.
		Note however that "Comic Sans MS" also fails in the same manner.
		Did not try any other fonts.

SN (2/5/01 1:08:53 PM)
	SN to fix. (base on fix for 1 line text)
Comment 1 DJ Houghton CLA 2001-10-29 16:21:24 EST
PRODUCT VERSION:
	SWT win32 0.047a

Comment 2 Steve Northover CLA 2002-08-15 17:22:51 EDT
Fixed > 20020815