summaryrefslogtreecommitdiff
path: root/lisp/term
diff options
context:
space:
mode:
authorGeoff Voelker <voelker@cs.washington.edu>1996-05-03 18:26:22 +0000
committerGeoff Voelker <voelker@cs.washington.edu>1996-05-03 18:26:22 +0000
commit09c201da0615e43fb767a099b5617e9026321104 (patch)
treecaef69c04dad0afa73534f2966cd36b6fe9ffdd7 /lisp/term
parent3abc71544a5922f90f28b0e970eda9653a284298 (diff)
downloademacs-09c201da0615e43fb767a099b5617e9026321104.tar.gz
(win32-handle-scroll-bar-event): New function.
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/w32-win.el34
1 files changed, 32 insertions, 2 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index b2c6b923a27..305c4ec9265 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -77,8 +77,38 @@
(require 'select)
(require 'menu-bar)
-;; Disable until scrollbars are fully functional
-(scroll-bar-mode nil)
+;; Because Windows scrollbars look and act quite differently compared
+;; with the standard X scroll-bars, we don't try to use the normal
+;; scroll bar routines.
+
+(defun win32-handle-scroll-bar-event (event)
+ "Handle Win32 scroll bar events to do normal Window style scrolling."
+ (interactive "e")
+ (let* ((position (event-start event))
+ (window (nth 0 position))
+ (portion-whole (nth 2 position))
+ (bar-part (nth 4 position)))
+ (save-excursion
+ (select-window window)
+ (cond
+ ((eq bar-part 'up-arrow)
+ (scroll-down 1))
+ ((eq bar-part 'above-handle)
+ (scroll-down))
+ ((eq bar-part 'handle)
+ (scroll-bar-drag-1 event))
+ ((eq bar-part 'below-handle)
+ (scroll-up))
+ ((eq bar-part 'down-arrow)
+ (scroll-up 1))
+ ))))
+
+;; The following definition is used for debugging.
+;(defun win32-handle-scroll-bar-event (event) (interactive "e") (princ event))
+
+(global-set-key [vertical-scroll-bar mouse-1] 'win32-handle-scroll-bar-event)
+
+;; (scroll-bar-mode nil)
(defvar x-invocation-args)