Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

scroll-increment

Arguments: window type direction

This generic function is called to determine the amount by which a regular (non-widget) window should be scrolled when the user clicks on the window's scrollbars. The function should return the amount by which the window should scroll (measured in pixels). This function affects when the user clicks on the arrows or body of the scrollbars, but not when they drag the scroller box.

This function is a platform-independent partial alternative to the older function user-scroll, which is called on Windows but not on GTK. Methods supplied by an application should not make assumptions about when the methods will be called, though, because this happens at different times on different platforms. Specifically, on Windows the function is called when the user clicks on the scrollbar, whereas on GTK it is called when the user creates or resizes the window or changes its page size.

window is the window being scrolled.

type is either :line (if the user has clicked on a scrollbar arrow) or :page (if the user has clicked in the scrollbar body).

direction is either :vertical (if the user has clicked on a vertical scrollbar) or :horizontal (for a horizontal scrollbar).

Here are the default methods. They cause line scrolling to scroll by one text line, and page scrolling to scroll by one text line less than a full page. An application can add methods as needed to override these defaults.

(defmethod scroll-increment ((window basic-pane)(type (eql :line))
			     (direction (eql :vertical)))
  (line-height window))

(defmethod scroll-increment ((window basic-pane)(type (eql :line))
			     (direction (eql :horizontal)))
  (space-width window))

(defmethod scroll-increment ((window basic-pane)(type (eql :page))
			     (direction (eql :vertical)))
  (i- (visible-box-height window) 
      (line-height window)))

(defmethod scroll-increment ((window basic-pane)(type (eql :page))
			     (direction (eql :horizontal)))
  (- (visible-box-width window)
     (space-width window)))

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version