Bug 93472 - [ScrolledComposite] Content of ScrolledComposite doesn't get scrolled by mousewheel
Summary: [ScrolledComposite] Content of ScrolledComposite doesn't get scrolled by mous...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Duong Nguyen CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-02 21:09 EDT by Adam Pordzik CLA
Modified: 2021-11-18 17:10 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Pordzik CLA 2005-05-02 21:09:41 EDT
Controls combined within a Composite which itself lays inside a
ScrolledComposide won't get scrolled by mousewheel, if another Controls "comes
before" the ScrolledComposite:

Placing a simple Button: 

"final Button btn = new Button (shell, SWT.PUSH);"

before 

"ScrolledComposite scrollComposite = new ScrolledComposite (
     shell, SWT.V_SCROLL | SWT.BORDER);"

as written in Snippet166.

As seen in Bugs 71176 or 81189, this should be due to missing focus on the
Composite. Of course, forcing focus on scrollComposite works somehow, but isn't
practicable, because it will loss it as soon as I click on mentioned "malicious"
Control, e.g.
Comment 1 Adam Pordzik CLA 2005-05-02 21:11:59 EDT
Oh. I missed to say, that wheel-scrolling only doesn't work, if the mouse-cursor
is over this "Button btn".
Comment 2 Veronika Irvine CLA 2005-05-03 13:22:12 EDT
For me, mouse wheel scrolling doesn't work at all as soon as the Button widget 
is added to the snippet.  This is because there is no way to get focus away 
from the Button.

I can make the ScrolledComposite respond to wheel events as follows:

scrollComposite.addListener(SWT.Activate, new Listener() {
	public void handleEvent(Event e) {
		scrollComposite.setFocus();
	}
});

I do not want to add this to the default behaviour of ScrolledComposite 
because it is not desired if the children want to take focus.
Comment 3 Adam Pordzik CLA 2005-05-05 19:07:23 EDT
To summarize my experiences (for win32): When a widget outside a
ScrollableComposite has keyboard focus, the SWT.MouseWheel event goes from this
widget (e.g.) to Shell and is then discarded.  If in this case the mousecursor
is over a Label, Button or other control inside ScrolledComposite's
Child-Composite, "wheeling" of content hangs. Only if mousecursor is directly
located over the ScrollableComposite or its child-Composite, wheeling works,
althougt no events were catched by display.addFilter().

Same for kb-focussed, scrollable Widgets like Table inside ScrollableComposite.

Perhaps it might be a good idea, to differentiate  between keyboard- and
mousecursor focus. On Platforms, where this isn't possible, let keyboard-focus
follow automatically the cursor. Or maybe at least discard the event, if the
cursors doesn't hovers focussed control.
Comment 4 abby CLA 2005-11-03 14:13:10 EST
Hi,
  For me the mouse works but the keyboard arrows are not working. I am using
windows XP. I tried even adding a forcefocus but still fails. I am just trying
to put multiple buttons on a scrolled composite. Even the Tab doesn't make the
scroll bar scroll, even when the content is not visible.  
Comment 5 Steve Northover CLA 2008-09-10 07:28:53 EDT
*** Bug 246137 has been marked as a duplicate of this bug. ***
Comment 6 Eclipse Webmaster CLA 2019-09-06 16:07:44 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 7 Eclipse Genie CLA 2021-11-18 17:10:22 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.