ComboListV.st
author Claus Gittinger <cg@exept.de>
Thu, 09 Jan 1997 12:57:57 +0100
changeset 275 da88b7732dff
parent 272 6c6466cd4ea1
child 278 4a22889a5730
permissions -rw-r--r--
commentary
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
ComboView subclass:#ComboListView
231
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
     2
	instanceVariableNames:'useIndex'
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	classVariableNames:''
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	poolDictionaries:''
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	category:'Views-Interactors'
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
!
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
270
35558a88d500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 238
diff changeset
     8
!ComboListView class methodsFor:'documentation'!
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
documentation
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
    A ComboListView combines an label with a drop down list of default inputs;
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
    choosing any from the pulled list sets the string in the label.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
    This is the same as a PopUpList or SelectionInListView, bit looks different.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    17
    Not yet finished - it may need more protocol.
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    18
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    19
    [author:]
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    20
        Claus Gittinger
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    21
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    22
    [see also:]
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    23
        ComboView
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    24
        PopUpList SelectionInListView
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    25
        ComboBoxView
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
    26
        PullDownMenu Label EntryField
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
examples
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    32
                                                                [exBegin]
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
     |top b|
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
     top := StandardSystemView new.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
     top extent:(300 @ 200).
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
     b := ComboListView in:top.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
     b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
     b bottomInset:(b preferredExtent y negated).
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
     b list:#('hello' 'world' 'this' 'is' 'st/x').
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
     top open.
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    44
                                                                [exEnd]
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
  model operation:
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    49
                                                                [exBegin]
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
     |model top b|
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
     model := 'foo' asValue.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
     top := StandardSystemView new.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
     top extent:(300 @ 200).
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
     b := ComboListView in:top.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
     b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
     b bottomInset:(b preferredExtent y negated).
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
     b list:#('hello' 'world' 'this' 'is' 'st/x').
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
     b model:model.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
     top openModal.
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
    65
     Transcript showCR:('comboBox''s value: ' , model value).
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    66
                                                                [exEnd]
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
  in a dialog:
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    70
                                                                [exBegin]
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
     |model1 model2 dialog b|
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
     model1 := 'foo' asValue.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
     model2 := 'bar' asValue.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
     dialog := Dialog new.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
     (dialog addTextLabel:'ComboList example:') adjust:#left.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
     dialog addVerticalSpace.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
     (b := dialog addComboListOn:model1 tabable:true).
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
     b list:#('fee' 'foe' 'foo').
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
     dialog addVerticalSpace.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
     (b := dialog addComboListOn:model2 tabable:true).
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
     b list:#('bar' 'baz' 'baloo').
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
     dialog addVerticalSpace.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
     dialog addOkButton.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
     dialog open.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
    92
     Transcript showCR:('1st comboBox''s value: ' , model1 value).
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
    93
     Transcript showCR:('2nd comboBox''s value: ' , model2 value).
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    94
                                                                [exEnd]
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
"
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
! !
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
231
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
    98
!ComboListView methodsFor:'accessing-behavior'!
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
    99
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   100
useIndex:aBoolean
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   101
    "specify, if the selected components value or its index in the
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   102
     list should be sent to the model. The default is its value."
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   103
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   104
    useIndex := aBoolean.
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   105
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   106
    "Created: 26.7.1996 / 17:44:18 / cg"
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   107
! !
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   108
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
!ComboListView methodsFor:'accessing-components'!
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
label 
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   112
    "return the label component"
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    ^ field
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    "Modified: 28.2.1996 / 15:10:50 / cg"
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    "Created: 28.2.1996 / 15:13:51 / cg"
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
! !
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
215
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   120
!ComboListView methodsFor:'accessing-contents'!
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   121
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   122
contents:something
272
6c6466cd4ea1 commentary
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   123
    "set the current value - either in the fields model
6c6466cd4ea1 commentary
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   124
     or directly"
6c6466cd4ea1 commentary
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   125
215
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   126
    |m|
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   127
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   128
    (m := field model) notNil ifTrue:[
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   129
        m value:something
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   130
    ] ifFalse:[
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   131
        field label:something
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   132
    ]
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   133
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   134
    "Created: 15.7.1996 / 13:16:49 / cg"
272
6c6466cd4ea1 commentary
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   135
    "Modified: 5.1.1997 / 00:05:04 / cg"
215
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   136
! !
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   137
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
!ComboListView methodsFor:'initialization'!
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
231
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   140
initialize
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   141
    useIndex isNil ifTrue:[useIndex := false].
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   142
    super initialize.
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   143
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   144
    "Created: 26.7.1996 / 17:44:57 / cg"
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   145
!
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   146
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
initializeField
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    field := Label in:self.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    field level:-1.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
    field adjust:#left.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    "
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
     |b|
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
     b := ComboListView new.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
     b list:#('hello' 'world' 'this' 'is' 'st/x').
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
     b open
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    "
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    "Created: 28.2.1996 / 15:13:46 / cg"
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    "Modified: 28.2.1996 / 15:18:40 / cg"
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
! !
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
215
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   164
!ComboListView methodsFor:'private'!
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   165
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   166
getValueFromModel
232
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   167
    |val|
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   168
215
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   169
    model notNil ifTrue:[
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   170
        (model respondsTo:#selection) ifTrue:[
232
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   171
            "/ mhmh - looks like a selectionInList model
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   172
            useIndex ifTrue:[
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   173
                val := list at:(model selectionIndex)
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   174
            ] ifFalse:[
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   175
                val := (model selection)
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   176
            ]
231
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   177
        ] ifFalse:[
232
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   178
            "/ mhmh - looks like a valueHolder
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   179
            useIndex ifTrue:[
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   180
                val := list at:(model value)
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   181
            ] ifFalse:[
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   182
                val := model value
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   183
            ].
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   184
        ].
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   185
        self contents:val
215
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   186
    ].
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   187
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   188
    "Created: 15.7.1996 / 12:28:53 / cg"
232
23dd09b9fbdf also care for #useIndex: when fetching values from the model
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   189
    "Modified: 26.7.1996 / 18:07:04 / cg"
215
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   190
! !
28541bca7791 get value from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   191
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
!ComboListView methodsFor:'user interaction'!
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
231
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   194
entryChanged:index
270
35558a88d500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 238
diff changeset
   195
    |what changeArg|
231
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   196
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   197
    what := list at:index.
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    field label:what.
238
6be113228de3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 232
diff changeset
   199
231
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   200
    model notNil ifTrue:[
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   201
        useIndex ifTrue:[
270
35558a88d500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 238
diff changeset
   202
            changeArg := index
231
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   203
        ] ifFalse:[
270
35558a88d500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 238
diff changeset
   204
            changeArg := what
35558a88d500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 238
diff changeset
   205
        ].
35558a88d500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 238
diff changeset
   206
        self sendChangeMessage:changeMsg with:changeArg
231
3cb7dafa8cd2 allow index-passing (#useIndex:)
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
   207
    ].
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    pullDownButton turnOff.
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
    "Created: 28.2.1996 / 15:13:46 / cg"
238
6be113228de3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 232
diff changeset
   211
    "Modified: 4.9.1996 / 22:38:57 / cg"
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
! !
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
270
35558a88d500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 238
diff changeset
   214
!ComboListView class methodsFor:'documentation'!
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
version
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 272
diff changeset
   217
    ^ '$Header: /cvs/stx/stx/libwidg2/Attic/ComboListV.st,v 1.10 1997-01-09 11:57:57 cg Exp $'
131
ee1b6e7cdf75 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
! !