SimpleView.st
changeset 2371 fafba97d401c
parent 2357 29a966362aad
child 2376 8fd96878c8c3
equal deleted inserted replaced
2370:5f45f0d30fba 2371:fafba97d401c
  7119 
  7119 
  7120     "Created: 13.9.1996 / 14:08:03 / cg"
  7120     "Created: 13.9.1996 / 14:08:03 / cg"
  7121     "Modified: 13.9.1996 / 14:09:32 / cg"
  7121     "Modified: 13.9.1996 / 14:09:32 / cg"
  7122 !
  7122 !
  7123 
  7123 
       
  7124 scrollToLeft
       
  7125     "move viewOrigin to the left"
       
  7126 
       
  7127     self scrollHorizontalTo:0
       
  7128 !
       
  7129 
  7124 scrollToPercent:originAsPercent
  7130 scrollToPercent:originAsPercent
  7125     "scroll to a position given in percent of total (x and y as a Point)"
  7131     "scroll to a position given in percent of total (x and y as a Point)"
  7126 
  7132 
  7127     |wCont hCont percent|
  7133     |wCont hCont percent|
  7128 
  7134 
  7139 	    ((((wCont * percent x) / 100.0) + 0.5) asInteger) @
  7145 	    ((((wCont * percent x) / 100.0) + 0.5) asInteger) @
  7140 	    ((((hCont * percent y) / 100.0) + 0.5) asInteger)
  7146 	    ((((hCont * percent y) / 100.0) + 0.5) asInteger)
  7141 
  7147 
  7142     "Created: 5.8.1996 / 12:15:53 / stefan"
  7148     "Created: 5.8.1996 / 12:15:53 / stefan"
  7143     "Modified: 5.8.1996 / 12:42:57 / stefan"
  7149     "Modified: 5.8.1996 / 12:42:57 / stefan"
       
  7150 !
       
  7151 
       
  7152 scrollToRight
       
  7153     "move viewOrigin to the right"
       
  7154 
       
  7155     |wCont|
       
  7156 
       
  7157     wCont := self widthOfContents.
       
  7158     transformation notNil ifTrue:[
       
  7159         wCont := transformation applyScaleX:wCont.
       
  7160     ].
       
  7161     self scrollHorizontalTo:((wCont - self innerWidth) max:0)
       
  7162 
  7144 !
  7163 !
  7145 
  7164 
  7146 scrollToTop
  7165 scrollToTop
  7147     "move viewOrigin to top"
  7166     "move viewOrigin to top"
  7148 
  7167 
  7883 ! !
  7902 ! !
  7884 
  7903 
  7885 !SimpleView class methodsFor:'documentation'!
  7904 !SimpleView class methodsFor:'documentation'!
  7886 
  7905 
  7887 version
  7906 version
  7888     ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.275 1998-09-18 20:19:26 cg Exp $'
  7907     ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.276 1998-09-28 11:51:43 cg Exp $'
  7889 ! !
  7908 ! !
  7890 SimpleView initialize!
  7909 SimpleView initialize!