Commit 3f0f1700 authored by Glenn Morris's avatar Glenn Morris
Browse files

Calendar fix for scroll-bar scrolling (b#8305).

* lisp/calendar/cal-move.el (calendar-scroll-toolkit-scroll): New function.
* lisp/calendar/calendar.el (calendar-mode-map):
Check for toolkit scroll bars.
parent f872186f
2011-04-06 Glenn Morris <rgm@gnu.org>
* calendar/cal-move.el (calendar-scroll-toolkit-scroll): New function.
* calendar/calendar.el (calendar-mode-map):
Check for toolkit scroll bars. (Bug#8305)
2011-04-05 Chong Yidong <cyd@stupidchicken.com>
 
* minibuffer.el (completion-in-region--postch)
......
......@@ -204,6 +204,18 @@ EVENT is an event like `last-nonmenu-event'."
(define-obsolete-function-alias 'scroll-calendar-left-three-months
'calendar-scroll-left-three-months "23.1")
;; cf scroll-bar-toolkit-scroll
;;;###cal-autoload
(defun calendar-scroll-toolkit-scroll (event)
"Function to scroll the calendar after a toolkit scroll-bar click."
(interactive "e")
(let ((part (nth 4 (event-end event))))
;; Not bothering with drag events (handle, end-scroll).
(cond ((memq part '(above-handle up top))
(calendar-scroll-right nil event))
((memq part '(below-handle down bottom))
(calendar-scroll-left nil event)))))
;;;###cal-autoload
(defun calendar-scroll-right-three-months (arg &optional event)
"Scroll the displayed calendar window right by 3*ARG months.
......
......@@ -1648,14 +1648,17 @@ line."
(define-key map [down-mouse-2]
(easy-menu-binding cal-menu-global-mouse-menu))
;; Left-click moves us forward in time, right-click backwards.
;; cf scroll-bar.el.
(define-key map [vertical-scroll-bar mouse-1] 'calendar-scroll-left)
(define-key map [vertical-scroll-bar drag-mouse-1] 'calendar-scroll-left)
;; down-mouse-2 stays as scroll-bar-drag.
(define-key map [vertical-scroll-bar mouse-3] 'calendar-scroll-right)
(define-key map [vertical-scroll-bar drag-mouse-3] 'calendar-scroll-right)
(if (and (boundp 'x-toolkit-scroll-bars) x-toolkit-scroll-bars)
(define-key map [vertical-scroll-bar mouse-1]
'calendar-scroll-toolkit-scroll)
;; Left-click moves us forward in time, right-click backwards.
(define-key map [vertical-scroll-bar mouse-1] 'calendar-scroll-left)
(define-key map [vertical-scroll-bar drag-mouse-1] 'calendar-scroll-left)
;; down-mouse-2 stays as scroll-bar-drag.
(define-key map [vertical-scroll-bar mouse-3] 'calendar-scroll-right)
(define-key map [vertical-scroll-bar drag-mouse-3]
'calendar-scroll-right))
map)
"Keymap for `calendar-mode'.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment