Menu.st
author mawalch
Tue, 16 May 2017 17:06:05 +0200
changeset 3953 ca94dc8d03cb
parent 3951 e5d3a0e5404f
child 3965 acb5ac4df86b
permissions -rw-r--r--
#DOCUMENTATION by mawalch class: JPEGReader comment/format in: #app1SegmentCallback
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3951
e5d3a0e5404f #DOCUMENTATION by mawalch
mawalch
parents: 3942
diff changeset
     1
"{ Encoding: utf8 }"
e5d3a0e5404f #DOCUMENTATION by mawalch
mawalch
parents: 3942
diff changeset
     2
1354
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
     3
"
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
     4
 COPYRIGHT (c) 1997 by eXept Software AG
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
     5
              All Rights Reserved
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
     6
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
     7
 This software is furnished under a license and may be used
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
     8
 only in accordance with the terms of that license and with the
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    10
 be provided or otherwise made available to, or used by, any
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    11
 other person.  No title to or ownership of the software is
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    12
 hereby transferred.
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    13
"
1367
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
    14
"{ Package: 'stx:libview2' }"
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
    15
3449
1ba7759f8a59 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3355
diff changeset
    16
"{ NameSpace: Smalltalk }"
1ba7759f8a59 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3355
diff changeset
    17
2854
d37c539b59ad inherit from model, for cheap dependents.
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
    18
Model subclass:#Menu
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
    19
	instanceVariableNames:'items groupSizes receiver'
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'Views-Support'
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
3778
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
    25
Query subclass:#NeedResourcesQuery
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
    26
	instanceVariableNames:''
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
    27
	classVariableNames:''
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
    28
	poolDictionaries:''
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
    29
	privateIn:Menu
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
    30
!
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
    31
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
!Menu class methodsFor:'documentation'!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
1354
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    34
copyright
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    35
"
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    36
 COPYRIGHT (c) 1997 by eXept Software AG
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    37
              All Rights Reserved
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    38
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    39
 This software is furnished under a license and may be used
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    40
 only in accordance with the terms of that license and with the
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    41
 inclusion of the above copyright notice.   This software may not
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    42
 be provided or otherwise made available to, or used by, any
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    43
 other person.  No title to or ownership of the software is
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    44
 hereby transferred.
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    45
"
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    46
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    47
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    48
!
0c7e6c83b440 copyrights
Claus Gittinger <cg@exept.de>
parents: 1327
diff changeset
    49
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
documentation
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    not yet finished Menu class - this will eventually replace
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    most of the MenuView and PopUpMenu stuff.
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    (and hopefully be ST-80 compatible ...)
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    For now, only a subset of the full protocol is implemented.
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    [author:]
740
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
    59
	Claus Gittinger
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    [see also:]
740
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
    62
	MenuItem
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
    63
	PopUpMenu
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
! !
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
610
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
    67
!Menu class methodsFor:'instance creation'!
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
    68
1174
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    69
labelArray:arrayOfString lines:linesArray values:valueArrayOrNil
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    70
    "return a menu with menu items built with labels from arrayOfString (not Symbols).  
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    71
     The linesArray describes which menu items are the last menu item in their group. 
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    72
     The valueArray contains value objects for each menu item 
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    73
     (or is nil if no value objects are specified)."
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    74
1174
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    75
    |nLabel valueArray menuItems groupLengths|
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    76
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    77
    nLabel := arrayOfString size.
610
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
    78
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    79
    valueArrayOrNil isNil ifTrue:[
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    80
        (valueArray := arrayOfString isEmpty) ifTrue: [
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    81
            valueArray := #()
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    82
        ] ifFalse:[
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    83
            valueArray := (1 to:nLabel)
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    84
        ]
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    85
    ] ifFalse:[
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    86
        valueArray := valueArrayOrNil
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    87
    ].
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    88
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    89
    nLabel ~~ valueArray size ifTrue: [
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    90
        ^ self error: 'illegal menu combination'
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    91
    ].
610
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
    92
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    93
    menuItems := Array new:nLabel.
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    94
    1 to:nLabel do:[:i |
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    95
        |mi v|
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    96
3222
2bc1eca23bd7 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
    97
        mi := MenuItem label:(arrayOfString at:i) asString.
1174
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    98
        v := valueArray at:i.
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    99
        (v isKindOf:Menu) ifTrue:[mi submenu:v].
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   100
        menuItems at:i put:mi
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   101
    ].
610
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   102
1174
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   103
    (linesArray size == 0) ifTrue:[
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   104
        groupLengths := (menuItems isEmpty)
1174
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   105
                            ifTrue: [Array new:0]
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   106
                            ifFalse: [Array with:menuItems size]
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   107
    ] ifFalse:[
1174
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   108
        groupLengths := Array new:(linesArray size + 1).
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   109
        groupLengths at:1 put:linesArray first.
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   110
        2 to:linesArray size do: [:i | 
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   111
            groupLengths at:i put:((linesArray at:i) - (linesArray at:i - 1))
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   112
        ].
1174
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   113
        groupLengths at:groupLengths size put:(menuItems size - linesArray last).
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   114
    ].
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   115
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   116
    ^ self new 
1174
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   117
        menuItems:menuItems 
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   118
        menuItemGroups:groupLengths 
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   119
        values:valueArray
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   120
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   121
    "Modified: / 19.4.1998 / 11:30:18 / cg"
696
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   122
!
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   123
1174
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   124
labelArray:arrayOfString values:valueArrayOrNil
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   125
    "return a menu with menu items built with labels from arrayOfString (not Symbols).  
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   126
     The valueArray contains value objects for each menu item 
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   127
     (or is nil if no value objects are specified)."
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   128
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   129
    ^ self 
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   130
        labelArray:arrayOfString 
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   131
        lines:nil 
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   132
        values: valueArrayOrNil
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   133
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   134
!
f58d5c8cee82 added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   135
696
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   136
labelList:arrayOfGroupStrings values:valueArrayOrNil
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   137
    |labels lines|
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   138
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   139
    lines := arrayOfGroupStrings collect:[:each | each size].
2017
0cdc1c537fa0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1986
diff changeset
   140
    labels := arrayOfGroupStrings collectAll:[:eachGroup | eachGroup].
696
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   141
    ^ self labelArray:labels lines:lines values:valueArrayOrNil
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   142
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   143
    "Modified: 20.6.1997 / 10:46:45 / cg"
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   144
    "Created: 13.9.1997 / 10:35:46 / cg"
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   145
!
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   146
738
f7e6b6cd3855 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
   147
labels:aString lines:linesArray values:valueArrayOrNil
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   148
    ^ self 
740
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
   149
	labelArray:(aString asCollectionOfLines)
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
   150
	lines:linesArray
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
   151
	values:valueArrayOrNil
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   152
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   153
    "Created: / 31.10.1997 / 03:12:20 / cg"
738
f7e6b6cd3855 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
   154
    "Modified: / 31.10.1997 / 03:23:42 / cg"
1525
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   155
!
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   156
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   157
labels:aString values:valueArrayOrNil
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   158
    ^ self 
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   159
        labelArray:(aString asCollectionOfLines)
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   160
        lines:#()
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   161
        values:valueArrayOrNil
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   162
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   163
    "Modified: / 31.10.1997 / 03:23:42 / cg"
9008957b8ff7 compatibility
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
   164
    "Created: / 12.11.2001 / 16:06:36 / cg"
610
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   165
! !
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   166
1764
caf114053269 method category rename
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
   167
!Menu methodsFor:'Compatibility-ST80'!
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   168
2126
79be7625f40f addLine: VW7 compat.
Claus Gittinger <cg@exept.de>
parents: 2092
diff changeset
   169
addLine
79be7625f40f addLine: VW7 compat.
Claus Gittinger <cg@exept.de>
parents: 2092
diff changeset
   170
    self addSeparator
