ComboView.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:53:39 +0200
changeset 6083 7a2c0a30e75c
parent 6040 a3296ee359af
child 6088 1b000948eeda
permissions -rw-r--r--
#REFACTORING by exept class: NoteBookView changed: #buttonPress:x:y: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5949
10935e855698 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5923
diff changeset
     1
"{ Encoding: utf8 }"
10935e855698 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5923
diff changeset
     2
1301
93a3ec8c339c OOPS - stefan what happened to your checkin (garbage)
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
     3
"
332
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     4
 COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     5
              All Rights Reserved
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     6
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     7
 This software is furnished under a license and may be used
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     8
 only in accordance with the terms of that license and with the
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    10
 be provided or otherwise made available to, or used by, any
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    11
 other person.  No title to or ownership of the software is
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    12
 hereby transferred.
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    13
"
1884
bf33562ea53b use rootWindowId (save a message send)
Claus Gittinger <cg@exept.de>
parents: 1696
diff changeset
    14
"{ Package: 'stx:libwidg2' }"
bf33562ea53b use rootWindowId (save a message send)
Claus Gittinger <cg@exept.de>
parents: 1696
diff changeset
    15
4824
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
    16
"{ NameSpace: Smalltalk }"
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
    17
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
View subclass:#ComboView
3312
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
    19
	instanceVariableNames:'field pullDownButton list listHolder listMsg action resizableMenu
4187
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
    20
		currentIndex comboMenuHolder comboMenuMessage'
2950
431dafff127d cash comboButtonForms
ca
parents: 2892
diff changeset
    21
	classVariableNames:'DefaultButtonForm ComboButtonForms'
1306
56e90a9e5da1 renambe #enableStateChange to #enableStateChanged
Claus Gittinger <cg@exept.de>
parents: 1301
diff changeset
    22
	poolDictionaries:''
56e90a9e5da1 renambe #enableStateChange to #enableStateChanged
Claus Gittinger <cg@exept.de>
parents: 1301
diff changeset
    23
	category:'Views-Interactors'
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
263
865b7d99d3f5 added an example for a menu-pull-hook
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
    26
!ComboView class methodsFor:'documentation'!
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
332
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    28
copyright
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    29
"
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    30
 COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    31
              All Rights Reserved
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    32
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    33
 This software is furnished under a license and may be used
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    34
 only in accordance with the terms of that license and with the
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    35
 inclusion of the above copyright notice.   This software may not
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    36
 be provided or otherwise made available to, or used by, any
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    37
 other person.  No title to or ownership of the software is
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    38
 hereby transferred.
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    39
"
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    40
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    41
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    42
!
78dcd3cacbfd documentation
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    43
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
documentation
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    A ComboView combines some field (typically an enterField or Label)
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    with a drop down list of default inputs;
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    ComboView is abstract, providing protocol common to ComboBoxView and
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    ComboListView. See documentation & examples there.
274
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    50
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    51
    [author:]
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    52
        Claus Gittinger
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    53
3312
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
    54
    [instance variables:]
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
    55
        currentIndex    Integer     index into the list, that is currently selected
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
    56
274
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    57
    [see also:]
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    58
        PopUpList
1281
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1210
diff changeset
    59
        ComboListView ComboBoxView ExtendedComboBox
274
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    60
        PullDownMenu Label EntryField
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
"
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
!
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
examples
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
"
308
922a96deba3e examples removed; cleanup
Claus Gittinger <cg@exept.de>
parents: 304
diff changeset
    66
  see examples in ComboListView and ComboBoxView
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
"
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
! !
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
263
865b7d99d3f5 added an example for a menu-pull-hook
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
    70
!ComboView class methodsFor:'defaults'!
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
5889
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
    72
activeForm
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
    73
    <resource: #style (#'comboView.activeDownForm' 
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
    74
                       #'comboView.activeDownFormFile')>
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
    75
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
    76
    ^ self formForKey:#activeLogo styleFormKey:#'comboView.activeDownForm' styleFilenameKey:#'comboView.activeDownFormFile'
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
    77
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
    78
    "Created: / 17-08-2018 / 17:21:52 / Claus Gittinger"
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
    79
!
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
    80
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
buttonForm
282
95209b20eaca commentary
Claus Gittinger <cg@exept.de>
parents: 280
diff changeset
    82
    "return the pull-buttons image"
95209b20eaca commentary
Claus Gittinger <cg@exept.de>
parents: 280
diff changeset
    83
1344
100e4d309847 support for disabled-image in pull-button
Claus Gittinger <cg@exept.de>
parents: 1334
diff changeset
    84
    <resource: #style (#'comboView.downForm' 
100e4d309847 support for disabled-image in pull-button
Claus Gittinger <cg@exept.de>
parents: 1334
diff changeset
    85
                       #'comboView.downFormFile')>
274
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    86
276
8f90ed6c37bc allow either fileName or form to be given by styleSheet
Claus Gittinger <cg@exept.de>
parents: 274
diff changeset
    87
    |fileName form|
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
525
d0731a41d19f cache the pull-button image
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    89
    DefaultButtonForm notNil ifTrue:[
d0731a41d19f cache the pull-button image
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    90
        ^ DefaultButtonForm
d0731a41d19f cache the pull-button image
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    91
    ].
d0731a41d19f cache the pull-button image
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    92
1334
cc79acaebf00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
    93
    form := StyleSheet at:#'comboView.downForm'.
274
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    94
    form isNil ifTrue:[
1334
cc79acaebf00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
    95
        fileName := StyleSheet at:#'comboView.downFormFile' "default:'ComboDn.14.xbm'".
1622
ea4d9baf568f try bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents: 1560
diff changeset
    96
        fileName notNil ifTrue:[
1633
e3b4e18f4545 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
    97
            form := Smalltalk imageFromFileNamed:fileName forClass:self.
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
    98
            form isNil ifTrue:[
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
    99
                form := Smalltalk imageFromFileNamed:fileName inPackage:'stx:libwidg'.
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   100
            ]
1622
ea4d9baf568f try bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents: 1560
diff changeset
   101
        ].
274
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   102
    ].
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   103
    form isNil ifTrue:[
5383
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   104
        form  := self defaultButtonForm.
274
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   105
    ].
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   106
    form notNil ifTrue:[
525
d0731a41d19f cache the pull-button image
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   107
        form := DefaultButtonForm := form onDevice:Display.
d0731a41d19f cache the pull-button image
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   108
        ^ form
274
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   109
    ].
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   110
    ^ nil
92b51554b1d7 allow form to be specified by styleSheet
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   111
1344
100e4d309847 support for disabled-image in pull-button
Claus Gittinger <cg@exept.de>
parents: 1334
diff changeset
   112
    "Modified: / 28.4.1999 / 12:49:42 / cg"
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   113
!
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   114
3839
d269a10c33c9 comment/format in: #comboButtonFor:
Claus Gittinger <cg@exept.de>
parents: 3836
diff changeset
   115
comboButtonFor:aComboView
5889
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   116
    <resource: #style (#'comboView.button.activeForegroundColor'
2176
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   117
                       #'comboView.button.activeBackgroundColor'
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   118
                       #'comboView.button.activeLevel'
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   119
                       #'comboView.button.passiveLevel'  )>
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   120
5889
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   121
    |pullDownButton logo disabledLogo activeLogo enteredLogo lvl clr|
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   122
3839
d269a10c33c9 comment/format in: #comboButtonFor:
Claus Gittinger <cg@exept.de>
parents: 3836
diff changeset
   123
    pullDownButton := ComboBoxButton in:aComboView.
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   124
    pullDownButton controller beTriggerOnDown.
