Squeak Class Documentation category index | class index  
 
ScrollBar
  category: Morphic-Windows
  superclass: Slider
  subclasses:

Inspired by an oiginal design of Hans-Martin Mosner, this ScrollBar is intended to exercise the handling of input events in Morphic. With sufficient flexibility in this area, all particular behavior can be concentrated in this single class with no need to specialize any other morphs to achieve button, slider and menu-button behavior.

Once we have this working, put in logic for horizontal operation as well.

CachedImages was added to reduce the number of forms created and thrown away. This will be helpful for Nebraska and others as well.

instance methods
  access
  interval:
pagingArea
scrollDelta
scrollDelta:pageDelta:

  as yet unclassified
  cachedImageAt:ifAbsentPut:

  geometry
  buttonExtent
computeSlider
expandSlider
extent:
sliderExtent
totalSliderArea

  initialize
  initialize
initializeDownButton
initializeMenuButton
initializePagingArea
initializeSlider
initializeUpButton
upArrow8Bit

  other events
  menuButtonMouseDown:
mouseDownInSlider:

  scroll timing
  resetTimer
waitForDelay1:delay2:

  scrolling
  doScrollByPage
doScrollDown
doScrollUp
finishedScrolling
scrollBarAction
scrollBarAction:
scrollDown
scrollDown:
scrollDownInit
scrollPageInit:
scrollUp
scrollUp:
scrollUpInit
setNextDirectionFromEvent:
setValue:

  stepping
  step
stepTime
wantsSteps

class methods
  class initialization
  initialize

instance methods
  access top  
 

interval:

Supply an optional floating fraction so slider can expand to indicate range


 

pagingArea


 

scrollDelta


 

scrollDelta:pageDelta:

Supply optional increments for better scrolling of, eg, text


  as yet unclassified top  
 

cachedImageAt:ifAbsentPut:


  geometry top  
 

buttonExtent


 

computeSlider

interval ifNotNil: [self expandSlider].


 

expandSlider

Compute the new size of the slider (use the old sliderThickness as a minimum).


 

extent:


 

sliderExtent

The sliderExtent is now stored in the slider itself, not hardcoded as it is in the superclass.


 

totalSliderArea


  initialize top  
 

initialize


 

initializeDownButton


 

initializeMenuButton

Preferences disable: #scrollBarsWithoutMenuButton


 

initializePagingArea


 

initializeSlider


 

initializeUpButton


 

upArrow8Bit

convert to 8-bit and convert white to transparent to avoid gratuitous conversion every time we put one in an ImageMorph


  other events top  
 

menuButtonMouseDown:


 

mouseDownInSlider:


  scroll timing top  
 

resetTimer


 

waitForDelay1:delay2:

Return true if an appropriate delay has passed since the last scroll operation.
The delay decreases exponentially from delay1 to delay2.


  scrolling top  
 

doScrollByPage

Scroll automatically while mouse is down


 

doScrollDown

Scroll automatically while mouse is down


 

doScrollUp

Scroll automatically while mouse is down


 

finishedScrolling


 

scrollBarAction


 

scrollBarAction:


 

scrollDown


 

scrollDown:


 

scrollDownInit


 

scrollPageInit:


 

scrollUp


 

scrollUp:


 

scrollUpInit


 

setNextDirectionFromEvent:


 

setValue:

Using roundTo: instead of truncateTo: ensures that scrollUp will scroll the same distance as scrollDown.


  stepping top  
 

step

Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.


 

stepTime

Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.


 

wantsSteps

Return true if the receiver overrides the default Morph step method.


class methods
  class initialization top  
 

initialize

ScrollBar initialize