ComboBoxView.st
author Claus Gittinger <cg@exept.de>
Thu, 15 Apr 1999 18:30:31 +0200
changeset 1312 4c706bd30a5c
parent 1281 94b22cb9c19f
child 2108 cbba33be6ac0
permissions -rw-r--r--
tabbing (cursor display)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
332
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
     1
"
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
     2
 COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
     3
	      All Rights Reserved
332
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
     4
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
     5
 This software is furnished under a license and may be used
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
     6
 only in accordance with the terms of that license and with the
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
     8
 be provided or otherwise made available to, or used by, any
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
     9
 other person.  No title to or ownership of the software is
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    10
 hereby transferred.
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    11
"
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    12
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    13
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    14
ComboView subclass:#ComboBoxView
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    15
	instanceVariableNames:''
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Views-Interactors'
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    21
!ComboBoxView class methodsFor:'documentation'!
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
332
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    23
copyright
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    24
"
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    25
 COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    26
	      All Rights Reserved
332
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    27
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    28
 This software is furnished under a license and may be used
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    29
 only in accordance with the terms of that license and with the
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    31
 be provided or otherwise made available to, or used by, any
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    32
 other person.  No title to or ownership of the software is
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    33
 hereby transferred.
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    34
"
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    35
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    36
!
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
    37
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    40
    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
    41
    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
    42
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    43
    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
    44
    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
    45
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    46
    Not yet finished - it may need more protocol.
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    47
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
    48
    [author:]
1281
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
    49
        Claus Gittinger
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    50
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    51
    [see also:]
1281
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
    52
        ComboView
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
    53
        PopUpList SelectionInListView
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
    54
        ComboListView ExtendedComboBox
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
    55
        PullDownMenu Label EntryField
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
"
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
examples
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
"
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    61
  non MVC operation:
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    62
									[exBegin]
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
     |top b|
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
     top := StandardSystemView new.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
     top extent:(300 @ 200).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
     b := ComboBoxView in:top.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
     b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
     b bottomInset:(b preferredExtent y negated).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
     b list:#('hello' 'world' 'this' 'is' 'st/x').
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
     top open.
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    74
									[exEnd]
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    78
  with action:
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    79
									[exBegin]
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    80
     |top b|
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    81
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    82
     top := StandardSystemView new.
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    83
     top extent:(300 @ 200).
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    84
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    85
     b := ComboBoxView in:top.
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    86
     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
    87
     b bottomInset:(b preferredExtent y negated).
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    88
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    89
     b list:#('hello' 'world' 'this' 'is' 'st/x').
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    90
     b action:[:entry | Transcript showCR:entry].
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    91
     top open.
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    92
									[exEnd]
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    93
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    94
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
    95
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
  model operation:
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    97
									[exBegin]
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
     |model top b|
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
     model := 'foo' asValue.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
     top := StandardSystemView new.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
     top extent:(300 @ 200).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
     b := ComboBoxView in:top.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
     b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
     b bottomInset:(b preferredExtent y negated).
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
     b list:#('hello' 'world' 'this' 'is' 'st/x').
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
     b model:model.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
     top openModal.
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   113
     Transcript showCR:('comboBox''s value: ' , model value).
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   114
									[exEnd]
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   115
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   116
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   117
  in a dialog:
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   118
									[exBegin]
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   119
     |model1 model2 dialog b|
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   120
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   121
     model1 := 'foo' asValue.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   122
     model2 := 'bar' asValue.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   123
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   124
     dialog := Dialog new.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   125
     (dialog addTextLabel:'ComboBox example:') adjust:#left.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   126
     dialog addVerticalSpace.
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   128
     (b := dialog addComboBoxOn:model1 tabable:true).
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   129
     b list:#('fee' 'foe' 'foo').
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   130
     dialog addVerticalSpace.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   131
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   132
     (b := dialog addComboBoxOn:model2 tabable:true).
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   133
     b list:#('bar' 'baz' 'baloo').
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   134
     dialog addVerticalSpace.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   135
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   136
     dialog addOkButton.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   137
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   138
     dialog open.
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   139
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   140
     Transcript showCR:('1st comboBox''s value: ' , model1 value).
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   141
     Transcript showCR:('2nd comboBox''s value: ' , model2 value).
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   142
									[exEnd]
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
"
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   146
!ComboBoxView methodsFor:'accessing-components'!
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   147
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   148
editor
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   149
    "return the inputField component"
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   150
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   151
    ^ field
