Skip to content

Commit 86cde49

Browse files
committed
Adapt to PluggableLists refactoring.
1 parent aab738a commit 86cde49

File tree

2 files changed

+30
-39
lines changed

2 files changed

+30
-39
lines changed

IA-EN-Dictionary/IA-EN-Dictionary.pck.st

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
'From Cuis 6.0 [latest update: #5979] on 9 August 2023 at 10:00:08 pm'!
1+
'From Cuis7.1 [latest update: #6378] on 18 May 2024 at 4:42:11 pm'!
22
'Description Enter a word in English or Interlingua and find the corresponding Interlingua or English usage.'!
3-
!provides: 'IA-EN-Dictionary' 1 26!
3+
!provides: 'IA-EN-Dictionary' 1 27!
44
!requires: 'Cuis-Base' 50 4413 nil!
55
!requires: 'Morphic-Widgets-Extras' 1 7 nil!
6-
SystemOrganization addCategory: 'IA-EN-Dictionary'!
6+
SystemOrganization addCategory: #'IA-EN-Dictionary'!
77

88

9-
!classDefinition: #IEDictWindow category: 'IA-EN-Dictionary'!
9+
!classDefinition: #IEDictWindow category: #'IA-EN-Dictionary'!
1010
SystemWindow subclass: #IEDictWindow
1111
instanceVariableNames: 'entryTextMorph promptMorph resultMorph'
1212
classVariableNames: ''
1313
poolDictionaries: 'IAENDictionary'
1414
category: 'IA-EN-Dictionary'!
15-
!classDefinition: 'IEDictWindow class' category: 'IA-EN-Dictionary'!
15+
!classDefinition: 'IEDictWindow class' category: #'IA-EN-Dictionary'!
1616
IEDictWindow class
1717
instanceVariableNames: ''!
1818

19-
!classDefinition: #IEDict category: 'IA-EN-Dictionary'!
19+
!classDefinition: #IEDict category: #'IA-EN-Dictionary'!
2020
Object subclass: #IEDict
2121
instanceVariableNames: 'searchString searchResult resultIndex'
2222
classVariableNames: 'DictData'
2323
poolDictionaries: 'IAENDictionary'
2424
category: 'IA-EN-Dictionary'!
25-
!classDefinition: 'IEDict class' category: 'IA-EN-Dictionary'!
25+
!classDefinition: 'IEDict class' category: #'IA-EN-Dictionary'!
2626
IEDict class
2727
instanceVariableNames: 'result'!
2828

@@ -166,18 +166,18 @@ makeEntryArea
166166
yourself
167167
! !
168168

169-
!IEDictWindow methodsFor: 'GUI building' stamp: 'KenD 11/7/2016 14:25:13'!
169+
!IEDictWindow methodsFor: 'GUI building' stamp: 'jmv 5/17/2024 17:57:50'!
170170
makeResultsArea
171171
"Answer a LayoutMoph containing the results of the query"
172172

