ExtendedComboBox.st
author ca
Thu, 29 Nov 2007 10:32:01 +0100
changeset 3289 7bf0ddb4df39
parent 3285 1541e5cf4395
child 3420 d112104710bb
permissions -rw-r--r--
bugfix - processEvents should have a look for which button is pressed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1281
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
     1
"
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
     2
 COPYRIGHT (c) 1998 by eXept Software AG
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
     3
              All Rights Reserved
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
     4
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
     5
 This software is furnished under a license and may be used
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
     6
 only in accordance with the terms of that license and with the
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
     8
 be provided or otherwise made available to, or used by, any
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
     9
 other person.  No title to or ownership of the software is
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    10
 hereby transferred.
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    11
"
1830
66c131adec9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
    12
"{ Package: 'stx:libwidg2' }"
66c131adec9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
    13
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    14
View subclass:#ExtendedComboBox
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    15
	instanceVariableNames:'menuButton menuField menuWrapper adjust menuWidgetHolder
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    16
		menuWidget menuHeight openAction isReadOnly closeOnSelect
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    17
		menuExtent usePreferredWidthForMenu hasHorizontalScrollBar
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    18
		hasVerticalScrollBar miniScrollerHorizontal miniScrollerVertical
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    19
		autoHideScrollBars'
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    20
	classVariableNames:''
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    21
	poolDictionaries:''
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    22
	category:'Views-Interactors'
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
    23
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
    24
1273
0460739b9e97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
    25
PopUpView subclass:#MenuWrapper
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    26
	instanceVariableNames:'comboBox widget lastPointerView implicitGrabView eventHandler
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    27
		resizeCursor restoreCursor'
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    28
	classVariableNames:''
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    29
	poolDictionaries:''
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
    30
	privateIn:ExtendedComboBox
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
    31
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
    32
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    33
!ExtendedComboBox class methodsFor:'documentation'!
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    34
1281
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    35
copyright
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    36
"
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    37
 COPYRIGHT (c) 1998 by eXept Software AG
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    38
              All Rights Reserved
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    39
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    40
 This software is furnished under a license and may be used
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    41
 only in accordance with the terms of that license and with the
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    42
 inclusion of the above copyright notice.   This software may not
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    43
 be provided or otherwise made available to, or used by, any
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    44
 other person.  No title to or ownership of the software is
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    45
 hereby transferred.
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    46
"
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    47
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    48
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    49
!
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    50
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    51
documentation
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    52
"
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    53
    An ExtendedComboBox looks much like a ComboBox, but allows for any view
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    54
    to be popped up (in contrast to a ComboBox, which has a hardWired selectionInList-
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    55
    menu).
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    56
    The popped view may optionally be decorated with scrollBars.
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    57
    As a side effect, an ExtendedComboBox with a SelectionInListView or Menu
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    58
    can now be used as a replacement for ComboBoxes when long-lists are to be shown,
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    59
    since those can now be scrolled.
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    60
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    61
    [author:]
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    62
        Claus Atzkern
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    63
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    64
    [see also:]
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    65
        ComboBox ComboView
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    66
        PopUpList SelectionInListView
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    67
        ComboListView
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    68
        PullDownMenu Label EntryField
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    69
"
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    70
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    71
!
94b22cb9c19f documentation
Claus Gittinger <cg@exept.de>
parents: 1274
diff changeset
    72
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    73
examples
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    74
"
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    75
    example 1: SelectionInListView
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    76
                                                                                [exBegin]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    77
    |top menu widget list sidx|
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    78
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    79
    top  := StandardSystemView extent:200@35.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    80
    menu := ExtendedComboBox origin:5 @ 5 corner:1.0 @ 0.0 in:top.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    81
    list := #('foo' 'bar' 'baz' 'hjh' 'kk' 'claus' 'gjhj').
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    82
    sidx := 4.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    83
    menu bottomInset:(menu preferredExtent y negated).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    84
    menu contents:(list at:sidx).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    85
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    86
    widget := SelectionInListView new.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    87
    widget list:list.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    88
    widget doubleClickAction:[:i| menu contents:(widget at:i) ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    89
    widget selection:sidx.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    90
    menu menuWidget:widget.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    91
    top open.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    92
                                                                                [exEnd]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    93
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    94
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    95
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    96
    example 2: FileSelectionTree
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    97
                                                                                [exBegin]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    98
    |top menu widget|
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
    99
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   100
    top  := StandardSystemView extent:200@35.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   101
    menu := ExtendedComboBox origin:5 @ 5 corner:1.0 @ 0.0 in:top.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   102
    menu bottomInset:(menu preferredExtent y negated).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   103
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   104
    widget := FileSelectionTree new.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   105
    widget directory:(Filename homeDirectory).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   106
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   107
    widget doubleClickAction:[:i||n|
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   108
        n := widget selectedNode.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   109
        n isDirectory ifFalse:[menu contents:(n pathName)]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   110
    ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   111
    menu menuHeight:400.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   112
    menu menuWidget:widget.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   113
    top  open.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   114
                                                                                [exEnd]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   115
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   116
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   117
1286
d22e114ac9e2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1285
diff changeset
   118
    example 3: SelectionInTreeView
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   119
                                                                                [exBegin]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   120
    |top menu widget|
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   121
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   122
    top  := StandardSystemView extent:200@35.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   123
    menu := ExtendedComboBox origin:5 @ 5 corner:1.0 @ 0.0 in:top.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   124
    menu bottomInset:(menu preferredExtent y negated).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   125
    menu contents:'foo'.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   126
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   127
    widget := SelectionInTreeView new.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   128
    widget root:(TreeItem newAsTreeFromSmalltalkClass:Object).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   129
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   130
    widget doubleClickAction:[:i||n|
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   131
        n := widget selectedNode.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   132
        n hasChildren ifFalse:[menu contents:(n name)]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   133
    ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   134
    menu menuHeight:300.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   135
    menu menuWidget:widget.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   136
    top  open.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   137
                                                                                [exEnd]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   138
1282
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   139
    example 3: Funny
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   140
                                                                                [exBegin]
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   141
    |top menu widget|
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   142
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   143
    top  := StandardSystemView extent:250@35.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   144
    menu := ExtendedComboBox origin:5 @ 5 corner:1.0 @ 0.0 in:top.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   145
    menu bottomInset:(menu preferredExtent y negated).
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   146
    menu contents:'lets do the timeWarp again...'.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   147
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   148
    widget := ClockView new.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   149
    menu menuHeight:[widget width].
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   150
    menu menuWidget:widget.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   151
    top open.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   152
                                                                                [exEnd]
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   153
1285
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   154
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   155
    example 3: Funny - again 
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   156
               (use widgets pref-width; even if the combo-box is smaller)
1282
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   157
                                                                                [exBegin]
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   158
    |top menu widget|
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   159
1284
1fb5f5cbd4d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
   160
    top  := StandardSystemView extent:80@35.
1282
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   161
    menu := ExtendedComboBox origin:5 @ 5 corner:1.0 @ 0.0 in:top.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   162
    menu bottomInset:(menu preferredExtent y negated).
1284
1fb5f5cbd4d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
   163
    menu contents:'time...'.
1282
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   164
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   165
    widget := ClockView new.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   166
    menu menuWidget:widget.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   167
    menu usePreferredWidthForMenu:true.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   168
    top open.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   169
                                                                                [exEnd]
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   170
1285
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   171
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   172
    example 4: Funny - again 
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   173
               (use widgets pref-width; even if the combo-box is smaller,
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   174
                adjust the height for the width)
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   175
                                                                                [exBegin]
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   176
    |top menu widget|
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   177
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   178
    top  := StandardSystemView extent:80@35.
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   179
    menu := ExtendedComboBox origin:5 @ 5 corner:1.0 @ 0.0 in:top.
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   180
    menu bottomInset:(menu preferredExtent y negated).
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   181
    menu contents:'time...'.
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   182
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   183
    widget := ClockView new.
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   184
    menu menuWidget:widget.
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   185
    menu usePreferredWidthForMenu:true.
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   186
    menu menuHeight:[widget width].
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   187
    top open.
839acde3f42c fixed width when usePrefWidgetWidth is true
Claus Gittinger <cg@exept.de>
parents: 1284
diff changeset
   188
                                                                                [exEnd]
1406
982b813545c8 example
ah
parents: 1395
diff changeset
   189
982b813545c8 example
ah
parents: 1395
diff changeset
   190
    example 5: Subcanvas with a spec
982b813545c8 example
ah
parents: 1395
diff changeset
   191
                                                                                [exBegin]
982b813545c8 example
ah
parents: 1395
diff changeset
   192
    |top menu widget list sidx spec|
982b813545c8 example
ah
parents: 1395
diff changeset
   193
982b813545c8 example
ah
parents: 1395
diff changeset
   194
    spec :=  #(#FullSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   195
          #window: 
982b813545c8 example
ah
parents: 1395
diff changeset
   196
           #(#WindowSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   197
              #name: 'Define Color'
982b813545c8 example
ah
parents: 1395
diff changeset
   198
              #layout: #(#LayoutFrame 13 0 29 0 352 0 159 0)
982b813545c8 example
ah
parents: 1395
diff changeset
   199
              #label: 'Define Color'
982b813545c8 example
ah
parents: 1395
diff changeset
   200
              #min: #(#Point 340 110)
982b813545c8 example
ah
parents: 1395
diff changeset
   201
              #max: #(#Point 1152 900)
982b813545c8 example
ah
parents: 1395
diff changeset
   202
              #bounds: #(#Rectangle 13 29 353 160)
982b813545c8 example
ah
parents: 1395
diff changeset
   203
              #usePreferredExtent: false
982b813545c8 example
ah
parents: 1395
diff changeset
   204
          )
982b813545c8 example
ah
parents: 1395
diff changeset
   205
          #component: 
982b813545c8 example
ah
parents: 1395
diff changeset
   206
           #(#SpecCollection
982b813545c8 example
ah
parents: 1395
diff changeset
   207
              #collection: 
982b813545c8 example
ah
parents: 1395
diff changeset
   208
               #(
982b813545c8 example
ah
parents: 1395
diff changeset
   209
                 #(#VerticalPanelViewSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   210
                    #name: 'VerticalPanel1'
982b813545c8 example
ah
parents: 1395
diff changeset
   211
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 58 0 -40 1.0)
982b813545c8 example
ah
parents: 1395
diff changeset
   212
                    #component: 
982b813545c8 example
ah
parents: 1395
diff changeset
   213
                     #(#SpecCollection
982b813545c8 example
ah
parents: 1395
diff changeset
   214
                        #collection: 
982b813545c8 example
ah
parents: 1395
diff changeset
   215
                         #(
982b813545c8 example
ah
parents: 1395
diff changeset
   216
                           #(#LabelSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   217
                              #name: 'RedLabel'
982b813545c8 example
ah
parents: 1395
diff changeset
   218
                              #label: 'Red:'
982b813545c8 example
ah
parents: 1395
diff changeset
   219
                              #translateLabel: true
982b813545c8 example
ah
parents: 1395
diff changeset
   220
                              #adjust: #right
982b813545c8 example
ah
parents: 1395
diff changeset
   221
                              #extent: #(#Point 58 26)
982b813545c8 example
ah
parents: 1395
diff changeset
   222
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   223
                           #(#LabelSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   224
                              #name: 'GreenLabel'
982b813545c8 example
ah
parents: 1395
diff changeset
   225
                              #label: 'Green:'
982b813545c8 example
ah
parents: 1395
diff changeset
   226
                              #translateLabel: true
982b813545c8 example
ah
parents: 1395
diff changeset
   227
                              #adjust: #right
982b813545c8 example
ah
parents: 1395
diff changeset
   228
                              #extent: #(#Point 58 27)
982b813545c8 example
ah
parents: 1395
diff changeset
   229
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   230
                           #(#LabelSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   231
                              #name: 'BlueLabel'
982b813545c8 example
ah
parents: 1395
diff changeset
   232
                              #label: 'Blue:'
982b813545c8 example
ah
parents: 1395
diff changeset
   233
                              #translateLabel: true
982b813545c8 example
ah
parents: 1395
diff changeset
   234
                              #adjust: #right
982b813545c8 example
ah
parents: 1395
diff changeset
   235
                              #extent: #(#Point 58 26)
982b813545c8 example
ah
parents: 1395
diff changeset
   236
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   237
                        )