126
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   152
888d8ccd35af better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   153
    "Created: 9.2.1996 / 20:18:03 / cg"
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   154
    "Modified: 28.2.1996 / 15:10:50 / cg"
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
!ComboBoxView methodsFor:'accessing-mvc'!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
model
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   160
    ^ field model
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    "Created: 9.2.1996 / 00:50:18 / cg"
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   163
    "Modified: 28.2.1996 / 15:10:59 / cg"
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
model:aModel
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   167
    super model:aModel.
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   168
    field model:aModel.
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    "Created: 9.2.1996 / 00:50:12 / cg"
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   171
    "Modified: 28.2.1996 / 15:11:03 / cg"
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
1312
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   174
!ComboBoxView methodsFor:'event handling'!
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   175
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   176
hasKeyboardFocus:aBoolean
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   177
    super hasKeyboardFocus:aBoolean.
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   178
    field hasKeyboardFocus:aBoolean
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   179
!
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   180
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   181
showFocus:explicit
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   182
    super showFocus:explicit.
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   183
    field showCursor.
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   184
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   185
!
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   186
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   187
showNoFocus:explicit
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   188
    super showNoFocus:explicit.
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   189
    field hideCursor.
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   190
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   191
! !
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   192
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
!ComboBoxView methodsFor:'initialization'!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   195
initializeField
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   196
    field := EditField in:self.
519
9ab4fc771a7f better look with 2D styles
Claus Gittinger <cg@exept.de>
parents: 332
diff changeset
   197
    field borderWidth:0.
279
3d96c6f3e588 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   198
    field model:(ValueHolder newString).
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   199
    field acceptOnLostFocus:true.
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   200
    field acceptOnLeave:true.
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   201
    field leaveAction:[:key | self fieldLeft].
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    "
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
     all of my input goes to the enterfield
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    "
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   206
    self delegate:(KeyboardForwarder toView:field).
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    "
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
     |b|
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
     b := ComboBoxView new.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
     b list:#('hello' 'world' 'this' 'is' 'st/x').
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
     b open
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    "
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   216
    "Created: 28.2.1996 / 15:07:51 / cg"
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   217
    "Modified: 26.2.1997 / 19:44:13 / cg"
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
1183
667132091c2f ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   220
!ComboBoxView methodsFor:'private'!
667132091c2f ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   221
667132091c2f ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   222
setFieldsFont:aFont
667132091c2f ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   223
    "ignored - the inputFields font remains unchanged"
667132091c2f ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   224
! !
667132091c2f ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   225
291
65229309ad5e specClass
ca
parents: 279
diff changeset
   226
!ComboBoxView methodsFor:'queries'!
65229309ad5e specClass
ca
parents: 279
diff changeset
   227
65229309ad5e specClass
ca
parents: 279
diff changeset
   228
specClass
597
ebb7dc78e670 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 519
diff changeset
   229
    "XXX no longer needed (inherited default works here)"
ebb7dc78e670 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 519
diff changeset
   230
291
65229309ad5e specClass
ca
parents: 279
diff changeset
   231
    self class == ComboBoxView ifTrue:[
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   232
	^ ComboBoxSpec
291
65229309ad5e specClass
ca
parents: 279
diff changeset
   233
    ].
301
edddd206a2e5 specClass query
ca
parents: 291
diff changeset
   234
    ^ super specClass
edddd206a2e5 specClass query
ca
parents: 291
diff changeset
   235
597
ebb7dc78e670 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 519
diff changeset
   236
    "Modified: / 31.10.1997 / 19:49:39 / cg"
291
65229309ad5e specClass
ca
parents: 279
diff changeset
   237
! !
65229309ad5e specClass
ca
parents: 279
diff changeset
   238
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
!ComboBoxView methodsFor:'user interaction'!
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
311
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   241
fieldLeft
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   242
    field accept.
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   243
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   244
    action notNil ifTrue:[
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   245
	action value:(field contents)
311
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   246
    ].
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   247
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   248
    "Modified: 26.2.1997 / 19:38:24 / cg"
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   249
    "Created: 26.2.1997 / 19:42:30 / cg"
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   250
!
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   251
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   252
select:index
230
0c32e90e689b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   253
    |what|
0c32e90e689b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   254
0c32e90e689b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   255
    what := list at:index.
130
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   256
    field contents:what.
5cad43b11fb5 inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   257
    field accept.
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
    pullDownButton turnOff.
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   260
    action notNil ifTrue:[
679
bd0e422aab67 fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   261
	action value:what
305
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   262
    ].
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   263
7dd100869f7b cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   264
    "Modified: 26.2.1997 / 19:38:24 / cg"
311
Claus Gittinger <cg@exept.de>
parents: 305
diff changeset
   265
    "Created: 28.2.1997 / 14:01:53 / cg"
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
! !
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
275
da88b7732dff commentary
Claus Gittinger <cg@exept.de>
parents: 230
diff changeset
   268
!ComboBoxView class methodsFor:'documentation'!
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
version
1312
4c706bd30a5c tabbing (cursor display)
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   271
    ^ '$Header: /cvs/stx/stx/libwidg2/ComboBoxView.st,v 1.24 1999-04-15 16:30:31 cg Exp $'
124
4244606d3a06 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
! !