Skip to content

Commit

Permalink
Add a copy button to the PyStons
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyan11 committed Jun 14, 2024
1 parent 5b135bf commit 38cfe44
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 449 deletions.
37 changes: 20 additions & 17 deletions src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ PyramidVisualPystonForCly class >> shouldBeActivatedInContext: aBrowserContext [
{ #category : 'accessing' }
PyramidVisualPystonForCly class >> tabOrder [

^ 1
^ 100
]

{ #category : 'accessing' }
Expand Down Expand Up @@ -82,10 +82,11 @@ PyramidVisualPystonForCly >> belongsToRemovedBrowserContext [
{ #category : 'building' }
PyramidVisualPystonForCly >> build [

| buttonEditor buttonOpen blElement |
| buttonEditor buttonOpen buttonCopy blElement |
self cellInset: 5.
buttonEditor := self buttonEditor.
buttonOpen := self buttonOpen.
buttonCopy := self buttonCopy.
blElement := self getStonFromMethod materializeAsBlElement.
blElement isCollection ifTrue: [
blElement := BlElement new
Expand All @@ -95,7 +96,17 @@ PyramidVisualPystonForCly >> build [
imageMorph := ImageMorph withForm: blElement exportAsForm.
self addMorph: imageMorph fullFrame: LayoutFrame identity.
self addMorph: buttonEditor.
self addMorph: buttonOpen
self addMorph: buttonOpen.
self addMorph: buttonCopy
]

{ #category : 'as yet unclassified' }
PyramidVisualPystonForCly >> buttonCopy [

^ self
buttonLabel: 'Copy in Clipboard'
help: 'Copy to clipboard to paste it in Pyramid.'
action: [ self copyElement ]
]

{ #category : 'as yet unclassified' }
Expand Down Expand Up @@ -132,6 +143,12 @@ PyramidVisualPystonForCly >> buttonOpen [
action: [ self openInNewSpace ]
]

{ #category : 'as yet unclassified' }
PyramidVisualPystonForCly >> copyElement [

Clipboard clipboardText: self getStonFromMethod
]

{ #category : 'initialization' }
PyramidVisualPystonForCly >> defaultIconName [

Expand Down Expand Up @@ -207,20 +224,6 @@ PyramidVisualPystonForCly >> openInNewSpace [
space root addChildren: elements allButFirst
]

{ #category : 'printing' }
PyramidVisualPystonForCly >> printContext [

^ self method printSystemPath
]

{ #category : 'initialization' }
PyramidVisualPystonForCly >> resetStateForSnapshot [

super resetStateForSnapshot.

imageMorph := nil
]

{ #category : 'initialization' }
PyramidVisualPystonForCly >> setUpModelFromContext [

Expand Down
Loading

0 comments on commit 38cfe44

Please sign in to comment.