982b813545c8 example
ah
parents: 1395
diff changeset
   238
                    )
982b813545c8 example
ah
parents: 1395
diff changeset
   239
                    #horizontalLayout: #fit
982b813545c8 example
ah
parents: 1395
diff changeset
   240
                    #verticalLayout: #fitSpace
982b813545c8 example
ah
parents: 1395
diff changeset
   241
                    #horizontalSpace: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   242
                    #verticalSpace: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   243
                )
982b813545c8 example
ah
parents: 1395
diff changeset
   244
                 #(#VerticalPanelViewSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   245
                    #name: 'VerticalPanel2'
982b813545c8 example
ah
parents: 1395
diff changeset
   246
                    #layout: #(#LayoutFrame 60 0 0 0.0 -160 1.0 -40 1.0)
982b813545c8 example
ah
parents: 1395
diff changeset
   247
                    #component: 
982b813545c8 example
ah
parents: 1395
diff changeset
   248
                     #(#SpecCollection
982b813545c8 example
ah
parents: 1395
diff changeset
   249
                        #collection: 
982b813545c8 example
ah
parents: 1395
diff changeset
   250
                         #(
982b813545c8 example
ah
parents: 1395
diff changeset
   251
                           #(#SliderSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   252
                              #name: 'RedSlider'
982b813545c8 example
ah
parents: 1395
diff changeset
   253
                              #tabable: true
982b813545c8 example
ah
parents: 1395
diff changeset
   254
                              #model: #red
982b813545c8 example
ah
parents: 1395
diff changeset
   255
                              #orientation: #horizontal
982b813545c8 example
ah
parents: 1395
diff changeset
   256
                              #stop: 255
982b813545c8 example
ah
parents: 1395
diff changeset
   257
                              #step: 1
982b813545c8 example
ah
parents: 1395
diff changeset
   258
                              #backgroundColor: #(#Color 100.0 0.0 0.0)
982b813545c8 example
ah
parents: 1395
diff changeset
   259
                              #extent: #(#Point 118 16)
982b813545c8 example
ah
parents: 1395
diff changeset
   260
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   261
                           #(#SliderSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   262
                              #name: 'GreenSlider'
982b813545c8 example
ah
parents: 1395
diff changeset
   263
                              #tabable: true
982b813545c8 example
ah
parents: 1395
diff changeset
   264
                              #model: #green
982b813545c8 example
ah
parents: 1395
diff changeset
   265
                              #orientation: #horizontal
982b813545c8 example
ah
parents: 1395
diff changeset
   266
                              #stop: 255
982b813545c8 example
ah
parents: 1395
diff changeset
   267
                              #step: 1
982b813545c8 example
ah
parents: 1395
diff changeset
   268
                              #backgroundColor: #(#Color 0.0 100.0 0.0)
982b813545c8 example
ah
parents: 1395
diff changeset
   269
                              #extent: #(#Point 118 16)
982b813545c8 example
ah
parents: 1395
diff changeset
   270
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   271
                           #(#SliderSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   272
                              #name: 'BlueSlider'
982b813545c8 example
ah
parents: 1395
diff changeset
   273
                              #tabable: true
982b813545c8 example
ah
parents: 1395
diff changeset
   274
                              #model: #blue
982b813545c8 example
ah
parents: 1395
diff changeset
   275
                              #orientation: #horizontal
982b813545c8 example
ah
parents: 1395
diff changeset
   276
                              #stop: 255
982b813545c8 example
ah
parents: 1395
diff changeset
   277
                              #step: 1
982b813545c8 example
ah
parents: 1395
diff changeset
   278
                              #backgroundColor: #(#Color 0.0 0.0 100.0)
982b813545c8 example
ah
parents: 1395
diff changeset
   279
                              #extent: #(#Point 118 16)
982b813545c8 example
ah
parents: 1395
diff changeset
   280
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   281
                        )
982b813545c8 example
ah
parents: 1395
diff changeset
   282
                    )
982b813545c8 example
ah
parents: 1395
diff changeset
   283
                    #horizontalLayout: #fit
982b813545c8 example
ah
parents: 1395
diff changeset
   284
                    #verticalLayout: #spreadSpace
982b813545c8 example
ah
parents: 1395
diff changeset
   285
                    #horizontalSpace: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   286
                    #verticalSpace: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   287
                )
982b813545c8 example
ah
parents: 1395
diff changeset
   288
                 #(#VerticalPanelViewSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   289
                    #name: 'VerticalPanel3'
982b813545c8 example
ah
parents: 1395
diff changeset
   290
                    #layout: #(#LayoutFrame -158 1 0 0.0 -120 1 -40 1.0)
982b813545c8 example
ah
parents: 1395
diff changeset
   291
                    #component: 
982b813545c8 example
ah
parents: 1395
diff changeset
   292
                     #(#SpecCollection
982b813545c8 example
ah
parents: 1395
diff changeset
   293
                        #collection: 
982b813545c8 example
ah
parents: 1395
diff changeset
   294
                         #(
982b813545c8 example
ah
parents: 1395
diff changeset
   295
                           #(#InputFieldSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   296
                              #name: 'RedField'
982b813545c8 example
ah
parents: 1395
diff changeset
   297
                              #model: #red
982b813545c8 example
ah
parents: 1395
diff changeset
   298
                              #type: #numberInRange
982b813545c8 example
ah
parents: 1395
diff changeset
   299
                              #numChars: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   300
                              #minValue: 0
982b813545c8 example
ah
parents: 1395
diff changeset
   301
                              #maxValue: 255
