MenuItem.st
author Claus Gittinger <cg@exept.de>
Tue, 13 Jul 1999 17:42:43 +0200
changeset 1202 1cc76ca8e500
parent 1196 27897663fc97
child 1203 35445f3530a4
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1196
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
     1
"
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
     2
 COPYRIGHT (c) 1998 by eXept Software AG
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
     3
              All Rights Reserved
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
     4
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
     5
 This software is furnished under a license and may be used
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
     6
 only in accordance with the terms of that license and with the
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
     8
 be provided or otherwise made available to, or used by, any
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
     9
 other person.  No title to or ownership of the software is
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    10
 hereby transferred.
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    11
"
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    12
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    13
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#MenuItem
752
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
    15
	instanceVariableNames:'activeHelpKey enabled label value nameKey adornment
798
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
    16
		translateLabel isButton startGroup isVisible'
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'Views-Support'
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
Object subclass:#MenuItemAdornment
666
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
    23
	instanceVariableNames:'color indication submenu submenuChannel shortcutKey labelText
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
    24
		labelImage accessCharacterPosition argument choice choiceValue'
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
	classVariableNames:''
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
	poolDictionaries:''
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
	privateIn:MenuItem
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
!MenuItem class methodsFor:'documentation'!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
1196
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    32
copyright
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    33
"
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    34
 COPYRIGHT (c) 1998 by eXept Software AG
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    35
              All Rights Reserved
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    36
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    37
 This software is furnished under a license and may be used
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    38
 only in accordance with the terms of that license and with the
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    39
 inclusion of the above copyright notice.   This software may not
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    40
 be provided or otherwise made available to, or used by, any
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    41
 other person.  No title to or ownership of the software is
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    42
 hereby transferred.
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    43
"
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    44
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    45
!
27897663fc97 docu & copyright
Claus Gittinger <cg@exept.de>
parents: 1044
diff changeset
    46
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
documentation
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    not yet finished MenuItem class - this will eventually replace
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    most of the MenuView and PopUpMenu stuff.
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    (and hopefully be ST-80 compatible ...)
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    For now, only a subset of the full protocol is implemented.
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    [author:]
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
        Claus Gittinger
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    [see also:]
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
        MenuItem
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
        PopUpMenu
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
! !
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
490
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
    65
!MenuItem class methodsFor:'instance creation'!
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
    66
1044
5ecf46d0f1b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    67
label:aString
5ecf46d0f1b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    68
    "create and return a new menuItem, given a label string"
5ecf46d0f1b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    69
5ecf46d0f1b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    70
    ^ self new label:aString
5ecf46d0f1b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    71
5ecf46d0f1b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    72
    "Modified: / 4.8.1998 / 17:33:13 / cg"
5ecf46d0f1b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    73
    "Created: / 14.8.1998 / 19:19:14 / cg"
5ecf46d0f1b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    74
!
5ecf46d0f1b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    75
1030
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    76
label:labelString value:selectorOrValue
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    77
    "create and return a new menuItem, given its label and value"
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    78
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    79
    ^ (self new) label:labelString; value:selectorOrValue; yourself
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    80
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    81
    "Created: / 4.8.1998 / 17:34:18 / cg"
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    82
!
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    83
490
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
    84
labeled:aString
1030
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    85
    "create and return a new menuItem, given a label string"
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    86
490
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
    87
    ^ self new label:aString
1030
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    88
3684379a1ac8 added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
    89
    "Modified: / 4.8.1998 / 17:33:13 / cg"
490
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
    90
! !
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
    91
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
    92
!MenuItem methodsFor:'ST-80 compatibility'!
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
    93
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
    94
isEnabled:aBoolean
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
    95
    self enabled:aBoolean
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
    96
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
    97
    "Created: / 27.10.1997 / 16:34:55 / cg"
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
    98
! !
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
    99
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
!MenuItem methodsFor:'accessing'!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   102
accessCharacterPosition
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   103
    "get the index of the access character in the label text or string, or nil if none
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   104
    "
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   105
    adornment notNil ifTrue:[
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   106
        ^ adornment accessCharacterPosition
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   107
    ].
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   108
    ^ nil
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   111
accessCharacterPosition:index
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   112
    "set the index of the access character in the label text or string, or nil if none
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   113
    "
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   114
    (index isNil and:[adornment isNil]) ifFalse:[
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   115
        self adornment accessCharacterPosition:index
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   116
    ]
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
640
4e1c0d0a633b add active help for items
ca
parents: 590
diff changeset
   119