2785
3c705bdd5792 Do not use obsolete message #logo:
Stefan Vogel <sv@exept.de>
parents: 2750
diff changeset
   125
    pullDownButton label:(logo := self buttonForm).
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   126
2950
431dafff127d cash comboButtonForms
ca
parents: 2892
diff changeset
   127
    ComboButtonForms isNil ifTrue:[
431dafff127d cash comboButtonForms
ca
parents: 2892
diff changeset
   128
        ComboButtonForms := IdentityDictionary new.
431dafff127d cash comboButtonForms
ca
parents: 2892
diff changeset
   129
    ].
431dafff127d cash comboButtonForms
ca
parents: 2892
diff changeset
   130
5889
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   131
    disabledLogo := self disabledForm.
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   132
    activeLogo := self activeForm.
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   133
    enteredLogo := self enteredForm.
2950
431dafff127d cash comboButtonForms
ca
parents: 2892
diff changeset
   134
2176
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   135
    disabledLogo notNil ifTrue:[
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   136
        pullDownButton passiveLogo:logo.
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   137
        pullDownButton activeLogo:logo.
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   138
        pullDownButton disabledLogo:disabledLogo.
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   139
    ].
2950
431dafff127d cash comboButtonForms
ca
parents: 2892
diff changeset
   140
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   141
    pullDownButton showLamp:false.
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   142
2176
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   143
    activeLogo notNil ifTrue:[
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   144
        pullDownButton activeLogo:activeLogo.
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   145
        pullDownButton passiveLogo:logo.
2785
3c705bdd5792 Do not use obsolete message #logo:
Stefan Vogel <sv@exept.de>
parents: 2750
diff changeset
   146
        pullDownButton label:logo.
2176
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   147
    ].
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   148
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   149
    enteredLogo notNil ifTrue:[
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   150
        pullDownButton enteredLogo:enteredLogo.
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   151
    ].
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   152
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   153
    (lvl := StyleSheet at:#'comboView.button.activeLevel') notNil ifTrue:[
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   154
        pullDownButton activeLevel:lvl
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   155
    ].
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   156
    (lvl := StyleSheet at:#'comboView.button.passiveLevel') notNil ifTrue:[
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   157
        pullDownButton passiveLevel:lvl
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   158
    ].
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   159
2176
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   160
    (clr := StyleSheet colorAt:#'comboView.button.activeForegroundColor') notNil ifTrue:[
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   161
        pullDownButton activeForegroundColor:clr
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   162
    ].
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   163
    (clr := StyleSheet colorAt:#'comboView.button.activeBackgroundColor') notNil ifTrue:[
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   164
        pullDownButton activeBackgroundColor:clr
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   165
    ].
a4ddd3e25bee background from styleSheet
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
   166
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   167
    pullDownButton activeLevel == pullDownButton passiveLevel ifTrue:[
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   168
        pullDownButton activeLevel:0.
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   169
    ].
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   170
    ^ pullDownButton.
5889
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   171
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   172
    "Modified: / 17-08-2018 / 17:23:38 / Claus Gittinger"
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   173
!
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   174
415
82d22b1ce5f5 defaultFont
Claus Gittinger <cg@exept.de>
parents: 411
diff changeset
   175
defaultFont
82d22b1ce5f5 defaultFont
Claus Gittinger <cg@exept.de>
parents: 411
diff changeset
   176
    "/ for now - should come from the styleSheet
82d22b1ce5f5 defaultFont
Claus Gittinger <cg@exept.de>
parents: 411
diff changeset
   177
4567
797d6ef51905 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4564
diff changeset
   178
    ^ EditField defaultFont.
797d6ef51905 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4564
diff changeset
   179
    "/ ^ SelectionInListView defaultFont.
415
82d22b1ce5f5 defaultFont
Claus Gittinger <cg@exept.de>
parents: 411
diff changeset
   180
82d22b1ce5f5 defaultFont
Claus Gittinger <cg@exept.de>
parents: 411
diff changeset
   181
    "Created: 4.6.1997 / 15:44:17 / cg"
82d22b1ce5f5 defaultFont
Claus Gittinger <cg@exept.de>
parents: 411
diff changeset
   182
!
82d22b1ce5f5 defaultFont
Claus Gittinger <cg@exept.de>
parents: 411
diff changeset
   183
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   184
defaultListMessage
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   185
    ^ #list
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   186
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   187
    "Created: 26.2.1997 / 19:34:50 / cg"
605
a8da1eb4e180 smaller button
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   188
!
a8da1eb4e180 smaller button
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   189
5889
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   190
disabledForm
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   191
    <resource: #style (#'comboView.disabledDownForm' 
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   192
                       #'comboView.disabledDownFormFile')>
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   193
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   194
    ^ self formForKey:#disabledLogo styleFormKey:#'comboView.disabledDownForm' styleFilenameKey:#'comboView.disabledDownFormFile'
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   195
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   196
    "Created: / 17-08-2018 / 17:20:34 / Claus Gittinger"
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   197
!
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   198
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   199
enteredForm
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   200
    <resource: #style (#'comboView.enteredDownForm' 
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   201
                       #'comboView.enteredDownFormFile')>
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   202
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   203
    ^ self formForKey:#enteredLogo styleFormKey:#'comboView.enteredDownForm' styleFilenameKey:#'comboView.enteredDownFormFile'
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   204
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   205
    "Created: / 17-08-2018 / 17:22:43 / Claus Gittinger"
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   206
!
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   207
605
a8da1eb4e180 smaller button
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   208
updateStyleCache
3842
7356371ac6b8 changed: #updateStyleCache
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   209
    "flush the forms cache"
7356371ac6b8 changed: #updateStyleCache
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   210
2950
431dafff127d cash comboButtonForms
ca
parents: 2892
diff changeset
   211
    DefaultButtonForm := ComboButtonForms := nil.
605
a8da1eb4e180 smaller button
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   212
a8da1eb4e180 smaller button
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   213
    "Created: / 3.11.1997 / 15:28:48 / cg"
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   214
! !
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   215
5383
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   216
!ComboView class methodsFor:'image specs'!
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   217
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   218
defaultButtonForm
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   219
    "This resource specification was automatically generated
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   220
     by the ImageEditor of ST/X."
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   221
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   222
    "Do not manually edit this!! If it is corrupted,
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   223
     the ImageEditor may not be able to read the specification."
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   224
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   225
    "
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   226
     self defaultButtonForm inspect
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   227
     ImageEditor openOnClass:self andSelector:#defaultButtonForm
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   228
     Icon flushCachedIcons
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   229
    "
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   230
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   231
    <resource: #image>
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   232
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   233
    ^Icon
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   234
        constantNamed:'ComboView class defaultButtonForm'
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   235
        ifAbsentPut:[(Depth1Image width:12 height:12) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@')
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   236
            colorMapFromArray:#[0 0 0]
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   237
            mask:((ImageMask width:12 height:12) bits:(ByteArray fromPackedString:'@@<OC0<OC0=?;3?OG8<OC0XO@@=?;0@O'); yourself); yourself]
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   238
! !
738829c844c8 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 5352
diff changeset
   239