982b813545c8 example
ah
parents: 1395
diff changeset
   302
                              #extent: #(#Point 38 20)
982b813545c8 example
ah
parents: 1395
diff changeset
   303
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   304
                           #(#InputFieldSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   305
                              #name: 'GreenField'
982b813545c8 example
ah
parents: 1395
diff changeset
   306
                              #model: #green
982b813545c8 example
ah
parents: 1395
diff changeset
   307
                              #type: #numberInRange
982b813545c8 example
ah
parents: 1395
diff changeset
   308
                              #numChars: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   309
                              #minValue: 0
982b813545c8 example
ah
parents: 1395
diff changeset
   310
                              #maxValue: 255
982b813545c8 example
ah
parents: 1395
diff changeset
   311
                              #extent: #(#Point 38 20)
982b813545c8 example
ah
parents: 1395
diff changeset
   312
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   313
                           #(#InputFieldSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   314
                              #name: 'BlueField'
982b813545c8 example
ah
parents: 1395
diff changeset
   315
                              #model: #blue
982b813545c8 example
ah
parents: 1395
diff changeset
   316
                              #type: #numberInRange
982b813545c8 example
ah
parents: 1395
diff changeset
   317
                              #numChars: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   318
                              #minValue: 0
982b813545c8 example
ah
parents: 1395
diff changeset
   319
                              #maxValue: 255
982b813545c8 example
ah
parents: 1395
diff changeset
   320
                              #extent: #(#Point 38 20)
982b813545c8 example
ah
parents: 1395
diff changeset
   321
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   322
                        )
982b813545c8 example
ah
parents: 1395
diff changeset
   323
                    )
982b813545c8 example
ah
parents: 1395
diff changeset
   324
                    #horizontalLayout: #fit
982b813545c8 example
ah
parents: 1395
diff changeset
   325
                    #verticalLayout: #spreadSpace
982b813545c8 example
ah
parents: 1395
diff changeset
   326
                    #horizontalSpace: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   327
                    #verticalSpace: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   328
                )
982b813545c8 example
ah
parents: 1395
diff changeset
   329
                 #(#LabelSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   330
                    #name: 'PreviewBox'
982b813545c8 example
ah
parents: 1395
diff changeset
   331
                    #layout: #(#LayoutFrame -116 1 0 0.0 -2 1.0 -40 1.0)
982b813545c8 example
ah
parents: 1395
diff changeset
   332
                    #label: 'Preview'
982b813545c8 example
ah
parents: 1395
diff changeset
   333
                    #translateLabel: true
982b813545c8 example
ah
parents: 1395
diff changeset
   334
                    #level: -1
982b813545c8 example
ah
parents: 1395
diff changeset
   335
                )
982b813545c8 example
ah
parents: 1395
diff changeset
   336
                 #(#HorizontalPanelViewSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   337
                    #name: 'HorizontalPanel1'
982b813545c8 example
ah
parents: 1395
diff changeset
   338
                    #layout: #(#LayoutFrame 0 0.0 -32 1 0 1.0 0 1.0)
982b813545c8 example
ah
parents: 1395
diff changeset
   339
                    #component: 
982b813545c8 example
ah
parents: 1395
diff changeset
   340
                     #(#SpecCollection
982b813545c8 example
ah
parents: 1395
diff changeset
   341
                        #collection: 
982b813545c8 example
ah
parents: 1395
diff changeset
   342
                         #(
982b813545c8 example
ah
parents: 1395
diff changeset
   343
                           #(#ActionButtonSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   344
                              #name: 'CancelButton'
982b813545c8 example
ah
parents: 1395
diff changeset
   345
                              #label: 'Cancel'
982b813545c8 example
ah
parents: 1395
diff changeset
   346
                              #translateLabel: true
982b813545c8 example
ah
parents: 1395
diff changeset
   347
                              #model: #cancel
982b813545c8 example
ah
parents: 1395
diff changeset
   348
                              #extent: #(#Point 165 26)
982b813545c8 example
ah
parents: 1395
diff changeset
   349
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   350
                           #(#ActionButtonSpec
982b813545c8 example
ah
parents: 1395
diff changeset
   351
                              #name: 'OKButton'
982b813545c8 example
ah
parents: 1395
diff changeset
   352
                              #label: 'OK'
982b813545c8 example
ah
parents: 1395
diff changeset
   353
                              #translateLabel: true
982b813545c8 example
ah
parents: 1395
diff changeset
   354
                              #model: #accept
982b813545c8 example
ah
parents: 1395
diff changeset
   355
                              #extent: #(#Point 166 26)
982b813545c8 example
ah
parents: 1395
diff changeset
   356
                          )
982b813545c8 example
ah
parents: 1395
diff changeset
   357
                        )
982b813545c8 example
ah
parents: 1395
diff changeset
   358
                    )
982b813545c8 example
ah
parents: 1395
diff changeset
   359
                    #horizontalLayout: #fitSpace
982b813545c8 example
ah
parents: 1395
diff changeset
   360
                    #verticalLayout: #centerMax
982b813545c8 example
ah
parents: 1395
diff changeset
   361
                    #horizontalSpace: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   362
                    #verticalSpace: 3
982b813545c8 example
ah
parents: 1395
diff changeset
   363
                )
982b813545c8 example
ah
parents: 1395
diff changeset
   364
              )
982b813545c8 example
ah
parents: 1395
diff changeset
   365
          )
982b813545c8 example
ah
parents: 1395
diff changeset
   366
      ).
982b813545c8 example
ah
parents: 1395
diff changeset
   367
982b813545c8 example
ah
parents: 1395
diff changeset
   368
    top  := StandardSystemView extent:200@35.
982b813545c8 example
ah
parents: 1395
diff changeset
   369
    menu := ExtendedComboBox origin:5 @ 5 corner:1.0 @ 0.0 in:top.
982b813545c8 example
ah
parents: 1395
diff changeset
   370
    list := #('foo' 'bar' 'baz' 'hjh' 'kk' 'claus' 'gjhj').
982b813545c8 example
ah
parents: 1395
diff changeset
   371
    sidx := 4.
982b813545c8 example
ah
parents: 1395
diff changeset
   372
    menu bottomInset:(menu preferredExtent y negated).
982b813545c8 example
ah
parents: 1395
diff changeset
   373
    menu contents:(list at:sidx).
982b813545c8 example
ah
parents: 1395
diff changeset
   374
982b813545c8 example
ah
parents: 1395
diff changeset
   375
    widget := SubCanvas new.
982b813545c8 example
ah
parents: 1395
diff changeset
   376
    widget spec:spec.
982b813545c8 example
ah
parents: 1395
diff changeset
   377
    menu menuWidget:widget.
982b813545c8 example
ah
parents: 1395
diff changeset
   378
    top open.
982b813545c8 example
ah
parents: 1395
diff changeset
   379
                                                                                [exEnd]
982b813545c8 example
ah
parents: 1395
diff changeset
   380
982b813545c8 example
ah
parents: 1395
diff changeset
   381
982b813545c8 example
ah
parents: 1395
diff changeset
   382
982b813545c8 example
ah
parents: 1395
diff changeset
   383
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   384
"
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   385
! !
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   386
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   387
!ExtendedComboBox methodsFor:'accessing'!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   388
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   389
contents
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   390
    "return the value of the field (the models value)"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   391
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   392
    ^ model value
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   393
!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   394
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   395
contents:aValue
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   396
    "set the value of the field (the models value)"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   397
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   398
    model value:aValue.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   399
!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   400
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   401
menuExtent
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   402
    ^ menuExtent
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   403
!
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   404
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   405
menuExtent:anExtent
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   406
    menuExtent := anExtent.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   407
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   408
    anExtent notNil ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   409
        menuHeight := nil.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   410
    ] ifFalse:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   411
        menuHeight := anExtent y max:50.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   412
    ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   413
    usePreferredWidthForMenu := true.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   414
!
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
   415
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   416
menuWidget
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   417
    "get the menu widget or nil"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   418
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   419
    ^ menuWidget
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   420
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   421
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   422
menuWidget:aWidgetOrFilenameOrSequenceableCollectionOrNil
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   423
    "set the menu widget or nil"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   424
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   425
    menuWidget ~~ aWidgetOrFilenameOrSequenceableCollectionOrNil ifTrue:[
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   426
        menuWrapper notNil ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   427
            self closeMenu.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   428
            menuWrapper destroy.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   429
            menuWrapper := nil.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   430
        ].
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   431
        aWidgetOrFilenameOrSequenceableCollectionOrNil isView ifTrue:[
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   432
            menuWidget := aWidgetOrFilenameOrSequenceableCollectionOrNil.
2013
3f550c902871 care for someone setting menuWrapper to nil,
Claus Gittinger <cg@exept.de>
parents: 1944
diff changeset
   433
            ^ self
1868
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
   434
        ].
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
   435
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   436
        aWidgetOrFilenameOrSequenceableCollectionOrNil isFilename ifTrue:[
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   437
            self setupMenuWidgetForDirectory:aWidgetOrFilenameOrSequenceableCollectionOrNil.
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   438
            ^ self
1868
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
   439
        ].
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
   440
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   441
        aWidgetOrFilenameOrSequenceableCollectionOrNil isSequenceable ifTrue:[
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   442
            self setupMenuWidgetForList:aWidgetOrFilenameOrSequenceableCollectionOrNil.
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   443
            ^ self
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   444
        ].
