GrafoscopioFind > Closing of the window: starting implementation.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2017-09-16 18:39:26 +00:00
parent e6d86d7aae
commit 9ae4f36ca8
2 changed files with 59 additions and 3 deletions

View File

@ -34,13 +34,53 @@ GrafoscopioButtonModel >> button: anObject [
button := anObject button := anObject
] ]
{ #category : #accessing }
GrafoscopioButtonModel >> cancel [
^ cancel
]
{ #category : #accessing }
GrafoscopioButtonModel >> cancel: anObject [
cancel := anObject
]
{ #category : #api } { #category : #api }
GrafoscopioButtonModel >> content: anAssoc [ GrafoscopioButtonModel >> content: anAssoc [
button label: anAssoc key. button label: anAssoc key.
button action: anAssoc value. button action: anAssoc value.
] ]
{ #category : #accessing }
GrafoscopioButtonModel >> find [
^ find
]
{ #category : #accessing }
GrafoscopioButtonModel >> find: anObject [
find := anObject
]
{ #category : #initalize } { #category : #initalize }
GrafoscopioButtonModel >> initializeWidgets [ GrafoscopioButtonModel >> initializeWidgets [
button := self newButton. button := self newButton.
] ]
{ #category : #accessing }
GrafoscopioButtonModel >> ok [
^ ok
]
{ #category : #accessing }
GrafoscopioButtonModel >> ok: anObject [
ok := anObject
]
{ #category : #accessing }
GrafoscopioButtonModel >> replace [
^ replace
]
{ #category : #accessing }
GrafoscopioButtonModel >> replace: anObject [
replace := anObject
]

View File

@ -47,18 +47,24 @@ GrafoscopioReplace >> find: anObject [
{ #category : #initialization } { #category : #initialization }
GrafoscopioReplace >> initializeWidgets [ GrafoscopioReplace >> initializeWidgets [
find := self newText. find := self newTextInput
replace := self newText. ghostText: 'Text to find...';
autoAccept: true.
replace := self newTextInput
ghostText: 'Text to replace...';
autoAccept: true.
ok := self newButton ok := self newButton
label: 'OK'; label: 'OK';
action: [ Transcript show: self find getText ]. action: [ Transcript show: self find getText ].
cancel := self newButton cancel := self newButton
label: 'Cancel'. label: 'Cancel';
action: [ super closeWindowAction ].
self focusOrder self focusOrder
add: find; add: find;
add: replace; add: replace;
add: ok; add: ok;
add: cancel. add: cancel.
self askOkToClose: true.
] ]
{ #category : #accessing } { #category : #accessing }
@ -71,6 +77,11 @@ GrafoscopioReplace >> ok: anObject [
ok := anObject ok := anObject
] ]
{ #category : #private }
GrafoscopioReplace >> okToChange [
^ false
]
{ #category : #accessing } { #category : #accessing }
GrafoscopioReplace >> replace [ GrafoscopioReplace >> replace [
^ replace ^ replace
@ -80,3 +91,8 @@ GrafoscopioReplace >> replace [
GrafoscopioReplace >> replace: anObject [ GrafoscopioReplace >> replace: anObject [
replace := anObject replace := anObject
] ]
{ #category : #api }
GrafoscopioReplace >> title [
^ 'Find & Replace'
]