+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)
(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.
(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'.")