ComboBoxView.st
author Claus Gittinger <cg@exept.de>
Fri, 28 Feb 1997 14:02:31 +0100
changeset 311 d790d0524822
parent 305 7dd100869f7b
child 332 78dcd3cacbfd
permissions -rw-r--r--
oops
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
     1
ComboView subclass:#ComboBoxView
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
     2
	instanceVariableNames:''
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	classVariableNames:''
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	poolDictionaries:''
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	category:'Views-Interactors'
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
     8
!ComboBoxView class methodsFor:'documentation'!
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
documentation
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    12
    A ComboBoxView combines an inputField with a drop down list of default inputs;
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    13
    choosing any from the pulled list presets the string in the field.
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    14
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    15
    In contrast to a PopUpList or ComboListView, the string can still be edited -
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    16
    the list is actually only a set of values for the convenience of the user.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    17
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    18
    Not yet finished - it may need more protocol.
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    19
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    20
    [author:]
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    21
        Claus Gittinger
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    22
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    23
    [see also:]
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    24
        ComboView
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    25
        PopUpList SelectionInListView
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    26
        ComboListView
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    27
        PullDownMenu Label EntryField
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
examples
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
"
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    33
  non MVC operation:
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    34
                                                                        [exBegin]
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
     |top b|
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
     top := StandardSystemView new.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
     top extent:(300 @ 200).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
     b := ComboBoxView in:top.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
     b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
     b bottomInset:(b preferredExtent y negated).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
     b list:#('hello' 'world' 'this' 'is' 'st/x').
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
     top open.
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    46
                                                                        [exEnd]
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    50
  with action:
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    51
                                                                        [exBegin]
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    52
     |top b|
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    53
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    54
     top := StandardSystemView new.
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    55
     top extent:(300 @ 200).
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    56
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    57
     b := ComboBoxView in:top.
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    58
     b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    59
     b bottomInset:(b preferredExtent y negated).
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    60
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    61
     b list:#('hello' 'world' 'this' 'is' 'st/x').
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    62
     b action:[:entry | Transcript showCR:entry].
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    63
     top open.
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    64
                                                                        [exEnd]
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    65
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    66
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    67
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
  model operation:
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    69
                                                                        [exBegin]
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
     |model top b|
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
     model := 'foo' asValue.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
     top := StandardSystemView new.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
     top extent:(300 @ 200).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
     b := ComboBoxView in:top.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
     b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
     b bottomInset:(b preferredExtent y negated).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
     b list:#('hello' 'world' 'this' 'is' 'st/x').
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
     b model:model.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
     top openModal.
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
    85
     Transcript showCR:('comboBox''s value: ' , model value).
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    86
                                                                        [exEnd]
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    87
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    88
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    89
  in a dialog:
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    90
                                                                        [exBegin]
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    91
     |model1 model2 dialog b|
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    92
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    93
     model1 := 'foo' asValue.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    94
     model2 := 'bar' asValue.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    95
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    96
     dialog := Dialog new.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    97
     (dialog addTextLabel:'ComboBox example:') adjust:#left.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
    98
     dialog addVerticalSpace.
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   100
     (b := dialog addComboBoxOn:model1 tabable:true).
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   101
     b list:#('fee' 'foe' 'foo').
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   102
     dialog addVerticalSpace.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   103
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   104
     (b := dialog addComboBoxOn:model2 tabable:true).
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   105
     b list:#('bar' 'baz' 'baloo').
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   106
     dialog addVerticalSpace.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   107
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   108
     dialog addOkButton.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   109
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   110
     dialog open.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   111
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   112
     Transcript showCR:('1st comboBox''s value: ' , model1 value).
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   113
     Transcript showCR:('2nd comboBox''s value: ' , model2 value).
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   114
                                                                        [exEnd]
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
"
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   118
!ComboBoxView methodsFor:'accessing-components'!
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   119
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   120
editor
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   121
    "return the inputField component"
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   122
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   123
    ^ field
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   124
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   125
    "Created: 9.2.1996 / 20:18:03 / cg"
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   126
    "Modified: 28.2.1996 / 15:10:50 / cg"
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
!ComboBoxView methodsFor:'accessing-mvc'!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
135
1c113f77460e accept forwarded to field
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
   131
