Skip to content

Commit

Permalink
Implement #103
Browse files Browse the repository at this point in the history
  • Loading branch information
Encotric committed Jun 22, 2022
1 parent 006e18c commit b3626c1
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
isInSelectionPreviewMode
^ self mode = #selectionPreview
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"isInPenMode" : "CS 6/11/2021 17:30",
"isInSelectLasso" : "md 5/27/2022 20:39",
"isInSelectionMode" : "ms 7/8/2021 16:22",
"isInSelectionPreviewMode" : "SW 6/22/2022 20:57",
"isInTemporaryGeometricMode" : "md 5/16/2022 18:28",
"isInTextMode" : "CS 6/11/2021 17:30",
"mode" : "CS 6/28/2021 17:33",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ clickAt: aPoint
ifTrue: [^ self startEditingTextAt: aPoint].
self context isInEditingTextMode
ifTrue: [^ self printText].
self context isInSelectionPreviewMode
ifTrue: [ self removeSelection ].
self context isInInsertSelectionMode
ifTrue: [^ self projectSelectionAt: aPoint].
self context isInTemporaryGeometricMode
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
drawing
copySelection
| form |
self context isInSelectionPreviewMode ifFalse: [ ^ self ].
form := self backend activeForm contentsOfArea: self selectionBounds.
form := self clipSelection: form.
self clipboardForm: form.
self temporaryGeometricMorph delete.
self context mode: #selection
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
drawing
finishSelection
| form |
form := self backend activeForm contentsOfArea: self selectionBounds.
form := self clipSelection: form.
self clipboardForm: form.
self temporaryGeometricMorph delete
self context mode: #selectionPreview
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
drawing
removeSelection

self temporaryGeometricMorph delete.
self context mode: #selection
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tool selection
switchMode
self context isInSelectionPreviewMode ifTrue: [ self removeSelection ].
self commitText.
self finishGeometricForm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"canvas:" : "mFr 6/23/2021 15:27",
"chooseFont" : "mFr 6/24/2021 17:25",
"circleCursor" : "K.P. 8/1/2021 20:02",
"clickAt:" : "md 6/18/2022 17:20",
"clickAt:" : "SW 6/22/2022 21:11",
"clipSelection:" : "md 5/27/2022 21:41",
"clipSelectionLasso:" : "md 5/27/2022 22:19",
"clipboardForm" : "ms 7/8/2021 17:25",
Expand All @@ -22,6 +22,7 @@
"configureTemporaryGeometricMorph:at:" : "md 5/27/2022 20:47",
"context" : "md 6/17/2022 15:40",
"context:" : "md 6/17/2022 15:40",
"copySelection" : "SW 6/22/2022 20:59",
"currentCursor" : "CS 6/28/2021 21:19",
"currentCursor:" : "CS 6/28/2021 21:19",
"defaultDepth" : "md 6/18/2022 17:31",
Expand All @@ -39,7 +40,7 @@
"eraserSize" : "CS 6/23/2021 14:15",
"fillShape" : "md 6/17/2022 17:39",
"finishGeometricForm" : "md 6/18/2022 18:53",
"finishSelection" : "md 6/11/2022 21:05",
"finishSelection" : "SW 6/22/2022 20:57",
"generateImageStack" : "md 6/18/2022 17:47",
"generateLayer:" : "SW 6/14/2022 19:22",
"geometricMorph" : "kbr 5/30/2022 20:20",
Expand All @@ -66,6 +67,7 @@
"rectangleBrushSize" : "md 6/18/2022 17:26",
"rectangleCursor" : "CS 8/4/2021 19:33",
"refresh" : "SW 6/14/2022 19:22",
"removeSelection" : "SW 6/22/2022 21:04",
"resizeTemporaryGeometricMorphAt:" : "ms 5/27/2022 17:49",
"scalar" : "mFr 6/25/2021 15:19",
"scalar:" : "mFr 6/9/2021 16:46",
Expand All @@ -81,7 +83,7 @@
"startPoint:" : "md 6/17/2022 15:42",
"startRectangleSelection" : "md 6/17/2022 17:36",
"stopDrawing" : "md 6/17/2022 16:57",
"switchMode" : "md 5/19/2022 14:08",
"switchMode" : "SW 6/22/2022 21:05",
"temporaryGeometricMorph" : "K.P. 6/26/2021 16:03",
"temporaryGeometricMorph:" : "K.P. 6/26/2021 16:03",
"temporaryTextMorph" : "mFr 6/24/2021 17:24",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tooling
copyToClipboard

self viewPort copySelection
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ event handling
handleCommandKeystroke: aKeyboardEvent
aKeyboardEvent keyCharacter caseOf: {
[$v] -> [self pasteClipboard].
[$e] -> [self clickMenuItemWith: M2ExportPNG label].
[$x] -> [self clickMenuItemWith: M2ExportPNG label].
[$i] -> [self clickMenuItemWith: M2ImportImage label].
[$z] -> [self clickMenuItemWith: M2Undo label].
[$t] -> [self clickMenuItemWith: M2TriangleBrush label].
[$c] -> [self clickMenuItemWith: M2CircleBrush label].
[$e] -> [self clickMenuItemWith: M2CircleBrush label].
[$c] -> [self copyToClipboard].
[$r] -> [self clickMenuItemWith: M2RectangleBrush label].
[Character backspace] -> [self clickMenuItemWith: M2ClearCanvas label]
} otherwise: [^ aKeyboardEvent "no hit"].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"colorPanel" : "mFr 5/19/2021 10:59",
"colorPanel:" : "mFr 5/19/2021 10:59",
"colorPicker" : "mFr 5/19/2021 10:59",
"copyToClipboard" : "SW 6/22/2022 20:49",
"defaultActivatedMenuItem" : "CS 8/5/2021 22:06",
"defaultBrushSizeIndicator" : "CS 8/5/2021 22:21",
"defaultBrushSizeSlider" : "CS 8/6/2021 18:57",
Expand All @@ -37,7 +38,7 @@
"form" : "mFr 5/19/2021 11:00",
"getNameOfFileToExport" : "mFr 5/19/2021 11:00",
"getNameOfFileToImport" : "CS 8/5/2021 22:17",
"handleCommandKeystroke:" : "K.P. 7/8/2021 13:44",
"handleCommandKeystroke:" : "SW 6/22/2022 20:47",
"handleKeystroke:" : "K.P. 8/1/2021 19:47",
"handleNoModifierKeystroke:" : "K.P. 8/1/2021 19:49",
"handleShiftKeystroke:" : "AK 6/18/2022 17:47",
Expand Down

0 comments on commit b3626c1

Please sign in to comment.