activeHelpKey
4e1c0d0a633b add active help for items
ca
parents: 590
diff changeset
   120
    ^ activeHelpKey
4e1c0d0a633b add active help for items
ca
parents: 590
diff changeset
   121
!
4e1c0d0a633b add active help for items
ca
parents: 590
diff changeset
   122
4e1c0d0a633b add active help for items
ca
parents: 590
diff changeset
   123
activeHelpKey:aKey
4e1c0d0a633b add active help for items
ca
parents: 590
diff changeset
   124
    activeHelpKey := aKey
4e1c0d0a633b add active help for items
ca
parents: 590
diff changeset
   125
!
4e1c0d0a633b add active help for items
ca
parents: 590
diff changeset
   126
684
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   127
argument
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   128
    "get argument given to the value (selector)
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   129
    "
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   130
    adornment notNil ifTrue:[
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   131
        ^ adornment argument
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   132
    ].
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   133
    ^ nil
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   134
!
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   135
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   136
argument:something
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   137
    "set argument given to the value (selector)
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   138
    "
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   139
    |arg|
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   140
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   141
    (arg := something) notNil ifTrue:[
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   142
        arg isString ifTrue:[
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   143
            (arg size == 0 or:[(arg indexOfNonSeparatorStartingAt:1) == 0]) ifTrue:[
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   144
                arg := nil
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   145
            ]
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   146
        ]
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   147
    ].
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   148
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   149
    (arg isNil and:[adornment isNil]) ifFalse:[
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   150
        self adornment argument:arg
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   151
    ]
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   152
!
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   153
798
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   154
isVisible
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   155
    ^ isVisible ? true
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   156
!
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   157
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   158
isVisible:something
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   159
    isVisible := something
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   160
!
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   161
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
label
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   163
    ^ self filteredLabel "/ label
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   165
    "Created: / 25.2.1997 / 19:48:16 / cg"
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   166
    "Modified: / 19.6.1998 / 00:02:55 / cg"
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
453
e06bf3866328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   169
label:aString
e06bf3866328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   170
    label := aString
e06bf3866328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   171
e06bf3866328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   172
    "Created: 25.2.1997 / 19:55:16 / cg"
e06bf3866328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   173
!
e06bf3866328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 451
diff changeset
   174
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   175
labelImage
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   176
    "gets the labelImage
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   177
    "
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   178
    adornment notNil ifTrue:[
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 581
diff changeset
   179
        ^ adornment labelImage value
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   180
    ].
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   181
  ^ nil
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   182
!
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   183
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   184
labelImage:aResourceRetriever
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   185
    "set the labelImage
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   186
    "
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   187
    aResourceRetriever notNil ifTrue:[
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   188
        self adornment labelImage:aResourceRetriever
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   189
    ]
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   190
!
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   191
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   192
nameKey
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   193
    ^ nameKey
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   194
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   195
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   196
!
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   197
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   198
nameKey:aNameKey
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   199
    nameKey := aNameKey.
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   200
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   201
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   202
!
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   203
490
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   204
rawLabel
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   205
    ^ label
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   206
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   207
    "Created: 25.2.1997 / 19:48:16 / cg"
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   208
!
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   209
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
rawLabel:aString
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
    label := aString
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    "Created: 25.2.1997 / 19:11:02 / cg"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
490
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   216
shortcutKeyCharacter
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   217
    "ignored for now"
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   218
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   219
    adornment notNil ifTrue:[
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   220
        ^ adornment shortcutKeyCharacter
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   221
    ].