2904
b0b7eb41d6fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
   445
b0b7eb41d6fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
   446
        aWidgetOrFilenameOrSequenceableCollectionOrNil isNil ifTrue:[
b0b7eb41d6fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
   447
            menuWidget := aWidgetOrFilenameOrSequenceableCollectionOrNil.
b0b7eb41d6fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
   448
            ^ self
b0b7eb41d6fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
   449
        ].
b0b7eb41d6fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
   450
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   451
        self error:'invalid menuWidget'
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   452
    ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   453
! !
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   454
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   455
!ExtendedComboBox methodsFor:'accessing-actions'!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   456
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   457
openAction
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   458
    "returns the action, called before opening the pulldown menu"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   459
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   460
    ^ openAction
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   461
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   462
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   463
openAction:aOneArgBlock
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   464
    "set the action, called before opening the pulldown menu;
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   465
     the argument to the action is the menu widget"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   466
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   467
    openAction := aOneArgBlock
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   468
! !
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   469
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   470
!ExtendedComboBox methodsFor:'accessing-behavior'!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   471
2411
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   472
closeOnSelect
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   473
    "if true, then the comboList is closed when the model value/selection changed"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   474
2411
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   475
    ^ closeOnSelect
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   476
!
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   477
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   478
closeOnSelect:aBoolean
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   479
    "if true, then the comboList is closed when the model value/selection changed"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   480
2411
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   481
    closeOnSelect := aBoolean.
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   482
!
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   483
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   484
disable
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   485
    "disable me and my components"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   486
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   487
    self closeMenu.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   488
2461
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   489
    menuField disable.
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   490
    menuButton disable.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   491
!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   492
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   493
enable
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   494
    "enable me and my components"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   495
2461
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   496
    menuField enable.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   497
    menuButton enable
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   498
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   499
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   500
enabled
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   501
    "returns true, if enabled"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   502
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   503
    ^ menuButton enabled
2462
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   504
!
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   505
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   506
readOnly
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   507
    "returns true if the menuField is readonly"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   508
2462
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   509
    ^ isReadOnly
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   510
!
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   511
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   512
readOnly:aBoolean
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   513
    "set the menuField to be readonly or writable"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   514
2462
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   515
    isReadOnly == aBoolean ifTrue:[ ^ self ].
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   516
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   517
    isReadOnly := aBoolean.
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   518
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   519
    menuField isNil ifTrue:[
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   520
        self createEditField.
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   521
    ].
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   522
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   523
    menuField readOnly:aBoolean.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   524
! !
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   525
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   526
!ExtendedComboBox methodsFor:'accessing-bg & border'!
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   527
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   528
backgroundColor
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   529
    "get the background color of the menu field"
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   530
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   531
    ^ menuField backgroundColor
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   532
!
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   533
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   534
backgroundColor:aColor
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   535
    "set the background color of the menu field"
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   536
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   537
    menuField backgroundColor:aColor
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   538
!
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   539
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   540
foregroundColor
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   541
    "return the foreground color of the menu field"
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   542
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   543
    ^ menuField foregroundColor
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   544
!
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   545
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   546
foregroundColor:aColor
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   547
    "set the foreground color of the menu field"
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   548
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   549
    menuField foregroundColor:aColor
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   550
! !
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   551
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   552
!ExtendedComboBox methodsFor:'accessing-channels'!
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   553
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   554
enableChannel 
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   555
    "return a valueHolder for enable/disable"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   556
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   557
    ^ menuButton enableChannel
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   558
!
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   559
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   560
enableChannel:aValueHolder 
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   561
    "set a valueHolder for enable/disable"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   562
2461
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   563
    menuField enableChannel:aValueHolder.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   564
    menuButton enableChannel:aValueHolder.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   565
!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   566
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   567
menuWidgetHolder
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   568
    "returns the menu widget or nil"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   569
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   570
    ^ menuWidgetHolder
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   571
!
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   572
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   573
menuWidgetHolder:aHolder
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   574
    "returns the menu widget or nil"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   575
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   576
    menuWidgetHolder notNil ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   577
        menuWidgetHolder removeDependent:self
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   578
    ].
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   579
    menuWidgetHolder := aHolder.
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   580
    menuWidgetHolder notNil ifTrue:[
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   581
        menuWidgetHolder addDependent:self
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   582
    ].
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   583
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   584
    self menuWidget:(menuWidgetHolder value).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   585
!
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   586
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   587
model:aModel
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   588
    "set the model"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   589
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   590
    super model:(aModel ? ValueHolder new).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   591
    menuField notNil ifTrue:[ menuField model:model ].
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   592
! !
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   593
1848
5256c7de1045 access to input-field
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
   594
!ExtendedComboBox methodsFor:'accessing-components'!
5256c7de1045 access to input-field
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
   595
2461
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   596
editor
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   597
    ^ menuField
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   598
!
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   599
1848
5256c7de1045 access to input-field
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
   600
menuField
2707
8643fcf4e814 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 2472
diff changeset
   601
    <resource: #obsolete>
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   602
2461
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   603
    self obsoleteMethodWarning:'Use #editor for ComboBox compatibility'.
1848
5256c7de1045 access to input-field
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
   604
    ^ menuField
1857
3c1a9729f46c popup menu holder added
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
   605
!
3c1a9729f46c popup menu holder added
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
   606
3c1a9729f46c popup menu holder added
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
   607
menuHolder:anObject
3c1a9729f46c popup menu holder added
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
   608
    "change the one that provides the menu (via menuMsg)."
3c1a9729f46c popup menu holder added
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
   609
3c1a9729f46c popup menu holder added
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
   610
    super menuHolder:anObject.
2461
208fed751e87 do not use a Label if readOnly;
tm
parents: 2411
diff changeset
   611
    menuField notNil ifTrue:[  
1857
3c1a9729f46c popup menu holder added
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
   612
        menuField menuHolder:anObject
3c1a9729f46c popup menu holder added
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
   613
    ]
1848
5256c7de1045 access to input-field
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
   614
! !
5256c7de1045 access to input-field
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
   615
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   616
!ExtendedComboBox methodsFor:'accessing-default menus'!
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   617
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   618
directory:aDirectory
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   619
    "creates a FileSelectionTree as menuWidget - menu, setting the root to the directory"
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   620
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   621
    self obsoleteMethodWarning:'use #setupMenuWidgetForDirectory:'.
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   622
    self setupMenuWidgetForDirectory:aDirectory
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   623
!
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   624
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   625
list:aList
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   626
    "creates a SelectionInListView as menuWidget - menu setting the list"
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   627
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   628
    self obsoleteMethodWarning:'use #setupMenuWidgetForList:'.
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   629
    self setupMenuWidgetForList:aList
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   630
!
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   631
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   632
setupMenuWidgetForDirectory:aDirectory
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   633
    "creates a FileSelectionTree as menuWidget - setting the root to the directory"
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   634
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   635
    menuWidget isNil ifTrue:[
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   636
        self autoHideScrollBars:false.
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   637
        menuWidget := FileSelectionTree new.
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   638
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   639
        menuWidget doubleClickAction:[:aDummy||node|
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   640
            node := menuWidget selectedNode.
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   641
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   642
            node isDirectory ifFalse:[
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   643
                self contents:(node pathName)
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   644
            ]
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   645
        ]
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   646
    ].
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   647
    self menuHeight:400.
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   648
    menuWidget directory:aDirectory.
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   649
!
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   650
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   651
setupMenuWidgetForList:aList
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   652
    "creates a SelectionInListView as menuWidget - menu setting the list"
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   653
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   654
    menuWidget isNil ifTrue:[
1648
aed7d8a7097c create popup & subviews on my device (not on screen current)
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
   655
        menuWidget := SelectionInListView onDevice:(device ? Screen current).
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   656
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   657
        menuWidget doubleClickAction:[:anIndex| 
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   658
            self contents:(menuWidget at:anIndex)
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   659
        ]
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   660
    ].
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   661
    menuWidget list:aList
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   662
! !
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   663
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   664
!ExtendedComboBox methodsFor:'accessing-dimension'!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   665
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   666
menuHeight
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   667
    "get the maximum height of the menu widget or nil"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   668
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   669
    ^ menuHeight
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   670
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   671
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   672
menuHeight:aHeight
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   673
    "set the maximum height of the menu widget or nil"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   674
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   675
    menuHeight := aHeight.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   676
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   677
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   678
preferredExtent
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   679
    "compute & return the preferredExtent from the components' preferrences"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   680
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   681
    |fieldPref buttonPref m w h f|
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   682
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   683
    "/ If I have an explicit preferredExtent ..
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   684
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   685
    preferredExtent notNil ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   686
        ^ preferredExtent
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   687
    ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   688
    fieldPref  := menuField preferredExtent.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   689
    buttonPref := menuButton preferredExtent.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   690
    f := 2 + font maxHeight + (font maxDescent * 2) + (menuField margin * 2).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   691
    h := (fieldPref y max:f) max:buttonPref y.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   692
    m := margin max:1.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   693
    h := h + m + m.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   694
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   695
    w := (fieldPref x max:100) + buttonPref x.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   696
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   697
    menuWidget notNil ifTrue:[
1282
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
   698
        f := menuWidget preferredExtent x "widthOfContents" + buttonPref x + 20.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   699
        w := f max:w
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   700
    ].
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   701
    w := w + margin + margin.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   702
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   703
    ^ w @ h
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   704
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   705
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   706
usePreferredWidthForMenu
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   707
    "returns true if the menu is to be opened with its menu preferred width"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   708
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   709
    ^ usePreferredWidthForMenu
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   710
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   711
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   712
usePreferredWidthForMenu:aBoolean
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   713
    "open the menu with its preferred width"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   714
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   715
    usePreferredWidthForMenu := aBoolean
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   716
! !
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   717
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   718
!ExtendedComboBox methodsFor:'accessing-look'!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   719
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   720
adjust
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   721
    "returns the button-adjust symbol, which is one of
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   722
         #left  -> left adjust  
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   723
         #right -> right adjust"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   724
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   725
    ^ adjust ? #right
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   726
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   727
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   728
adjust:how
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   729
    "set the button-adjust, which must be one of
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   730
         #left  -> left adjust  
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   731
         #right -> right adjust"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   732
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   733
    |rightInset|
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   734
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   735
    (adjust ~~ how and:[(how == #left or:[how == #right])]) ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   736
        (adjust := how) == #left ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   737
            menuButton origin:0.0@0.0 corner:0.0@1.0
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   738
        ] ifFalse:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   739
            menuButton origin:1.0@0.0 corner:1.0@1.0
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   740
        ].
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   741
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   742
        rightInset := menuButton leftInset.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   743
        menuButton leftInset:(menuButton rightInset).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   744
        menuButton rightInset:rightInset.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   745
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   746
        rightInset := menuField leftInset.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   747
        menuField  leftInset:(menuField rightInset).
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   748
        menuField rightInset:rightInset.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   749
    ].
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   750
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   751
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   752
font:aFont
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   753
    "set the font of the menu field"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   754
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   755
    super font:aFont.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   756
    menuField font:aFont.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   757
