From 9ae4f36ca803f6578b2b473757a5d4a6cc329d45 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sat, 16 Sep 2017 18:39:26 +0000 Subject: [PATCH] GrafoscopioFind > Closing of the window: starting implementation. --- .../GrafoscopioButtonModel.class.st | 40 +++++++++++++++++++ .../Grafoscopio/GrafoscopioReplace.class.st | 22 ++++++++-- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/repository/Grafoscopio/GrafoscopioButtonModel.class.st b/repository/Grafoscopio/GrafoscopioButtonModel.class.st index 89ad1d4..a79e165 100644 --- a/repository/Grafoscopio/GrafoscopioButtonModel.class.st +++ b/repository/Grafoscopio/GrafoscopioButtonModel.class.st @@ -34,13 +34,53 @@ GrafoscopioButtonModel >> button: anObject [ button := anObject ] +{ #category : #accessing } +GrafoscopioButtonModel >> cancel [ + ^ cancel +] + +{ #category : #accessing } +GrafoscopioButtonModel >> cancel: anObject [ + cancel := anObject +] + { #category : #api } GrafoscopioButtonModel >> content: anAssoc [ button label: anAssoc key. button action: anAssoc value. ] +{ #category : #accessing } +GrafoscopioButtonModel >> find [ + ^ find +] + +{ #category : #accessing } +GrafoscopioButtonModel >> find: anObject [ + find := anObject +] + { #category : #initalize } GrafoscopioButtonModel >> initializeWidgets [ 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 +] diff --git a/repository/Grafoscopio/GrafoscopioReplace.class.st b/repository/Grafoscopio/GrafoscopioReplace.class.st index bbb287e..9283367 100644 --- a/repository/Grafoscopio/GrafoscopioReplace.class.st +++ b/repository/Grafoscopio/GrafoscopioReplace.class.st @@ -47,18 +47,24 @@ GrafoscopioReplace >> find: anObject [ { #category : #initialization } GrafoscopioReplace >> initializeWidgets [ - find := self newText. - replace := self newText. + find := self newTextInput + ghostText: 'Text to find...'; + autoAccept: true. + replace := self newTextInput + ghostText: 'Text to replace...'; + autoAccept: true. ok := self newButton label: 'OK'; action: [ Transcript show: self find getText ]. cancel := self newButton - label: 'Cancel'. + label: 'Cancel'; + action: [ super closeWindowAction ]. self focusOrder add: find; add: replace; add: ok; add: cancel. + self askOkToClose: true. ] { #category : #accessing } @@ -71,6 +77,11 @@ GrafoscopioReplace >> ok: anObject [ ok := anObject ] +{ #category : #private } +GrafoscopioReplace >> okToChange [ + ^ false +] + { #category : #accessing } GrafoscopioReplace >> replace [ ^ replace @@ -80,3 +91,8 @@ GrafoscopioReplace >> replace [ GrafoscopioReplace >> replace: anObject [ replace := anObject ] + +{ #category : #api } +GrafoscopioReplace >> title [ + ^ 'Find & Replace' +]