Bug 22055 - CoolBar - setWrapIndices causes rows to collapse/expand unnecessarily
Summary: CoolBar - setWrapIndices causes rows to collapse/expand unnecessarily
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-30 16:08 EDT by Lynne Kues CLA
Modified: 2002-08-21 15:08 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 Lynne Kues CLA 2002-07-30 16:08:08 EDT
Build 200207161002

1. Load the test case code.
2. Put a breakpoint on this line in the Button handler:
     coolBar.setWrapIndices(new int[] {0, 1, 5});
3. Debug the test case.  Size the outer Eclipse workbench window so that it 
does not overlap the test window.
4. Press "Set Wraps".
5. When the breakpoint is hit, step into the CoolBar.setWrapIndices() method.
6. Step through the method.  When OS.RB_SETBANDINFO is sent for item i = 1, the 
coolbar rows are collapsed into 1 row.  This behavior is unnecessary and leads 
to quite noticeable resizing "flash" (i.e., you can see the rows collapse than 
expand) in Eclipse when I do a similar scenario.

Since the first two wrap indices are the same as the current wrap indices, I 
would not expect this collapsing/expanding of the coolbar rows.
Comment 1 Felipe Heidrich CLA 2002-08-01 11:58:36 EDT
where is the testcase ? or should I get anyone that use setWraps ?
Comment 2 Felipe Heidrich CLA 2002-08-01 14:37:09 EDT
Lynne, there is no much we can do about this.
For the OS we have to set the wraps one by one. The best you can get is no 
flashing in the case where you are setting the wraps exactly for the same 
indices.

Anyway, for this case the best strategy is using setRedraw:
coolBar.setRedraw(false);
coolBar.setWrapIndices(wraps);    		
coolBar.setRedraw(true);	

Another thing SWT could do is setRedraw internally inside the setWrapIndices. 
So the app don't need to care about this.


		    


Comment 3 Lynne Kues CLA 2002-08-01 14:56:26 EDT
Okay, I guess you were able to reproduce the behavior, so I don't need to 
attach the test case?
Comment 4 Felipe Heidrich CLA 2002-08-01 16:27:18 EDT
Don't worry about the testcase.

It would be bad for you using setRedraw surrounding the setWrapIndices, or 
should I talk to SN about doing this internally ?
Comment 5 Lynne Kues CLA 2002-08-01 17:23:19 EDT
I would prefer if it could be done internally by SWT.  The UI code that deals 
with the Coolbar has a number of workarounds/quirks already - I'd prefer not to 
add more if at all possible.
Comment 6 Steve Northover CLA 2002-08-08 12:31:23 EDT
Fixed in R2.0.1.
Comment 7 Felipe Heidrich CLA 2002-08-13 13:59:41 EDT
fix in the HEAD > 20020813