79be7625f40f addLine: VW7 compat.
Claus Gittinger <cg@exept.de>
parents: 2092
diff changeset
   171
!
79be7625f40f addLine: VW7 compat.
Claus Gittinger <cg@exept.de>
parents: 2092
diff changeset
   172
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   173
indexOfMenuItem:anItem
2433
632122b652eb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
   174
    ^ items indexOf:anItem
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   175
2433
632122b652eb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
   176
    "Created: / 27.10.1997 / 16:34:19 / cg"
632122b652eb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
   177
!
632122b652eb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
   178
632122b652eb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
   179
indexOfMenuItemForWhich:aBlock
632122b652eb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
   180
    ^ items findFirst:aBlock
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   181
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   182
    "Created: / 27.10.1997 / 16:34:19 / cg"
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   183
!
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   184
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   185
menuButtons
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   186
    "ST-80 seems to use a special menuButton class here.
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   187
     Here, kludge a collection of menuItems."
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   188
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   189
    ^ items
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   190
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   191
    "Created: / 27.10.1997 / 16:33:35 / cg"
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   192
! !
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   193
1782
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   194
!Menu methodsFor:'Compatibility-Squeak'!
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   195
2764
c83f22018324 squeak oompatibility:
Claus Gittinger <cg@exept.de>
parents: 2751
diff changeset
   196
add:label target:target selector:selector
3185
0d09b958253d class: Menu
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   197
    self addItem:(MenuItem label:label itemValue:[target perform:selector]).
2764
c83f22018324 squeak oompatibility:
Claus Gittinger <cg@exept.de>
parents: 2751
diff changeset
   198
!
c83f22018324 squeak oompatibility:
Claus Gittinger <cg@exept.de>
parents: 2751
diff changeset
   199
c83f22018324 squeak oompatibility:
Claus Gittinger <cg@exept.de>
parents: 2751
diff changeset
   200
balloonTextForLastItem:aString
c83f22018324 squeak oompatibility:
Claus Gittinger <cg@exept.de>
parents: 2751
diff changeset
   201
    items last helpText:aString
c83f22018324 squeak oompatibility:
Claus Gittinger <cg@exept.de>
parents: 2751
diff changeset
   202
!
c83f22018324 squeak oompatibility:
Claus Gittinger <cg@exept.de>
parents: 2751
diff changeset
   203
1782
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   204
labels:labels lines:lines selections:selections
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   205
    |labelArray|
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   206
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   207
    labels isString ifTrue:[
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   208
        labelArray := labels asCollectionOfLines.
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   209
    ] ifFalse:[
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   210
        labelArray := labels.
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   211
    ].
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   212
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   213
    1 to:labelArray size do:[:idx |
3355
214c2aa60193 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3340
diff changeset
   214
        self addItem:(MenuItem 
214c2aa60193 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3340
diff changeset
   215
                        label:(labelArray at:idx)
214c2aa60193 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3340
diff changeset
   216
                        itemValue:(selections at:idx)).
1782
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   217
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   218
        (lines includes:idx) ifTrue:[
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   219
            self addSeparator.
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   220
        ].
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   221
    ].
3022
ce344185f4f4 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
   222
ce344185f4f4 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
   223
    "Modified: / 09-09-2012 / 13:08:55 / cg"
1782
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   224
! !
6a40c04cda8c squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 1764
diff changeset
   225
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
!Menu methodsFor:'accessing'!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
2916
ff96b6187a5f added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
   228
atMenuItemLabeled:aString putSubmenu:aMenu visible:visible
ff96b6187a5f added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
   229
    (self menuItemLabeled:aString)
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   230
        submenu:aMenu;
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   231
        isVisible:visible
2916
ff96b6187a5f added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
   232
ff96b6187a5f added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
   233
    "Created: / 30-06-2011 / 10:30:22 / cg"
ff96b6187a5f added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
   234
!
ff96b6187a5f added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
   235
696
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   236
atNameKey:aNameKey
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   237
    "return the menuItem for the given nameKey; nil if no such item is in the menu.
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   238
     Searches in allItems (i.e. also in subMenus)"
696
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   239
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   240
    self allItemsDo:[:anItem|
740
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
   241
	anItem nameKey == aNameKey ifTrue:[^ anItem]
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   242
    ].
696
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   243
    ^ nil
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   244
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   245
    "Modified: / 27.10.1997 / 15:12:00 / cg"
696
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   246
!
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   247
3340
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   248
atNameKey:aNameKey ifPresentDo:aBlock
3951
e5d3a0e5404f #DOCUMENTATION by mawalch
mawalch
parents: 3942
diff changeset
   249
    "look for a menuItem with the given nameKey. If one is found, aBlock is evaluated for it.
3340
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   250
     If not, nothing is done.
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   251
     Searches in allItems (i.e. also in subMenus).
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   252
     Returns the item or nil."
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   253
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   254
    |item|
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   255
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   256
    (item := self atNameKey:aNameKey) notNil ifTrue:[
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   257
        aBlock value:item.
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   258
    ].
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   259
    ^ item
3951
e5d3a0e5404f #DOCUMENTATION by mawalch
mawalch
parents: 3942
diff changeset
   260
e5d3a0e5404f #DOCUMENTATION by mawalch
mawalch
parents: 3942
diff changeset
   261
    "Modified (comment): / 16-05-2017 / 10:55:03 / mawalch"
3340
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   262
!
96d5a7df1639 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
   263
578
7e0f62d9bc47 access methods ...
ca
parents: 494
diff changeset
   264
groupSizes
1500
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   265
    ^ groupSizes
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   266
!
578
7e0f62d9bc47 access methods ...
ca
parents: 494
diff changeset
   267
7e0f62d9bc47 access methods ...
ca
parents: 494
diff changeset
   268
groupSizes:something
1500
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   269
    groupSizes := something.
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   270
!
578
7e0f62d9bc47 access methods ...
ca
parents: 494
diff changeset
   271
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   272
itemAtValue:aValue
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   273
    "gets the item which has aValue assigned as value
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   274
    "
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   275
    ^ self menuAndSubmenusDetectItem:[:anItem | anItem value == aValue ].
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   276
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   277
    "Created: / 14-03-2017 / 16:12:37 / cg"
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   278
!
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   279
1986
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   280
items
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   281
    ^ items
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   282
!
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   283
3833
7bec3052fa14 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3778
diff changeset
   284
items:aCollectionOfMenuItems
7bec3052fa14 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3778
diff changeset
   285
    items := aCollectionOfMenuItems
7bec3052fa14 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3778
diff changeset
   286
!
7bec3052fa14 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3778
diff changeset
   287
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   288
labelAt:anIndex
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   289
    "gets the label of the menu item at the given index or nil
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   290
    "
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   291
    |item|
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   292
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   293
    (item := self menuItemAt:anIndex) notNil ifTrue:[
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   294
        ^ item label
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   295
    ].
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   296
    ^ nil
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   297
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   298
    "Modified: / 2.2.1998 / 13:28:32 / cg"
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   299
!
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   300
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   301
labelAtValue:aValue
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   302
    "gets the label of the menu item assigned to value
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   303
    "
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   304
    |item|
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   305
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   306
    item := self menuAndSubmenusDetectItem:[:anItem | anItem value == aValue ].
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   307
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   308
    item notNil ifTrue:[
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   309
        ^ item label
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   310
    ].
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   311
    ^ nil
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   312
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   313
    "Modified: / 2.2.1998 / 13:28:28 / cg"
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   314
!
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   315
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
labels
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
    "return a collection of labels from my items"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