5889
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   240
!ComboView class methodsFor:'private'!
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   241
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   242
formForKey:key styleFormKey:styleFormKey styleFilenameKey:styleFilenameKey
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   243
    ComboButtonForms isNil ifTrue:[
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   244
        ComboButtonForms := IdentityDictionary new.
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   245
    ].
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   246
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   247
    ^ ComboButtonForms 
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   248
        at:key 
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   249
        ifAbsentPut:[
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   250
            |logo fn|
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   251
            logo := StyleSheet at:styleFormKey.
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   252
            logo isNil ifTrue:[
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   253
                fn := StyleSheet at:styleFilenameKey.
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   254
                fn notNil ifTrue:[
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   255
                    logo := Smalltalk imageFromFileNamed:fn forClass:self.
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   256
                    logo isNil ifTrue:[
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   257
                        logo := Smalltalk imageFromFileNamed:fn inPackage:'stx:libwidg'.
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   258
                    ]
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   259
                ]
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   260
            ].
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   261
            logo
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   262
        ].
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   263
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   264
    "Created: / 17-08-2018 / 17:25:10 / Claus Gittinger"
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   265
! !
42b2e8de59ef #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
   266
4972
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   267
!ComboView class methodsFor:'queries'!
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   268
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   269
isAbstract
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   270
    "Return if this class is an abstract class.
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   271
     True is returned here for myself only; false for subclasses.
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   272
     Abstract subclasses must redefine this again."
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   273
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   274
    ^ self == ComboView.
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   275
! !
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   276
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   277
!ComboView methodsFor:'accessing-behavior'!
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   278
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   279
action:aBlock
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   280
    "specify, a block, which is evaluated when the lists selection changes.
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   281
     This is an additional hook - normally, you would communicate with the model
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   282
     alone"
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   283
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   284
    action := aBlock.
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   285
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   286
    "Created: 26.7.1996 / 17:44:18 / cg"
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   287
    "Modified: 26.2.1997 / 19:37:18 / cg"
411
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   288
!
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   289
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   290
enabled
4663
b63155a28428 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4567
diff changeset
   291
    "return true, if it is enabled"
2892
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   292
    
1207
9019fe235f32 do not share my enableChannel with my buttons channel
tm
parents: 1183
diff changeset
   293
    enableChannel isNil ifTrue:[^ true].
4663
b63155a28428 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4567
diff changeset
   294
    ^ enableChannel value ? true
1294
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   295
!
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   296
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   297
enabled:aBoolean
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   298
    "enable/disable components"
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   299
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   300
    self enableChannel value:aBoolean.
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   301
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   302
    "Modified: / 30.3.1999 / 14:56:18 / stefan"
2892
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   303
!
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   304
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   305
resizableMenu
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   306
    "return true, if the menu is to be resizable.
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   307
     This feature is as yet unimplemented."
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   308
    
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   309
    ^ resizableMenu ? false
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   310
!
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   311
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   312
resizableMenu:aBoolean
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   313
    "enable/disable, if the menu is to be resizable.
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   314
     This feature is as yet unimplemented."
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   315
    
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   316
    resizableMenu := aBoolean
411
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   317
! !
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   318
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   319
!ComboView methodsFor:'accessing-channels'!
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   320
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   321
enableChannel 
2892
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   322
    "return a valueHolder for enable/disable"
42ba7f03313b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   323
1207
9019fe235f32 do not share my enableChannel with my buttons channel
tm
parents: 1183
diff changeset
   324
    enableChannel isNil ifTrue:[
1294
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   325
        self enableChannel:(true asValue).
411
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   326
    ].
1207
9019fe235f32 do not share my enableChannel with my buttons channel
tm
parents: 1183
diff changeset
   327
    ^ enableChannel
411
5a32b4247011 delegate font:
ca
parents: 332
diff changeset
   328
1294
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   329
    "Modified: / 30.3.1999 / 16:20:25 / stefan"
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
! !
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
!ComboView methodsFor:'accessing-components'!
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
1560
8abb4de4f8f5 added access to field.
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   334
field
8abb4de4f8f5 added access to field.
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   335
    "return the field (input or label) component.
8abb4de4f8f5 added access to field.
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   336
     For knowledgable users only."
8abb4de4f8f5 added access to field.
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   337
8abb4de4f8f5 added access to field.
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   338
    ^ field
8abb4de4f8f5 added access to field.
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   339
8abb4de4f8f5 added access to field.
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   340
    "Created: / 26.9.1999 / 13:33:15 / cg"
8abb4de4f8f5 added access to field.
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   341
!
8abb4de4f8f5 added access to field.
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   342
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
menuButton
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
    "return the menuButton component"
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
    ^ pullDownButton
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
    "Created: 28.2.1996 / 15:03:14 / cg"
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
! !
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
!ComboView methodsFor:'accessing-contents'!
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
   353
contents
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   354
    "get the contents of my field"
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   355
4115
6af2a4dea174 changed: #contents
Claus Gittinger <cg@exept.de>
parents: 4060
diff changeset
   356
    |m|
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
   357
4115
6af2a4dea174 changed: #contents
Claus Gittinger <cg@exept.de>
parents: 4060
diff changeset
   358
    (m := field model) isNil ifTrue:[
6af2a4dea174 changed: #contents
Claus Gittinger <cg@exept.de>
parents: 4060
diff changeset
   359
        ^ field contents
6af2a4dea174 changed: #contents
Claus Gittinger <cg@exept.de>
parents: 4060
diff changeset
   360
    ].
6af2a4dea174 changed: #contents
Claus Gittinger <cg@exept.de>
parents: 4060
diff changeset
   361
    ^ m value
6af2a4dea174 changed: #contents
Claus Gittinger <cg@exept.de>
parents: 4060
diff changeset
   362
6af2a4dea174 changed: #contents
Claus Gittinger <cg@exept.de>
parents: 4060
diff changeset
   363
    "Created: / 14-05-1996 / 13:05:16 / cg"
6af2a4dea174 changed: #contents
Claus Gittinger <cg@exept.de>
parents: 4060
diff changeset
   364
    "Modified: / 21-03-2012 / 12:06:42 / cg"
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
   365
!
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
   366
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
   367
contents:something
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   368
    "set the contents of my field; questionable"
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   369
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   370
    |m|
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   371
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   372
    (m := field model) notNil ifTrue:[
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   373
        m value:something
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   374
    ]
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
   375
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
   376
    "Created: 14.5.1996 / 13:05:33 / cg"
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   377
    "Modified: 26.2.1997 / 16:56:08 / cg"
181
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
   378
!
31e8f8ab2fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
   379
889
7879fffb4810 oops #list returned wrong list
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   380
list
7879fffb4810 oops #list returned wrong list
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   381
    "return the list"
7879fffb4810 oops #list returned wrong list
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   382
7879fffb4810 oops #list returned wrong list
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   383
    ^ list
7879fffb4810 oops #list returned wrong list
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   384
7879fffb4810 oops #list returned wrong list
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   385
    "Created: / 18.5.1998 / 18:58:08 / cg"
7879fffb4810 oops #list returned wrong list
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   386
!
7879fffb4810 oops #list returned wrong list
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   387
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
list:aList
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   389
    "set the list explicitely; used internally or 
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   390
     to be send from the outside if no model/listHolder is used."
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   391
3312
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   392
    list ~~ aList ifTrue:[
6040
a3296ee359af #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5983
diff changeset
   393
        self assert:(aList isNil or:[aList isOrdered "isSequenceable"]).
3369
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   394
        currentIndex := 1.
3312
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   395
        list := aList.
2474
173a07117f56 trap if assigned list is not sequenceable
martin
parents: 2406
diff changeset
   396
    ].
3315
5bbfd49857a2 changed #list:
Stefan Vogel <sv@exept.de>
parents: 3312
diff changeset
   397
    "maybe some values have been added to / removed from list"
5bbfd49857a2 changed #list:
Stefan Vogel <sv@exept.de>
parents: 3312
diff changeset
   398
    self enableStateChanged.
