Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336853

Summary: RTL Mode - calendar appears in wrong position after clicking the combo
Product: z_Archived Reporter: Barry Dresdner <barry.dresdner>
Component: NebulaAssignee: Wim Jongman <wim.jongman>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ahmad_alobaidy, peter
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Barry Dresdner CLA 2011-02-10 12:49:56 EST
Build Identifier: Version: 3.6.1.r361_v20100909

When clicking the button to expand the calendar combo, the widget appears off to the right, not under the combo.  This happens when running Eclipse with RTL mode.

Reproducible: Always

Steps to Reproduce:
1. Add the CDateTime widget to a composite within a dialog
2. Launch Eclipse with the program argument  -dir rtl
3. Display the dialog with the CDateTime.
4. Click the small calendar image to expand the combo
5. Note the position of the calendar
Comment 1 Barry Dresdner CLA 2011-11-03 10:59:53 EDT
Can I please get an update on this?  Wondering if anything has been done and/or if the Nebula project is going anywhere?  Should I continue to use the Nebula widgets in my source or should I go with something else?  Thanks
Comment 2 Barry Dresdner CLA 2011-12-01 08:13:19 EST
I made the following code changes in my local source, and it solves my problem:

org.eclipse.nebula.cwt.base.BaseCombo in:

protected synchronized void setOpen(boolean open, final Runnable callback) {

Line 1038:

			if((stretchControl != null) && (size.x < stretchControl.getSize().x)) {
				size.x = stretchControl.getSize().x;
//				contentShell.setSize(size);
			}
			// Begin Fix for RTL
			int deltaX = 0;
			String orientation = System.getProperty("eclipse.orientation"); //$NON-NLS-1$
			if ("rtl".equals(orientation)) { //$NON-NLS-1$
				leftAlign = true;
				deltaX = getBounds().width;
			}
			// End Fix for RTL
			if(leftAlign) {
				location.x -= positionControl.getLocation().x;
				location.x -= deltaX; // Rest of fix for RTL
			} else {
				location.x += (positionControl.getSize().x - size.x);
				if(location.x < 0) {
					location.x = 0;
				}
			}
Comment 3 Wim Jongman CLA 2011-12-12 13:20:02 EST
Thanks for the patch. We are regrouping. Let me fix this for you.
Comment 4 Wim Jongman CLA 2011-12-12 16:10:59 EST
*** Bug 217082 has been marked as a duplicate of this bug. ***
Comment 5 Wim Jongman CLA 2011-12-12 16:34:14 EST
Should this also happen if the orientation is alignment left or only if RTL?
Comment 6 Wim Jongman CLA 2011-12-12 16:38:58 EST
Made a slightly different approach. Since Nebula cannot depend on Eclipse I took the RTL style bit from the shell. This should also be set if Eclipse is in RTL mode. 

			if (leftAlign || isRTL()) {
				location.x -= positionControl.getLocation().x;
				// bug 336853
				if(isRTL()){
					location.x -= getBounds().width;
				}

Made a method to determine RTL and used your formula to calculate offsets. 

Please test, confirm or reopen.
Comment 7 Wim Jongman CLA 2011-12-12 16:39:56 EST
released to HEAD