977
e07277070839 return valid collection in #labels.
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   319
    items isNil ifTrue:[^ #()].
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
    ^ items collect:[:anItem | anItem label]
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
972
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
   322
    "Created: / 25.2.1997 / 19:47:53 / cg"
977
e07277070839 return valid collection in #labels.
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   323
    "Modified: / 19.6.1998 / 02:36:22 / cg"
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   326
lastItem
2584
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
   327
    "returns the last item or nil, if there are none"
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
   328
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
   329
    ^ items isEmptyOrNil 
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
   330
        ifTrue:[nil]
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
   331
        ifFalse:[items last]
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   332
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   333
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   334
lines
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   335
    "return the indexes of the menu items that are the last menu item in their group (except the very last)."
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   336
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   337
    |lines groupSz|
737
c8bdd9dd8906 st80 stuff
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   338
3752
42375c1cc0e9 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3449
diff changeset
   339
    (groupSz := groupSizes size) <= 1 ifTrue: [^ #()].
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   340
    lines := Array new:(groupSz - 1).
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   341
    lines at:1 put:groupSizes first.
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   342
    2 to:(groupSz-1) do:[:i |
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   343
        lines at:i put:(lines at:(i - 1)) + (groupSizes at:i)
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   344
    ].
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   345
    ^ lines
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   346
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   347
    "Modified: / 2.2.1998 / 13:28:19 / cg"
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   348
!
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   349
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   350
menuItemAt:index 
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   351
    "gets the menu item at the given index. 
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   352
     When the index is out of bounds, nil is returned"
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   353
    
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   354
    (index > 0 and:[ index <= items size ]) ifTrue:[
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   355
        ^ items at:index
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   356
    ].
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   357
    ^ nil
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   358
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   359
    "Modified: / 30-06-2011 / 10:51:39 / cg"
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   360
    "Modified (comment): / 14-03-2017 / 16:11:31 / cg"
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   361
!
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   362
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   363
menuItemLabeled:anItemLabel 
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   364
    "return the menuItem for the given nameKey; nil if no such item is in the menu.
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   365
     Searches all items (i.e. also submenu items)"
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   366
    
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   367
    self 
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   368
        allItemsDo:[:anItem | 
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   369
            |l|
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   370
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   371
            ((l := anItem label) sameAs:anItemLabel) ifTrue:[
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   372
                ^ anItem
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   373
            ].
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   374
            (l includes:$&) ifTrue:[
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   375
                ((l copyWithout:$&) sameAs:anItemLabel) ifTrue:[
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   376
                    ^ anItem
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   377
                ]
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   378
            ]
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   379
        ].
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   380
    ^ nil
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   381
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   382
    "Created: / 13-09-1997 / 10:25:16 / cg"
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   383
    "Modified: / 30-06-2011 / 10:51:44 / cg"
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   384
!
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   385
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   386
menuItemWithArgument:aValue 
2908
e21010b76553 added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
   387
    "return the menuItem for the given value; nil if no such item is in the menu.
e21010b76553 added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
   388
     Searches all items (i.e. also submenu items)"
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   389
    
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   390
    self 
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   391
        allItemsDo:[:anItem | 
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   392
            |l|
2908
e21010b76553 added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
   393
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   394
            (anItem argument = aValue) ifTrue:[
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   395
                ^ anItem
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   396
            ].
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   397
        ].
2908
e21010b76553 added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
   398
    ^ nil
e21010b76553 added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
   399
e21010b76553 added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
   400
    "Created: / 19-04-2011 / 14:42:18 / cg"
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   401
    "Modified: / 30-06-2011 / 10:51:50 / cg"
2908
e21010b76553 added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
   402
!
e21010b76553 added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
   403
2952
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   404
menuItemWithKey:aValue 
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   405
    "return the menuItem for the given key; nil if no such item is in the menu.
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   406
     Searches all items (i.e. also submenu items)"
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   407
    
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   408
    self 
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   409
        allItemsDo:[:anItem | 
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   410
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   411
            (anItem nameKey = aValue) ifTrue:[
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   412
                ^ anItem
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   413
            ].
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   414
        ].
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   415
    ^ nil
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   416
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   417
    "Created: / 19-04-2011 / 14:42:18 / cg"
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   418
    "Modified: / 30-06-2011 / 10:51:50 / cg"
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   419
    "Created: / 07-10-2011 / 15:04:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   420
!
1cedbbc95433 added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2918
diff changeset
   421
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   422
menuItemWithValue:aValue 
1652
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
   423
    "return the menuItem for the given value; nil if no such item is in the menu.
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
   424
     Searches all items (i.e. also submenu items)"
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   425
    
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   426
    self 
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   427
        allItemsDo:[:anItem | 
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   428
            |l|
1652
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
   429
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   430
            (anItem value == aValue) ifTrue:[
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   431
                ^ anItem
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   432
            ].
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   433
        ].
1652
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
   434
    ^ nil
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
   435
2918
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   436
    "Created: / 13-09-1997 / 10:25:16 / cg"
44a68f3ffba5 fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents: 2917
diff changeset
   437
    "Modified: / 30-06-2011 / 10:51:56 / cg"
1652
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
   438
!
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
   439
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   440
menuItems
1327
b0b482a84570 menuItems always returns a collection (never nil)
Claus Gittinger <cg@exept.de>
parents: 1308
diff changeset
   441
    ^ items ? #()
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   442
!
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   443
610
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   444
menuItems:aCollectionOfMenuItems menuItemGroups:sizes values:values
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   445
    |n|
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   446
1620
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   447
    items := groupSizes := nil.
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   448
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   449
    aCollectionOfMenuItems size == 0 ifTrue:[ ^ self ].
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   450
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
    items := aCollectionOfMenuItems.
1620
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   452
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   453
    sizes size > 0 ifTrue:[
1620
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   454
        groupSizes := sizes.
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   455
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   456
        n := sizes inject:0 into:[:sumSoFar :this | sumSoFar + this].
1620
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   457
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   458
        n = items size ifTrue:[
3117
3c7f6b69b2c5 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3028
diff changeset
   459
            groupSizes := sizes copyButLast:1
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   460
        ]
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   461
    ].
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   463
    values notNil ifTrue:[
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   464
        items with:values do:[:anItem :aValue |anItem value:aValue]
454
539b7c318760 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   465
    ].
610
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   466
900
aa93395cdb55 care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   467
    "Modified: / 19.4.1998 / 11:47:34 / cg"
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   468
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
1116
2b08dc4f8ae1 checkin from browser
tm
parents: 1111
diff changeset
   470
menuPerformer:something
2b08dc4f8ae1 checkin from browser
tm
parents: 1111
diff changeset
   471
    "set the receiver of the menu messages"
2b08dc4f8ae1 checkin from browser
tm
parents: 1111
diff changeset
   472
2b08dc4f8ae1 checkin from browser
tm
parents: 1111
diff changeset
   473
    receiver := something.
2b08dc4f8ae1 checkin from browser
tm
parents: 1111
diff changeset
   474
2b08dc4f8ae1 checkin from browser
tm
parents: 1111
diff changeset
   475
    "Modified: / 2.2.1998 / 13:26:29 / cg"
2b08dc4f8ae1 checkin from browser
tm
parents: 1111
diff changeset
   476
!
2b08dc4f8ae1 checkin from browser
tm
parents: 1111
diff changeset
   477
494
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   478
numberOfItems
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   479
    "return the number of items in this menu"
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   480
494
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   481
    ^ items size
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   482
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   483
    "Created: / 6.3.1997 / 15:15:53 / cg"
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   484
    "Modified: / 2.2.1998 / 13:26:40 / cg"
494
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   485
!
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   486
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   487
receiver
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   488
    "return the receiver of the menu messages"
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   489
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   490
    ^ receiver
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   491
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   492
    "Modified: / 2.2.1998 / 13:26:20 / cg"
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   493
!
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   494
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   495
receiver:something
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   496
    "set the receiver of the menu messages"
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   497
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   498
    receiver := something.
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   499
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   500
    "Modified: / 2.2.1998 / 13:26:29 / cg"
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   501
!
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   502
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
valueAt:index
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   504
    "return the value of an item"
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
    ^ (items at:index) value
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   508
    "Created: / 25-02-1997 / 19:49:41 / cg"
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   509
    "Modified (comment): / 14-03-2017 / 16:10:23 / cg"
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
494
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   512
valueAt:anIndex put:aValue
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   513
    "put value at an index"
494
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   514
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   515
    (items at:anIndex) value:aValue
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   516
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   517
    "Created: / 06-03-1997 / 15:15:48 / cg"
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   518
    "Modified (comment): / 14-03-2017 / 16:10:29 / cg"
494
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   519
!
ce8c074d5e6b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   520
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
values
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
    "return a collection of values from my items"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
    ^ items collect:[:anItem | anItem value]
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
    "Created: 25.2.1997 / 19:49:29 / cg"
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   527
!
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   528
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   529
values:aCollectionOfValues
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   530
    "set the collection of values in my items"
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   531
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   532
    |s|
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   533
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   534
    s := aCollectionOfValues readStream.
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   535
    self itemsDo:[:item |
1111
6c1084c56d7f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   536
        |val|
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   537
1111
6c1084c56d7f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   538
        val := s next.
6c1084c56d7f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   539
        item value:val
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   540
    ].
1111
6c1084c56d7f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   541
    s atEnd ifFalse:[
2092
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
   542
        self error:'not enough elements in the value collection' mayProceed:true
1111
6c1084c56d7f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   543
    ]
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   544
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   545
    "Created: / 27-10-1997 / 15:15:47 / cg"
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
   546
    "Modified (comment): / 14-03-2017 / 16:10:41 / cg"
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   547
!
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   548
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   549
visibleMenuItemGroups
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   550
    |itemGroups visibleItemGroups nextItem|
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   551
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   552
    itemGroups := OrderedCollection new.
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   553
    nextItem := 1.
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   554
    groupSizes do:[:groupSize |
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   555
        itemGroups addLast: (items copyFrom:nextItem to:nextItem + groupSize - 1).
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   556
        nextItem := nextItem + groupSize
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   557
    ].
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   558
    self hasHiddenItems ifFalse:[^ itemGroups].
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   559
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   560
    "Remove the hidden items."
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   561
    visibleItemGroups := OrderedCollection new.
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   562
    itemGroups do:[:eachItemGroup |
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   563
        |visibleItemGroup|
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   564
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   565
        visibleItemGroup := eachItemGroup reject:[:eachMenuItem | eachMenuItem hidden].
2129
e68ef88be0c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   566
        visibleItemGroup notEmpty ifTrue:[
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   567
            visibleItemGroups addLast: visibleItemGroup
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   568
        ]
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   569
    ].
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   570
    ^ visibleItemGroups
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   571
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   572
    "Created: / 27.10.1997 / 15:07:50 / cg"
801
0b87e3ba8eaf comments
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   573
    "Modified: / 2.2.1998 / 13:25:52 / cg"
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
! !
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
1397
47ac1d3e1df1 category changes
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   576
!Menu methodsFor:'accessing-resource'!
582
94f55f6a8bad support of ResourceRetriver
ca
parents: 579
diff changeset
   577
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   578
findGuiResourcesIn:aResourceContainerOrApplication
2269
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   579
    "setup a resource owner"
1986
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   580
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   581
    receiver isNil ifTrue:[
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   582
        receiver := aResourceContainerOrApplication
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   583
    ].
3778
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
   584
    self 
2269
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   585
        findGuiResourcesIn:aResourceContainerOrApplication 
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   586
        rememberResourcesIn:(ValueHolder new)
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   587
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   588
    "Modified: / 26-10-2006 / 16:37:57 / cg"
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   589
!
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   590
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   591
findGuiResourcesIn:aResourceContainerOrApplication rememberResourcesIn:aValueHolderOrNil
3845
fbeacbb4b90b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   592
    "resolve national language translations from aResourceContainerOrApplication"
2269
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   593
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   594
    |resolvedItems rcv|
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   595
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   596
    "/ cg: do not recursively change the receiver - it could be set for the top
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   597
    "/ menu via #receiver: by the application.
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   598
    "/ if the submenu's receiver is nil, the parentmenus receiver will be used, which is ok.
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   599
    "/ But if it was changed below, we would need a recursive setting in #receiver: as well.
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   600
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   601
"/    receiver isNil ifTrue:[
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   602
"/        receiver := aResourceContainerOrApplication
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   603
"/    ].
1986
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   604
    items isEmptyOrNil ifTrue:[^ self].
3778
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
   605
    NeedResourcesQuery query ifFalse:[^self].
1986
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   606
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   607
    resolvedItems := OrderedCollection new.
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   608
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   609
    items do:[:anItem |
2867
b745ee0a04ac comment/format
Claus Gittinger <cg@exept.de>
parents: 2864
diff changeset
   610
        anItem isMenuSlice ifTrue:[ 
b745ee0a04ac comment/format
Claus Gittinger <cg@exept.de>
parents: 2864
diff changeset
   611
            |resItems|
b745ee0a04ac comment/format
Claus Gittinger <cg@exept.de>
parents: 2864
diff changeset
   612
2059
36e4aa247402 fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   613
            rcv := aResourceContainerOrApplication.
36e4aa247402 fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   614
            [rcv notNil and:[resItems isNil]] whileTrue:[
3449
1ba7759f8a59 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3355
diff changeset
   615
                resItems := anItem resolveSliceMenuItemsIn:rcv rememberResourcesIn:aValueHolderOrNil.
2059
36e4aa247402 fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   616
                rcv := rcv perform:#masterApplication ifNotUnderstood:nil.
36e4aa247402 fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   617
            ].
1986
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   618
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   619
            resItems notEmptyOrNil ifTrue:[
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   620
                resolvedItems addAll:resItems.
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   621
            ]
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   622
        ] ifFalse:[
3449
1ba7759f8a59 class: Menu
Claus Gittinger <cg@exept.de>
parents: 3355
diff changeset
   623
            anItem findGuiResourcesIn:aResourceContainerOrApplication rememberResourcesIn:aValueHolderOrNil.
1986
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   624
            resolvedItems add:anItem.
1534
292c277fcf6a findGuiResources... now sets the receiver, if not yet set
Claus Gittinger <cg@exept.de>
parents: 1532
diff changeset
   625
        ].
1986
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   626
    ].
f819e439d917 *** empty log message ***
ca
parents: 1782
diff changeset
   627
    items := resolvedItems.
2269
7fae2df3ba48 resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   628
2867
b745ee0a04ac comment/format
Claus Gittinger <cg@exept.de>
parents: 2864
diff changeset
   629
    "Modified: / 22-09-2010 / 13:34:38 / cg"
582
94f55f6a8bad support of ResourceRetriver
ca
parents: 579
diff changeset
   630
! !
94f55f6a8bad support of ResourceRetriver
ca
parents: 579
diff changeset
   631
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   632
!Menu methodsFor:'adding & removing'!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   633
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   634
addItem:aMenuItem
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   635
    "add a menuItem at the end;
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   636
     useful to build a menu programmatically (or, to add more items dynamically)"
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   637
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   638
    items isNil ifTrue:[
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   639
        items := OrderedCollection new
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   640
    ] ifFalse:[
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   641
        items := items asOrderedCollection
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   642
    ].
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   643
    items add:aMenuItem.
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   644
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   645
    "Modified: / 4.8.1998 / 17:31:13 / cg"
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   646
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   647
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   648
addItem:aMenuItem beforeIndex:anIndex
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   649
    "add a menuItem at some position;
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   650
     useful to build a menu programmatically (or, to add more items dynamically)"
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   651
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   652
    items isNil ifTrue:[
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   653
        items := OrderedCollection new
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   654
    ] ifFalse:[
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   655
        items := items asOrderedCollection
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   656
    ].
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   657
    items add:aMenuItem beforeIndex:anIndex.
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   658
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   659
    "Modified: / 4.8.1998 / 17:31:39 / cg"
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   660
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   661
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   662
addItem:aMenuItem value:aValue
3022
ce344185f4f4 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
   663
    aMenuItem itemValue:aValue.
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   664
    self addItem:aMenuItem.
3022
ce344185f4f4 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
   665
ce344185f4f4 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
   666
    "Modified: / 09-09-2012 / 13:08:50 / cg"
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   667
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   668
1758
b55ccdd15885 itemGroup fix
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   669
addItemGroup:aGroup
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   670
    "add a group of items at the end;
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   671
     useful to build a menu programmatically (or, to add more items dynamically)"
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   672
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   673
    groupSizes isNil ifTrue:[
1758
b55ccdd15885 itemGroup fix
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   674
        groupSizes := OrderedCollection with:items size.
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   675
    ].
1758
b55ccdd15885 itemGroup fix
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   676
    groupSizes add:aGroup size.
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   677
1758
b55ccdd15885 itemGroup fix
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   678
    aGroup do:[:item |
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   679
        self addItem:item
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   680
    ].
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   681
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   682
    "Created: / 27.10.1997 / 15:02:15 / cg"
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   683
    "Modified: / 4.8.1998 / 17:32:06 / cg"
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   684
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   685
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   686
addItemGroup:aGroup values:values
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   687
    "add a group of items at the end;
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   688
     useful to build a menu programmatically (or, to add more items dynamically)"
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   689
1758
b55ccdd15885 itemGroup fix
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   690
    aGroup with:values do:[:item :value |
b55ccdd15885 itemGroup fix
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   691
        item value:value
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   692
    ].
1758
b55ccdd15885 itemGroup fix
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   693
    self addItemGroup:aGroup
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   694
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   695
    "Modified: / 4.8.1998 / 17:32:18 / cg"
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   696
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   697
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   698
addItemGroupLabels:labels values:values
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   699
    "add a group of items at the end;
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   700
     useful to build a menu programmatically (or, to add more items dynamically)"
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   701
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   702
    |items|
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   703
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   704
    items := labels with:values
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   705
                collect:[:label :value | 
3185
0d09b958253d class: Menu
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   706
                            MenuItem label:label itemValue:value
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   707
                        ].
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   708
    self addItemGroup:items
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   709
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   710
    "Created: / 27.10.1997 / 19:49:27 / cg"
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   711
    "Modified: / 4.8.1998 / 17:35:22 / cg"
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   712
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   713
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   714
addItemLabel:label value:value
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   715
    "add an item at the end;
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   716
     useful to build a menu programmatically (or, to add more items dynamically)"
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   717
3185
0d09b958253d class: Menu
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   718
    self addItem:(MenuItem label:label itemValue:value)
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   719
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   720
    "Created: / 27.10.1997 / 19:47:12 / cg"
1029
c77fe01f61a4 comments added;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
   721
    "Modified: / 4.8.1998 / 17:34:44 / cg"
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   722
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   723
3226
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   724
addItems: collection
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   725
    "Add all items in given collection.
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   726
     Useful to build a menu programmatically (or, to add more items dynamically)"
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   727
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   728
    items isNil ifTrue:[
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   729
        items := OrderedCollection new
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   730
    ] ifFalse:[
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   731
        items := items asOrderedCollection
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   732
    ].
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   733
    items addAll: collection
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   734
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   735
    "Created: / 01-09-2013 / 16:43:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   736
!
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   737
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   738
addItemsFrom: anotherMenu
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   739
    "Add all items from another menu.
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   740
     Useful to build a menu programmatically (or, to add more items dynamically)"
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   741
3254
8c2680e496c9 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3245
diff changeset
   742
    self addItems: anotherMenu items ? #()
3226
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   743
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   744
    "Created: / 01-09-2013 / 16:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3254
8c2680e496c9 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3245
diff changeset
   745
    "Modified: / 04-10-2013 / 19:28:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3226
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   746
!
5cbe343a7611 class: Menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3222
diff changeset
   747
1500
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   748
addSeparator
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   749
    "add a separating line item at the end;
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   750
     useful to build a menu programmatically (or, to add more items dynamically)"
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   751
2814
f75f27d92a5b changed: #addSeparator
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
   752
    self addItem:(MenuItem separator).
1500
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   753
!
367e30b243cd added #addSeparator
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
   754
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   755
removeItem:aMenuItem
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   756
    "remove an item from the menu"
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   757
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   758
    |idx|
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   759
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   760
    items notNil ifTrue:[
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   761
        idx := items identityIndexOf:aMenuItem.
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   762
        idx ~~ 0 ifTrue:[
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   763
            items removeAtIndex:idx
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   764
        ]
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   765
    ].
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   766
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   767
    "Created: / 13.9.1997 / 10:27:31 / cg"
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   768
    "Modified: / 2.2.1998 / 13:26:49 / cg"
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   769
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   770
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   771
removeItemAt:anIndex
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   772
    "remove item at an index
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   773
    "
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   774
    anIndex <= items size ifTrue:[
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   775
        ^ items removeAtIndex:anIndex
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   776
    ].
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   777
    ^ nil
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   778
! !
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   779
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   780
!Menu methodsFor:'converting'!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   781
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   782
asOldStylePopUpMenuFor:anApplicationOrNil
2080
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   783
    "a temporary kludge - will vanish, when oldStyle MenuView and PopUpMenu are gone"
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   784
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   785
    |menuView itemsShown|
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   786
2867
b745ee0a04ac comment/format
Claus Gittinger <cg@exept.de>
parents: 2864
diff changeset
   787
    itemsShown := items 
b745ee0a04ac comment/format
Claus Gittinger <cg@exept.de>
parents: 2864
diff changeset
   788
        select:[:each |
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   789
            |visibilityInItem|
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   790
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   791
            visibilityInItem := each isVisible.
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   792
            visibilityInItem isNil ifTrue:[
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   793
                true
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   794
            ] ifFalse:[
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   795
                visibilityInItem isBoolean ifTrue:[
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   796
                    visibilityInItem
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   797
                ] ifFalse:[
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   798
                    visibilityInItem isSymbol ifTrue:[
2917
2ba0fee85a7f changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   799
                        anApplicationOrNil isNil
2ba0fee85a7f changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   800
                        or:[ (anApplicationOrNil perform:visibilityInItem) value ].
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   801
                    ] ifFalse:[
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   802
                        visibilityInItem value
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   803
                    ].
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   804
                ].
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   805
            ].
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   806
        ].
2080
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   807
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   808
    menuView := MenuView 
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   809
        labels:(itemsShown collect:[:each | each label])
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   810
        selectors:(itemsShown collect:[:each | each value])
2751
d0729d604864 changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents: 2584
diff changeset
   811
        accelerators:(itemsShown collect:[:each | each shortcutKey])
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   812
        args:(itemsShown collect:[:each | each argument])
2080
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   813
        receiver:receiver.
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   814
2092
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
   815
    itemsShown doWithIndex:[:each :idx |
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   816
        |enabledInItem enabled|
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   817
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   818
        enabledInItem := each enabled.
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   819
        enabledInItem notNil ifTrue:[
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   820
            enabledInItem isSymbol ifTrue:[
2917
2ba0fee85a7f changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   821
                enabled := anApplicationOrNil isNil or:[ (anApplicationOrNil perform:enabledInItem) ].
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   822
            ] ifFalse:[
3028
29a0a22942fe changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   823
                enabled := enabledInItem
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   824
            ].
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   825
            enabled value ifFalse:[
2092
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
   826
                menuView disable:idx
2081
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   827
            ].
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   828
        ].
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   829
    ].
52ba70a79ce9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
   830
3245
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   831
    menuView actions:(itemsShown
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   832
                        collect:[:each |
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   833
                            [ 
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   834
                                |actionOrSymbol|
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   835
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   836
                                actionOrSymbol := each itemValue.
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   837
                                actionOrSymbol isBlock ifTrue:[
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   838
                                    actionOrSymbol value
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   839
                                ] ifFalse:[
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   840
                                    receiver perform:actionOrSymbol 
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   841
                                ]
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   842
                            ]
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   843
                        ]
5dd413dddd1c class: Menu
Claus Gittinger <cg@exept.de>
parents: 3226
diff changeset
   844
                      ).
2080
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   845
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   846
    ^ PopUpMenu forMenu:menuView
2867
b745ee0a04ac comment/format
Claus Gittinger <cg@exept.de>
parents: 2864
diff changeset
   847
2917
2ba0fee85a7f changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   848
    "Modified: / 30-06-2011 / 10:35:57 / cg"
2080
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   849
!
4fe491fe114c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
   850
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   851
fromLiteralArrayEncoding:aLiteralEncodedArray
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   852
    "read my contents from a aLiteralEncodedArray"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   853
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   854
    |items groups values|
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   855
1620
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   856
    items := aLiteralEncodedArray at:2.
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   857
2864
f90017f2da66 changed: #fromLiteralArrayEncoding:
Claus Gittinger <cg@exept.de>
parents: 2854
diff changeset
   858
    items notNil ifTrue:[
1620
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   859
        items := items collect:[:item | item decodeAsLiteralArray].
bf72298c42bc bug fixes; handle unspecified items in literalArrayEncoding
ca
parents: 1599
diff changeset
   860
    ].
1405
c7775c10e8fd tolerant literalDecoding (missing 2nd and 3rd elements);
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   861
    groups := aLiteralEncodedArray at:3 ifAbsent:nil.
c7775c10e8fd tolerant literalDecoding (missing 2nd and 3rd elements);
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   862
    values := aLiteralEncodedArray at:4 ifAbsent:nil.
610
72dbf392e888 ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   863
    self menuItems:items menuItemGroups:groups values:values.
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   864
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   865
    "extract from PD folder.st:
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   866
     #(#Menu #(
1245
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   867
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   868
                        #rawLabel: 'left' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   869
                        #value: #left ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   870
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   871
                        #rawLabel: 'center' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   872
                        #value: #center ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   873
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   874
                        #rawLabel: 'right' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   875
                        #value: #right ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   876
              ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   877
             #(3 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   878
             nil 
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   879
       ) decodeAsLiteralArray
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   880
    "
452
b708d60b96b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   881
    "
b708d60b96b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   882
     #(#Menu #(
1245
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   883
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   884
                        #label: 'Straighten Up' ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   885
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   886
                        #label: 'Inspect' ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   887
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   888
                        #label: 'Coredump' ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   889
              ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   890
             #(3 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   891
            #(#straightenUp #inspect #halt ) 
452
b708d60b96b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   892
       ) decodeAsLiteralArray startUp  
