[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: Controls on ScrolledComposite 'guzzles' events
|
There may be different ways you can configure your mouse wheel in the
Windows Control Panel for Mouse. This may account for some differences you
are seeing (also, different windowing systems may by default respond
differently).
For me, the mouse wheel events go to the widget with focus (not the widget
my cursor is over). If the widget with focus does not make use of the mouse
wheel events, the events are propogated up the parent heirarchy until a
widget does make use of them.
The problem with Labels is that they do not take focus. As a result,
another widget such as a button which does take focus will be getting the
mouse wheel events and the events will be going to the parent hierarchy of
the button rather than the label.
One workaround is to use Text with the style READ_ONLY instead of a Label.
The Text widget can take focus.
"Adam Pordzik" <adresseverbummelt@xxxxxx> wrote in message
news:d57m7l$hmd$1@xxxxxxxxxxxxxxxxxxx
> Emil Crumhorn schrieb:
>> I tested your code and after clicking the "freeze" button, scrolling
>> still works fine for me. But..
>
> Hmm. Due to your posting I've first removed every obsolete swt.jat/dll,
> but that doesn't help. What exactly did you have done? It its't needed to
> click on the Button in my example, a simple Label works also (better:
> doesn't work) when the cursor comes over this control.
>
> Or is my approach to place a composite for collecting Controls inside
> another composite bad?
>
>> You might want to take a look at the ScrollWheel events added in 3.1M4+
>> that allow you to listen to the scrollwheel. Some controls on a
>> scrollable canvas will not scroll the canvas, (some for good reason, such
>> as textareas with their own scrollbars).
>
> Yes. for sure! But i don't want wheeling stopping, when cursor gets over a
> drop-down box or even a label. :(
>
> Is there another way? I try to sketch the layout I want to arrange:
>
> +-----------------------------------------------+
> | Label | Text | Button |
> +-----------------------------------------------+
> | |^|
> | | |
> | scrollable area with misc. control in it. | |
> | | |
> | |v|
> +-----------------------------------------------+
> | | Button |
> +-----------------------------------------------+
>
> So, these controls were arranged within a GridLayout, the inner area is
> the named ScrolledComposite, within a 'normal', laid-out composite with
> Labels, Checkboxes, Buttons etc. (And again, if I didn't verbalized it
> correctly) As long as my mousecursor stays over the scrollbar, the
> composites 'backgroud', everythings works well, but when the cursor comes
> over a Label e.g. due to wheeling, scrolling stops.
>
>
> works:
> +----------------------------------+
> | |^|
> | Label Label | |
> | Button Text |\ | |
> | | \ |v|
> +----------------------------------+
>
>
> doesn't work:
> +----------------------------------+
> | |^|
> | Label Label | |
> | Button T|\t | |
> | | \ |v|
> +----------------------------------+
>
>
> where
>
> "|\ "
> "| \"
>
> is my mousecursor.
>
> Would it help, if I post longer, "real-world" code?
>
> A
>
> --