UIGalleryView.st
changeset 2201 c68492590b1b
parent 2200 f258c24270b5
child 2204 bde4a7ef693a
equal deleted inserted replaced
2200:f258c24270b5 2201:c68492590b1b
   456     |evView p|
   456     |evView p|
   457 
   457 
   458     evView := anEvent view.
   458     evView := anEvent view.
   459     evView isNil ifTrue:[ ^ false ].
   459     evView isNil ifTrue:[ ^ false ].
   460 
   460 
       
   461     (anEvent isButtonPressEvent or:[anEvent isButtonReleaseEvent])ifTrue:[
       
   462         lastClickPoint := nil.
       
   463     ].
   461     evView == self ifFalse:[
   464     evView == self ifFalse:[
   462         (evView isComponentOf:self) ifFalse:[ ^ false ].
   465         (evView isComponentOf:self) ifFalse:[ ^ false ].
   463     ].
   466     ].
   464 
   467 
   465     anEvent isButtonEvent ifFalse:[
   468     anEvent isButtonEvent ifFalse:[
   466         anEvent isInputEvent ifTrue:[^ true].
   469         anEvent isInputEvent ifTrue:[^ true].
       
   470 
   467         anEvent isDamage ifTrue:[ self redrawSelection ].
   471         anEvent isDamage ifTrue:[ self redrawSelection ].
   468         ^ false
   472         ^ false
   469     ].
   473     ].
   470 
   474 
   471     anEvent isButtonReleaseEvent ifTrue:[
   475     anEvent isButtonReleaseEvent ifTrue:[ ^ true ].
   472         lastClickPoint := nil.
       
   473         ^ true
       
   474     ].
       
   475 
   476 
   476     anEvent isButtonMotionEvent ifTrue:[
   477     anEvent isButtonMotionEvent ifTrue:[
   477         (lastClickPoint notNil and:[anEvent state ~~ 0]) ifTrue:[
   478         (lastClickPoint notNil and:[anEvent state ~~ 0]) ifTrue:[
   478             p := Point x:(anEvent x) y:(anEvent y).
   479             p := Point x:(anEvent x) y:(anEvent y).
   479 
   480             p := device translatePoint:p fromView:evView toView:self.
   480             (lastClickPoint dist:p) > 10.0 ifTrue:[
   481 
       
   482             (lastClickPoint dist:p) > 20.0 ifTrue:[
   481                 self startDragFrom:evView.
   483                 self startDragFrom:evView.
   482                 lastClickPoint := nil.
   484                 lastClickPoint := nil.
   483             ]
   485             ]
   484         ].
   486         ].
   485         ^ true
   487         ^ true
   486     ].
   488     ].
   487 
   489 
   488     anEvent isButtonPressEvent ifTrue:[ |button application|
   490     anEvent isButtonPressEvent ifTrue:[ |button application|
   489         button := anEvent button.
   491         button := anEvent button.
   490         lastClickPoint := nil.
       
   491 
   492 
   492         (button == 1 or:[button == #select]) ifTrue:[
   493         (button == 1 or:[button == #select]) ifTrue:[
   493             p := Point x:(anEvent x) y:(anEvent y).
   494             p := Point x:(anEvent x) y:(anEvent y).
   494             p := device translatePoint:p fromView:evView toView:self.
   495             p := device translatePoint:p fromView:evView toView:self.
   495 
   496 
   496             self selection:(self findObjectAt:p).
   497             self selection:(self findObjectAt:p).
   497 
   498 
   498             selection notNil ifTrue:[
   499             selection notNil ifTrue:[
   499                 lastClickPoint := p
   500                 lastClickPoint := p.
   500             ]
   501             ]
   501         ] ifFalse:[
   502         ] ifFalse:[
   502             (menuSelector notNil and:[(application := self application) notNil]) ifTrue:[
   503             (menuSelector notNil and:[(application := self application) notNil]) ifTrue:[
   503                 MessageNotUnderstood catch:[
   504                 MessageNotUnderstood catch:[
   504                     application aspectFor:menuSelector
   505                     application aspectFor:menuSelector
   507         ].
   508         ].
   508         ^ true
   509         ^ true
   509     ].
   510     ].
   510 
   511 
   511     ^ true
   512     ^ true
       
   513 ! !
       
   514 
       
   515 !UIGalleryView::Canvas methodsFor:'focus handling'!
       
   516 
       
   517 subviewsInFocusOrder
       
   518     "returns none views - focus not handled within buildin canvas"
       
   519 
       
   520     ^ #()
   512 ! !
   521 ! !
   513 
   522 
   514 !UIGalleryView::Canvas methodsFor:'initialization'!
   523 !UIGalleryView::Canvas methodsFor:'initialization'!
   515 
   524 
   516 destroy
   525 destroy