Capturing values in a Spec window.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2017-09-16 20:23:34 +00:00
parent af2c4e10cd
commit 05daa3836c
2 changed files with 22 additions and 4 deletions

View File

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

View File

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