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 141527 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]
patch
patch-118049.txt (text/plain), 2.81 KB, created by
Lakshmi P Shanmugam
on 2009-07-14 10:53:54 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Lakshmi P Shanmugam
Created:
2009-07-14 10:53:54 EDT
Size:
2.81 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.130 >diff -u -r1.130 CCombo.java >--- Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java 1 Jul 2009 14:49:32 -0000 1.130 >+++ Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java 14 Jul 2009 14:06:11 -0000 >@@ -136,6 +136,10 @@ > filter = new Listener() { > public void handleEvent(Event event) { > if (isDisposed ()) return; >+ if (event.widget instanceof ScrollBar && event.type == SWT.Selection) { >+ handleScroll(event); >+ return; >+ } > Shell shell = ((Control)event.widget).getShell (); > if (shell == CCombo.this.getShell ()) { > handleFocus (SWT.FocusOut); >@@ -513,7 +517,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(); >@@ -540,7 +546,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 (); >@@ -554,6 +559,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 >@@ -846,6 +859,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 >@@ -1004,6 +1023,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