b708d60b96b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   893
    "
457
19f2c28e4adb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 456
diff changeset
   894
454
539b7c318760 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   895
    "extract from iconicBrowser.st:
452
b708d60b96b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   896
     #(#Menu #(
1245
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   897
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   898
                        #label: 'Straighten Up' ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   899
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   900
                        #label: 'Inspect' ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   901
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   902
                        #label: 'Coredump' ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   903
              ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   904
             #(3 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   905
             #(1 2 3 )
452
b708d60b96b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   906
       ) decodeAsLiteralArray startUp  
b708d60b96b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   907
    "
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
454
539b7c318760 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   909
    "extract from refactory213.st:
539b7c318760 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   910
     #(#Menu #(
1245
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   911
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   912
                    #label: 'File List' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   913
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   914
                #(#MenuItem #label: 'File Editor...' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   915
                    #accessCharacterPosition: 6 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   916
                #(#MenuItem #label: 'Refactoring Tool...' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   917
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   918
                #(#MenuItem #label: 'Workspace' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   919
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   920
                #(#MenuItem #label: 'New Canvas' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   921
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   922
                #(#MenuItem #label: 'Palette' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   923
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   924
                #(#MenuItem #label: 'Canvas Tool' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   925
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   926
                #(#MenuItem #label: 'Image Editor' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   927
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   928
                #(#MenuItem #label: 'Menu Editor' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   929
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   930
                #(#MenuItem #label: 'Advanced' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   931
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   932
                #(#MenuItem #label: 'DLL and C Connect' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   933
                    #accessCharacterPosition: 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   934
                #(#MenuItem #label: 'System Transcript' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   935
                    #accessCharacterPosition: 8 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   936
              ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   937
              #(4 5 2 1 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   938
              #(#openFileList #openFileEditor #openRefactoringTool #toolsNewWorkspace #toolsNewCanvas #toolsPalette #toolsCanvasTool #toolsMaskEditor #toolsMenuEditor nil #openExternalFinder #toggleSystemTranscript ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   939
        ) decodeAsLiteralArray startUp