! !
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   758
2404
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2173
diff changeset
   759
!ExtendedComboBox methodsFor:'accessing-scrollbars'!
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   760
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   761
autoHideScrollBars
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   762
    "set/clear the flag which controls if scrollBars should
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   763
     be made invisible dynamically, when there is nothing to scroll
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   764
     (and shown if there is)"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   765
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   766
    ^ autoHideScrollBars
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   767
!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   768
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   769
autoHideScrollBars:aBoolean
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   770
    "set/clear the flag which controls if scrollBars should
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   771
     be made invisible dynamically, when there is nothing to scroll
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   772
     (and shown if there is)"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   773
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   774
    autoHideScrollBars := aBoolean
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   775
!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   776
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   777
hasHorizontalScrollBar
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   778
    "return the horizontal scrollability.
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   779
     If disabled, the horizontal scrollBar is made invisible."
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   780
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   781
    ^ hasHorizontalScrollBar
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   782
!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   783
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   784
hasHorizontalScrollBar:aBool
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   785
    "enable/disable horizontal scrollability.
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   786
     If disabled, the horizontal scrollBar is made invisible."
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   787
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   788
    hasHorizontalScrollBar := aBool
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   789
!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   790
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   791
hasVerticalScrollBar
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   792
    "return the vertical scrollability.
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   793
     If disabled, the vertical scrollBar is made invisible."
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   794
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   795
    ^ hasVerticalScrollBar
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   796
!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   797
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   798
hasVerticalScrollBar:aBool
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   799
    "enable/disable vertical scrollability.
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   800
     If disabled, the vertical scrollBar is made invisible."
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   801
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   802
    hasVerticalScrollBar := aBool
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   803
!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   804
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   805
miniScrollerHorizontal
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   806
    "return the flag which controls if the horizontal scrollBar is either a miniScroller,
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   807
     or a full scrollBar."
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   808
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   809
    ^ miniScrollerHorizontal
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   810
!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   811
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   812
miniScrollerHorizontal:aBool
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   813
    "control the horizontal scrollBar to be either a miniScroller,
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   814
     or a full scrollBar."
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   815
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   816
    miniScrollerHorizontal := aBool
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   817
!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   818
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   819
miniScrollerVertical
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   820
    "return the flag which controls if the vertical scrollBar is either a miniScroller,
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   821
     or a full scrollBar."
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   822
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   823
    ^ miniScrollerVertical
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   824
!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   825
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   826
miniScrollerVertical:aBool
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   827
    "control the vertical scrollBar to be either a miniScroller,
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   828
     or a full scrollBar."
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   829
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   830
    miniScrollerVertical := aBool
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   831
! !
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   832
2411
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   833
!ExtendedComboBox methodsFor:'change & update'!
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   834
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   835
update:what with:aPara from:aModel
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   836
    "one of my models changed"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   837
2411
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   838
    aModel == self model ifTrue:[
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   839
        closeOnSelect ifTrue:[
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   840
            self closeMenu
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   841
        ].
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   842
        ^ self
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   843
    ].
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   844
    aModel == self menuWidgetHolder ifTrue:[
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   845
        self menuWidget:(aModel value).
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   846
        ^ self
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   847
    ].
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   848
    super update:what with:aPara from:aModel
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   849
! !
47fa3acd65a5 add: #closeOnSelect
ca
parents: 2404
diff changeset
   850
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   851
!ExtendedComboBox methodsFor:'error handling'!
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   852
2890
e302b773ba71 ugly comments
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   853
doesNotUnderstand:aMessage 
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   854
    "delegate messages to the widget"
2890
e302b773ba71 ugly comments
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   855
    
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   856
    menuWidget notNil ifTrue:[
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   857
        ^ aMessage sendTo:menuWidget
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   858
    ].
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
   859
    ^ super doesNotUnderstand:aMessage
2903
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   860
! !
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   861
be9322441131 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   862
!ExtendedComboBox methodsFor:'event handling'!
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   863
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   864
keyPress:key x:x y:y
2890
e302b773ba71 ugly comments
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   865
    "handle a key press event"
e302b773ba71 ugly comments
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   866
2026
3b9f6e0aaad5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2022
diff changeset
   867
    <resource: #keyboard (#Return)>
3b9f6e0aaad5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2022
diff changeset
   868
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   869
    (key == Character space or:[key == #Return]) ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   870
        self enabled ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   871
            self openMenu
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   872
        ]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   873
    ] ifFalse:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   874
        super keyPress:key x:x y:y
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   875
    ]
3235
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   876
!
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   877
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   878
processEvent:anEvent
3289
7bf0ddb4df39 bugfix - processEvents should have a look for which button is pressed
ca
parents: 3285
diff changeset
   879
    |evView button point x y|
3235
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   880
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   881
    anEvent isButtonPressEvent ifFalse:[
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   882
        ^ false
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   883
    ].
3289
7bf0ddb4df39 bugfix - processEvents should have a look for which button is pressed
ca
parents: 3285
diff changeset
   884
    button := anEvent state.