accept
1c113f77460e accept forwarded to field
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
   132
    field accept
1c113f77460e accept forwarded to field
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
   133
1c113f77460e accept forwarded to field
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
   134
    "Created: 4.3.1996 / 12:15:18 / cg"
1c113f77460e accept forwarded to field
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
   135
!
1c113f77460e accept forwarded to field
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
   136
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
model
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   138
    ^ field model
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    "Created: 9.2.1996 / 00:50:18 / cg"
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   141
    "Modified: 28.2.1996 / 15:10:59 / cg"
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
model:aModel
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   145
    field model:aModel.
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    "Created: 9.2.1996 / 00:50:12 / cg"
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   148
    "Modified: 28.2.1996 / 15:11:03 / cg"
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
!ComboBoxView methodsFor:'initialization'!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   153
initializeField
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   154
    field := EditField in:self.
279
3d96c6f3e588 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   155
    field model:(ValueHolder newString).
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   156
    field acceptOnLostFocus:true.
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   157
    field acceptOnLeave:true.
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   158
    field leaveAction:[:key | self fieldLeft].
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    "
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
     all of my input goes to the enterfield
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    "
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   163
    self delegate:(KeyboardForwarder toView:field).
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
    "
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
     |b|
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
     b := ComboBoxView new.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
     b list:#('hello' 'world' 'this' 'is' 'st/x').
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
     b open
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    "
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   173
    "Created: 28.2.1996 / 15:07:51 / cg"
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   174
    "Modified: 26.2.1997 / 19:44:13 / cg"
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
291
65229309ad5e specClass
ca
parents: 279
diff changeset
   177
!ComboBoxView methodsFor:'queries'!
65229309ad5e specClass
ca
parents: 279
diff changeset
   178
65229309ad5e specClass
ca
parents: 279
diff changeset
   179
specClass
65229309ad5e specClass
ca
parents: 279
diff changeset
   180
    self class == ComboBoxView ifTrue:[
65229309ad5e specClass
ca
parents: 279
diff changeset
   181
        ^ ComboBoxSpec
65229309ad5e specClass
ca
parents: 279
diff changeset
   182
    ].
301
edddd206a2e5 specClass query
ca
parents: 291
diff changeset
   183
    ^ super specClass
edddd206a2e5 specClass query
ca
parents: 291
diff changeset
   184
291
65229309ad5e specClass
ca
parents: 279
diff changeset
   185
! !
65229309ad5e specClass
ca
parents: 279
diff changeset
   186
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
!ComboBoxView methodsFor:'user interaction'!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
311
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   189
fieldLeft
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   190
    field accept.
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   191
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   192
    action notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   193
        action value:(field contents)
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   194
    ].
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   195
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   196
    "Modified: 26.2.1997 / 19:38:24 / cg"
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   197
    "Created: 26.2.1997 / 19:42:30 / cg"
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   198
!
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   199
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   200
select:index
230
0c32e90e689b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   201
    |what|
0c32e90e689b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   202
0c32e90e689b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   203
    what := list at:index.
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   204
    field contents:what.
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   205
    field accept.
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    pullDownButton turnOff.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   208
    action notNil ifTrue:[
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   209
        action value:what
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   210
    ].
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   211
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   212
    "Modified: 26.2.1997 / 19:38:24 / cg"
311
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   213
    "Created: 28.2.1997 / 14:01:53 / cg"
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
   216
!ComboBoxView class methodsFor:'documentation'!
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
version
311
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   219
    ^ '$Header: /cvs/stx/stx/libwidg2/ComboBoxView.st,v 1.15 1997-02-28 13:02:31 cg Exp $'
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
! !