454
539b7c318760 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   940
    "
539b7c318760 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   941
457
19f2c28e4adb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 456
diff changeset
   942
    "submenus:
19f2c28e4adb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 456
diff changeset
   943
     #(#Menu #(
1245
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   944
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   945
                        #label: 'Foo' 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   946
                        #submenu: #(#Menu #(
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   947
                                            #(#MenuItem #label: 'foo 1')     
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   948
                                            #(#MenuItem #label: 'foo 2')     
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   949
                                          )
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   950
                                          nil
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   951
                                          #(11 22)
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   952
                                   )     
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   953
                 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   954
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   955
                        #label: 'Inspect' ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   956
                #(#MenuItem 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   957
                        #label: 'Coredump' ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   958
              ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   959
             #(3 ) 
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   960
             #(1 2 3 )
457
19f2c28e4adb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 456
diff changeset
   961
       ) decodeAsLiteralArray startUp  
19f2c28e4adb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 456
diff changeset
   962
    "
19f2c28e4adb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 456
diff changeset
   963
2864
f90017f2da66 changed: #fromLiteralArrayEncoding:
Claus Gittinger <cg@exept.de>
parents: 2854
diff changeset
   964
    "Modified: / 08-08-2010 / 14:43:03 / cg"
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   965
!
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   966
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   967
literalArrayEncoding
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   968
    "return myself encoded as a literal array"
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   969
1245
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   970
    |coll array size|
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   971
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   972
    coll := OrderedCollection new.
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   973
    coll add:#Menu.
