Squeak Class Documentation category index | class index  
 
ScrollController
  category: Kernel-ST80 Remnants
  superclass: MouseMenuController
  subclasses: ListController ParagraphEditor

I represent control for scrolling using a scrollBar. I am a MouseMenuController that creates a scrollBar, rather than menus. My subclasses add the button menus. I keep control as long as the cursor is inside the view or the scrollBar area.

A scrollBar is a rectangular area representing the length of the information being viewed. It contains an inner rectangle whose top y-coordinate represents the relative position of the information visible on the screen with respect to all of the information, and whose size represents the relative amount of that information visible on the screen. The user controls which part of the information is visible by pressing the red button. If the cursor is to the right of the inner rectangle, the window onto the visible information moves upward, if the cursor is to the left, the window moves downward, and if the cursor is inside, the inner rectangle is grabbed and moved to a desired position.

instance methods
  basic control sequence
  controlInitialize
controlTerminate

  control defaults
  controlActivity
isControlActive
isControlWanted
normalActivity

  cursor
  changeCursor:
markerContainsCursor
menuBarContainsCursor
scrollBarContainsCursor

  initialize-release
  initialize

  marker adjustment
  computeMarkerRegion
markerDelta
markerRegion:
moveMarker
moveMarker:anchorMarker:
moveMarkerTo:

  private
  scrollAbsolute
scrollDown
scrollUp

  scrolling
  anyButtonActivity
downLine
scroll
scrollAmount
scrollByKeyboard
scrollView
scrollView:
scrollViewDown
scrollViewUp
upDownLine
upLine
viewDelta
yellowLine

class methods
  no messages
 

instance methods
  basic control sequence top  
 

controlInitialize

Recompute scroll bars. Save underlying image unless it is already saved.


 

controlTerminate

Provide a place in the standard control sequence for terminating the
receiver (taking into account the current state of its model and view). It
should be redefined in subclasses to perform some specific action.


  control defaults top  
 

controlActivity

Refer to the comment in Controller|controlActivity.


 

isControlActive

In contrast to class Controller, only blue button but not yellow button
events will end the receiver's control loop.


 

isControlWanted

Answer whether the cursor is inside the inset display box (see
View|insetDisplayBox) of the receiver's view. It is sent by
Controller|controlNextLevel in order to determine whether or not control
should be passed to this receiver from the Controller of the superView of
this receiver's view.


 

normalActivity


  cursor top  
 

changeCursor:

The current cursor should be set to be aCursor.


 

markerContainsCursor

Answer whether the gray area inside the scroll bar area contains the
cursor.


 

menuBarContainsCursor

Answer whether the cursor is anywhere within the menu bar area.


 

scrollBarContainsCursor

Answer whether the cursor is anywhere within the scroll bar area.


  initialize-release top  
 

initialize

Initialize the state of the receiver. Subclasses should include 'super
initialize' when redefining this message to insure proper initialization.


  marker adjustment top  
 

computeMarkerRegion

Answer the rectangular area in which the gray area of the scroll bar
should be displayed.


 

markerDelta


 

markerRegion:

Set the area defined by aRectangle as the marker. Fill it with gray tone.


 

moveMarker

The view window has changed. Update the marker.


 

moveMarker:anchorMarker:

Update the marker so that is is translated by an amount corresponding to
a distance of anInteger, constrained within the boundaries of the scroll
bar. If anchorMarker ~= nil, display the border around the area where the
marker first went down.


 

moveMarkerTo:

Same as markerRegion: aRectangle; moveMarker, except a no-op if the marker
would not move.


  private top  
 

scrollAbsolute


 

scrollDown


 

scrollUp


  scrolling top  
 

anyButtonActivity

deal with red button down in scrollBar beyond yellowLine


 

downLine

if cursor before downLine, display down cursor and scroll down on button down


 

scroll

Check to see whether the user wishes to jump, scroll up, or scroll down.


 

scrollAmount

Answer the number of bits of y-coordinate should be scrolled. This is a
default determination based on the view's preset display transformation.


 

scrollByKeyboard


 

scrollView

The scroll bar jump method was used so that the view should be
updated to correspond to the location of the scroll bar gray area.
Return true only if scrolling took place.


 

scrollView:

Tell the reciever's view to scroll by anInteger amount.
Return true only if scrolling actually resulted.


 

scrollViewDown

Scroll the receiver's view down the default amount.
Return true only if scrolling actually took place.


 

scrollViewUp

Scroll the receiver's view up the default amount.
Return true only if scrolling actually took place.


 

upDownLine

Check to see whether the user wishes to jump, scroll up, or scroll down.


 

upLine

if cursor beyond upLine, display up cursor and scroll up on button down


 

viewDelta

Answer an integer that indicates how much the view should be scrolled.
The scroll bar has been moved and now the view must be so the amount
to scroll is computed as a ratio of the current scroll bar position.


 

yellowLine

Check to see whether the user wishes to jump, scroll up, or scroll down.


class methods
  no messages top