Community
Participate
Working Groups
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.
Oh. I missed to say, that wheel-scrolling only doesn't work, if the mouse-cursor is over this "Button btn".
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.
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.
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.
*** Bug 246137 has been marked as a duplicate of this bug. ***
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.
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.