Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 16700 - Coolbar tab order is backwards
Summary: Coolbar tab order is backwards
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 16669
  Show dependency tree
 
Reported: 2002-05-21 17:16 EDT by Lynne Kues CLA
Modified: 2002-09-12 10:31 EDT (History)
2 users (show)

See Also:


Attachments
test case (6.88 KB, application/octet-stream)
2002-05-21 17:16 EDT, Lynne Kues CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lynne Kues CLA 2002-05-21 17:16:00 EDT
Build 20020521

Run the attached test case.
Press the tab key.  Notice that tabbing is backwards for the CoolBar.
Comment 1 Lynne Kues CLA 2002-05-21 17:16:38 EDT
Created attachment 929 [details]
test case
Comment 2 Lynne Kues CLA 2002-09-04 16:39:32 EDT
Is this going to be fixed?  I have a P2 bug that depends on this bug.
Comment 3 Felipe Heidrich CLA 2002-09-04 17:54:17 EDT
Just wait SN returns to work (next Monday 9/9), then I can talk to him about to 
release the fix.

Comment 4 Felipe Heidrich CLA 2002-09-04 17:55:43 EDT
Here's the fix:

CoolItem.java:

public void setControl (Control control) {
	checkWidget ();
	if (control != null) {
		if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
		if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT);
	}
	int index = parent.indexOf (this);
	if (index == -1) return;
	if (this.control != null && this.control.isDisposed ()) {
		this.control = null;
	}
	Control oldControl = this.control, newControl = control;
	int hwnd = parent.handle;
	int hwndChild = 0;
	if (newControl != null) hwndChild = control.handle;
	REBARBANDINFO rbBand = new REBARBANDINFO ();
	rbBand.cbSize = REBARBANDINFO.sizeof;
	rbBand.fMask = OS.RBBIM_CHILD;
	rbBand.hwndChild = hwndChild;
	this.control = newControl;

	int hwndAbove = 0;
	if (newControl != null) {
		hwndAbove = OS.GetWindow (hwndChild, OS.GW_HWNDPREV);
	}	
	/*
	* Feature in Windows.  When Windows sets the rebar band child,
	* it makes the new child visible and hides the old child.  The
	* fix is to save and restore the visibility of the controls.
	*/		
	boolean hideNew = newControl != null && !newControl.getVisible ();
	boolean showOld = oldControl != null && oldControl.getVisible ();
	OS.SendMessage (hwnd, OS.RB_SETBANDINFO, index, rbBand);
	if (hideNew) newControl.setVisible (false);
	if (showOld) oldControl.setVisible (true);
	if (hwndAbove != 0 && hwndAbove != hwndChild) {
		int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE; 
		OS.SetWindowPos (hwndChild, hwndAbove, 0, 0, 0, 0, flags);
	}
}
Comment 5 Lynne Kues CLA 2002-09-05 10:53:48 EDT
Related to this is whether or not each item in the cool bar should even be 
considered as a tab group.  Right now tabbing goes to each cool item and arrow 
keys can be used to move within the items in the cool item.  It has been 
suggested (another PR) that this is not desirable (i.e., the whole coolbar 
should be treated as one tab group).  What is the precedent for the current 
tabbing behavior?  I tried to see what IE did, but couldn't get the tabbing 
behavior to occur.  Thoughts?  The other PR indicated that it would take too 
many tab presses to cycle through the Eclipse widgets if each tab goes to a 
cool item.  I tend to agree with this, especially for WSAD, which has many cool 
items.
Comment 6 Lynne Kues CLA 2002-09-05 14:27:23 EDT
In MSWord, each cool item is treated as a tab group and you use CTRL-TAB to 
move through the cool items.  Tab and arrow keys move amongst the tool items in 
the cool item.  Unable to get tab traversal behavior to work for the coolbar in 
IE.
Comment 7 Lynne Kues CLA 2002-09-06 10:16:20 EDT
Tabbing to each coolitem is fine - expected behavior (other apps do this).  Not 
sure about the Ctrl-Tab vs. Tab behavior.  No one else seems to particularly 
care either, so leave as is.  Please fix the backward problem.
Comment 8 Steve Northover CLA 2002-09-12 10:31:31 EDT
Fixed > 20020912 (backward problem only)