1245
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   974
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   975
    (size := items size) == 0  ifTrue:[
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   976
        array := nil
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   977
    ] ifFalse:[
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   978
        array := Array new:size.
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   979
        items keysAndValuesDo:[:anIndex :anItem|
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   980
            array at:anIndex put:(anItem literalArrayEncoding)
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   981
        ]
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   982
    ].
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   983
    coll add:array.
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   984
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   985
    (size := groupSizes size) == 0  ifTrue:[
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   986
        array := nil
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   987
    ] ifFalse:[
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   988
        array := Array new:size.
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   989
        groupSizes keysAndValuesDo:[:anIndex :aSize|
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   990
            array at:anIndex put:(aSize literalArrayEncoding)
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   991
        ]
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   992
    ].
93d262fccc63 bugFix in
ca
parents: 1174
diff changeset
   993
    coll add:array.
489
264ba86c52c1 checkin from browser
ca
parents: 457
diff changeset
   994
    coll add:nil.
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   995
  ^ coll asArray
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   996
! !
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   997
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   998
!Menu methodsFor:'enumerating'!
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
   999
2494
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1000
allItemsDetect:aOneArgBlock ifNone:exceptionalValue
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1001
    "find an element amongst each item and submenu items"
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1002
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1003
    self itemsDo:[:anItem|
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1004
        |sub subItem|
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1005
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1006
        (aOneArgBlock value:anItem) ifTrue:[^ anItem].
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1007
        (sub := anItem submenu) notNil ifTrue:[
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1008
            subItem := sub allItemsDetect:aOneArgBlock ifNone:nil.
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1009
            subItem notNil ifTrue:[^ subItem].
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1010
        ]
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1011
    ].
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1012
    ^ exceptionalValue value
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1013
!
994b030ae562 new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 2433
diff changeset
  1014