490
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   222
    ^ nil
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   223
!
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   224
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   225
shortcutKeyCharacter:aKey
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   226
    "set the  key to press to select the menu item from the keyboard
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   227
    "
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   228
    (aKey isNil and:[adornment isNil]) ifFalse:[
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   229
        self adornment shortcutKeyCharacter:aKey
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   230
    ]
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   231
!
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   232
794
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   233
startGroup
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   234
    "start group #left #right #center ... or nil
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   235
     at the moment only #right is implemented
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   236
    "
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   237
    ^ startGroup 
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   238
!
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   239
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   240
startGroup:aSymbol
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   241
    "start group #left #right #center ...
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   242
     at the moment only #right is implemented
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   243
    "
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   244
    (startGroup isNil or:[startGroup == #right]) ifTrue:[
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   245
        startGroup := aSymbol
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   246
    ] ifFalse:[
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   247
        self warn:('not supported group: ', aSymbol printString ).
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   248
    ]
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   249
!
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   250
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   251
submenu
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   252
    adornment notNil ifTrue:[
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   253
        ^ adornment submenu
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   254
    ].
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   255
    ^ nil
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   256
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   257
    "Created: 25.2.1997 / 20:57:24 / cg"
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   258
!
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   259
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   260
submenu:aMenu
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   261
    self adornment submenu:aMenu
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   262
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   263
    "Created: 25.2.1997 / 20:56:20 / cg"
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   264
!
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   265
666
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   266
submenuChannel
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   267
    adornment notNil ifTrue:[
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   268
        ^ adornment submenuChannel
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   269
    ].
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   270
    ^ nil
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   271
!
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   272
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   273
submenuChannel:something
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   274
    self adornment submenuChannel:something
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   275
!
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   276
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
value
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
    ^ value
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
    "Created: 25.2.1997 / 19:50:14 / cg"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
value:something
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
    value := something
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
    "Created: 25.2.1997 / 19:11:13 / cg"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
! !
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   289
!MenuItem methodsFor:'accessing behavior'!
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   290
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   291
beOff
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   292
    "set indication off
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   293
    "
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   294
    self indication:false
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   295
!
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   296
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   297
beOn
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   298
    "set indication on
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   299
    "
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   300
    self indication:true
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   301
!
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   302
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   303
choice
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   304
    "return the menu items choice indicator (RadioButton)
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   305
    "
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   306
    adornment notNil ifTrue:[
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   307
        ^ adornment choice
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   308
    ].
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   309
    ^ nil
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   310
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   311
    "Created: / 14.8.1998 / 14:34:55 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   312
    "Modified: / 14.8.1998 / 15:11:57 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   313
!
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   314
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   315
choice:aChoice
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   316
    "set the menu items choice indicator (RadioButton)
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   317
    "
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   318
    (aChoice notNil or:[adornment notNil]) ifTrue:[
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   319
        self adornment choice:aChoice.
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   320
    ].
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   321
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   322
    "Created: / 14.8.1998 / 15:11:17 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   323
!
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   324
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   325
choiceValue
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   326
    "return the menu items choiceValue (RadioButton)
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   327
    "
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   328
    adornment notNil ifTrue:[
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   329
        ^ adornment choiceValue
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   330
    ].
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   331
    ^ nil
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   332
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   333
    "Modified: / 14.8.1998 / 15:11:57 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   334
    "Created: / 14.8.1998 / 15:38:05 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   335
!
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   336
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   337
choiceValue:something
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   338
    "set the menu items choiceValue (RadioButton)
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   339
    "
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   340
    (something notNil or:[adornment notNil]) ifTrue:[
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   341
        self adornment choiceValue:something.
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   342
    ].
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   343
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   344
    "Created: / 14.8.1998 / 15:39:12 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   345
!
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   346
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   347
disable
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   348
    enabled := false
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   349
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   350
    "Created: 25.2.1997 / 19:39:09 / cg"
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   351
!
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   352
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   353
enable
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   354
    enabled := true
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   355
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   356
    "Created: 25.2.1997 / 19:39:00 / cg"
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   357
!
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   358
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   359
enabled
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   360
    "returns a boolean, valueHolder or block
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   361
    "
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   362
    ^ enabled
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   363
!
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   364
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   365
enabled:something
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   366
    "a boolean, valueHolder or block
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   367
    "
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   368
    enabled := something
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   369
!
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   370
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   371
indication
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   372
    "return the menu items on/off indicator (CheckToggle)
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   373
    "
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   374
    adornment notNil ifTrue:[
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   375
        ^ adornment indication
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   376
    ].
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   377
    ^ nil
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   378
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   379
    "Modified: / 14.8.1998 / 15:11:37 / cg"
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   380
!
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   381
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   382
indication:anIndication
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   383
    "set the menu items an on/off indicator (CheckToggle)
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   384
    "
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   385
    (anIndication notNil or:[adornment notNil]) ifTrue:[
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   386
        self adornment indication:anIndication.
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   387
    ].
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   388
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   389
    "Modified: / 14.8.1998 / 15:11:25 / cg"
752
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   390
!
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   391
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   392
isButton
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   393
    "returns whether item looks like a Button
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   394
    "
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   395
    ^isButton ? false
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   396
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   397
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   398
!
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   399
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   400
isButton:anBoolean
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   401
    "sets whether item looks like a Button
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   402
    "
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   403
    isButton := anBoolean
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   404
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   405
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   406
!
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   407
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   408
translateLabel
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   409
    "returns whether label is translated
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   410
    "
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   411
    ^translateLabel ? false
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   412
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   413
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   414
!
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   415
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   416
translateLabel:anBoolean
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   417
    "sets whether label is translated
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   418
    "
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   419
    translateLabel := anBoolean
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   420
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   421
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   422
! !
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   423
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   424
!MenuItem methodsFor:'accessing resource'!
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   425
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 581
diff changeset
   426
findGuiResourcesIn:aResourceContainerOrApplication
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   427
    "setup a resource container
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   428
    "
960
fee5a1a50374 adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   429
    |lblImg m|
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   430
752
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   431
    self translateLabel ifTrue:[
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   432
        label := ResourceRetriever findResourceLabel: label in: aResourceContainerOrApplication
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   433
    ].
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   434
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 581
diff changeset
   435
    adornment notNil ifTrue:[
752
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   436
        (lblImg := adornment labelImage) notNil ifTrue:[   
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   437
            lblImg findGuiResourcesIn:aResourceContainerOrApplication.
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   438
            lblImg labelText notNil ifTrue: [lblImg labelText: label].
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   439
        ].   
960
fee5a1a50374 adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   440
        (m := adornment submenu) notNil ifTrue:[
fee5a1a50374 adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   441
            m := m value.
fee5a1a50374 adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   442
            m notNil ifTrue:[
fee5a1a50374 adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   443
                m findGuiResourcesIn:aResourceContainerOrApplication
fee5a1a50374 adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   444
            ]
752
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   445
        ].
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   446
    ]
960
fee5a1a50374 adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   447
fee5a1a50374 adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   448
    "Modified: / 18.6.1998 / 16:54:25 / cg"
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   449
! !
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   450
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
!MenuItem methodsFor:'converting'!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
fromLiteralArrayEncoding:aLiteralEncodedArray
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
    "read my contents from a aLiteralEncodedArray"
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
1202
1cc76ca8e500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   456
    |selector value|
1cc76ca8e500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   457
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
    2 to:aLiteralEncodedArray size by:2 do:[:i |
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
        selector := aLiteralEncodedArray at:i.
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   460
        value    := (aLiteralEncodedArray at:i+1) decodeAsLiteralArray.
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   461
        self perform:selector with:value
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
    ].
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
    "
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   465
     #( #MenuItem #rawLabel: 'left' #nameKey: 'identifier'  #value: #left )
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
         decodeAsLiteralArray
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
    "
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   468
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
    "Modified: 25.2.1997 / 19:24:22 / cg"
490
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   470
!
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   471
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   472
literalArrayEncoding
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   473
    "return myself encoded as a literal array"
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   474
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   475
    |coll something|
490
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   476
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   477
    coll := OrderedCollection new.
ebe88e50b29a *** empty log message ***
ca
parents: 458
diff changeset
   478
    coll add:#MenuItem.
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   479
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   480
    label notNil ifTrue:[
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   481
        coll add:#label: ; add:(label literalArrayEncoding)
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   482
    ].
752
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   483
    self translateLabel ifTrue:[
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   484
        coll add:#translateLabel: ; add:(translateLabel literalArrayEncoding)
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   485
    ].
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   486
    self isButton ifTrue:[
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   487
        coll add:#isButton:; add:(isButton literalArrayEncoding)
93690dcd1b75 button and label translation support added.
tz
parents: 724
diff changeset
   488
    ].
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   489
    nameKey notNil ifTrue:[
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   490
        coll add:#nameKey: ; add:(nameKey literalArrayEncoding)
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   491
    ].
798
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   492
    isVisible notNil ifTrue:[
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   493
        isVisible ~~ true ifTrue:[
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   494
            coll add:#isVisible: ; add:(isVisible literalArrayEncoding)
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   495
        ]
8a27a879ff23 support of visible/invisible items
ca
parents: 794
diff changeset
   496
    ].
794
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   497
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   498
    startGroup notNil ifTrue:[
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   499
        coll add:#startGroup: ; add:(startGroup literalArrayEncoding)
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   500
    ].
432935e754e0 add new feature:
ca
parents: 752
diff changeset
   501
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   502
    value notNil ifTrue:[
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   503
        coll add:#value: ; add:(value literalArrayEncoding).
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   504
    ].
653
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   505
    activeHelpKey notNil ifTrue:[
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   506
        coll add:#activeHelpKey: ; add:(activeHelpKey literalArrayEncoding).
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   507
    ].
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   508
    (something := self enabled) notNil ifTrue:[
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   509
        coll add:#enabled: ; add:(enabled literalArrayEncoding).
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   510
    ].
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   511
653
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   512
    adornment notNil ifTrue:[
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   513
        (something := self shortcutKeyCharacter) notNil ifTrue:[
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   514
            coll add:#shortcutKeyCharacter: ; add:(something literalArrayEncoding)
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   515
        ].
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   516
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   517
        (something := self accessCharacterPosition) notNil ifTrue:[
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   518
            coll add:#accessCharacterPosition: ; add:(something literalArrayEncoding)
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   519
        ].
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   520
684
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   521
        (something := self argument) notNil ifTrue:[
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   522
            coll add:#argument: ; add:(something literalArrayEncoding)
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   523
        ].
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   524
661
c09ac6b9820d literalArrayEncoding
ca
parents: 653
diff changeset
   525
        adornment labelImage notNil ifTrue:[
653
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   526
            coll add:#labelImage: ; add:(adornment labelImage literalArrayEncoding)
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   527
        ].
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   528
        (something := self indication) notNil ifTrue:[
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   529
            coll add:#indication: ; add:(something literalArrayEncoding)
666
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   530
        ].
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   531
        (something := self choice) notNil ifTrue:[
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   532
            coll add:#choice: ; add:(something literalArrayEncoding)
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   533
        ].
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   534
        (something := self choiceValue) notNil ifTrue:[
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   535
            coll add:#choiceValue: ; add:(something literalArrayEncoding)
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   536
        ].
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   537
666
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   538
        (something := self submenuChannel) notNil ifTrue:[
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   539
            coll add:#submenuChannel: ; add:(something literalArrayEncoding)
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   540
        ].
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   541
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   542
        self hasSubmenu ifTrue:[
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   543
            coll add:#submenu:; add:(self submenu literalArrayEncoding)
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   544
        ].
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   545
    ].
653
1e7c30f9ca6c literalArrayEncoding updated
ca
parents: 640
diff changeset
   546
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   547
  ^ coll asArray
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   548
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   549
    "Modified: / 14.8.1998 / 15:44:53 / cg"
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
! !
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   552
!MenuItem methodsFor:'private - accessing'!
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   553
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   554
adornment
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   555
    adornment isNil ifTrue:[
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   556
        adornment := MenuItemAdornment new
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   557
    ].
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   558
    ^ adornment
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   559
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   560
    "Created: 25.2.1997 / 20:57:05 / cg"
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   561
!
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   562
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   563
filteredLabel
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   564
    "return the label without any &-chars"
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   565
985
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   566
    |rawLabel l in out c pos emp e|
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   567
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   568
    rawLabel := self rawLabel.
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   569
    rawLabel isString ifFalse:[^ rawLabel].
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   570
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   571
    "/ be careful to preserve any emphasis ...
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   572
    "/ bad kludge ...
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   573
    rawLabel isText ifTrue:[
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   574
        emp := RunArray new.
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   575
    ].
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   576
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   577
    out := WriteStream on:''.
985
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   578
    in := rawLabel readStream.
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   579
    [in atEnd] whileFalse:[
985
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   580
        emp notNil ifTrue:[
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   581
            e := rawLabel emphasisAt:(in position).
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   582
        ].
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   583
        c := in next.
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   584
        c == $& ifTrue:[
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   585
            in peek == $& ifTrue:[
985
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   586
                out nextPut:c.
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   587
                emp notNil ifTrue:[
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   588
                    emp add:e
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   589
                ]
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   590
            ]
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   591
        ] ifFalse:[
985
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   592
            out nextPut:c.
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   593
            emp notNil ifTrue:[
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   594
                emp add:e
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   595
            ]
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   596
        ]
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   597
    ].
985
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   598
    l := out contents.
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   599
    emp notNil ifTrue:[
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   600
        ^ Text string:l emphasisCollection:emp
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   601
    ].
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   602
    ^ l.
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   603
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   604
    "Created: / 19.6.1998 / 00:02:10 / cg"
985
5a5b476cfd6b care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   605
    "Modified: / 20.6.1998 / 17:15:18 / cg"
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   606
! !
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   607
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   608
!MenuItem methodsFor:'queries'!
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   609
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   610
hasChoice
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   611
    "test whether choice exists
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   612
    "
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   613
  ^ self choice notNil
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   614
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   615
    "Created: / 14.8.1998 / 14:34:29 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   616
!
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   617
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   618
hasIndication
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   619
    "test whether indication on/off exists
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   620
    "
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   621
  ^ self indication notNil
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   622
!
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   623
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   624
hasSubmenu
584
9a4c30f7586f ST-80 compatible features addded
ca
parents: 581
diff changeset
   625
    ^ self submenu notNil
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   626
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   627
    "Created: 25.2.1997 / 20:56:20 / cg"
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   628
!
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   629
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   630
isEnabled
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   631
    ^ enabled value ? true
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   632
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   633
    "Created: 25.2.1997 / 19:39:17 / cg"
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   634
!
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   635
724
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   636
isHidden
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   637
    "not yet supported"
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   638
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   639
    ^ false
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   640
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   641
    "Created: / 27.10.1997 / 15:13:43 / cg"
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   642
!
898519684261 more VW comaptibility
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   643
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   644
isOff
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   645
    "test whether indication on/off exists and is off
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   646
    "
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   647
    |indication|
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   648
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   649
    indication := self indication.
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   650
  ^ indication value == false
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   651
!
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   652
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   653
isOn
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   654
    "test whether indication on/off exists and is on
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   655
    "
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   656
    |indication|
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   657
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   658
    indication := self indication.
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   659
  ^ indication value == true
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   660
! !
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   661
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   662
!MenuItem::MenuItemAdornment methodsFor:'accessing'!
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   663
579
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   664
accessCharacterPosition
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   665
    "return the value of the instance variable 'accessCharacterPosition' (automatically generated)"
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   666
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   667
    ^ accessCharacterPosition!
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   668
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   669
accessCharacterPosition:something
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   670
    "set the value of the instance variable 'accessCharacterPosition' (automatically generated)"
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   671
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   672
    accessCharacterPosition := something.!
77f6d490f1ac so far, so good
ca
parents: 578
diff changeset
   673
684
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   674
argument
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   675
    "return the value of the instance variable 'argument' (automatically generated)"
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   676
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   677
    ^ argument
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   678
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   679
    "Created: 25.2.1997 / 20:59:28 / cg"
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   680
!
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   681
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   682
argument:something
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   683
    "set the value of the instance variable 'argument' (automatically generated)"
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   684
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   685
    argument := something.
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   686
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   687
    "Created: 25.2.1997 / 20:59:28 / cg"
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   688
!
184dd159d02e support of arguments
ca
parents: 666
diff changeset
   689
1041
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   690
choice
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   691
    "return the value of the instance variable 'choice' (automatically generated)"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   692
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   693
    ^ choice
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   694
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   695
    "Created: / 14.8.1998 / 14:32:06 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   696
!
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   697
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   698
choice:something
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   699
    "set the value of the instance variable 'choice' (automatically generated)"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   700
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   701
    choice := something.
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   702
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   703
    "Created: / 14.8.1998 / 14:32:06 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   704
!
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   705
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   706
choiceValue
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   707
    "return the value of the instance variable 'choiceValue' (automatically generated)"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   708
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   709
    ^ choiceValue
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   710
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   711
    "Created: / 14.8.1998 / 15:39:26 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   712
!
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   713
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   714
choiceValue:something
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   715
    "set the value of the instance variable 'choiceValue' (automatically generated)"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   716
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   717
    choiceValue := something.
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   718
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   719
    "Created: / 14.8.1998 / 15:39:26 / cg"
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   720
!
d28f0375cd26 added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   721
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   722
color
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   723
    "return the value of the instance variable 'color' (automatically generated)"
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   724
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   725
    ^ color
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   726
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   727
    "Created: 25.2.1997 / 20:59:28 / cg"
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   728
!
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   729
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   730
color:something
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   731
    "set the value of the instance variable 'color' (automatically generated)"
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   732
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   733
    color := something.
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   734
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   735
    "Created: 25.2.1997 / 20:59:28 / cg"
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   736
!
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   737
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   738
indication
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   739
    "test whether the menu item has an on/off indicator (CheckToggle)
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   740
    "
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   741
    ^ indication
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   742
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   743
    "Created: 25.2.1997 / 20:59:28 / cg"
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   744
!
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   745
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   746
indication:something
590
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   747
    "test whether the menu item has an on/off indicator (CheckToggle)
fb2c55428c52 ST-80 compatibility
ca
parents: 584
diff changeset
   748
    "
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   749
    indication := something.
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   750
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   751
    "Created: 25.2.1997 / 20:59:28 / cg"
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   752
!
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   753
581
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   754
labelImage
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   755
    "return the value of the instance variable 'labelImage' (automatically generated)"
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   756
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   757
    ^ labelImage!
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   758
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   759
labelImage:something
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   760
    "set the value of the instance variable 'labelImage' (automatically generated)"
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   761
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   762
    labelImage := something.!
0080d12b5758 enabled can be something not only a boolean
ca
parents: 580
diff changeset
   763
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   764
labelText
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   765
    "get the text appear as the menu label
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   766
    "
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   767
    ^ labelText
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   768
!
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   769
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   770
labelText:something
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   771
    "set the text appear as the menu label
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   772
    "
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   773
    labelText := something.
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   774
!
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   775
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   776
shortcutKeyCharacter
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   777
    "get the  key to press to select the menu item from the keyboard
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   778
    "
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   779
    ^ shortcutKey
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   780
!
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   781
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   782
shortcutKeyCharacter:something
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   783
    "set the  key to press to select the menu item from the keyboard
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   784
    "
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   785
    shortcutKey := something.
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   786
!
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   787
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   788
submenu
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   789
    "get the submenu or nil
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   790
    "
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   791
    ^ submenu value
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   792
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   793
    "Created: / 25.2.1997 / 20:59:28 / cg"
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   794
    "Modified: / 19.6.1998 / 00:33:58 / cg"
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   795
!
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   796
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   797
submenu:something
578
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   798
    "set the submenu or nil
7e0f62d9bc47 access methods ...
ca
parents: 490
diff changeset
   799
    "
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   800
    submenu := something.
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   801
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   802
    "Created: 25.2.1997 / 20:59:28 / cg"
666
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   803
!
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   804
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   805
submenuChannel
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   806
    "get the submenuChannel or nil
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   807
    "
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   808
    ^ submenuChannel
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   809
!
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   810
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   811
submenuChannel:something
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   812
    "set the submenuChannel or nil
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   813
    "
6e614a5d9248 add submenuChannel
ca
parents: 661
diff changeset
   814
    submenuChannel := something.
973
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   815
!
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   816
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   817
submenuHolder
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   818
    "get the submenuHolder or nil
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   819
    "
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   820
    ^ submenu
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   821
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   822
    "Modified: / 19.6.1998 / 00:33:58 / cg"
cd6b8d08c9c9 submenu item send #value.
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   823
    "Created: / 19.6.1998 / 00:34:32 / cg"
458
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   824
! !
729ffdbd2b13 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   825
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   826
!MenuItem class methodsFor:'documentation'!
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   827
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   828
version
1202
1cc76ca8e500 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   829
    ^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.28 1999-07-13 15:42:43 cg Exp $'
451
95064b26ded1 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   830
! !