7bf0ddb4df39 bugfix - processEvents should have a look for which button is pressed
ca
parents: 3285
diff changeset
   885
    ((button == 1) or:[button == #select]) ifFalse:[
7bf0ddb4df39 bugfix - processEvents should have a look for which button is pressed
ca
parents: 3285
diff changeset
   886
        ^ false
7bf0ddb4df39 bugfix - processEvents should have a look for which button is pressed
ca
parents: 3285
diff changeset
   887
    ].
3235
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   888
    (menuField notNil and:[menuField shown]) ifFalse:[
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   889
        ^ false
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   890
    ].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   891
    (isReadOnly and:[self enabled]) ifFalse:[
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   892
        ^ false
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   893
    ].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   894
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   895
    evView := anEvent view.
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   896
    evView isNil ifTrue:[^ false].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   897
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   898
    point := Point x:(anEvent x) y:(anEvent y).
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   899
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   900
    evView ~~ menuField ifTrue:[
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   901
        (evView isSameOrComponentOf:menuField) ifFalse:[
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   902
            ^ false
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   903
        ].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   904
        point := device translatePoint:point fromView:evView toView:menuField.
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   905
    ].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   906
    x := point x.
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   907
    (x between:0 and:menuField width) ifFalse:[^ false].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   908
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   909
    y := point y.
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   910
    (y between:0 and:menuField height) ifFalse:[^ false].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   911
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   912
    self openMenu.
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   913
    ^ true
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   914
! !
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   915
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   916
!ExtendedComboBox methodsFor:'initialization'!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   917
2462
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   918
createEditField
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   919
    |nm|
2462
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   920
3282
3f94ea1cf64d test for unspecified menuField before creation
ca
parents: 3237
diff changeset
   921
    menuField isNil ifTrue:[
3f94ea1cf64d test for unspecified menuField before creation
ca
parents: 3237
diff changeset
   922
        menuField := EditField in:self.
3f94ea1cf64d test for unspecified menuField before creation
ca
parents: 3237
diff changeset
   923
    ].
2462
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   924
    menuField origin:0.0 @ 0.0 corner:1.0 @ 1.0.
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   925
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   926
    styleSheet is3D ifTrue:[
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   927
        (styleSheet at:'comboViewLevel' default:nil) notNil ifTrue:[
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   928
            menuField level:0.
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   929
        ] ifFalse:[
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   930
            menuField leftInset:(ViewSpacing // 2).
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   931
        ]
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   932
    ].
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   933
    nm := styleSheet name.
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   934
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   935
    (nm = #win95 or:[nm = #win98 or:[ nm = #winXP or:[nm = #st80]]]) ifTrue:[
2462
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   936
        menuField level:0.
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   937
        menuField leftInset:0.
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   938
    ].
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   939
    menuField rightInset:(menuButton leftInset negated).
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   940
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   941
    menuField menuHolder:(self menuHolder).
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   942
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   943
    menuField model:model.
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   944
    menuField  font:font.
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   945
    self shown ifTrue:[ menuField realize ].
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   946
!
8eaa99008134 checkin from browser
tm
parents: 2461
diff changeset
   947
2472
dee96e84c441 *** empty log message ***
martin
parents: 2463
diff changeset
   948
destroy
3235
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   949
    |wgrp|
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   950
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   951
    (wgrp := self windowGroup) notNil ifTrue:[
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   952
       wgrp removePreEventHook:self.
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   953
    ].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
   954
2472
dee96e84c441 *** empty log message ***
martin
parents: 2463
diff changeset
   955
    menuWidget notNil ifTrue:[
dee96e84c441 *** empty log message ***
martin
parents: 2463
diff changeset
   956
        menuWidget destroy.
dee96e84c441 *** empty log message ***
martin
parents: 2463
diff changeset
   957
        self menuWidget:nil.
dee96e84c441 *** empty log message ***
martin
parents: 2463
diff changeset
   958
    ].
dee96e84c441 *** empty log message ***
martin
parents: 2463
diff changeset
   959
    super destroy
dee96e84c441 *** empty log message ***
martin
parents: 2463
diff changeset
   960
!
dee96e84c441 *** empty log message ***
martin
parents: 2463
diff changeset
   961
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   962
initialize
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   963
    "setup defaults"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
   964
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   965
    |prefExt prefWidth lvl rightInset leftInset halfSpacing nm|
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   966
fd1e5968db2f initial checkin
ps
parents:
diff changeset
   967
    super initialize.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   968
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   969
    closeOnSelect := true.
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   970
2173
41ed0651d789 use same button init code as ComboView
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   971
    self initializeButton.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   972
    menuButton pressAction:[self openMenu].
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   973
    prefExt   := menuButton preferredExtent.
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   974
    prefWidth := prefExt x.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   975
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   976
    menuButton origin:1.0@0.0 corner:1.0@1.0.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   977
    styleSheet is3D ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   978
        halfSpacing := ViewSpacing // 2.
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   979
        leftInset := rightInset := prefWidth + halfSpacing.
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   980
        (lvl := styleSheet at:#'comboView.level' default:nil) notNil ifTrue:[
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   981
            self level:lvl.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   982
        ] ifFalse:[
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   983
            menuButton rightInset:halfSpacing.
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   984
        ].
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   985
    ] ifFalse:[
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   986
        leftInset := prefWidth + menuButton borderWidth.
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   987
        rightInset := prefWidth.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   988
    ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   989
1696
f1bae6d68ffe eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents: 1648
diff changeset
   990
    nm := styleSheet name.
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   991
    (nm = #win95 or:[nm = #win98 or:[nm = #winXP or:[nm = #st80]]]) ifTrue:[
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   992
        lvl isNil ifTrue:[self level:-1].
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   993
        menuButton rightInset:0.
1696
f1bae6d68ffe eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents: 1648
diff changeset
   994
        nm ~= #st80 ifTrue:[
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   995
            leftInset := (ArrowButton new preferredExtent x).
3285
1541e5cf4395 bugfix winXP style
ca
parents: 3282
diff changeset
   996
            rightInset := leftInset.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   997
        ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   998
    ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   999
    menuButton leftInset:leftInset negated.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1000
    self model:nil.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1001
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1002
    adjust                   := #right.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1003
    usePreferredWidthForMenu := false.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1004
    isReadOnly               := false.
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1005
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1006
    autoHideScrollBars       := true.
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1007
    hasHorizontalScrollBar   := true.
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1008
    hasVerticalScrollBar     := true.
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1009
    miniScrollerHorizontal   := true.
1868
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1010
    miniScrollerVertical     := true.
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1011
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1012
    self readOnly:true.
2173
41ed0651d789 use same button init code as ComboView
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
  1013
!
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1014
2173
41ed0651d789 use same button init code as ComboView
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
  1015
initializeButton
41ed0651d789 use same button init code as ComboView
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
  1016
    menuButton := ComboView comboButtonFor:self.
2157
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2125
diff changeset
  1017
!
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2125
diff changeset
  1018
3235
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1019
realize
3237
50336fd7fbbe test for unspecified windowGroup
ca
parents: 3235
diff changeset
  1020
    |wgrp pullMenuIfClickedOnField|
3235
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1021
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1022
    super realize.
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1023
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1024
    pullMenuIfClickedOnField := styleSheet at:#'comboView.pullMenuIfClickedOnField'
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1025
                   default:[ OperatingSystem isMSWINDOWSlike ].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1026
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1027
    pullMenuIfClickedOnField == true ifTrue:[
3237
50336fd7fbbe test for unspecified windowGroup
ca
parents: 3235
diff changeset
  1028
        wgrp := self windowGroup.
50336fd7fbbe test for unspecified windowGroup
ca
parents: 3235
diff changeset
  1029
        wgrp notNil ifTrue:[ wgrp addPreEventHook:self ].
3235
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1030
    ].
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1031
!
e38e4be1602e comboView.pullMenuIfClickedOnField
ca
parents: 3134
diff changeset
  1032
2157
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2125
diff changeset
  1033
release
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1034
    "release dependencies"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1035
2472
dee96e84c441 *** empty log message ***
martin
parents: 2463
diff changeset
  1036
    self menuWidget:nil.
2157
6cfdf247519a destroy - release
Claus Gittinger <cg@exept.de>
parents: 2125
diff changeset
  1037
    super release.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1038
! !
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1039
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1040
!ExtendedComboBox methodsFor:'queries'!
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1041
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1042
menuIsScrollable
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1043
    "returns true if the menu is scrollable"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1044
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1045
    ^ (self hasVerticalScrollBar or:[self hasHorizontalScrollBar])
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1046
! !
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1047
1890
b08a2a15cea6 category change
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1048
!ExtendedComboBox methodsFor:'user interaction'!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1049
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1050
closeMenu
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1051
    "close the menu"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1052
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1053
    |id|
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1054
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1055
    menuWrapper notNil ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1056
        menuWrapper realized ifFalse:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1057
            (id := menuWrapper id) notNil ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1058
                device unmapWindow:id
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1059
            ]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1060
        ] ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1061
           menuWrapper unmap
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1062
        ].
1273
0460739b9e97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1063
"/        menuWrapper windowGroup:nil.
0460739b9e97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1064
"/        self windowGroup removeView:menuWrapper.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1065
    ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1066
    menuButton turnOff.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1067
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1068
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1069
openMenu
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1070
    "pull the menu - triggered from the button"
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1071
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1072
    |h w menuOrigin useableExt widgetPrfExt|
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1073
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
  1074
    openAction notNil ifTrue:[
2069
7891c7d3af69 use new #perform:withOptionalArgument:
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
  1075
        openAction valueWithOptionalArgument:menuWidget
1274
0f36e87f6b21 add openAction
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
  1076
    ].
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1077
    menuWrapper isNil ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1078
        menuWidget isNil ifTrue:[^ self].
1648
aed7d8a7097c create popup & subviews on my device (not on screen current)
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  1079
        menuWrapper := MenuWrapper onDevice:(device ? Screen current).
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1080
        menuWrapper for:menuWidget in:self.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1081
    ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1082
    menuButton turnOn.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1083
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1084
    menuOrigin   := device translatePoint:(0@height) fromView:self toView:nil.
