Skip to content

Commit

Permalink
Adjusts delete actiong for watches
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeAtHPI committed Aug 31, 2023
1 parent 273b1b1 commit bf7f05b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
27 changes: 24 additions & 3 deletions packages/Sandblocks-Babylonian/SBExampleWatch.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ SBExampleWatch class >> newFor: aBlock [
expression: aBlock arguments first
]

{ #category : #'as yet unclassified' }
SBExampleWatch class >> registerShortcuts: aProvider [

aProvider registerShortcut: Character backspace do: #replaceWithWatchedExpression.
aProvider cmdShortcut: Character delete do: #replaceWithWatchedExpression.

]

{ #category : #'event handling' }
SBExampleWatch class >> registerWatch: aWatch [

Expand Down Expand Up @@ -84,12 +92,16 @@ SBExampleWatch >> color [
^ self parentSandblock color
]

{ #category : #'insert/delete' }
SBExampleWatch >> deleteCommandFor: aBlock [

^ nil
]

{ #category : #'event handling' }
SBExampleWatch >> doubleClick: anEvent [

self sandblockEditor do: (SBReplaceCommand new
replacer: self expression;
target: self)
self replaceWithWatchedExpression
]

{ #category : #'colors and color policies' }
Expand Down Expand Up @@ -252,6 +264,15 @@ SBExampleWatch >> printOn: aStream [
self modifyExpression printOn: aStream.
]

{ #category : #'event handling' }
SBExampleWatch >> replaceWithWatchedExpression [
<action>

self sandblockEditor do: (SBReplaceCommand new
replacer: self expression;
target: self)
]

{ #category : #actions }
SBExampleWatch >> reportValue: anObject for: anExample modifying: aBlock [

Expand Down
18 changes: 18 additions & 0 deletions packages/Sandblocks-Watch/SBWatchView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ SBWatchView >> addValue: anObject [
^ watchValues addLast: (SBWatchValue value: anObject sbSnapshot identityHash: anObject identityHash)
]

{ #category : #'insert/delete' }
SBWatchView >> canDelete [

^ false
]

{ #category : #'insert/delete' }
SBWatchView >> canDeleteChild: aBlock [

^ false
]

{ #category : #display }
SBWatchView >> changeDisplay [
<action>
Expand Down Expand Up @@ -80,6 +92,12 @@ SBWatchView >> defaultDisplay [
height: 20)
]

{ #category : #'insert/delete' }
SBWatchView >> deleteCommandFor: aBlock [

^ nil
]

{ #category : #accessing }
SBWatchView >> display [

Expand Down

0 comments on commit bf7f05b

Please sign in to comment.