665
9e8b4bc9fedb enumerating:
ca
parents: 627
diff changeset
  1015
allItemsDo:aOneArgBlock
9e8b4bc9fedb enumerating:
ca
parents: 627
diff changeset
  1016
    "evaluate block on each item and submenu items
9e8b4bc9fedb enumerating:
ca
parents: 627
diff changeset
  1017
    "
9e8b4bc9fedb enumerating:
ca
parents: 627
diff changeset
  1018
    self itemsDo:[:anItem|
972
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1019
        |sub|
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1020
972
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1021
        aOneArgBlock value:anItem.
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1022
        (sub := anItem submenu) notNil ifTrue:[
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1023
            sub allItemsDo:aOneArgBlock
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1024
        ]
665
9e8b4bc9fedb enumerating:
ca
parents: 627
diff changeset
  1025
    ]
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1026
972
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1027
    "Modified: / 19.6.1998 / 00:34:53 / cg"
665
9e8b4bc9fedb enumerating:
ca
parents: 627
diff changeset
  1028
!
9e8b4bc9fedb enumerating:
ca
parents: 627
diff changeset
  1029
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1030
detectItem:aBlock
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1031
    "evaluate the argument, aBlock for each item in the menu until the
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1032
     block returns true; in this case return the item which caused the
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1033
     true evaluation.
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1034
     If none of the evaluations returns true, return the result of the
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1035
     evaluation of the exceptionBlock
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1036
    "
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1037
    ^ self detectItem:aBlock ifNone:[self errorNotFound]
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1038
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1039
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1040
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
  1041
detectItem:aBlock ifNone:exceptionValue
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1042
    "evaluate the argument, aBlock for each item in the menu until the
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1043
     block returns true; in this case return the item which caused the
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1044
     true evaluation.
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
  1045
     If none of the evaluations returns true, return the value from exceptionValue
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1046
    "
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1047
    items notNil ifTrue:[
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
  1048
        ^ items detect:aBlock ifNone:exceptionValue
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1049
    ].
3942
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
  1050
    ^ exceptionValue value
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
  1051
521552945b3a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3845
diff changeset
  1052
    "Modified (comment): / 14-03-2017 / 16:09:51 / cg"
940
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1053
!
418cfd9b298d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
  1054
589
cc422fe7824f ST-80 compatibility; enumerating & indication
ca
parents: 584
diff changeset
  1055
itemsDo:aOneArgBlock
cc422fe7824f ST-80 compatibility; enumerating & indication
ca
parents: 584
diff changeset
  1056
    "evaluate the block for each item in the current menu
cc422fe7824f ST-80 compatibility; enumerating & indication
ca
parents: 584
diff changeset
  1057
    "
cc422fe7824f ST-80 compatibility; enumerating & indication
ca
parents: 584
diff changeset
  1058
    items notNil ifTrue:[items do:aOneArgBlock]
cc422fe7824f ST-80 compatibility; enumerating & indication
ca
parents: 584
diff changeset
  1059
!
cc422fe7824f ST-80 compatibility; enumerating & indication
ca
parents: 584
diff changeset
  1060
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1061
menuAndSubmenusDetectItem:aOneArgBlock
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1062
    "evaluate the block for each item in the current menu and all
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1063
     submenus. In case that the block returns a non nil argument,
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1064
     the item will be returned
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1065
    "
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1066
    |item|
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1067
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1068
    items notNil ifTrue:[
972
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1069
        items do:[:anItem|
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1070
            |sub|
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1071
972
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1072
            (aOneArgBlock value:anItem) ifTrue:[
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1073
                ^ anItem
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1074
            ].
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1075
            (sub := anItem submenu) notNil ifTrue:[
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1076
                item := sub menuAndSubmenusDetectItem:aOneArgBlock.
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1077
                item notNil ifTrue:[
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1078
                    ^ item
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1079
                ]
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1080
            ]
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1081
        ]
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1082
    ].
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1083
    ^ nil
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1084
972
09bc0765dbc1 no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
  1085
    "Modified: / 19.6.1998 / 00:35:00 / cg"
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1086
! !
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1087
672
2db4bb41aa93 added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents: 665
diff changeset
  1088
!Menu methodsFor:'kludged fixes'!
2db4bb41aa93 added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents: 665
diff changeset
  1089
2db4bb41aa93 added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents: 665
diff changeset
  1090
destroy
1599
85108dff13a9 comment
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
  1091
    "dummy to allow a menu to be used where a MenuView used to be"
672
2db4bb41aa93 added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents: 665
diff changeset
  1092
2db4bb41aa93 added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents: 665
diff changeset
  1093
    "Created: 28.7.1997 / 10:16:52 / cg"
2db4bb41aa93 added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents: 665
diff changeset
  1094
! !
2db4bb41aa93 added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents: 665
diff changeset
  1095
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1096
!Menu methodsFor:'menu items'!
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1097
2404
8cbc5d26f26e +removeAllAccelerators
Claus Gittinger <cg@exept.de>
parents: 2269
diff changeset
  1098
removeAllAccelerators
8cbc5d26f26e +removeAllAccelerators
Claus Gittinger <cg@exept.de>
parents: 2269
diff changeset
  1099
    self allItemsDo:[:eachItem |
8cbc5d26f26e +removeAllAccelerators
Claus Gittinger <cg@exept.de>
parents: 2269
diff changeset
  1100
        eachItem shortcutKey:nil.
8cbc5d26f26e +removeAllAccelerators
Claus Gittinger <cg@exept.de>
parents: 2269
diff changeset
  1101
    ].
8cbc5d26f26e +removeAllAccelerators
Claus Gittinger <cg@exept.de>
parents: 2269
diff changeset
  1102
!
8cbc5d26f26e +removeAllAccelerators
Claus Gittinger <cg@exept.de>
parents: 2269
diff changeset
  1103
740
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1104
someMenuItemLabeled:aLabel
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1105
    "get the menu item with that label; in case that the label
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1106
     is not found, nil is returned
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1107
    "
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1108
    ^ self someMenuItemLabeled:aLabel ifNone:nil
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1109
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1110
    "Created: / 14.11.1997 / 20:55:17 / cg"
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1111
!
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1112
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1113
someMenuItemLabeled:aLabel ifNone:exceptionBlock
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1114
    "get the menu item labeled aLabel; in case that the value
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1115
     is not found, the given exceptionBlock is executed and its value returned
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1116
    "
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1117
    |item|
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1118
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1119
    item := self menuAndSubmenusDetectItem:[:anItem| anItem label = aLabel].
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1120
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1121
    item notNil ifTrue:[
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1122
	^ item
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1123
    ].
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1124
    ^ exceptionBlock value
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1125
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1126
    "Created: / 14.11.1997 / 20:56:13 / cg"
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1127
!
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1128
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1129
someMenuItemWithValue:aValue
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1130
    "get the menu item assigned with the value; in case that the value
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1131
     is not found nil is returned
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1132
    "
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1133
    ^ self someMenuItemWithValue:aValue ifNone:nil
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1134
!
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1135
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1136
someMenuItemWithValue:aValue ifNone:exceptionBlock
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1137
    "get the menu item assigned with the value; in case that the value
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1138
     is not found, the given exceptionBlock is executed and returned
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1139
    "
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1140
    |item|
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1141
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1142
    item := self menuAndSubmenusDetectItem:[:anItem| anItem value == aValue].
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1143
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1144
    item notNil ifTrue:[
740
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1145
	^ item
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1146
    ].
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1147
  ^ exceptionBlock value
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1148
! !
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1149
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1150
!Menu methodsFor:'queries'!
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1151
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1152
hasHiddenItems
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1153
    "test whether any item is hidden"
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1154
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1155
    self allItemsDo:[:anItem|
740
4f45cc61d4e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
  1156
	anItem isHidden ifTrue:[^ true]
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1157
    ].
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1158
    ^ false
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1159
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1160
    "Modified: / 27.10.1997 / 15:12:44 / cg"
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1161
!
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
  1162
