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

Bug 344460

Summary: Bidi 3.7: [Coolbar] Chrevon is not updated during setOrientation()
Product: [Eclipse Project] Platform Reporter: mariavin <mariavin>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: camle, eclipse.felipe, gheorghe, Lina.Kemmel, mariavin, pwebster, remy.suen, sadir, Silenio_Quarti, wajnberg
Version: 3.7Flags: gheorghe: review+
Silenio_Quarti: review+
Target Milestone: 3.7 RC2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch for Linux.
none
picture of the problem.
none
Patch for changing the direction of the chevron dynamically
none
A new patch following your suggestions
none
The new patch fixing the error compilation
none
Patch none

Description mariavin CLA 2011-05-02 10:19:56 EDT
Build Identifier: 20110218-0911

REDHAT, SLES11:

For the style : SWT.DROP_DOWN the arrow of shrink item is not mirrored when setOrientation() used, the arrow mirrored only if created in mirrored orientation (RTL).

Reproducible: Always

Steps to Reproduce:
1. Apply the attached patch on the "org.eclipse.swt.examples" project (project
level).
2. Go to org.eclipse.swt.examples.mirroringTest package.
3. Run the ControlExamle.
4. Go to the "CoolBar" Tab.
5. In "Item Styles..." group the check the "SWT.DROP_DOWN" option.
6. In second line of the CoolBar stretch the  radio CoolItem (group of items in the middle) to their left (till you get the drop down arrow). 
7. In "Orientation..." group, click the "set orientation SWT.RIGHT_TO_LEFT" radio option.

result : the arrow of the drop down not mirrored.

Note: if you click "create new SWT.RIGHT_TO_LEFT" then the arrow is mirrored.
Comment 1 mariavin CLA 2011-05-02 10:21:08 EDT
Created attachment 194489 [details]
Patch for Linux.
Comment 2 mariavin CLA 2011-05-02 10:21:42 EDT
Created attachment 194490 [details]
picture of the problem.
Comment 3 Felipe Heidrich CLA 2011-05-02 11:42:37 EDT
Moshe, please fix it.
Note that Coolbar is emulated in GTK (the code is shared among several platforms).
Comment 4 Moshe WAJNBERG CLA 2011-05-03 09:20:42 EDT
Created attachment 194576 [details]
Patch for changing the direction of the chevron dynamically
Comment 5 Felipe Heidrich CLA 2011-05-03 11:43:57 EDT
This fix only updates the chevron after the next relayout and I think you can fix this problem without adding new instance variable (we avoid adding instance variables whe possible).
Comment 6 Moshe WAJNBERG CLA 2011-05-04 07:49:33 EDT
Created attachment 194697 [details]
A new patch following your suggestions

I introduced new method setOrientation for both CoolBar and CoolItem
Comment 7 Felipe Heidrich CLA 2011-05-04 14:40:03 EDT
(In reply to comment #6)
> Created attachment 194697 [details]
> A new patch following your suggestions
> I introduced new method setOrientation for both CoolBar and CoolItem

You forgot that CoolBar is emulated (common code), your code introduces a compilation bug in cocoa, carbon, motif, etc.
Just put all the code in CoolBar#setOrientation(int) [the public one].
Comment 8 Moshe WAJNBERG CLA 2011-05-05 06:15:30 EDT
Created attachment 194809 [details]
The new patch fixing the error compilation

Sorry I forgot that CoolBar was common code
Comment 9 Felipe Heidrich CLA 2011-05-06 11:31:03 EDT
Created attachment 194948 [details]
Patch
Comment 10 Felipe Heidrich CLA 2011-05-06 11:37:37 EDT
(Moshe, are you an Eclipse committer  ? - Btw, you code is fine, I changed a bit but it is basically the same code).

Bog, this is some low risk fix for a new feature. it should not impact Eclipse.
Comment 11 Moshe WAJNBERG CLA 2011-05-08 05:09:18 EDT
Hello Felipe,

No I am not an Eclipse committer. Anyway thank you very much for your review and your invaluable comments.
Comment 12 Felipe Heidrich CLA 2011-05-12 09:48:39 EDT
Bogdan, can you pls approve or reject this problem ?
Comment 13 Felipe Heidrich CLA 2011-05-12 17:07:06 EDT
fixed in HEAD