1294
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   399
6040
a3296ee359af #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5983
diff changeset
   400
    "Modified: / 30-03-1999 / 14:17:38 / stefan"
a3296ee359af #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5983
diff changeset
   401
    "Modified: / 02-04-2019 / 18:01:15 / Claus Gittinger"
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
! !
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
853
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   404
!ComboView methodsFor:'accessing-look'!
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   405
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   406
backgroundColor
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   407
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   408
    ^field backgroundColor
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   409
!
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   410
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   411
backgroundColor:aColor
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   412
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   413
    field backgroundColor:aColor
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   414
!
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   415
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   416
font:aFont
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   417
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   418
    super font:aFont.
1183
667132091c2f ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
   419
    self setFieldsFont:aFont.
853
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   420
!
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   421
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   422
foregroundColor
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   423
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   424
    ^field foregroundColor
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   425
!
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   426
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   427
foregroundColor:aColor
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   428
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   429
    field foregroundColor:aColor
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   430
! !
e7e1c2bbd6f1 color selectors
tz
parents: 683
diff changeset
   431
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   432
!ComboView methodsFor:'accessing-mvc'!
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   433
4187
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   434
comboMenuHolder
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   435
    ^ comboMenuHolder
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   436
!
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   437
4225
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   438
comboMenuHolder:aMenuHolder
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   439
    "allows for arbitrary menus to be opened via the combo button"
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   440
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   441
    comboMenuHolder := aMenuHolder.
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   442
!
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   443
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   444
comboMenuHolder:aMenuHolder comboMenuMessage:aSelectorToTheHolder
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   445
    "allows for arbitrary menus to be opened via the combo button"
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   446
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   447
    comboMenuHolder := aMenuHolder.
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   448
    comboMenuMessage := aSelectorToTheHolder.
4187
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   449
!
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   450
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   451
comboMenuMessage
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   452
    ^ comboMenuMessage
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   453
!
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   454
4225
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   455
comboMenuMessage:aSelectorToTheHolder
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   456
    "allows for arbitrary menus to be opened via the combo button"
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   457
565906233a1d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4187
diff changeset
   458
    comboMenuMessage := aSelectorToTheHolder.
4187
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   459
!
b658d1a5ac5d class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   460
5592
bdb957272782 #FEATURE by Maren
matilk
parents: 5383
diff changeset
   461
currentIndex
bdb957272782 #FEATURE by Maren
matilk
parents: 5383
diff changeset
   462
    ^ currentIndex
bdb957272782 #FEATURE by Maren
matilk
parents: 5383
diff changeset
   463
!
bdb957272782 #FEATURE by Maren
matilk
parents: 5383
diff changeset
   464
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   465
listHolder:aValueHolder
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   466
    "set the listHolder.
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   467
     If not set, the list is supposed to be set explicitely"
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   468
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   469
    listHolder notNil ifTrue:[
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   470
        listHolder removeDependent:self.
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   471
    ].
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   472
    listHolder := aValueHolder.
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   473
    listHolder notNil ifTrue:[
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   474
        aValueHolder addDependent:self.
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   475
    ].
3274
e162e9218179 must fetch the lists value when the listHilder is set.
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   476
e162e9218179 must fetch the lists value when the listHilder is set.
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   477
    "/ cg: either fetch it here or when realized;
5180
afe1add1fcec #OTHER by mawalch
mawalch
parents: 4994
diff changeset
   478
    "/ (otherwise we'd never fetch the list if it won't change later)
3274
e162e9218179 must fetch the lists value when the listHilder is set.
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   479
"/    realized ifTrue:[
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   480
        self getListFromModel.
3274
e162e9218179 must fetch the lists value when the listHilder is set.
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   481
"/    ]
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   482
3274
e162e9218179 must fetch the lists value when the listHilder is set.
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   483
    "Modified: / 09-11-2007 / 15:59:18 / cg"
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   484
!
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   485
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   486
listMessage:aSymbol
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   487
    "define the message selector sent to the model, to fetch
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   488
     the list. If not defined, #list is used"
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   489
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   490
    listMsg := aSymbol
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   491
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   492
    "Created: 14.2.1997 / 19:16:52 / cg"
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   493
    "Modified: 26.2.1997 / 19:33:09 / cg"
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   494
!
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   495
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   496
model:aModel
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   497
    "set the model, which is supposed to provide the boxes value.
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   498
     If a listMessage was defined, it is also responsible for providing
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   499
     the list"
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   500
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   501
    super model:aModel.
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   502
3596
cc15fa1bdb45 *** empty log message ***
sr
parents: 3573
diff changeset
   503
    listHolder isNil ifTrue:[
cc15fa1bdb45 *** empty log message ***
sr
parents: 3573
diff changeset
   504
        self getListFromModel.
cc15fa1bdb45 *** empty log message ***
sr
parents: 3573
diff changeset
   505
    ].
314
6ff49c930c71 fetch models value when a model is assigned;
Claus Gittinger <cg@exept.de>
parents: 312
diff changeset
   506
    self getValueFromModel.
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   507
314
6ff49c930c71 fetch models value when a model is assigned;
Claus Gittinger <cg@exept.de>
parents: 312
diff changeset
   508
    "Modified: 28.2.1997 / 19:08:45 / cg"
310
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   509
! !
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   510
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   511
!ComboView methodsFor:'change & update'!
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   512
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   513
update:something with:aParameter from:changedObject
1207
9019fe235f32 do not share my enableChannel with my buttons channel
tm
parents: 1183
diff changeset
   514
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   515
    changedObject == model ifTrue:[
310
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   516
        listHolder isNil ifTrue:[
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   517
            self getListFromModel.
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   518
        ].
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   519
        self getValueFromModel.
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   520
        ^ self
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   521
    ].
310
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   522
    changedObject == listHolder ifTrue:[
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   523
        self getListFromModel.
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   524
        ^ self
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   525
    ].
15ef4f52f8cf comments
Claus Gittinger <cg@exept.de>
parents: 308
diff changeset
   526
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   527
    super update:something with:aParameter from:changedObject
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   528
1294
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   529
    "Created: / 15.7.1996 / 12:26:49 / cg"
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   530
    "Modified: / 28.2.1997 / 13:48:51 / cg"
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   531
    "Modified: / 30.3.1999 / 14:17:55 / stefan"
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   532
! !
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   533
869
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   534
!ComboView methodsFor:'event handling'!
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   535
1306
56e90a9e5da1 renambe #enableStateChange to #enableStateChanged
Claus Gittinger <cg@exept.de>
parents: 1301
diff changeset
   536
enableStateChanged
1294
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   537
    "the enable state has changed - pass this to my field and pullDownButton"
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   538
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   539
    |msg|
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   540
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   541
    (enableChannel isNil or:[enableChannel value]) ifTrue:[
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   542
        msg := #enable
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   543
    ] ifFalse:[
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   544
        msg := #disable
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   545
    ].
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   546
    field perform:msg ifNotUnderstood:nil.
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   547
3755
dca9622d2aa9 code cleanup
Claus Gittinger <cg@exept.de>
parents: 3596
diff changeset
   548
    list isEmptyOrNil ifTrue:[
4186
0087947b1b29 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4180
diff changeset
   549
        "/ may only do this, if the list is static or a valueModel. 
0087947b1b29 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4180
diff changeset
   550
        "/ If it is a block, we do not know what value will be returned the next
0087947b1b29 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4180
diff changeset
   551
        "/ time.
0087947b1b29 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4180
diff changeset
   552
        listHolder isBlock ifFalse:[
0087947b1b29 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4180
diff changeset
   553
            msg := #disable
0087947b1b29 class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4180
diff changeset
   554
        ].
1294
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   555
    ].
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   556
    pullDownButton perform:msg ifNotUnderstood:nil.
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   557
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   558
    "Modified: / 22.2.1999 / 00:47:46 / cg"
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   559
    "Modified: / 30.3.1999 / 14:17:10 / stefan"
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   560
!
36a0e9dcd813 Move common channels to View.
Stefan Vogel <sv@exept.de>
parents: 1291
diff changeset
   561
