Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 167756 Details for
Bug 118049
[CCombo] CCombo in form : dropdown scrolling causes parent shell to scroll too
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
final patch
patch (text/plain), 2.83 KB, created by
Grant Gayed
on 2010-05-10 12:58:03 EDT
(
hide
)
Description:
final patch
Filename:
MIME Type:
Creator:
Grant Gayed
Created:
2010-05-10 12:58:03 EDT
Size:
2.83 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java,v >retrieving revision 1.137 >diff -u -r1.137 CCombo.java >--- Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java 8 Mar 2010 22:55:12 -0000 1.137 >+++ Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java 10 May 2010 16:52:49 -0000 >@@ -136,6 +136,12 @@ > filter = new Listener() { > public void handleEvent(Event event) { > if (isDisposed ()) return; >+ if (event.type == SWT.Selection) { >+ if (event.widget instanceof ScrollBar) { >+ handleScroll(event); >+ } >+ return; >+ } > Shell shell = ((Control)event.widget).getShell (); > if (shell == CCombo.this.getShell ()) { > handleFocus (SWT.FocusOut); >@@ -532,7 +538,9 @@ > } > void dropDown (boolean drop) { > if (drop == isDropped ()) return; >+ Display display = getDisplay (); > if (!drop) { >+ display.removeFilter (SWT.Selection, filter); > popup.setVisible (false); > if (!isDisposed () && isFocusControl()) { > text.setFocus(); >@@ -559,7 +567,6 @@ > > int index = list.getSelectionIndex (); > if (index != -1) list.setTopIndex (index); >- Display display = getDisplay (); > Rectangle listRect = list.getBounds (); > Rectangle parentRect = display.map (getParent (), null, getBounds ()); > Point comboSize = getSize (); >@@ -573,6 +580,14 @@ > popup.setBounds (x, y, width, height); > popup.setVisible (true); > if (isFocusControl()) list.setFocus (); >+ >+ /* >+ * Add a filter to listen to scrolling of the parent composite, when the >+ * drop-down is visible. Remove the filter when drop-down is not >+ * visible. >+ */ >+ display.removeFilter (SWT.Selection, filter); >+ display.addFilter (SWT.Selection, filter); > } > /* > * Return the lowercase of the first non-'&' character following >@@ -865,6 +880,12 @@ > } > } > } >+void handleScroll(Event event) { >+ ScrollBar scrollBar = (ScrollBar)event.widget; >+ Control scrollableParent = scrollBar.getParent(); >+ if (scrollableParent.equals(list)) return; >+ if (isParentScrolling(scrollableParent)) dropDown(false); >+} > /** > * Searches the receiver's list starting at the first item > * (index 0) until an item is found that is equal to the >@@ -1023,6 +1044,15 @@ > } > return super.isFocusControl (); > } >+boolean isParentScrolling(Control scrollableParent) { >+ Control parent = this.getParent(); >+ while (parent != null) { >+ if (parent.equals(scrollableParent)) >+ return true; >+ parent = parent.getParent(); >+ } >+ return false; >+} > void internalLayout (boolean changed) { > if (isDropped ()) dropDown (false); > Rectangle rect = getClientArea ();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 118049
:
30607
|
30608
|
132508
|
141527
|
141528
|
155799
| 167756