173173
resultMorph := (PluggableListMorph
174-
model: model
174+
withModel: model
175175
listGetter: #resultAsList
176176
indexGetter: #resultIndex
177-
indexSetter: #resultIndex:
178-
mainView: self
179-
menuGetter: #resultsMenu
180-
keystrokeAction: #resultsKey:from:).
177+
indexSetter: #resultIndex:)
178+
mainView: self
179+
menuGetter: #resultsMenu
180+
keystrokeAction: #resultsKey:from:.
181181

182182
^ resultMorph
183183
layoutSpec: (LayoutSpec proportionalWidth: 1.0 proportionalHeight: 0.98);

Patterns/Code-Patterns.pck.st

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
'From Cuis 5.0 [latest update: #4208] on 8 June 2020 at 9:47:45 am'!
1+
'From Cuis7.1 [latest update: #6378] on 18 May 2024 at 4:27:24 pm'!
22
'Description Useful Cuis code patterns, intended to help the programmer exploit some of the features of Cuis classes. These examples separate model from view and feature two styles: coupled and decoupled.
33

44
The coupled style employs the "dependency mechanism" and exposes the model to changes in the view and to views which were unanticipated. The primary methods of the dependency mechanism are #changed: and #update: .
55

66
The decoupled style employs the "observer pattern" which ensures that the model can remain unaffected by changes to the view or by additional views. The primary methods of the observer pattern are #triggerEvent: and #when:send:to: . This is the preferred style for Cuis, although both styles can be found in the base.
77
'!
8-
!provides: 'Code-Patterns' 1 4!
8+
!provides: 'Code-Patterns' 1 5!
99
SystemOrganization addCategory: #'Code-Patterns'!
1010

1111

@@ -283,25 +283,22 @@ authorIndex: anObject
283283
initialize
284284
super initialize! !
285285

286-
!AnotherView methodsFor: 'initialization' stamp: 'dhn 1/4/2016 14:41'!
286+
!AnotherView methodsFor: 'initialization' stamp: 'jmv 5/17/2024 17:55:33'!
287287
buildMorphicWindow
288288
"Specify the layout of the view"
289289
| listM |
290290

291291
self layoutMorph beRow "make use of the layoutMorph already in SystemWindow; change it from column to row"
292292
name: #'Pattern Row'. "give the layoutMorph a name which will appear in the halos"
293293

294-
listM _ (PluggableListMorph
295-
model: model "the object specified in self class open"
294+
listM := (PluggableListMorph
295+
withModel: model "the object specified in self class open"
296296
listGetter: #authors "the method in 'model' which answers the list content"
297297
indexGetter: #authorIndex "the method in 'model' which answers the selection made in the list"
298-
indexSetter: #authorIndex: "the method in 'model' which sets the list index"
299-
mainView: nil
300-
menuGetter: nil
301-
keystrokeAction: nil)
298+
indexSetter: #authorIndex: )"the method in 'model' which sets the list index"
302299
name: #author. "give the PluggableListMorph a name which will appear in the halos"
303300

304-
textPane _ (TextModelMorph
301+
textPane := (TextModelMorph
305302
withModel: (TextModel withText: 'foo')) "note the different model specification"
306303
askBeforeDiscardingEdits: false; "discard changes to the text"
307304
name: #quote. "give the TextModelMorph a name which will appear in the halos"
@@ -567,22 +564,19 @@ title
567564

568565
^ 'Buttons Up on the Decoupled Model'! !
569566

570-
!CoupledView methodsFor: 'initialization' stamp: 'dhn 12/8/2015 12:55'!
567+
!CoupledView methodsFor: 'initialization' stamp: 'jmv 5/17/2024 17:54:20'!
571568
buildMorphicWindow
572569
"Specify the layout of the view"
573570
| listM |
574571

575-
listM _ (PluggableListMorph
576-
model: model "the object specified in self class open"
572+
listM := (PluggableListMorph
573+
withModel: model "the object specified in self class open"
577574
listGetter: #authors "the method in 'model' which answers the list content"
578575
indexGetter: #authorIndex "the method in 'model' which answers the selection made in the list"
579-
indexSetter: #authorIndex: "the method in 'model' which sets the list index"
580-
mainView: nil
581-
menuGetter: nil
582-
keystrokeAction: nil)
576+
indexSetter: #authorIndex: )"the method in 'model' which sets the list index"
583577
name: #author. "give the PluggableListMorph a name which will appear in the halos"
584578

585-
textMorph _ (TextModelMorph
579+
textMorph := (TextModelMorph
586580
withModel: (TextModel withText: 'foo')) "note the different model specification"
587581
askBeforeDiscardingEdits: false; "discard changes to the text"
588582
name: #quote. "give the TextModelMorph a name which will appear in the halos"
@@ -650,25 +644,22 @@ open
650644
or, use a Color class method"
651645
! !
652646

653-
!DecoupledView methodsFor: 'initialization' stamp: 'dhn 1/4/2016 14:39'!
647+
!DecoupledView methodsFor: 'initialization' stamp: 'jmv 5/17/2024 17:55:51'!
654648
buildMorphicWindow
655649
"Specify the layout of the view"
656650
| listM |
657651

658652
self layoutMorph beRow "make use of the layoutMorph already in SystemWindow; change it from column to row"
659653
name: #'Pattern Row'. "give the layoutMorph a name which will appear in the halos"
660654

661-
listM _ (PluggableListMorph
662-
model: model "the object specified in self class open"
655+
listM := (PluggableListMorph
656+
withModel: model "the object specified in self class open"
663657
listGetter: #authors "the method in 'model' which answers the list content"
664658
indexGetter: #authorIndex "the method in 'model' which answers the selection made in the list"
665-
indexSetter: #authorIndex: "the method in 'model' which sets the list index"
666-
mainView: nil
667-
menuGetter: nil
668-
keystrokeAction: nil)
659+
indexSetter: #authorIndex:) "the method in 'model' which sets the list index"
669660
name: #author. "give the PluggableListMorph a name which will appear in the halos"
670661

671-
textPane _ (TextModelMorph
662+
textPane := (TextModelMorph
672663
withModel: (TextModel withText: 'foo')) "note the different model specification"
673664
askBeforeDiscardingEdits: false; "discard changes to the text"
674665
name: #quote. "give the TextModelMorph a name which will appear in the halos"

0 commit comments

Comments
 (0)