506 |
506 |
507 keyPress:key x:x y:y |
507 keyPress:key x:x y:y |
508 "any key pressed |
508 "any key pressed |
509 " |
509 " |
510 <resource: #keyboard ( #CursorUp #CursorDown #CursorLeft #CursorRight |
510 <resource: #keyboard ( #CursorUp #CursorDown #CursorLeft #CursorRight |
511 #Delete #BackSpace #Cut #Copy #Paste #Cmdu ) > |
511 #Delete #BackSpace #Cut #Copy #Paste #Cmdu #Again) > |
512 |
512 |
513 |n sensor| |
513 |n sensor| |
514 |
514 |
515 (key == #Cut or:[key == #Delete or:[key == #BackSpace]]) ifTrue: [ |
515 (key == #Cut or:[key == #Delete or:[key == #BackSpace]]) ifTrue: [ |
516 ^ self deleteSelection |
516 ^ self deleteSelection |
|
517 ]. |
|
518 (key = #PreviousPage) ifTrue:[ |
|
519 self selectNextUpInHierarchy. |
517 ]. |
520 ]. |
518 key == #Copy ifTrue:[ ^ self copySelection]. |
521 key == #Copy ifTrue:[ ^ self copySelection]. |
519 key == #Paste ifTrue:[ ^ self pasteBuffer]. |
522 key == #Paste ifTrue:[ ^ self pasteBuffer]. |
520 key == #Cmdu ifTrue:[ ^ self undoLast ]. "/ #Undo |
523 key == #Cmdu ifTrue:[ ^ self undoLast ]. "/ #Undo |
521 |
524 |
522 (#(CursorUp CursorDown CursorRight CursorLeft) includes:key) ifTrue:[ |
525 ( #(CursorUp CursorDown CursorRight CursorLeft) |
523 sensor := self sensor. |
526 includes:key) ifTrue:[ |
524 n := 1 + (sensor compressKeyPressEventsWithKey:key). |
527 (sensor := self sensor) isNil ifTrue:[ |
525 sensor shiftDown ifTrue:[ |
528 n := 1 |
526 n := n * 10. |
529 ] ifFalse:[ |
|
530 n := 1 + (sensor compressKeyPressEventsWithKey:key). |
|
531 sensor shiftDown ifTrue:[ |
|
532 n := n * 10. |
|
533 ]. |
527 ]. |
534 ]. |
528 |
535 |
529 key == #CursorUp ifTrue:[ |
536 key == #CursorUp ifTrue:[ |
530 ^ self moveSelectionUp:n |
537 ^ self moveSelectionUp:n |
531 ]. |
538 ]. |
705 pressAction := [:pressPoint | self startSelectOrMove:pressPoint]. |
712 pressAction := [:pressPoint | self startSelectOrMove:pressPoint]. |
706 shiftPressAction := [:pressPoint | self startSelectMoreOrMove:pressPoint]. |
713 shiftPressAction := [:pressPoint | self startSelectMoreOrMove:pressPoint]. |
707 motionAction := [:movePoint | nil]. |
714 motionAction := [:movePoint | nil]. |
708 releaseAction := [nil]. |
715 releaseAction := [nil]. |
709 keyPressAction := nil. |
716 keyPressAction := nil. |
|
717 doublePressAction := [:pressPoint | self doublePressed: pressPoint]. |
710 |
718 |
711 self cursor:Cursor normal. |
719 self cursor:Cursor normal. |
712 |
720 |
713 ! ! |
721 ! ! |
714 |
722 |
916 [self sensor hasExposeEventFor:nil] whileTrue:[ |
924 [self sensor hasExposeEventFor:nil] whileTrue:[ |
917 self windowGroup processExposeEvents |
925 self windowGroup processExposeEvents |
918 ]. |
926 ]. |
919 |
927 |
920 self setSelection:object withRedraw:true. |
928 self setSelection:object withRedraw:true. |
|
929 self forEach:selection do:[:aView | |
|
930 self recomputeShapeIfTransparentBox:aView. |
|
931 ]. |
921 self layoutChanged. |
932 self layoutChanged. |
|
933 ! |
|
934 |
|
935 layoutChanged |
922 ! |
936 ! |
923 |
937 |
924 startResizeBorder:b of:selection |
938 startResizeBorder:b of:selection |
925 "resize selected view |
939 "resize selected view |
926 " |
940 " |
963 ]. |
977 ]. |
964 ^ nil |
978 ^ nil |
965 ! ! |
979 ! ! |
966 |
980 |
967 !UIObjectView methodsFor:'private-resizing subviews'! |
981 !UIObjectView methodsFor:'private-resizing subviews'! |
|
982 |
|
983 recomputeShapeIfTransparentBox:aView |
|
984 (aView notNil and:[aView isTBox]) ifTrue:[ |
|
985 aView computeShape. |
|
986 aView clear; redraw |
|
987 ]. |
|
988 ! |
968 |
989 |
969 resize:aView bottom:aPoint |
990 resize:aView bottom:aPoint |
970 "resize a views bottom |
991 "resize a views bottom |
971 " |
992 " |
972 undoHistory withoutTransactionDo:[ |
993 undoHistory withoutTransactionDo:[ |
1296 aBlock value. |
1321 aBlock value. |
1297 self setSelection:sel withRedraw:true. |
1322 self setSelection:sel withRedraw:true. |
1298 ] |
1323 ] |
1299 |
1324 |
1300 |
1325 |
|
1326 ! ! |
|
1327 |
|
1328 !UIObjectView methodsFor:'selections basic'! |
|
1329 |
|
1330 setSelection:aNewSelection withRedraw:doRedraw |
|
1331 "set a new selection without change notifications |
|
1332 " |
|
1333 | sel | |
|
1334 |
|
1335 (sel := aNewSelection) == self ifTrue:[ |
|
1336 sel := nil |
|
1337 ]. |
|
1338 |
|
1339 doRedraw ifTrue:[ |
|
1340 self hideSelection. |
|
1341 selection := sel. |
|
1342 |
|
1343 self forEach:selection do:[:aView | |
|
1344 |superView| |
|
1345 |
|
1346 superView := aView superView. |
|
1347 self recomputeShapeIfTransparentBox:superView. |
|
1348 ]. |
|
1349 self showSelection. |
|
1350 ] ifFalse:[ |
|
1351 selection := sel |
|
1352 ] |
1301 ! ! |
1353 ! ! |
1302 |
1354 |
1303 !UIObjectView methodsFor:'selections-basic'! |
1355 !UIObjectView methodsFor:'selections-basic'! |
1304 |
1356 |
1305 recursiveRepair:theDamages startIn:aView |
1357 recursiveRepair:theDamages startIn:aView |