1392
2d4a90914f2b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1085
    useableExt   := device usableExtent.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1086
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1087
    menuExtent notNil ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1088
        widgetPrfExt := menuExtent.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1089
    ] ifFalse:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1090
        widgetPrfExt := menuWrapper preferredExtent.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1091
    ].
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1092
    menuHeight isNil ifTrue:[
1392
2d4a90914f2b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1093
        menuHeight := (5 + widgetPrfExt y) min:(useableExt y // 2).
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1094
    ].
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1095
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1096
    usePreferredWidthForMenu ifFalse:[
1868
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1097
        w := width.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1098
    ] ifTrue:[
1392
2d4a90914f2b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1099
        (w := widgetPrfExt x+(menuWrapper borderWidth*2)) <= width ifTrue:[
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1100
            w := width
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1101
        ] ifFalse:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1102
            (w + menuOrigin x) > useableExt x ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1103
                menuOrigin x:((useableExt x - w) max:0)
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1104
            ]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1105
        ]
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1106
    ].
1282
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
  1107
    "/ nice side-effect; set width first, to allow menuHeight
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
  1108
    "/ to be a block computing the height based upon the width.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
  1109
    "/ (allows for geometry adjustments)
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
  1110
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
  1111
    menuWrapper width:w.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
  1112
    h := (useableExt y - menuOrigin y - 4) min:(menuHeight value).
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
  1113
    menuWrapper height:h.
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
  1114
4269f064951c allow for menuHeight to be a block;
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
  1115
    menuWrapper origin:menuOrigin extent:(w@h).
1273
0460739b9e97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1116
    menuWrapper openModal.
2013
3f550c902871 care for someone setting menuWrapper to nil,
Claus Gittinger <cg@exept.de>
parents: 1944
diff changeset
  1117
    menuWrapper notNil ifTrue:[
3f550c902871 care for someone setting menuWrapper to nil,
Claus Gittinger <cg@exept.de>
parents: 1944
diff changeset
  1118
        menuWrapper realized ifTrue:[
3f550c902871 care for someone setting menuWrapper to nil,
Claus Gittinger <cg@exept.de>
parents: 1944
diff changeset
  1119
            self closeMenu
3f550c902871 care for someone setting menuWrapper to nil,
Claus Gittinger <cg@exept.de>
parents: 1944
diff changeset
  1120
        ].
1944
a9c42cd2c387 added: close menu if come back from open modal
tm
parents: 1890
diff changeset
  1121
    ].
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1122
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1123
    "Modified: / 10.10.2001 / 14:44:22 / cg"
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1124
! !
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1125
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1126
!ExtendedComboBox::MenuWrapper class methodsFor:'documentation'!
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1127
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1128
documentation
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1129
"
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1130
    problem: we have a grab - and get all events;
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1131
    to simulate regular behaior inside, we have to synthetically simulate
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1132
    focus control and implicit grab on buttonPress.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1133
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1134
    [instance variables:]
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1135
        comboBox                <ExtendedComboBox>
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1136
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1137
        widget                  <View>          the widget which contains the menu
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1138
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1139
        lastPointerView         <View>          view which contained the
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1140
                                                mouse pointer.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1141
                                                used for enter/leave event generation.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1142
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1143
        implicitGrabView         <View>         view in which button was pressed;
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1144
                                                nilled when released (wherever).
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1145
                                                If non-nil, all events are forwarded to this
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1146
                                                one (for example to scroll with mouse outside the scrollbar)
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1147
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1148
        eventHandler            <OneArgBlock>   if not nil, the block will
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1149
                                                handle all inputEvents
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1150
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1151
        resizeCursor            <Cursor>        shown for resize handle
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1152
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1153
        restoreCursor           <Cursor>        default cursor
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1154
"
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1155
! !
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1156
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1157
!ExtendedComboBox::MenuWrapper methodsFor:'accessing'!
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1158
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1159
application
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1160
    "return the application, under which this view was opened,
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1161
     or nil, if there is no application
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1162
    "
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1163
    ^ comboBox application
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1164
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1165
!
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1166
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1167
clearImplicitGrab
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1168
    implicitGrabView := nil
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1169
!
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1170
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1171
preferredExtent
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1172
    "compute & return the preferredExtent from the components' preferrences
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1173
    "
1284
1fb5f5cbd4d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
  1174
    ^ (widget preferredExtent max:(widget widthOfContents @ widget heightOfContents))
1fb5f5cbd4d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
  1175
      + (margin * 2) + 8.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1176
!
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1177
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1178
widget
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1179
    "returns the widget wrapped by the menuView
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1180
    "
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1181
    ^ widget
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1182
! !
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1183
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1184
!ExtendedComboBox::MenuWrapper methodsFor:'event handling'!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1185
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1186
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1187
    "dispatch the event"
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1188
2463
b20596470048 unused vars removed
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
  1189
    |x y oldGrabber p|
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1190
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1191
    eventHandler notNil ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1192
        (eventHandler value:event) ifTrue:[^ self].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1193
    ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1194
1830
66c131adec9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1195
    (event isInputEvent not
66c131adec9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1196
    or:[event isPointerEnterLeaveEvent]) ifTrue:[
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1197
        super dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate.
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1198
        ^ self
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1199
    ].
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1200
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1201
    event isButtonMotionEvent ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1202
        implicitGrabView isNil ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1203
            (self isEventAssignedToResizeArea:event) ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1204
                self setupResizeEventHandler.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1205
                ^ self.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1206
            ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1207
        ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1208
    ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1209
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1210
    event isButtonPressEvent ifTrue:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1211
        x := event x.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1212
        y := event y.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1213
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1214
        ((0@0 extent:self extent) containsPoint:(x @ y)) ifFalse:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1215
            comboBox closeMenu.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1216
            "/ if I took the grab from someone else, this buttonEvent should
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1217
            "/ also go to that one ...but not, if it falls into my own ext-comboBox (sigh)
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1218
            "/ (example: a sub-ext-box in an ext-box, clicking on the outer boxes menuButton)
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1219
            (oldGrabber := device activePointerGrab) notNil ifTrue:[
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1220
                p := device translatePoint:(x@y) fromView:self toView:comboBox.
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1221
                ((0@0 extent:comboBox extent) containsPoint:p) ifFalse:[        
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1222
                    p := device translatePoint:(x@y) fromView:self toView:oldGrabber.
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1223
                    event view:oldGrabber.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1224
                    event x:p x.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1225
                    event y:p y.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1226
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1227
                    "/ this is a hack
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1228
                    oldGrabber class == self class ifTrue:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1229
                        oldGrabber clearImplicitGrab.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1230
                    ].
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1231
                    oldGrabber dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1232
                ].
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1233
            ].
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1234
            ^  self.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1235
        ]
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1236
    ].
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1237
    self forwardEvent:event withFocusOn:focusViewOrNil.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1238
