Hi,
thanks to your help, the first prototype of the apps behaviour is surfacing and clim's mechanisms are getting less and less obscure.
I couldn't find documentation, whether mouse wheel movement is implemented as gesture in mcclim. In my app this would be very useful, but I could imagine, clim was invented long before mousewheels appeared.
On a related topic I tried to define a keystroke to invoke a command if the mouse is over a presentation. This didn't seem to work directly (via define gesture-name and define-presentation-to-command-translator). I resorted to defining a global variable in the application frame to hold a highlighted presentation (or nil if nothing is highlighted) and use this as reference for a command invoked by a keystroke. To me this seems to be rather a workaround than a solution. In case I'm missing something I'd be grateful for comments.
Nice holidays to all of you, Orm
On Tue, Dec 21, 2010 at 09:08:56PM +0100, Orm Finnendahl wrote:
Hi,
thanks to your help, the first prototype of the apps behaviour is surfacing and clim's mechanisms are getting less and less obscure.
I couldn't find documentation, whether mouse wheel movement is implemented as gesture in mcclim. In my app this would be very useful, but I could imagine, clim was invented long before mousewheels appeared.
Oh dear, no. There where wheel back in the old days. Mighty wheels of oak and iron, but wheels nevertheless :-)
From 'stream-input.lisp' in function 'realize-gesture-spec':
.... (let ((real-device-name (case device-name (:left +pointer-left-button+) (:middle +pointer-middle-button+) (:right +pointer-right-button+) (:wheel-up +pointer-wheel-up+) (:wheel-down +pointer-wheel-down+) (t (error "~S is not a known button" device-name)))))
...
Cheers and happy christmas
RalfD
On a related topic I tried to define a keystroke to invoke a command if the mouse is over a presentation. This didn't seem to work directly (via define gesture-name and define-presentation-to-command-translator). I resorted to defining a global variable in the application frame to hold a highlighted presentation (or nil if nothing is highlighted) and use this as reference for a command invoked by a keystroke. To me this seems to be rather a workaround than a solution. In case I'm missing something I'd be grateful for comments.
Nice holidays to all of you, Orm
mcclim-devel mailing list mcclim-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel
hmm, can't make it work with the mouse wheel.
This works:
(define-gesture-name :up :pointer-button-press :middle)
This doesn't work:
(define-gesture-name :up :pointer-button-press :wheel-up)
I also tried ":pointer-button" in place of "pointer-button-press".
Is there any way to find out, whether sbcl/mcclim is getting the event at all and what it gets translated into? The mouse wheel works in other applications.
-- Orm
Am Tuesday, den 21. December 2010 um 22:56:10 Uhr (+0100) schrieb rm@tuxteam.de:
.... (let ((real-device-name (case device-name (:left +pointer-left-button+) (:middle +pointer-middle-button+) (:right +pointer-right-button+) (:wheel-up +pointer-wheel-up+) (:wheel-down +pointer-wheel-down+) (t (error "~S is not a known button" device-name)))))
On Wed, Dec 22, 2010 at 11:24:25AM +0100, Orm Finnendahl wrote:
hmm, can't make it work with the mouse wheel.
This works:
(define-gesture-name :up :pointer-button-press :middle)
This doesn't work:
(define-gesture-name :up :pointer-button-press :wheel-up)
I also tried ":pointer-button" in place of "pointer-button-press".
Hmm, sorry, no wheel mouse here, so I can't test. But shouldn't that be (define-gesture-name :up :pointer-button-press (:wheel-up))
Is there any way to find out, whether sbcl/mcclim is getting the event at all and what it gets translated into? The mouse wheel works in other applications.
Well, the wheel buttons are used in panes.lisp (for scrolling), so maybe you could just test scrolling with the mouse wheel. Thinking of it: maybe your application pane inherits from mouse-wheel-scroll-mixin and somehow the scroll event gets eaten by that class' dispatch-event ...
Cheers, RalfD
BTW, send me your newest version, I can test with scroll-wheel tomorrow.
-- Orm
Am Tuesday, den 21. December 2010 um 22:56:10 Uhr (+0100) schrieb rm@tuxteam.de:
.... (let ((real-device-name (case device-name (:left +pointer-left-button+) (:middle +pointer-middle-button+) (:right +pointer-right-button+) (:wheel-up +pointer-wheel-up+) (:wheel-down +pointer-wheel-down+) (t (error "~S is not a known button" device-name)))))
mcclim-devel mailing list mcclim-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel
On Thu, Dec 23, 2010 at 6:25 AM, rm@tuxteam.de wrote:
Well, the wheel buttons are used in panes.lisp (for scrolling), so maybe you could just test scrolling with the mouse wheel. Thinking of it: maybe your application pane inherits from mouse-wheel-scroll-mixin and somehow the scroll event gets eaten by that class' dispatch-event ...
That's correct. In McCLIM, the superclasses of application-pane are clim-stream-pane, cut-and-paste-mixin, and mouse-wheel-scroll-mixin.
McCLIM arranges the classes with the expectation that most users want mouse wheel scrolling (and other features not explicitly mentioned by the spec), so the wheel scrolling mixin was incorporated by application-pane and interactor-pane, allowing users with unusual needs to instead inherit from clim-stream-pane. In retrospect, I should also have included an initarg in each such mixin to disable the feature.
I can't guarantee there isn't some other reason why using a wheel button as a gesture might fail (having never tried it myself), but bypassing the wheel scrolling code is necessary.
On Wed, 22 Dec 2010 11:24:25 +0100, Orm Finnendahl wrote:
Hi Orm, just a quick follow-up ....
hmm, can't make it work with the mouse wheel.
This works:
(define-gesture-name :up :pointer-button-press :middle)
This doesn't work:
(define-gesture-name :up :pointer-button-press :wheel-up)
It does work. Unfortunately you place your pane inside of (scrolling ...) - and the scoller-pane seems to swallow scroll-wheel events. Leave out the (scrolling ...) arround your pane in the layout definition and your pane receives scroll events (there's a bug in your presentation-to- command definition, but that's another problem).
Cheers, RalfD