Capturing values in a Spec window.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2017-09-16 20:23:34 +00:00 committed by SantiagoBragagnolo
parent 25a35cd65a
commit 96a18ed827
2 changed files with 22 additions and 4 deletions

View File

@ -263,6 +263,14 @@ GrafoscopioNotebook >> extent [
^900@500
]
{ #category : #'as yet unclassified' }
GrafoscopioNotebook >> findAndReplace [
| currentNode |
currentNode := tree highlightedItem content.
GrafoscopioReplace new openWithSpec.
currentNode find: '' andReplaceWith: nil.
]
{ #category : #accessing }
GrafoscopioNotebook >> header [
^ header
@ -794,7 +802,7 @@ GrafoscopioNotebook >> topBar [
name: nil;
description: 'Find & Replace';
icon: #smallFind asIcon;
action: [ self inform: 'To be implemented...' ] ] ];
action: [ self findAndReplace ] ] ];
addGroup: [ :group |
group
addItem: [ :item |

View File

@ -55,16 +55,18 @@ GrafoscopioReplace >> initializeWidgets [
autoAccept: true.
ok := self newButton
label: 'OK';
action: [ Transcript show: self find getText, String cr ].
action: [
self returnValues.
self window close ].
cancel := self newButton
label: 'Cancel';
action: [ self window close ].
self focusOrder
self focusOrder
add: find;
add: replace;
add: ok;
add: cancel.
self askOkToClose: true.
self askOkToClose: true
]
{ #category : #accessing }
@ -92,6 +94,14 @@ GrafoscopioReplace >> replace: anObject [
replace := anObject
]
{ #category : #initialization }
GrafoscopioReplace >> returnValues [
^ Dictionary new
at: 'find' put: find;
at: 'replace' put: replace;
yourself
]
{ #category : #api }
GrafoscopioReplace >> title [
^ 'Find & Replace'