ComboBoxButton.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 02 Sep 2022 11:25:39 +0100
branchjv
changeset 6261 9b7eb7159d29
parent 4642 567c795ded51
permissions -rw-r--r--
Fix loong standing bug with some menus not being translated / resolved This has happened with browser "View" menu when sometimes it had the slice resolved and sometimes not. It turned out that it was because the code disabled resources (and therefore slices) resolution when processing shortcuts, so the menu was created and cached unresolved. This fixes the issue. eXept apparently run into the same problem.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1716
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
     1
"
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
     2
 COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
     3
              All Rights Reserved
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
     4
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
     5
 This software is furnished under a license and may be used
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
     6
 only in accordance with the terms of that license and with the
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
     8
 be provided or otherwise made available to, or used by, any
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
     9
 other person.  No title to or ownership of the software is
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    10
 hereby transferred.
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    11
"
3496
36bb2c61cc61 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
    12
"{ Package: 'stx:libwidg2' }"
1716
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    13
512
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Toggle subclass:#ComboBoxButton
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
4175
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    16
	classVariableNames:'DefaultBorderWidth'
512
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Views-Interactors'
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!ComboBoxButton class methodsFor:'documentation'!
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
1716
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    23
copyright
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    24
"
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    25
 COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    26
              All Rights Reserved
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    27
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    28
 This software is furnished under a license and may be used
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    29
 only in accordance with the terms of that license and with the
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    31
 be provided or otherwise made available to, or used by, any
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    32
 other person.  No title to or ownership of the software is
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    33
 hereby transferred.
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    34
"
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    35
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    36
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    37
!
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
    38
512
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    for ST-80 compatibility, a place to add mimicri protocol.
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
! !
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
4175
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    45
!ComboBoxButton class methodsFor:'defaults'!
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    46
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    47
updateStyleCache
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    48
    <resource: #style (#'comboView.button.borderWidth' 
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    49
                      )>
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    50
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    51
    DefaultBorderWidth := StyleSheet at:#'comboView.button.borderWidth'.
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    52
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    53
    "
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    54
     self updateStyleCache
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    55
    "
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    56
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    57
    "Modified: / 28.4.1999 / 13:59:00 / cg"
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    58
! !
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    59
512
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
!ComboBoxButton methodsFor:'accessing'!
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
lastSelection:selectionIndex
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    "ignored for now"
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    "Modified: 30.8.1997 / 02:45:43 / cg"
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
! !
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
1292
12d0a583010d dont catch the focus with button press.
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
    68
!ComboBoxButton methodsFor:'focus control'!
12d0a583010d dont catch the focus with button press.
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
    69
12d0a583010d dont catch the focus with button press.
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
    70
wantsFocusWithButtonPress
4642
567c795ded51 class: ComboBoxButton
Claus Gittinger <cg@exept.de>
parents: 4175
diff changeset
    71
    "yes, catch the keyboard focus on button click"
1292
12d0a583010d dont catch the focus with button press.
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
    72
3496
36bb2c61cc61 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
    73
    ^ true.
36bb2c61cc61 focus frame drawing
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
    74
"/    ^ false
1292
12d0a583010d dont catch the focus with button press.
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
    75
! !
12d0a583010d dont catch the focus with button press.
Claus Gittinger <cg@exept.de>
parents: 1281
diff changeset
    76
4175
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    77
!ComboBoxButton methodsFor:'initialization'!
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    78
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    79
initStyle
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    80
    "setup viewStyle specifics"
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    81
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    82
    super initStyle.
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    83
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    84
    DefaultBorderWidth notNil ifTrue:[self borderWidth: DefaultBorderWidth].
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    85
! !
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    86
512
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
!ComboBoxButton class methodsFor:'documentation'!
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
version
4642
567c795ded51 class: ComboBoxButton
Claus Gittinger <cg@exept.de>
parents: 4175
diff changeset
    90
    ^ '$Header: /cvs/stx/stx/libwidg2/ComboBoxButton.st,v 1.7 2014-07-08 09:17:36 cg Exp $'
512
97beb6e8acbe ST-80 compatible ComboBoxButton
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
! !
4175
d169a9e82ddc more stylesheet options
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
    92