!
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1239
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1240
forwardEvent:ev withFocusOn:focusView
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1241
    "handle a key press event
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1242
    "
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1243
    |view x y p syntheticEvent|
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1244
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1245
    "/ situation: we get a buttonPress, set implicitGrab (for scrollbars etc.)
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1246
    "/ but never get the buttonRelease, since someone else (a popUp) grabbed the
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1247
    "/ pointer in the meantime, and has eaten the release event ... (double-sigh)
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1248
    implicitGrabView notNil ifTrue:[
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1249
        (ev isButtonReleaseEvent or:[self sensor leftButtonPressed]) ifFalse:[
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1250
            implicitGrabView := nil.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1251
        ].
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1252
    ].
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1253
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1254
    ((x := ev x) isNil or:[(y := ev y) isNil]) ifTrue:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1255
        ^ self
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1256
    ].
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1257
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1258
    implicitGrabView notNil ifTrue:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1259
        ev isButtonEvent ifTrue:[
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1260
            p := device translatePoint:(x@y) fromView:self toView:implicitGrabView.
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1261
            ev view:implicitGrabView.
2899
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1262
            ev x:p x.
e55595fe6a03 comments
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  1263
            ev y:p y.
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1264
            implicitGrabView dispatchEvent:ev withFocusOn:focusView delegate:false.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1265
2900
e49cb2bac7aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
  1266
            (ev isButtonReleaseEvent "or:[ev isButtonMultiPressEvent]") ifTrue:[
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1267
                implicitGrabView := nil.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1268
            ].
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1269
            ^ self
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1270
        ]
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1271
    ].
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1272
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1273
    view := self detectViewAtX:x y:y.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1274
    view isNil ifTrue:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1275
        ^ super dispatchEvent:ev withFocusOn:focusView delegate:false
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1276
    ].
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1277
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1278
    p := device translatePoint:(x@y) fromView:self toView:view.
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1279
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1280
    ev isButtonPressEvent ifTrue:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1281
        (view wantsFocusWithButtonPress) ifTrue:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1282
            view requestFocus.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1283
        ].
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1284
        view ~~ self ifTrue:[ "/ can this ever be self ?
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1285
            implicitGrabView := view.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1286
        ]
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1287
    ].
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1288
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1289
    ev isButtonMotionEvent ifTrue:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1290
        lastPointerView ~~ view ifTrue:[
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1291
            "/ must generate enter/leave ... (sigh)
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1292
            lastPointerView notNil ifTrue:[
2125
67e0f2c9ad4d event types are private to WindowEvent;
ca
parents: 2069
diff changeset
  1293
                "/ XXX: should be fixed
67e0f2c9ad4d event types are private to WindowEvent;
ca
parents: 2069
diff changeset
  1294
                syntheticEvent := WindowEvent pointerLeave:0 view:lastPointerView.  
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1295
                lastPointerView dispatchEvent:syntheticEvent withFocusOn:nil delegate:false.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1296
            ].
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1297
            view notNil ifTrue:[
2125
67e0f2c9ad4d event types are private to WindowEvent;
ca
parents: 2069
diff changeset
  1298
                syntheticEvent := WindowEvent pointerEnter:0 x:x y:y view:view.
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1299
                view dispatchEvent:syntheticEvent withFocusOn:nil delegate:false.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1300
            ].
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1301
            lastPointerView := view.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1302
        ].
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1303
    ].
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1304
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1305
    ev view:view.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1306
    ev x:p x.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1307
    ev y:p y.
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1308
    view dispatchEvent:ev withFocusOn:focusView delegate:false.
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1309
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1310
    "Modified: / 10.10.2001 / 13:54:20 / cg"
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1311
!
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1312
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1313
setupResizeEventHandler
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1314
    |clickExtent clickPoint|
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1315
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1316
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1317
    self windowGroup showCursor:resizeCursor.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1318
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1319
    eventHandler := [:ev|
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1320
        ev isButtonEvent ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1321
            clickPoint notNil ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1322
                ev isButtonMotionEvent ifTrue:[ |offset extent|
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1323
                    offset := self sensor mousePoint - clickPoint.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1324
                    extent := (clickExtent + offset) max:(comboBox width)@50.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1325
                    self extent:extent.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1326
                ] ifFalse:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1327
                    ev isButtonReleaseEvent ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1328
                        comboBox menuExtent:self extent.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1329
                    ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1330
                    clickPoint := clickExtent := nil.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1331
                ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1332
            ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1333
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1334
            clickPoint isNil ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1335
                ev isButtonMotionEvent ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1336
                    (self isEventAssignedToResizeArea:ev) ifFalse:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1337
                        self windowGroup showCursor:restoreCursor.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1338
                        clickPoint := clickExtent := eventHandler := nil.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1339
                    ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1340
                ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1341
                ev isButtonPressEvent ifTrue:[  "/ start resize
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1342
                    clickPoint  := self sensor mousePoint.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1343
                    clickExtent := self extent.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1344
                ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1345
            ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1346
        ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1347
        ev isInputEvent
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1348
    ].
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1349
! !
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1350
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1351
!ExtendedComboBox::MenuWrapper methodsFor:'focus handling'!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1352
1630
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1353
wantsFocusWithButtonPress
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1354
    "views which do not like to take the keyboard focus
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1355
     with buttonPress can do so by redefining this
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1356
     to return false"
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1357
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1358
    ^ false
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1359
01dc20096011 grabbing cleaned up;
ca
parents: 1614
diff changeset
  1360
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1361
! !
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1362
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1363
!ExtendedComboBox::MenuWrapper methodsFor:'initialization'!
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1364
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1365
for:aWidget in:aReceiver 
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1366
    "create a wrapper for a widget and the receiver, an extented comboBox
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1367
    "
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1368
    |hasScr|
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1369
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1370
    comboBox := aReceiver.
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1371
    widget   := aWidget.
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1372
    hasScr   := aWidget isScrollWrapper.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1373
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1374
    comboBox menuIsScrollable ifTrue:[
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1375
        hasScr ifFalse:[
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1376
            widget := ScrollableView forView:aWidget.
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1377
            hasScr := true.
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1378
        ].
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1379
        widget horizontalScrollable:(comboBox hasHorizontalScrollBar).
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1380
        widget   verticalScrollable:(comboBox hasVerticalScrollBar).
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1381
        widget       horizontalMini:(comboBox miniScrollerHorizontal).
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1382
        widget         verticalMini:(comboBox miniScrollerVertical).
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1383
        widget   autoHideScrollBars:(comboBox autoHideScrollBars).
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1384
    ].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1385
    widget origin:0.0 @ 0.0 corner:1.0 @ 1.0.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1386
    self add:widget.
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1387
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1388
    hasScr ifTrue:[
1868
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1389
        widget level:0.
1272
c3eb38fa149d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1225
diff changeset
  1390
        widget := widget scrolledView.
1868
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1391
    ].    
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1392
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1393
1273
0460739b9e97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1394
hideRequest
0460739b9e97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1395
    "hide request from windowGroup (i.e. via Escape key).
0460739b9e97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1396
     Can be redefined in subclasses which dont like this"
0460739b9e97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1397
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1398
    eventHandler := nil.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1399
    comboBox closeMenu.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1400
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1401
1868
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1402
initialize
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1403
    super initialize.
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1404
    super level:0.
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1405
    super borderWidth:1.
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1406
    self enableMotionEvents.
1868
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1407
!
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1408
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1409
level:aNumber
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1410
!
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1411
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1412
mapped
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1413
    "grab resources (mouse and keyboard)
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1414
    "
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1415
    eventHandler := nil.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1416
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1417
    resizeCursor isNil ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1418
        restoreCursor := self cursor.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1419
        resizeCursor  := Cursor fourWay onDevice:device.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1420
    ].
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1421
    super mapped.
2709
c43fad2a54c4 initial focus
Claus Gittinger <cg@exept.de>
parents: 2707
diff changeset
  1422
    self assignInitialKeyboardFocus.
1868
445f3285bbb2 checkin from browser
ca
parents: 1857
diff changeset
  1423
    widget notNil ifTrue:[widget level:0].
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1424
! !
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1425
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1426
!ExtendedComboBox::MenuWrapper methodsFor:'queries'!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1427
3134
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1428
isEventAssignedToResizeArea:ev
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1429
    |x y|
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1430
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1431
    ((x := ev x) notNil and:[(y := ev y) notNil]) ifTrue:[ |evView|
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1432
        evView := ev view.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1433
        
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1434
        evView ~~ self ifTrue:[ |p|
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1435
            p := device translatePoint:(x@y) fromView:evView toView:self.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1436
            x := p x.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1437
            y := p y.
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1438
        ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1439
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1440
        (x - width)  abs <= 5 ifTrue:[
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1441
            (y - height) abs <= 5 ifTrue:[^ true].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1442
        ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1443
    ].
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1444
    ^ false
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1445
!
d0a3d82a5bcd support resizing popup widget
ca
parents: 2904
diff changeset
  1446
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1447
raiseDeiconified
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1448
    ^ self raise
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1449
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1450
!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1451
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1452
type
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1453
    ^ nil.
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1454
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1455
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1456
! !
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1457
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1458
!ExtendedComboBox::MenuWrapper methodsFor:'searching'!
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1459
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1460
detectViewAtX:x y:y
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1461
    "detect view at x@y. if no view is detected or
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1462
     the it is my view, nil is returned
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1463
    "
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1464
    |v|
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1465
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1466
    (x notNil or:[y notNil]) ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1467
        ((x between:0 and:width) and:[y between:0 and:height]) ifTrue:[
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1468
            v := self detectViewAtX:x y:y in:self.
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1469
            v ~~ self ifTrue:[^ v].
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1470
        ]
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1471
    ].
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1472
    ^ nil
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1473
!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1474
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1475
detectViewAtX:x y:y in:aTopView
1224
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1476
    "detect view at x@y in a top view; if no view is detected
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1477
     the topview is returned
f499a42e072d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  1478
    "
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1479
    ^ aTopView detectViewAt:(x@y).
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1480
2022
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1481
"/ cg: old code was (refactored to use common code)
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1482
"/
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1483
"/    |subviews|
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1484
"/
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1485
"/    (subviews := aTopView subViews) notNil ifTrue:[
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1486
"/        subviews do:[:v||p|
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1487
"/            (    (x between:(v left) and:(v right))
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1488
"/             and:[y between:(v top)  and:(v bottom)]
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1489
"/            ) ifTrue:[
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1490
"/                p := device translatePoint:(x@y) fromView:aTopView toView:v.
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1491
"/                ^ self detectViewAtX:p x y:p y in:v.
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1492
"/            ]
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1493
"/        ]
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1494
"/    ].
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1495
"/    ^ aTopView
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1496
16e783eb5f2a use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  1497
    "Modified: / 10.10.2001 / 13:53:15 / cg"
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1498
! !
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1499
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1500
!ExtendedComboBox class methodsFor:'documentation'!
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1501
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1502
version
3289
7bf0ddb4df39 bugfix - processEvents should have a look for which button is pressed
ca
parents: 3285
diff changeset
  1503
    ^ '$Header: /cvs/stx/stx/libwidg2/ExtendedComboBox.st,v 1.54 2007-11-29 09:32:01 ca Exp $'
1179
fd1e5968db2f initial checkin
ps
parents:
diff changeset
  1504
! !