3312
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   562
handlesMouseWheelMotion:event inView:aView
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   563
    "we handle delegated mousewheel events"
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   564
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   565
    ^ true
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   566
!
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   567
869
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   568
keyPress:key x:x y:y
2868
0050e38370ed comment
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   569
    "pull the menu on space and return keys"
0050e38370ed comment
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   570
2025
cf30d2acc776 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2023
diff changeset
   571
    <resource: #keyboard (#Return)>
cf30d2acc776 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2023
diff changeset
   572
2868
0050e38370ed comment
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   573
    (key == Character space or:[key == #Return]) ifTrue:[
869
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   574
        self pullMenu.
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   575
        ^ self.
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   576
    ].
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   577
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   578
    ^ super keyPress:key x:x y:y
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   579
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   580
    "Modified: / 21.4.1998 / 20:10:05 / cg"
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   581
!
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   582
3312
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   583
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:delegatingView
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   584
    "scroll through the list items"
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   585
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   586
    self enableChannel value ifFalse:[
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   587
        ^ self.
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   588
    ].
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   589
    
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   590
    list isNil ifTrue:[
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   591
        self getListFromModel.
3365
06a46f12cb2e changed #mouseWheelMotion:x:y:amount:deltaTime:view:
Stefan Vogel <sv@exept.de>
parents: 3327
diff changeset
   592
        list isEmptyOrNil ifTrue:[
06a46f12cb2e changed #mouseWheelMotion:x:y:amount:deltaTime:view:
Stefan Vogel <sv@exept.de>
parents: 3327
diff changeset
   593
            "nothing to scroll"
06a46f12cb2e changed #mouseWheelMotion:x:y:amount:deltaTime:view:
Stefan Vogel <sv@exept.de>
parents: 3327
diff changeset
   594
            ^ self
06a46f12cb2e changed #mouseWheelMotion:x:y:amount:deltaTime:view:
Stefan Vogel <sv@exept.de>
parents: 3327
diff changeset
   595
        ].
3312
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   596
    ].
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   597
3369
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   598
    self deltaSelect:amount sign negated.
3312
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   599
!
ad1dcdaa7ba7 Support for selection via mouse wheel
Stefan Vogel <sv@exept.de>
parents: 3290
diff changeset
   600
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   601
processEvent:anEvent
3290
d6fafe560ade bugfix - processEvents should have a look for which button is pressed
ca
parents: 3281
diff changeset
   602
    |evView point x y button|
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   603
3495
33b88650f7e1 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 3429
diff changeset
   604
    "/ only care for buttonpress in my field...
33b88650f7e1 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 3429
diff changeset
   605
    anEvent isButtonPressEvent ifFalse:[^ false].
33b88650f7e1 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 3429
diff changeset
   606
    evView := anEvent view.
33b88650f7e1 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 3429
diff changeset
   607
    evView isNil ifTrue:[^ false].
33b88650f7e1 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 3429
diff changeset
   608
3290
d6fafe560ade bugfix - processEvents should have a look for which button is pressed
ca
parents: 3281
diff changeset
   609
    button := anEvent state.
d6fafe560ade bugfix - processEvents should have a look for which button is pressed
ca
parents: 3281
diff changeset
   610
    ((button == 1) or:[button == #select]) ifFalse:[
d6fafe560ade bugfix - processEvents should have a look for which button is pressed
ca
parents: 3281
diff changeset
   611
        ^ false
d6fafe560ade bugfix - processEvents should have a look for which button is pressed
ca
parents: 3281
diff changeset
   612
    ].
d6fafe560ade bugfix - processEvents should have a look for which button is pressed
ca
parents: 3281
diff changeset
   613
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   614
    (field isNil or:[field shown not]) ifTrue:[
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   615
        ^ false
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   616
    ].
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   617
    (field isKeyboardConsumer and:[field isEnabled]) ifTrue:[
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   618
        ^ false
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   619
    ].
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   620
3755
dca9622d2aa9 code cleanup
Claus Gittinger <cg@exept.de>
parents: 3596
diff changeset
   621
    x := anEvent x.
dca9622d2aa9 code cleanup
Claus Gittinger <cg@exept.de>
parents: 3596
diff changeset
   622
    y := anEvent y.
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   623
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   624
    evView ~~ field ifTrue:[
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   625
        (evView isSameOrComponentOf:field) ifFalse:[
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   626
            ^ false
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   627
        ].
3755
dca9622d2aa9 code cleanup
Claus Gittinger <cg@exept.de>
parents: 3596
diff changeset
   628
        point := x @ y.
4994
7d232a2752db device access
Claus Gittinger <cg@exept.de>
parents: 4972
diff changeset
   629
        point := device translatePoint:point fromView:evView toView:field.
3755
dca9622d2aa9 code cleanup
Claus Gittinger <cg@exept.de>
parents: 3596
diff changeset
   630
        x := point x.
dca9622d2aa9 code cleanup
Claus Gittinger <cg@exept.de>
parents: 3596
diff changeset
   631
        y := point y.
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   632
    ].
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   633
    (x between:0 and:field width) ifFalse:[^ false].
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   634
    (y between:0 and:field height) ifFalse:[^ false].
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   635
3281
75391e011897 *** empty log message ***
ca
parents: 3274
diff changeset
   636
    self pullMenu == false ifTrue:[ ^ false ].
3495
33b88650f7e1 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 3429
diff changeset
   637
33b88650f7e1 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 3429
diff changeset
   638
    "/ although eaten, we still must care for the focus !!
33b88650f7e1 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 3429
diff changeset
   639
    self wantsFocusWithButtonPress ifTrue:[
3503
f14e20004081 changed #processEvent:
Michael Beyl <mb@exept.de>
parents: 3495
diff changeset
   640
        self windowGroup notNil ifTrue:[
f14e20004081 changed #processEvent:
Michael Beyl <mb@exept.de>
parents: 3495
diff changeset
   641
            self windowGroup focusView:self.
f14e20004081 changed #processEvent:
Michael Beyl <mb@exept.de>
parents: 3495
diff changeset
   642
"/ Transcript showCR:self windowGroup focusCameByTab.
f14e20004081 changed #processEvent:
Michael Beyl <mb@exept.de>
parents: 3495
diff changeset
   643
        ]
3495
33b88650f7e1 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 3429
diff changeset
   644
    ].
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   645
    ^ true
869
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   646
! !
a1838cce9641 popup menu on space or return
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
   647
2499
a2b676b9292c method category rename
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
   648
!ComboView methodsFor:'initialization & release'!
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   650
destroy
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   651
    |wgrp|
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   652
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   653
    (wgrp := self windowGroup) notNil ifTrue:[
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   654
       wgrp removePreEventHook:self.
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   655
    ].
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   656
    super destroy.
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   657
!
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   658
3825
f5fe434e1cf7 border a la vista
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   659
initStyle
f5fe434e1cf7 border a la vista
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   660
    super initStyle.
f5fe434e1cf7 border a la vista
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   661
f5fe434e1cf7 border a la vista
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   662
    self borderWidth:(EditField defaultBorderWidth).
f5fe434e1cf7 border a la vista
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   663
    self borderColor:(EditField defaultBorderColor).
f5fe434e1cf7 border a la vista
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   664
!
f5fe434e1cf7 border a la vista
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   665
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   666
initialize
2750
4e0f6fde1ae8 more xp style
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
   667
    |prefExt leftInset rightInset prefWidth halfSpacing nm lvl|
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
    super initialize.
308
922a96deba3e examples removed; cleanup
Claus Gittinger <cg@exept.de>
parents: 304
diff changeset
   670
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   671
    listMsg := self class defaultListMessage.
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   672
    aspectMsg := self class defaultAspectMessage.
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   673
    changeMsg := self class defaultChangeMessage.
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   674
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   675
    self initializeField.
3825
f5fe434e1cf7 border a la vista
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   676
    field origin:margin@margin corner:1.0@1.0.
2136
6e2d9f16e7e3 shadowColor setup fixed
Claus Gittinger <cg@exept.de>
parents: 2131
diff changeset
   677
    self shadowColor:(field shadowColor).
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   678
331
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   679
    self initializeButton.
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   680
    pullDownButton pressAction:[self pullMenu].
280
3936f0839b64 nicer spacing
Claus Gittinger <cg@exept.de>
parents: 277
diff changeset
   681
    prefExt := pullDownButton preferredExtent.
3936f0839b64 nicer spacing
Claus Gittinger <cg@exept.de>
parents: 277
diff changeset
   682
    prefWidth := prefExt x.
3936f0839b64 nicer spacing
Claus Gittinger <cg@exept.de>
parents: 277
diff changeset
   683
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   684
    pullDownButton origin:1.0@0.0 corner:1.0@1.0.
217
82971d8b3938 care for 2D styles
Claus Gittinger <cg@exept.de>
parents: 214
diff changeset
   685
    styleSheet is3D ifTrue:[
280
3936f0839b64 nicer spacing
Claus Gittinger <cg@exept.de>
parents: 277
diff changeset
   686
        halfSpacing := ViewSpacing // 2.
5983
023c539cad97 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
   687
        leftInset := rightInset := (prefWidth + halfSpacing).
2750
4e0f6fde1ae8 more xp style
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
   688
        (lvl := styleSheet at:#'comboView.level' default:nil) notNil ifTrue:[
4e0f6fde1ae8 more xp style
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
   689
            self level:lvl.
319
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   690
            field level:0.
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   691
            field rightInset:margin.
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   692
        ] ifFalse:[
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   693
            pullDownButton rightInset:halfSpacing.
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   694
            field leftInset:halfSpacing
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   695
        ].
217
82971d8b3938 care for 2D styles
Claus Gittinger <cg@exept.de>
parents: 214
diff changeset
   696
    ] ifFalse:[
280
3936f0839b64 nicer spacing
Claus Gittinger <cg@exept.de>
parents: 277
diff changeset
   697
        leftInset := prefWidth + pullDownButton borderWidth.
3936f0839b64 nicer spacing
Claus Gittinger <cg@exept.de>
parents: 277
diff changeset
   698
        rightInset := prefWidth.
217
82971d8b3938 care for 2D styles
Claus Gittinger <cg@exept.de>
parents: 214
diff changeset
   699
    ].
1125
6bb8029bbc29 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
   700
3836
f8a3a65f1d78 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
   701
    "/ what a hack...
1696
f1bae6d68ffe eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   702
    nm := styleSheet name.
3836
f8a3a65f1d78 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
   703
    (nm = #win95 or:[nm = #win98 or:[nm = #winXP or:[nm = #st80 or:[nm = #winVista]]]]) ifTrue:[
1125
6bb8029bbc29 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
   704
        field level:0.
2750
4e0f6fde1ae8 more xp style
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
   705
        lvl isNil ifTrue:[self level:-1].
1125
6bb8029bbc29 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
   706
        pullDownButton rightInset:0.
1696
f1bae6d68ffe eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   707
        nm ~= #st80 ifTrue:[
3429
f2b4b84cd477 added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents: 3369
diff changeset
   708
            leftInset := (ArrowButton new preferredWidth).
1126
dc790a73ac4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   709
            rightInset := leftInset.
1125
6bb8029bbc29 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
   710
        ].
6bb8029bbc29 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
   711
        field origin:0.0@0.0.
2750
4e0f6fde1ae8 more xp style
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
   712
        field leftInset:0.
1125
6bb8029bbc29 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
   713
"/        field topInset:1; bottomInset:1.
2750
4e0f6fde1ae8 more xp style
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
   714
"/        nm = #winXP ifTrue:[
4e0f6fde1ae8 more xp style
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
   715
"/            self borderWidth:1.
4e0f6fde1ae8 more xp style
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
   716
"/            self borderColor:(Color blue lightened).
4e0f6fde1ae8 more xp style
Claus Gittinger <cg@exept.de>
parents: 2499
diff changeset
   717
"/        ].
1125
6bb8029bbc29 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
   718
    ].
1126
dc790a73ac4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   719
    field rightInset:rightInset.
280
3936f0839b64 nicer spacing
Claus Gittinger <cg@exept.de>
parents: 277
diff changeset
   720
    pullDownButton leftInset:leftInset negated.
5983
023c539cad97 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
   721
    self initialHeight:(field preferredHeight + ViewSpacing).
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   722
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   723
    "
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   724
     |b|
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   725
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   726
     b := ComboBoxView new.
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   727
     b list:#('hello' 'world' 'this' 'is' 'st/x').
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   728
     b open
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   729
    "
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
5983
023c539cad97 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
   731
    "Created: / 28-02-1996 / 15:03:17 / cg"
023c539cad97 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
   732
    "Modified: / 08-09-1998 / 20:33:22 / cg"
023c539cad97 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
   733
    "Modified: / 08-01-2019 / 14:16:03 / Claus Gittinger"
331
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   734
!
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   735
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   736
initializeButton
2174
ab242e29da64 button init code made publicly available
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   737
    pullDownButton := self class comboButtonFor:self.
331
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   738
    pullDownButton disable.
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   739
!
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   740
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   741
initializeField
4972
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   742
    "concrete subclass is responsible to instantiate
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   743
     a field widget here.
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   744
     For comboList, this will be a label;
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   745
     for comboBox, this will be an editfield"
9914ef4a84fc #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
   746
     
331
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   747
    self subclassResponsibility
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   748
d6fad4b27a9a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   749
    "Created: 29.3.1997 / 11:17:14 / cg"
2157
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2136
diff changeset
   750
!
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2136
diff changeset
   751
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   752
realize
3238
c3834ec3a914 test for unspecified windowGroup
ca
parents: 3236
diff changeset
   753
    |pullMenuIfClickedOnField wgrp|
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   754
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   755
    super realize.
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   756
3824
5d7e67f50bb5 comment/format in: #realize
Claus Gittinger <cg@exept.de>
parents: 3777
diff changeset
   757
    pullMenuIfClickedOnField := 
5d7e67f50bb5 comment/format in: #realize
Claus Gittinger <cg@exept.de>
parents: 3777
diff changeset
   758
            styleSheet 
5d7e67f50bb5 comment/format in: #realize
Claus Gittinger <cg@exept.de>
parents: 3777
diff changeset
   759
                at:#'comboView.pullMenuIfClickedOnField'
5d7e67f50bb5 comment/format in: #realize
Claus Gittinger <cg@exept.de>
parents: 3777
diff changeset
   760
                default:[ OperatingSystem isMSWINDOWSlike ].
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   761
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   762
    pullMenuIfClickedOnField == true ifTrue:[
3238
c3834ec3a914 test for unspecified windowGroup
ca
parents: 3236
diff changeset
   763
        wgrp := self windowGroup.
c3834ec3a914 test for unspecified windowGroup
ca
parents: 3236
diff changeset
   764
        wgrp notNil ifTrue:[ wgrp addPreEventHook:self ].
3236
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   765
    ].
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   766
!
4e8b01660a5c comboView.pullMenuIfClickedOnField
ca
parents: 3231
diff changeset
   767
2157
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2136
diff changeset
   768
release
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2136
diff changeset
   769
    listHolder notNil ifTrue:[
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2136
diff changeset
   770
        listHolder removeDependent:self.
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2136
diff changeset
   771
        listHolder := nil.
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2136
diff changeset
   772
    ].
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2136
diff changeset
   773
    super release
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   774
! !
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   775
2406
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   776
!ComboView methodsFor:'menu interaction'!
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   777
4564
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   778
createPullDownMenuForList:aList
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   779
    "pull the menu - triggered from the button"
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   780
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   781
    |menu index|
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   782
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   783
    comboMenuHolder notNil ifTrue:[
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   784
        menu := (comboMenuHolder perform:comboMenuMessage ? #value). 
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   785
        (menu isKindOf:Menu) ifTrue:[
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   786
            menu := MenuPanel new menu:menu.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   787
        ]
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   788
    ] ifFalse:[
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   789
        menu := MenuPanel new.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   790
        menu doAccessCharacterTranslation:false.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   791
        menu labels:aList.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   792
        menu hideOnRelease:false.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   793
        menu backgroundColor: field backgroundColor. 
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   794
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   795
        index := 1.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   796
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   797
        menu do:[:el |
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   798
            el value:#select: argument:index.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   799
            index := index + 1.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   800
        ].
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   801
        menu receiver:self.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   802
    ].
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   803
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   804
    menu font:self font.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   805
    menu preferredWidth:self width.
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   806
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   807
    ^ menu
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   808
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   809
    "Modified: / 25-03-2014 / 01:21:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   810
!
be449e47ce4b Fix in ComboView>>createPullDownMenuForList:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4563
diff changeset
   811
3369
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   812
deltaSelect:delta
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   813
    "change selection by delta. Wrap at start/end"
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   814
6040
a3296ee359af #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5983
diff changeset
   815
    |listSize newIndex|
3369
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   816
6040
a3296ee359af #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5983
diff changeset
   817
    (listSize := list size) == 0 ifTrue:[^ self].
3556
e7d87b5b3cf7 care for mouse-wheel deltaSelect: if list is empty
Claus Gittinger <cg@exept.de>
parents: 3503
diff changeset
   818
3369
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   819
    newIndex := currentIndex + delta.
6040
a3296ee359af #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5983
diff changeset
   820
    newIndex > listSize ifTrue:[
3369
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   821
        newIndex := 1.
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   822
    ] ifFalse:[
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   823
        newIndex <= 0 ifTrue:[
6040
a3296ee359af #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5983
diff changeset
   824
            newIndex := listSize.
3369
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   825
        ].
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   826
    ].
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   827
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   828
    self select:newIndex.
6040
a3296ee359af #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5983
diff changeset
   829
a3296ee359af #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5983
diff changeset
   830
    "Modified: / 02-04-2019 / 17:59:42 / Claus Gittinger"
3369
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   831
!
9f8f7c5d328f Correct selection behavior (start with line 1)
Stefan Vogel <sv@exept.de>
parents: 3365
diff changeset
   832
2406
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   833
pullMenu
3281
75391e011897 *** empty log message ***
ca
parents: 3274
diff changeset
   834
    "pull the menu - triggered from the button
75391e011897 *** empty log message ***
ca
parents: 3274
diff changeset
   835
     returns false if the menu cannot be opened"
2406
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   836
3281
75391e011897 *** empty log message ***
ca
parents: 3274
diff changeset
   837
    |menu origin opensMenu|
2406
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   838
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   839
    self getListFromModel.
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   840
4227
693706272bcb class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4225
diff changeset
   841
    opensMenu := ((list notEmptyOrNil or:[comboMenuHolder notNil])
693706272bcb class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4225
diff changeset
   842
                and:[self enableChannel value]).
3281
75391e011897 *** empty log message ***
ca
parents: 3274
diff changeset
   843
75391e011897 *** empty log message ***
ca
parents: 3274
diff changeset
   844
    opensMenu ifTrue:[
2406
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   845
        menu := self createPullDownMenuForList:list.
4994
7d232a2752db device access
Claus Gittinger <cg@exept.de>
parents: 4972
diff changeset
   846
        origin := device translatePoint:(0 @ self height) fromView:self toView:nil.
4227
693706272bcb class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4225
diff changeset
   847
        "/ menu extentChangedFlag:false.
693706272bcb class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4225
diff changeset
   848
        "/ menu originChangedFlag:false.
693706272bcb class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4225
diff changeset
   849
        menu showAt:origin resizing:false.
2406
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   850
    ].
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   851
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   852
    pullDownButton turnOff.
3281
75391e011897 *** empty log message ***
ca
parents: 3274
diff changeset
   853
    ^ opensMenu
2406
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   854
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   855
    "Created: / 10.10.2001 / 14:47:25 / cg"
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   856
    "Modified: / 10.10.2001 / 15:04:44 / cg"
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   857
!
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   858
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   859
select:anIndex
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   860
    "sent from the popped menu, when an item was selected"
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   861
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   862
    self subclassResponsibility
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   863
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   864
    "Modified: 27.2.1997 / 15:19:07 / cg"
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   865
! !
2ea7cf110e58 category change
penk
parents: 2405
diff changeset
   866
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   867
!ComboView methodsFor:'message delegation'!
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   868
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   869
doesNotUnderstand:aMessage
4824
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   870
    "delegate to my field"
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   871
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   872
    (field respondsTo:aMessage selector) ifTrue:[
1207
9019fe235f32 do not share my enableChannel with my buttons channel
tm
parents: 1183
diff changeset
   873
        ^ aMessage sendTo:field
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
    ].
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   875
    ^ super doesNotUnderstand:aMessage
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   876
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   877
    "Created: 28.2.1996 / 15:03:17 / cg"
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   878
    "Modified: 28.2.1996 / 15:06:09 / cg"
166
19f08c13b299 Forward respondsTo: message.
Stefan Vogel <sv@exept.de>
parents: 129
diff changeset
   879
!
19f08c13b299 Forward respondsTo: message.
Stefan Vogel <sv@exept.de>
parents: 129
diff changeset
   880
2300
c3d1ba5c884e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2176
diff changeset
   881
flash
4824
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   882
    "delegate to my field"
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   883
2300
c3d1ba5c884e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2176
diff changeset
   884
    field flash
c3d1ba5c884e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2176
diff changeset
   885
!
c3d1ba5c884e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2176
diff changeset
   886
5630
fa152610de50 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
   887
flash:messageOrNil withColor:flashColor
4824
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   888
    "delegate to my field"
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   889
5630
fa152610de50 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
   890
    field flash:messageOrNil withColor:flashColor
fa152610de50 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
   891
fa152610de50 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
   892
    "Modified (format): / 21-10-2017 / 23:13:39 / cg"
4824
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   893
!
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   894
166
19f08c13b299 Forward respondsTo: message.
Stefan Vogel <sv@exept.de>
parents: 129
diff changeset
   895
respondsTo:aSymbol
4824
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   896
    "delegate to my field"
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   897
166
19f08c13b299 Forward respondsTo: message.
Stefan Vogel <sv@exept.de>
parents: 129
diff changeset
   898
    ^ (field respondsTo:aSymbol) or:[super respondsTo:aSymbol]
19f08c13b299 Forward respondsTo: message.
Stefan Vogel <sv@exept.de>
parents: 129
diff changeset
   899
19f08c13b299 Forward respondsTo: message.
Stefan Vogel <sv@exept.de>
parents: 129
diff changeset
   900
    "Created: 2.5.1996 / 16:57:34 / stefan"
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   901
! !
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   902
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   903
!ComboView methodsFor:'private'!
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   904
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   905
getListFromModel
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   906
    "fetch the list - either from the listHolder, or
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   907
     from the model. If no listMessage was defined, fetch it
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   908
     using #list."
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   909
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   910
    listHolder notNil ifTrue:[
5352
af74e6a10e4f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5180
diff changeset
   911
        "/ should blocks be evaluated when the pull-down list is actually needed?    
af74e6a10e4f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5180
diff changeset
   912
        "/ listHolder isBlock ifFalse:[
af74e6a10e4f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5180
diff changeset
   913
            self list:listHolder value
af74e6a10e4f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5180
diff changeset
   914
        "/ ]
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   915
    ] ifFalse:[
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   916
        (model notNil and:[listMsg notNil]) ifTrue:[
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   917
            (model respondsTo:listMsg) ifTrue:[
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   918
                self list:(model perform:listMsg)
277
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   919
            ]
44eadbccc2b7 added support for a separate listHolder
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   920
        ]
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   921
    ].
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   922
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   923
    "Created: 15.7.1996 / 12:22:56 / cg"
304
7ee03df31561 cleaned up model interface
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   924
    "Modified: 26.2.1997 / 19:40:58 / cg"
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   925
!
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   926
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   927
getValueFromModel
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   928
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   929
    "Modified: 15.7.1996 / 12:28:59 / cg"
1183
667132091c2f ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
   930
!
667132091c2f ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
   931
1210
55f2c4209f94 oops - only pull-button is disabled with empty list;
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
   932
setFieldsFont:aFont
55f2c4209f94 oops - only pull-button is disabled with empty list;
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
   933
    field font:aFont.
214
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   934
! !
328a09259794 get list from model
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   935
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   936
!ComboView methodsFor:'queries'!
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   937
5949
10935e855698 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5923
diff changeset
   938
computePreferredExtent
285
a33d83de3849 commentary
Claus Gittinger <cg@exept.de>
parents: 283
diff changeset
   939
    "compute & return the boxes preferredExtent from the components' preferrences"
a33d83de3849 commentary
Claus Gittinger <cg@exept.de>
parents: 283
diff changeset
   940
683
a2593b4a3ce1 fixed preferredExtent to also look into the menus list
ca
parents: 605
diff changeset
   941
    |fieldPref buttonPref m menuPrefX menuPrefY w h|
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   942
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   943
    list isNil ifTrue:[
308
922a96deba3e examples removed; cleanup
Claus Gittinger <cg@exept.de>
parents: 304
diff changeset
   944
        self getListFromModel
922a96deba3e examples removed; cleanup
Claus Gittinger <cg@exept.de>
parents: 304
diff changeset
   945
    ].
922a96deba3e examples removed; cleanup
Claus Gittinger <cg@exept.de>
parents: 304
diff changeset
   946
922a96deba3e examples removed; cleanup
Claus Gittinger <cg@exept.de>
parents: 304
diff changeset
   947
    list isNil ifTrue:[
683
a2593b4a3ce1 fixed preferredExtent to also look into the menus list
ca
parents: 605
diff changeset
   948
        menuPrefX := menuPrefY := 0
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   949
    ] ifFalse:[
4503
10c4fb447777 class: ComboView
Stefan Vogel <sv@exept.de>
parents: 4495
diff changeset
   950
        |graphicsDevice|
10c4fb447777 class: ComboView
Stefan Vogel <sv@exept.de>
parents: 4495
diff changeset
   951
4994
7d232a2752db device access
Claus Gittinger <cg@exept.de>
parents: 4972
diff changeset
   952
        graphicsDevice := device ? Screen current.
4503
10c4fb447777 class: ComboView
Stefan Vogel <sv@exept.de>
parents: 4495
diff changeset
   953
        m := (MenuView onDevice:graphicsDevice) labels:list.
3429
f2b4b84cd477 added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents: 3369
diff changeset
   954
        menuPrefX := m preferredWidth.
1348
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   955
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   956
        "/ the menuView returns rubbish ...
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   957
"/        menuPrefY := (m preferredExtentForLines:1 cols:10) y
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   958
        
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   959
        "/ any non-strings ?
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   960
        menuPrefY := list 
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   961
            inject:('X' heightOn:self) 
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   962
            into:[:max :el | el isString ifTrue:[
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   963
                                max
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   964
                              ] ifFalse:[
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   965
                                max max:(el heightOn:self) 
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   966
                              ]
b4bf740ec2fc fixed pref. extent
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   967
                 ].
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   968
    ].
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   969
302
8af5f51ce7a5 preferredExtent is sum of menu + button
Claus Gittinger <cg@exept.de>
parents: 285
diff changeset
   970
    fieldPref := field preferredExtent.
8af5f51ce7a5 preferredExtent is sum of menu + button
Claus Gittinger <cg@exept.de>
parents: 285
diff changeset
   971
    buttonPref := pullDownButton preferredExtent.
8af5f51ce7a5 preferredExtent is sum of menu + button
Claus Gittinger <cg@exept.de>
parents: 285
diff changeset
   972
319
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   973
    w := ((fieldPref x max:menuPrefX) max:50) + buttonPref x.
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   974
    w := w + margin + margin.
683
a2593b4a3ce1 fixed preferredExtent to also look into the menus list
ca
parents: 605
diff changeset
   975
    h := (fieldPref y max:buttonPref y) max:menuPrefY.
319
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   976
    h := h + margin + margin.
920ef16160ae w95 style fixes
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   977
    ^ w @ h
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   978
5949
10935e855698 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5923
diff changeset
   979
    "Created: / 09-11-2018 / 19:49:42 / Claus Gittinger"
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   980
! !
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   981
4832
083a1522f3cd class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4824
diff changeset
   982
!ComboView methodsFor:'testing'!
083a1522f3cd class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4824
diff changeset
   983
083a1522f3cd class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4824
diff changeset
   984
isComboView
083a1522f3cd class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4824
diff changeset
   985
    ^ true
083a1522f3cd class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4824
diff changeset
   986
! !
083a1522f3cd class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4824
diff changeset
   987
263
865b7d99d3f5 added an example for a menu-pull-hook
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   988
!ComboView class methodsFor:'documentation'!
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   989
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   990
version
4824
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   991
    ^ '$Header$'
3777
83c52227471d changed: #createPullDownMenuForList:
Claus Gittinger <cg@exept.de>
parents: 3755
diff changeset
   992
!
83c52227471d changed: #createPullDownMenuForList:
Claus Gittinger <cg@exept.de>
parents: 3755
diff changeset
   993
83c52227471d changed: #createPullDownMenuForList:
Claus Gittinger <cg@exept.de>
parents: 3755
diff changeset
   994
version_CVS
4824
98d9c12ab96f class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   995
    ^ '$Header$'
129
a680f0b7508f intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   996
! !
4180
71610b2b34fa class: ComboView
Claus Gittinger <cg@exept.de>
parents: 4115
diff changeset
   997