2584
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
  1163
hasItems
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
  1164
    "test whether there are any menu-items"
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
  1165
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
  1166
    ^ items notEmptyOrNil
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
  1167
!
5b5c3dda9a4b +hasItems query
Claus Gittinger <cg@exept.de>
parents: 2494
diff changeset
  1168
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1169
hasSubMenuAt:anIndex
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1170
    "test whether the menu item at the given index has a submenu
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1171
    "
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1172
    ^ (self menuItemAt:anIndex) hasSubmenu
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1173
! !
9a4c30f7586f ST-80 compatible features addded
ca
parents: 582
diff changeset
  1174
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1175
!Menu methodsFor:'startup'!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1176
729
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1177
show
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1178
    "realize the menu at its last position; returns the value associated with the
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1179
     selected item, 0 if none was selected"
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1180
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1181
    ^ (MenuPanel menu:self) show ? 0
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1182
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1183
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1184
!
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1185
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1186
showAt:aPoint
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1187
    "realize the menu at aPoint; returns the value associated with the
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1188
     selected item, 0 if none was selected"
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1189
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1190
    ^ self showAt:aPoint resizing:true
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1191
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1192
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1193
!
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1194
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1195
showAt:aPoint resizing:aBoolean
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1196
    "realize the menu at aPoint; returns the value associated with the
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1197
     selected item, 0 if none was selected"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1198
996
1e10d01c90b8 careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1199
    ^ ((MenuPanel menu:self) showAt:aPoint resizing:aBoolean) ? 0
1e10d01c90b8 careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1200
1e10d01c90b8 careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1201
    "Modified: / 8.7.1998 / 19:57:55 / cg"
729
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1202
!
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1203
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1204
showAtPointer
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1205
    "realize the menu at the current pointer position; returns the value associated with the
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1206
     selected item, 0 if none was selected"
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1207
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1208
    ^ self startUp
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1209
!
457
19f2c28e4adb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 456
diff changeset
  1210
729
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1211
showCenteredIn:aView
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1212
    "realize the menu visible at the aView center; returns the value associated with the
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1213
     selected item, 0 if none was selected"
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1214
996
1e10d01c90b8 careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1215
    ^ ((MenuPanel menu:self) showCenteredIn:aView) ? 0
729
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1216
996
1e10d01c90b8 careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1217
    "Modified: / 8.7.1998 / 19:58:05 / cg"
729
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1218
!
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1219
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1220
startUp
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1221
    "display the menu as a popUp; returns the value associated with the
2039
30187ff89c64 comment
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  1222
     selected item, nil if none was selected.
30187ff89c64 comment
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  1223
     (should we return 0 form ST-80 compatibility ?)"
729
7e22cc23fd1f bugfix:
ca
parents: 724
diff changeset
  1224
1367
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1225
    ^ (MenuPanel menu:self) startUp "/ ? 0
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1226
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
  1227
"   
1367
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1228
        |m|
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
  1229
1367
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1230
        m := #(#Menu #(
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1231
                        #(#MenuItem 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1232
                                #rawLabel: 'left' 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1233
                                #value: #left ) 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1234
                        #(#MenuItem 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1235
                                #rawLabel: 'center' 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1236
                                #value: #center ) 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1237
                        #(#MenuItem 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1238
                                #rawLabel: 'right' 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1239
                                #value: #right ) ) 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1240
                 #(2) 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1241
                nil 
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1242
        ) decodeAsLiteralArray.
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1243
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
  1244
      Transcript showCR:(m startUp)        
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
  1245
"
938
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1246
!
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1247
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1248
startUpAt:aPoint
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1249
    "display the menu as a popUp at aPoint; returns the value associated with the
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1250
     selected item, 0 if none was selected"
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1251
939
f6df8fbf6b4a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
  1252
    ^ ((MenuPanel menu:self) startUpAt:aPoint) ? 0
938
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1253
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1254
"   
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1255
        |m|
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1256
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1257
        m := #(#Menu #(
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1258
                        #(#MenuItem 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1259
                                #rawLabel: 'left' 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1260
                                #value: #left ) 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1261
                        #(#MenuItem 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1262
                                #rawLabel: 'center' 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1263
                                #value: #center ) 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1264
                        #(#MenuItem 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1265
                                #rawLabel: 'right' 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1266
                                #value: #right ) ) 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1267
                 #(2) 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1268
                nil 
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1269
        ) decodeAsLiteralArray.
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1270
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1271
      Transcript showCR:(m startUpAt:100@100)        
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1272
"
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1273
dfa1b1666cfa added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1274
    "Created: / 21.5.1998 / 14:15:21 / cg"
939
f6df8fbf6b4a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
  1275
    "Modified: / 21.5.1998 / 14:17:46 / cg"
1367
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1276
!
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1277
1652
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1278
startUpFor:originatingWidget
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1279
    "display the menu as a popUp; returns the value associated with the
2039
30187ff89c64 comment
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  1280
     selected item, nil if none was selected.
30187ff89c64 comment
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  1281
     (should we return 0 for ST-80 compatibility ?)"
1652
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1282
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1283
    ^ (MenuPanel menu:self) startUpFor:originatingWidget "/ ? 0
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1284
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1285
"   
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1286
        |m|
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1287
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1288
        m := #(#Menu #(
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1289
                        #(#MenuItem 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1290
                                #rawLabel: 'left' 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1291
                                #value: #left ) 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1292
                        #(#MenuItem 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1293
                                #rawLabel: 'center' 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1294
                                #value: #center ) 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1295
                        #(#MenuItem 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1296
                                #rawLabel: 'right' 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1297
                                #value: #right ) ) 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1298
                 #(2) 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1299
                nil 
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1300
        ) decodeAsLiteralArray.
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1301
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1302
      Transcript showCR:(m startUp)        
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1303
"
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1304
!
e2a96fa70eef can now specify if menu action is to be performed by
ca
parents: 1620
diff changeset
  1305
1367
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1306
startUpOrNil
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1307
    "display the menu as a popUp; returns the value associated with the
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1308
     selected item, nil if none was selected"
37bf7a7b5bd1 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
  1309
1405
c7775c10e8fd tolerant literalDecoding (missing 2nd and 3rd elements);
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
  1310
    ^ (MenuPanel menu:self) startUpOrNil
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1311
! !
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1312
2967
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1313
!Menu methodsFor:'utilities'!
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1314
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1315
replaceArgument: oldValue with: newValue
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1316
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1317
    "Recusively Replace argument in menu items where
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1318
     current argument is equal to oldValue by newValue"
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1319
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1320
    self itemsDo:[:item|
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1321
        item replaceArgument: oldValue with: newValue
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1322
    ]
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1323
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1324
    "Created: / 12-10-2011 / 20:11:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1325
! !
c50ab5fa6cf0 Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1326
3778
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
  1327
!Menu::NeedResourcesQuery class methodsFor:'defaults'!
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
  1328
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
  1329
defaultAnswer
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
  1330
    ^ true
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
  1331
! !
902a70992ca0 #TUNING by sr
sr
parents: 3752
diff changeset
  1332
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1333
!Menu class methodsFor:'documentation'!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1334
3845
fbeacbb4b90b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1335
version
fbeacbb4b90b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1336
    ^ '$Header$'
fbeacbb4b90b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1337
!
fbeacbb4b90b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1338
2764
c83f22018324 squeak oompatibility:
Claus Gittinger <cg@exept.de>
parents: 2751
diff changeset
  1339
version_CVS
3752
42375c1cc0e9 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3449
diff changeset
  1340
    ^ '$Header$'
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1341
! !
3117
3c7f6b69b2c5 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3028
diff changeset
  1342