MenuEditor.st
author ca
Sat, 05 Jul 1997 14:59:38 +0200
changeset 213 71b11a173f87
parent 209 b2fa6f8d4808
child 215 d3c66fe05b12
permissions -rw-r--r--
change model; supports multiple selection
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
     1
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
     3
              All Rights Reserved
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
     4
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
     5
 This software is furnished under a license and may be used
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    10
 hereby transferred.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    11
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    12
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    13
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    14
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    15
ApplicationModel subclass:#MenuEditor
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    16
	instanceVariableNames:'specClass tabSelection aspects slices'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    17
	classVariableNames:''
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    18
	poolDictionaries:''
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    19
	category:'Interface-UIPainter'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    20
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    21
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    22
Object subclass:#Item
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    23
	instanceVariableNames:'activeHelpKey enabled label value nameKey indication shortcutKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    24
		accessCharaterPos retriever icon iconAndLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    25
	classVariableNames:''
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    26
	poolDictionaries:''
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    27
	privateIn:MenuEditor
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    28
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    29
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    30
SelectionInTreeView subclass:#Painter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    31
	instanceVariableNames:''
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    32
	classVariableNames:'CopyBuffer'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    33
	poolDictionaries:''
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    34
	privateIn:MenuEditor
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    35
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    36
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    37
!MenuEditor class methodsFor:'documentation'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    38
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    39
copyright
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    40
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    41
 COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    42
              All Rights Reserved
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    43
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    44
 This software is furnished under a license and may be used
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    45
 only in accordance with the terms of that license and with the
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    46
 inclusion of the above copyright notice.   This software may not
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    47
 be provided or otherwise made available to, or used by, any
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    48
 other person.  No title to or ownership of the software is
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    49
 hereby transferred.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    50
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    51
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    52
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    53
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    54
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    55
documentation
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    56
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    57
    create and modify or inspect popup and pullDown menus of the
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    58
    new style( derives from Menu).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    59
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    60
    [start with:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    61
        MenuEditor open
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    62
        MenuEditor new openOnClass:MenuEditor andSelector:#menuPullDown
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    63
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    64
    [see also:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    65
        UIPainter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    66
        UIHelpTool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    67
        UISpecificationTool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    68
        SelectionInTreeView
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    69
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    70
    [author:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    71
        Claus Atzkern
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    72
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    73
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    74
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    75
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    76
!MenuEditor class methodsFor:'interface specs'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    77
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    78
classAndMethodSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    79
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    80
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    81
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    82
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    83
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    84
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    85
     UIPainter new openOnClass:MenuEditor andSelector:#classAndMethodSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    86
     MenuEditor new openInterface:#classAndMethodSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    87
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    88
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    89
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    90
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    91
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    92
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    93
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    94
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    95
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    96
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    97
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    98
              #'label:' 'Painter'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
    99
              #'bounds:' #(#Rectangle 0 0 391 170)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   100
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   101
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   102
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   103
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   104
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   105
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   106
                    #'name:' 'classLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   107
                    #'layout:' #(#AlignmentOrigin 45 0.11 51 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   108
                    #'label:' 'class:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   109
                    #'adjust:' #right
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   110
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   111
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   112
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   113
                    #'name:' 'selectorLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   114
                    #'layout:' #(#AlignmentOrigin 45 0.11 74 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   115
                    #'label:' 'selector:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   116
                    #'adjust:' #right
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   117
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   118
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   119
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   120
                    #'name:' 'methodNameField'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   121
                    #'layout:' #(#LayoutFrame 47 0.11 64 0 -5 1.0 86 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   122
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   123
                    #'model:' #methodNameChannel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   124
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   125
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   126
                    #'name:' 'boxLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   127
                    #'layout:' #(#Point 5 10)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   128
                    #'label:' 'class & selector for code:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   129
                    #'adjust:' #left
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   130
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   131
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   132
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   133
                    #'name:' 'classNameField'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   134
                    #'layout:' #(#LayoutFrame 47 0.11 39 0 -5 1.0 61 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   135
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   136
                    #'model:' #classNameChannel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   137
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   138
                 #(#HorizontalPanelViewSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   139
                    #'name:' 'commitPanel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   140
                    #'layout:' #(#LayoutFrame 0 0.0 -24 1.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   141
                    #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   142
                     #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   143
                        #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   144
                         #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   145
                           #(#ActionButtonSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   146
                              #'name:' 'button1'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   147
                              #'label:' 'cancel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   148
                              #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   149
                              #'model:' #cancel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   150
                              #'extent:' #(#Point 191 24)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   151
                          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   152
                           #(#ActionButtonSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   153
                              #'name:' 'button2'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   154
                              #'label:' 'ok'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   155
                              #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   156
                              #'isDefault:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   157
                              #'model:' #accept
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   158
                              #'extent:' #(#Point 191 24)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   159
                          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   160
                        )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   161
                    )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   162
                    #'horizontalLayout:' #fitSpace
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   163
                    #'verticalLayout:' #fit
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   164
                    #'horizontalSpace:' 3
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   165
                    #'verticalSpace:' 3
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   166
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   167
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   168
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   169
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   170
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   171
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   172
classDefineSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   173
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   174
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   175
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   176
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   177
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   178
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   179
     UIPainter new openOnClass:MenuEditor andSelector:#classDefineSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   180
     MenuEditor new openInterface:#classDefineSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   181
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   182
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   183
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   184
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   185
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   186
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   187
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   188
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   189
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   190
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   191
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   192
              #'label:' 'Painter'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   193
              #'bounds:' #(#Rectangle 0 0 383 128)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   194
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   195
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   196
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   197
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   198
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   199
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   200
                    #'name:' 'classLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   201
                    #'layout:' #(#AlignmentOrigin 45 0.11 51 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   202
                    #'label:' 'class:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   203
                    #'adjust:' #right
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   204
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   205
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   206
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   207
                    #'name:' 'boxLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   208
                    #'layout:' #(#Point 5 10)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   209
                    #'label:' 'class for code:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   210
                    #'adjust:' #left
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   211
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   212
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   213
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   214
                    #'name:' 'classNameField'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   215
                    #'layout:' #(#LayoutFrame 47 0.11 39 0 -5 1.0 61 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   216
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   217
                    #'model:' #classNameChannel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   218
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   219
                 #(#HorizontalPanelViewSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   220
                    #'name:' 'commitPanel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   221
                    #'layout:' #(#LayoutFrame 0 0.0 -24 1.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   222
                    #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   223
                     #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   224
                        #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   225
                         #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   226
                           #(#ActionButtonSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   227
                              #'name:' 'button1'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   228
                              #'label:' 'cancel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   229
                              #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   230
                              #'model:' #cancel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   231
                              #'extent:' #(#Point 187 24)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   232
                          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   233
                           #(#ActionButtonSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   234
                              #'name:' 'button2'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   235
                              #'label:' 'ok'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   236
                              #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   237
                              #'isDefault:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   238
                              #'model:' #accept
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   239
                              #'extent:' #(#Point 187 24)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   240
                          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   241
                        )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   242
                    )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   243
                    #'horizontalLayout:' #fitSpace
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   244
                    #'verticalLayout:' #fit
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   245
                    #'horizontalSpace:' 3
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   246
                    #'verticalSpace:' 3
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   247
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   248
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   249
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   250
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   251
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   252
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   253
menuPullDown
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   254
    "this window spec was automatically generated by the ST/X MenuEditor"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   255
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   256
    "do not manually edit this - the builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   257
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   258
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   259
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   260
     MenuEditor new openOnClass:MenuEditor andSelector:#menuPullDown
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   261
     (Menu new fromLiteralArrayEncoding:(MenuEditor menuPullDown)) startUp
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   262
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   263
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   264
    <resource: #menu>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   265
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   266
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   267
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   268
       #(#Menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   269
          
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   270
           #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   271
             #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   272
                #'label:' 'file'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   273
                #'value:' #file
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   274
                #'submenu:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   275
                 #(#Menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   276
                    
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   277
                     #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   278
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   279
                          #'label:' 'new'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   280
                          #'value:' #doNew
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   281
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   282
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   283
                          #'label:' 'from class ...'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   284
                          #'value:' #doFromClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   285
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   286
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   287
                          #'label:' 'pick a menu'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   288
                          #'value:' #doPickAMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   289
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   290
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   291
                          #'label:' '='
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   292
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   293
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   294
                          #'label:' 'quit'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   295
                          #'value:' #closeRequest
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   296
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   297
                    ) nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   298
                    nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   299
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   300
            )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   301
             #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   302
                #'label:' 'code'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   303
                #'value:' #code
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   304
                #'submenu:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   305
                 #(#Menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   306
                    
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   307
                     #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   308
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   309
                          #'label:' 'class'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   310
                          #'value:' #doDefineClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   311
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   312
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   313
                          #'label:' '-'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   314
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   315
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   316
                          #'label:' 'install window spec.'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   317
                          #'value:' #doInstallSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   318
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   319
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   320
                          #'label:' 'install help spec.'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   321
                          #'value:' #doInstallHelp
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   322
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   323
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   324
                          #'label:' '='
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   325
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   326
                       #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   327
                          #'label:' 'browse application'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   328
                          #'value:' #doBrowseAppClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   329
                      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   330
                    ) nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   331
                    nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   332
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   333
            )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   334
             #(#MenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   335
                #'label:' 'test'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   336
                #'value:' #doTest
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   337
            )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   338
          ) nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   339
          nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   340
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   341
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   342
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   343
windowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   344
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   345
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   346
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   347
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   348
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   349
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   350
     UIPainter new openOnClass:MenuEditor andSelector:#windowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   351
     MenuEditor new openInterface:#windowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   352
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   353
    "MenuEditor open"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   354
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   355
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   356
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   357
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   358
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   359
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   360
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   361
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   362
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   363
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   364
              #'label:' 'Menu Builder'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   365
              #'bounds:' #(#Rectangle 0 0 580 384)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   366
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   367
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   368
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   369
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   370
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   371
                 #(#ArbitraryComponentSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   372
                    #'name:' 'painterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   373
                    #'layout:' #(#LayoutFrame 0 0.0 25 0.0 0 0.5 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   374
                    #'component:' #painter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   375
                    #'hasHorizontalScrollBar:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   376
                    #'hasVerticalScrollBar:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   377
                    #'hasBorder:' false
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   378
                    #'miniScrollerHorizontal:' false
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   379
                    #'miniScrollerVertical:' false
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   380
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   381
                 #(#NoteBookViewSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   382
                    #'name:' 'specificationView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   383
                    #'layout:' #(#LayoutFrame 0 0.5 25 0.0 0 1.0 -25 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   384
                    #'menu:' #tabList
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   385
                    #'model:' #tabModel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   386
                    #'tabWidget:' #Window
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   387
                    #'useIndex:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   388
                    #'canvas:' #tabCanvas
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   389
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   390
                 #(#HorizontalPanelViewSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   391
                    #'name:' 'confirmationPanel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   392
                    #'layout:' #(#LayoutFrame 0 0.5 -24 1.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   393
                    #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   394
                     #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   395
                        #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   396
                         #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   397
                           #(#ActionButtonSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   398
                              #'name:' 'cancelButton'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   399
                              #'label:' 'cancel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   400
                              #'model:' #cancel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   401
                              #'enableChannel:' #modifiedChannel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   402
                              #'extent:' #(#Point 140 24)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   403
                          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   404
                           #(#ActionButtonSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   405
                              #'name:' 'acceptButton'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   406
                              #'label:' 'ok'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   407
                              #'model:' #accept
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   408
                              #'enableChannel:' #modifiedChannel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   409
                              #'extent:' #(#Point 141 24)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   410
                          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   411
                        )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   412
                    )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   413
                    #'horizontalLayout:' #fitSpace
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   414
                    #'verticalLayout:' #fit
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   415
                    #'horizontalSpace:' 3
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   416
                    #'verticalSpace:' 3
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   417
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   418
                 #(#MenuPanelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   419
                    #'name:' 'pullDownMenu'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   420
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 24 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   421
                    #'menu:' #menuPullDown
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   422
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   423
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   424
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   425
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   426
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   427
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   428
!MenuEditor class methodsFor:'slices'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   429
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   430
slicesItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   431
    ^#(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   432
            (Basics     basicsItemSpec)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   433
            (Details    detailsEditSpec)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   434
            (Misc       miscEditSpec)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   435
            (Help       help)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   436
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   437
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   438
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   439
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   440
slicesMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   441
    ^#(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   442
            (Basics     basicsMenuSpec)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   443
            (Details    detailsEditSpec)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   444
            (Misc       miscEditSpec)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   445
            (Help       help)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   446
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   447
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   448
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   449
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   450
slicesRootMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   451
    ^#(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   452
            (Basics   basicsRootSpec)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   453
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   454
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   455
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   456
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   457
slicesSeperatorMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   458
    ^#(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   459
            (Basics   basicsSeperatorMenu)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   460
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   461
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   462
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   463
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   464
!MenuEditor class methodsFor:'specs'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   465
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   466
basicsItemSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   467
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   468
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   469
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   470
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   471
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   472
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   473
     UIPainter new openOnClass:MenuEditor andSelector:#basicsItemSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   474
     MenuEditor new openInterface:#basicsItemSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   475
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   476
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   477
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   478
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   479
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   480
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   481
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   482
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   483
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   484
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   485
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   486
              #'label:' 'unnamed canvas'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   487
              #'bounds:' #(#Rectangle 0 0 267 319)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   488
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   489
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   490
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   491
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   492
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   493
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   494
                    #'name:' 'nameKeyLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   495
                    #'layout:' #(#AlignmentOrigin 87 0 26 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   496
                    #'label:' 'NameKey:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   497
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   498
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   499
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   500
                    #'name:' 'itemNameKey'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   501
                    #'layout:' #(#LayoutFrame 91 0 15 0 -5 1.0 37 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   502
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   503
                    #'model:' #nameKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   504
                    #'type:' #symbolOrNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   505
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   506
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   507
                    #'name:' 'labelLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   508
                    #'layout:' #(#AlignmentOrigin 87 0 53 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   509
                    #'label:' 'Label'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   510
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   511
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   512
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   513
                    #'name:' 'itemLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   514
                    #'layout:' #(#LayoutFrame 91 0 42 0 -5 1.0 64 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   515
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   516
                    #'model:' #label
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   517
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   518
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   519
                    #'name:' 'valueLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   520
                    #'layout:' #(#AlignmentOrigin 87 0 79 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   521
                    #'label:' 'Value:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   522
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   523
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   524
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   525
                    #'name:' 'itemValue'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   526
                    #'layout:' #(#LayoutFrame 91 0 68 0 -5 1.0 90 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   527
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   528
                    #'model:' #value
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   529
                    #'type:' #symbolOrNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   530
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   531
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   532
                    #'name:' 'indicationLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   533
                    #'layout:' #(#AlignmentOrigin 87 0 139 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   534
                    #'label:' 'Indication:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   535
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   536
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   537
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   538
                    #'name:' 'indicationValue'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   539
                    #'layout:' #(#LayoutFrame 91 0 128 0 -5 1.0 150 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   540
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   541
                    #'model:' #indication
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   542
                    #'type:' #symbolOrNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   543
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   544
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   545
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   546
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   547
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   548
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   549
basicsMenuSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   550
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   551
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   552
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   553
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   554
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   555
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   556
     UIPainter new openOnClass:MenuEditor andSelector:#basicsMenuSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   557
     MenuEditor new openInterface:#basicsMenuSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   558
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   559
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   560
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   561
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   562
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   563
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   564
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   565
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   566
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   567
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   568
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   569
              #'label:' 'unnamed canvas'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   570
              #'bounds:' #(#Rectangle 0 0 267 319)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   571
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   572
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   573
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   574
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   575
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   576
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   577
                    #'name:' 'nameKeyLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   578
                    #'layout:' #(#AlignmentOrigin 87 0 26 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   579
                    #'label:' 'NameKey:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   580
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   581
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   582
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   583
                    #'name:' 'itemNameKey'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   584
                    #'layout:' #(#LayoutFrame 91 0 15 0 -5 1.0 37 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   585
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   586
                    #'model:' #nameKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   587
                    #'type:' #symbolOrNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   588
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   589
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   590
                    #'name:' 'labelLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   591
                    #'layout:' #(#AlignmentOrigin 87 0 53 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   592
                    #'label:' 'Label'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   593
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   594
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   595
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   596
                    #'name:' 'itemLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   597
                    #'layout:' #(#LayoutFrame 91 0 42 0 -5 1.0 64 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   598
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   599
                    #'model:' #label
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   600
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   601
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   602
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   603
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   604
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   605
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   606
basicsRootSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   607
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   608
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   609
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   610
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   611
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   612
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   613
     UIPainter new openOnClass:MenuEditor andSelector:#basicsRootSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   614
     MenuEditor new openInterface:#basicsRootSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   615
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   616
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   617
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   618
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   619
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   620
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   621
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   622
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   623
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   624
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   625
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   626
              #'label:' 'unnamed canvas'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   627
              #'bounds:' #(#Rectangle 0 0 267 319)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   628
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   629
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   630
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   631
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   632
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   633
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   634
                    #'name:' 'selectorLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   635
                    #'layout:' #(#AlignmentOrigin 78 0 53 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   636
                    #'label:' 'Selector:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   637
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   638
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   639
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   640
                    #'name:' 'selector'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   641
                    #'layout:' #(#LayoutFrame 82 0 42 0 -14 1.0 64 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   642
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   643
                    #'model:' #label
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   644
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   645
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   646
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   647
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   648
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   649
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   650
basicsSeperatorMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   651
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   652
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   653
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   654
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   655
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   656
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   657
     UIPainter new openOnClass:MenuEditor andSelector:#basicsSeperatorMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   658
     MenuEditor new openInterface:#basicsSeperatorMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   659
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   660
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   661
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   662
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   663
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   664
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   665
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   666
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   667
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   668
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   669
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   670
              #'label:' 'unnamed canvas'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   671
              #'bounds:' #(#Rectangle 0 0 267 319)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   672
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   673
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   674
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   675
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   676
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   677
                 #(#CheckBoxSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   678
                    #'name:' 'seperator'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   679
                    #'layout:' #(#AlignmentOrigin 19 0 48 0 0 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   680
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   681
                    #'model:' #doubleSeperator
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   682
                    #'label:' 'Double Seperator'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   683
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   684
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   685
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   686
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   687
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   688
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   689
detailsEditSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   690
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   691
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   692
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   693
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   694
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   695
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   696
     UIPainter new openOnClass:MenuEditor andSelector:#detailsEditSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   697
     MenuEditor new openInterface:#detailsEditSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   698
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   699
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   700
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   701
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   702
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   703
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   704
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   705
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   706
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   707
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   708
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   709
              #'label:' 'unnamed canvas'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   710
              #'bounds:' #(#Rectangle 0 0 259 288)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   711
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   712
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   713
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   714
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   715
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   716
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   717
                    #'name:' 'enabledLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   718
                    #'layout:' #(#AlignmentOrigin 87 0 59 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   719
                    #'label:' 'Enabled:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   720
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   721
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   722
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   723
                    #'name:' 'enabled'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   724
                    #'layout:' #(#LayoutFrame 91 0 48 0 -5 1.0 70 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   725
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   726
                    #'model:' #enabled
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   727
                    #'type:' #symbolOrNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   728
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   729
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   730
                    #'name:' 'shortcutKeyLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   731
                    #'layout:' #(#AlignmentOrigin 87 0 33 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   732
                    #'label:' 'Accelerator:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   733
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   734
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   735
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   736
                    #'name:' 'accelerator'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   737
                    #'layout:' #(#LayoutFrame 91 0 22 0 -5 1.0 44 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   738
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   739
                    #'model:' #shortcutKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   740
                    #'type:' #symbolOrNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   741
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   742
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   743
                    #'name:' 'accessCharPosLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   744
                    #'layout:' #(#AlignmentOrigin 181 0 127 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   745
                    #'label:' 'Access Character Position:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   746
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   747
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   748
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   749
                    #'name:' 'accessCharaterPos'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   750
                    #'layout:' #(#LayoutFrame 184 0 116 0 -5 1.0 138 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   751
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   752
                    #'model:' #accessCharaterPos
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   753
                    #'type:' #numberOrNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   754
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   755
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   756
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   757
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   758
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   759
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   760
miscEditSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   761
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   762
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   763
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   764
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   765
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   766
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   767
     UIPainter new openOnClass:MenuEditor andSelector:#miscEditSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   768
     MenuEditor new openInterface:#miscEditSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   769
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   770
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   771
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   772
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   773
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   774
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   775
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   776
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   777
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   778
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   779
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   780
              #'label:' 'unnamed canvas'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   781
              #'bounds:' #(#Rectangle 0 0 245 142)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   782
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   783
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   784
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   785
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   786
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   787
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   788
                    #'name:' 'retrieverLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   789
                    #'layout:' #(#AlignmentOrigin 77 0 26 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   790
                    #'label:' 'Retriever:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   791
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   792
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   793
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   794
                    #'name:' 'retriever'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   795
                    #'layout:' #(#LayoutFrame 81 0 15 0 -8 1.0 37 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   796
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   797
                    #'model:' #retriever
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   798
                    #'type:' #symbolOrNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   799
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   800
                 #(#LabelSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   801
                    #'name:' 'iconLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   802
                    #'layout:' #(#AlignmentOrigin 77 0 50 0 1 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   803
                    #'label:' 'Icon:'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   804
                    #'resizeForLabel:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   805
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   806
                 #(#InputFieldSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   807
                    #'name:' 'icon'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   808
                    #'layout:' #(#LayoutFrame 81 0 39 0 -8 1.0 61 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   809
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   810
                    #'model:' #icon
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   811
                    #'type:' #symbolOrNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   812
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   813
                 #(#CheckBoxSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   814
                    #'name:' 'iconAndLabel'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   815
                    #'layout:' #(#AlignmentOrigin 15 0 100 0 0 0.5)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   816
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   817
                    #'model:' #iconAndLabel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   818
                    #'label:' 'Icon & Label'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   819
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   820
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   821
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   822
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   823
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   824
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   825
seperatorSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   826
    "this window spec was automatically generated by the ST/X UIPainter"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   827
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   828
    "do not manually edit this - the painter/builder may not be able to
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   829
     handle the specification if its corrupted."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   830
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   831
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   832
     UIPainter new openOnClass:MenuEditor andSelector:#seperatorSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   833
     MenuEditor new openInterface:#seperatorSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   834
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   835
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   836
    <resource: #canvas>
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   837
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   838
    ^
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   839
     
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   840
       #(#FullSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   841
          #'window:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   842
           #(#WindowSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   843
              #'name:' 'uIPainterView'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   844
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   845
              #'label:' 'unnamed canvas'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   846
              #'bounds:' #(#Rectangle 0 0 267 319)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   847
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   848
          #'component:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   849
           #(#SpecCollection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   850
              #'collection:' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   851
               #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   852
                 #(#CheckBoxSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   853
                    #'name:' 'seperator'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   854
                    #'layout:' #(#AlignmentOrigin 19 0 48 0 0 0)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   855
                    #'tabable:' true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   856
                    #'model:' #doubleSeperator
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   857
                    #'label:' 'Double Seperator'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   858
                )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   859
              )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   860
          )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   861
      )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   862
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   863
209
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   864
!MenuEditor class methodsFor:'startup'!
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   865
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
   866
openModalOnClass:aClass andSelector:aSelector
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
   867
    ^ self new openModalOnClass:aClass andSelector:aSelector
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
   868
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
   869
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
   870
!
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
   871
209
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   872
openOnClass:aClass andSelector:aSelector
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   873
    ^ self new openOnClass:aClass andSelector:aSelector
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   874
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   875
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   876
! !
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   877
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   878
!MenuEditor methodsFor:'accessing'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   879
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   880
specClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   881
    ^ specClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   882
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   883
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   884
specClass:aClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   885
    aClass isBehavior ifTrue:[specClass := aClass name]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   886
                     ifFalse:[specClass := aClass].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   887
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   888
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   889
!MenuEditor methodsFor:'actions'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   890
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   891
accept
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   892
    "automatically generated by UIPainter ..."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   893
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   894
    |node cont|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   895
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   896
    node := self painter selectedNode.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   897
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   898
    node notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   899
        self isHelpToolSelected ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   900
            self helpTool accept
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   901
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   902
        cont := node contents buildFromAspects:aspects.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   903
        self painter selectedNodeChanged
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   904
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   905
    self modifiedChannel value:false.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   906
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   907
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   908
cancel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   909
    |node|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   910
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   911
    (node := self painter selectedNode) notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   912
        aspects do:[:anAspect| anAspect value:nil ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   913
        node contents toAspects:aspects.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   914
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   915
    self modifiedChannel value:false.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   916
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   917
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   918
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   919
!MenuEditor methodsFor:'aspects'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   920
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   921
aspectFor:aKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   922
    "returns aspect for a key or nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   923
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   924
  ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   925
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   926
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   927
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   928
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   929
menuPullDown
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   930
    |menu|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   931
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   932
    menu := Menu new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   933
    menu fromLiteralArrayEncoding:(self class menuPullDown).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   934
    menu receiver:self.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   935
  ^ menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   936
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   937
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   938
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   939
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   940
modifiedChannel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   941
    "automatically generated by UIPainter ..."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   942
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   943
    |holder|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   944
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   945
    (holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   946
        builder aspectAt:#modifiedChannel put:(holder :=  false asValue).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   947
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   948
    ^ holder
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   949
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   950
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   951
tabCanvas
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   952
    "automatically generated by UIPainter ..."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   953
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   954
    |holder|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   955
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   956
    (holder := builder bindingAt:#tabCanvas) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   957
        builder aspectAt:#tabCanvas put:(holder :=  SubCanvas new).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   958
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   959
    ^ holder
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   960
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   961
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   962
tabList
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   963
    "automatically generated by UIPainter ..."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   964
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   965
    |holder|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   966
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   967
    (holder := builder bindingAt:#tabList) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   968
        builder aspectAt:#tabList put:(holder := ValueHolder new)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   969
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   970
    ^ holder
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   971
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   972
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   973
tabModel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   974
    "automatically generated by UIPainter ..."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   975
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   976
    |holder|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   977
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   978
    (holder := builder bindingAt:#tabModel) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   979
        holder := AspectAdaptor new subject:self; forAspect:#tabSelection.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   980
        builder aspectAt:#tabModel put:holder.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   981
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   982
    ^ holder
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   983
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   984
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   985
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   986
!MenuEditor methodsFor:'change & update'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   987
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   988
update:something with:aParameter from:changedObject
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   989
    "one of my models changed its value
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   990
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   991
    self modifiedChannel value:true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   992
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   993
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   994
!MenuEditor methodsFor:'queries'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   995
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   996
isHelpToolSelected
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   997
    "returns true if current selection is help tool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   998
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   999
    (slices notNil and:[tabSelection notNil]) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1000
        ^ (slices at:tabSelection) last == #help
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1001
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1002
  ^ false
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1003
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1004
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1005
!MenuEditor methodsFor:'selection'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1006
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1007
menuChanged
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1008
    |node item slc sel|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1009
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1010
    (node := self painter selectedNode) notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1011
        aspects do:[:anAspect| anAspect value:nil ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1012
        item := node contents.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1013
        item toAspects:aspects.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1014
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1015
        item isSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1016
            node parent isNil ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1017
                node hasChildren ifTrue:[slc := #slicesMenu]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1018
                                ifFalse:[slc := #slicesItem].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1019
            ] ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1020
                slc := #slicesRootMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1021
            ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1022
        ] ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1023
            slc := #slicesSeperatorMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1024
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1025
        slc := self class perform:slc.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1026
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1027
    self modifiedChannel value:false.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1028
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1029
    slc ~= slices  ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1030
        (slices := slc) notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1031
            tabSelection notNil ifTrue:[sel := tabSelection min:(slices size)]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1032
                               ifFalse:[sel := 1].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1033
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1034
            self tabList value:(slices collect:[:s| s first]).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1035
            self tabModel setValue:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1036
            self tabModel value:sel.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1037
        ] ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1038
            self tabList value:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1039
            self tabSelection:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1040
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1041
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1042
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1043
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1044
tabSelection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1045
    ^ tabSelection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1046
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1047
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1048
tabSelection:aSelection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1049
    |tool sel|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1050
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1051
    tabSelection == aSelection ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1052
        ^ self
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1053
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1054
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1055
    (tabSelection := aSelection) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1056
      ^ self tabCanvas client:nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1057
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1058
    self isHelpToolSelected ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1059
        self tabCanvas client:(tool := self helpTool).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1060
        tool model:(self aspectFor:#activeHelpKey)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1061
    ] ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1062
        sel := (slices at:tabSelection) last.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1063
        self tabCanvas client:self spec:(self class perform:sel) builder:builder
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1064
    ]    
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1065
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1066
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1067
!MenuEditor methodsFor:'startup / release'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1068
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1069
buildFrom:aClass andSelector:aSelector
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1070
    |oldClass newClass|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1071
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1072
    oldClass := self specClass.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1073
    self specClass:aClass.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1074
    newClass := self specClass.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1075
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1076
    oldClass ~= newClass ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1077
        self helpTool helpSpecFrom:newClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1078
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1079
    self painter buildFrom:newClass andSelector:aSelector.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1080
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1081
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1082
initialize
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1083
    "initialize channels
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1084
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1085
    super initialize.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1086
    aspects := IdentityDictionary new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1087
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1088
    #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1089
        label
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1090
        accessCharaterPos
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1091
        activeHelpKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1092
        enabled
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1093
        value
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1094
        nameKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1095
        indication
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1096
        shortcutKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1097
        doubleSeperator
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1098
        retriever
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1099
        iconAndLabel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1100
        icon
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1101
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1102
     ) do:[:aKey||holder|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1103
        holder := ValueHolder new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1104
        holder addDependent:self.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1105
        aspects at:aKey put:holder.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1106
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1107
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1108
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1109
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1110
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1111
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1112
openModalOnClass:aClass andSelector:aSelector
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1113
    specClass := Association key:aClass value:aSelector.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1114
    super openInterfaceModal.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1115
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1116
!
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1117
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1118
openOnClass:aClass andSelector:aSelector
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1119
    specClass := Association key:aClass value:aSelector.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1120
    super openInterface.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1121
    self buildFrom:aClass andSelector:aSelector.
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1122
209
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
  1123
!
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
  1124
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
  1125
postBuildWith:builder
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1126
    |cls sel|
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1127
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1128
    specClass isAssociation ifTrue:[
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1129
        cls := specClass key.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1130
        sel := specClass value.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1131
    ].
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1132
    specClass := nil.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1133
    self buildFrom:cls andSelector:sel.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1134
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1135
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1136
!MenuEditor methodsFor:'user interactions'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1137
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1138
doBrowseAppClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1139
    "open a browser on the class"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1140
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1141
    |cls|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1142
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1143
    (cls := self specClass) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1144
        ^ self information:'no class yet'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1145
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1146
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1147
    cls isBehavior ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1148
        (cls := Smalltalk at:cls asSymbol) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1149
            ^ self information:'no valid class defined'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1150
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1151
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1152
    SystemBrowser openInClass:cls
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1153
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1154
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1155
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1156
doDefineClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1157
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1158
    aspects at:#classNameChannel  put:(self specClass asValue).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1159
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1160
    (self openDialogInterface:#classDefineSpec) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1161
        self specClass:((aspects at:#classNameChannel) value)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1162
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1163
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1164
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1165
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1166
doFromClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1167
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1168
    aspects at:#classNameChannel  put:(self specClass asValue).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1169
    aspects at:#methodNameChannel put:(self painter selectorName asValue).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1170
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1171
    (self openDialogInterface:#classAndMethodSpec) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1172
        self buildFrom:(aspects at:#classNameChannel) value
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1173
           andSelector:(aspects at:#methodNameChannel) value
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1174
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1175
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1176
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1177
doInstallHelp
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1178
    "install help text
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1179
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1180
    self helpTool installHelpSpecInto:(self specClass)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1181
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1182
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1183
doInstallSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1184
    |cls selector painter menu spec mthd category code|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1185
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1186
    (cls := self specClass) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1187
        ^ self information:'no class yet'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1188
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1189
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1190
    cls isBehavior ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1191
        (cls := Smalltalk at:cls asSymbol) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1192
            ^ self information:'no valid class defined'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1193
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1194
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1195
    painter  := self painter.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1196
    selector := painter selectorName.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1197
    menu     := painter asMenu.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1198
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1199
    menu isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1200
        ^ self information:'no menu defined'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1201
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1202
    menu := menu literalArrayEncoding.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1203
    spec := WriteStream on:String new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1204
    UISpecification prettyPrintSpecArray:menu on:spec indent:5.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1205
    spec := spec contents.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1206
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1207
    "/ if that method already exists, do not overwrite the category
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1208
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1209
    category := 'interface specs'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1210
    (mthd := cls class compiledMethodAt:selector) notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1211
        category := mthd category.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1212
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1213
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1214
    code := Character excla asString 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1215
            , cls name , ' class methodsFor:' , category storeString
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1216
            , Character excla asString , '\\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1217
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1218
            , selector , '\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1219
            , '    "this window spec was automatically generated by the ST/X MenuEditor"\\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1220
            , '    "do not manually edit this - the builder may not be able to\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1221
            , '     handle the specification if its corrupted."\\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1222
            , '    "\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1223
            , '     MenuEditor new openOnClass:' , cls name , ' andSelector:#' , selector , '\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1224
            , '     (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , selector , ')) startUp\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1225
            , '    "\'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1226
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1227
    code := code 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1228
            , '\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1229
            , '    <resource: #menu>\\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1230
            , '    ^\' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1231
            , '     ', spec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1232
            , '\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1233
            , Character excla asString
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1234
            , ' '
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1235
            , Character excla asString
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1236
            , '\\'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1237
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1238
    code := code withCRs.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1239
    (ReadStream on:code) fileIn.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1240
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1241
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1242
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1243
doNew
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1244
    self buildFrom:nil andSelector:(self painter selectorName)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1245
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1246
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1247
doPickAMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1248
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1249
    |menu|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1250
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1251
    menu := Screen current viewFromUser.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1252
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1253
    (menu isNil or:[menu == Screen current rootView]) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1254
        ^ self
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1255
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1256
    (menu isKindOf:MenuPanel) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1257
        ^ self painter buildFromMenu:(menu asMenu)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1258
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1259
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1260
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1261
doTest
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1262
    "open current editing menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1263
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1264
    |menu value|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1265
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1266
    menu := self painter asMenu.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1267
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1268
    menu notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1269
        menu receiver:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1270
        value := menu startUp.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1271
        Transcript showCR:'result from test: ', value printString
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1272
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1273
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1274
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1275
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1276
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1277
!MenuEditor methodsFor:'values'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1278
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1279
helpTool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1280
    |tool|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1281
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1282
    (tool := builder bindingAt:#helpTool) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1283
        tool := UIHelpTool new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1284
        tool masterApplication:self.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1285
        builder aspectAt:#helpTool put:tool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1286
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1287
  ^ tool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1288
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1289
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1290
painter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1291
    "automatically generated by UIPainter ..."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1292
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1293
    |painter|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1294
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1295
    (painter := builder bindingAt:#painter) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1296
        painter := Painter new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1297
        painter action:[:dummy| self menuChanged ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1298
        builder aspectAt:#painter put:painter.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1299
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1300
  ^ painter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1301
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1302
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1303
!MenuEditor::Item class methodsFor:'documentation'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1304
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1305
documentation
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1306
"
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1307
    implements the contents assigned to a TreeItem. An instance
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1308
    is associated with one item and keeps all its information
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1309
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1310
    [see also:]
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1311
        TreeItem
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1312
        MenuEditor
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1313
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1314
    [author:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1315
        Claus Atzkern
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1316
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1317
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1318
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1319
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1320
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1321
!MenuEditor::Item methodsFor:'accessing'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1322
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1323
label
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1324
    "return the value of the instance variable 'label' (automatically generated)"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1325
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1326
    ^ label!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1327
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1328
label:something
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1329
    "set the value of the instance variable 'label' (automatically generated)"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1330
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1331
    label := something.! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1332
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1333
!MenuEditor::Item methodsFor:'conversion'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1334
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1335
asMenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1336
    "converts self to a menu item
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1337
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1338
    |item rcv|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1339
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1340
    item := MenuItem labeled:(label ? '-').
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1341
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1342
    self isSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1343
        item activeHelpKey:activeHelpKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1344
        item enabled:enabled.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1345
        item accessCharacterPosition:accessCharaterPos.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1346
        item nameKey:nameKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1347
        item shortcutKeyCharacter:shortcutKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1348
        item value:value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1349
        item indication:indication.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1350
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1351
        icon notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1352
            rcv := ResourceRetriever new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1353
            rcv className:retriever.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1354
            rcv selector:icon.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1355
            iconAndLabel == true ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1356
                rcv labelText:label
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1357
            ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1358
            item labelImage:rcv
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1359
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1360
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1361
  ^ item.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1362
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1363
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1364
buildFromAspects:aspects
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1365
    |name|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1366
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1367
    self isSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1368
        name  := label.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1369
        label := (aspects at:#label) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1370
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1371
        self isSeperator ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1372
            (aspects at:#label) value:(label := name)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1373
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1374
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1375
        activeHelpKey       := (aspects at:#activeHelpKey) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1376
        enabled             := (aspects at:#enabled) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1377
        value               := (aspects at:#value) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1378
        nameKey             := (aspects at:#nameKey) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1379
        indication          := (aspects at:#indication) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1380
        shortcutKey         := (aspects at:#shortcutKey) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1381
        accessCharaterPos   := (aspects at:#accessCharaterPos) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1382
        retriever           := (aspects at:#retriever) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1383
        icon                := (aspects at:#icon) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1384
        iconAndLabel        := (aspects at:#iconAndLabel) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1385
    ] ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1386
        (aspects at:#doubleSeperator) value ifTrue:[label := '=']
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1387
                                           ifFalse:[label := nil].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1388
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1389
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1390
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1391
buildFromMenuItem:anItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1392
    |rtv|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1393
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1394
    label               := anItem label.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1395
    activeHelpKey       := anItem activeHelpKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1396
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1397
    (enabled := anItem enabled) isSymbol ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1398
        enabled := nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1399
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1400
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1401
    (value := anItem value) isSymbol ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1402
        value := nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1403
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1404
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1405
    (indication := anItem indication) isSymbol ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1406
        indication := nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1407
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1408
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1409
    nameKey           := anItem nameKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1410
    shortcutKey       := anItem shortcutKeyCharacter.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1411
    accessCharaterPos := anItem accessCharacterPosition.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1412
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1413
    (    ((rtv := anItem adornment) notNil)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1414
     and:[(rtv := rtv labelImage) isKindOf:ResourceRetriever]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1415
    ) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1416
        retriever := rtv className.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1417
        icon      := rtv selector.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1418
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1419
        (iconAndLabel := rtv labelText notNil) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1420
            label := rtv labelText.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1421
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1422
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1423
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1424
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1425
toAspects:aspects
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1426
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1427
    self isSeperator ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1428
        (aspects at:#doubleSeperator) value:(label notNil).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1429
    ] ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1430
        (aspects at:#label)                 value:label.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1431
        (aspects at:#activeHelpKey)         value:activeHelpKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1432
        (aspects at:#enabled)               value:enabled.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1433
        (aspects at:#value)                 value:value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1434
        (aspects at:#nameKey)               value:nameKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1435
        (aspects at:#indication)            value:indication.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1436
        (aspects at:#shortcutKey)           value:shortcutKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1437
        (aspects at:#accessCharaterPos)     value:accessCharaterPos.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1438
        (aspects at:#retriever)             value:retriever.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1439
        (aspects at:#icon)                  value:icon.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1440
        (aspects at:#iconAndLabel)          value:iconAndLabel.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1441
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1442
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1443
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1444
!MenuEditor::Item methodsFor:'queries'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1445
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1446
isSeperator
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1447
    |c|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1448
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1449
    label size > 1 ifTrue:[^ false].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1450
    label size == 1 ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1451
        (c := label first) == $= ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1452
            ^ true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1453
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1454
        c == $- ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1455
            ^ false
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1456
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1457
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1458
    label := nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1459
  ^ true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1460
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1461
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1462
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1463
isSimpleSeperator
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1464
    ^ label isNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1465
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1466
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1467
!MenuEditor::Painter class methodsFor:'defaults'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1468
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1469
defaultMenuMessage   
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1470
    "This message is the default yo be sent to the menuHolder to get a menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1471
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1472
    ^ #menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1473
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1474
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1475
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1476
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1477
!MenuEditor::Painter class methodsFor:'documentation'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1478
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1479
documentation
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1480
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1481
    menu selection list
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1482
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1483
    [see also:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1484
        SelectionInTreeView
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1485
        SelectionInTree
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1486
        TreeItem
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1487
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1488
    [author:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1489
        Claus Atzkern
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1490
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1491
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1492
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1493
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1494
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1495
!MenuEditor::Painter methodsFor:'accessing'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1496
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1497
root
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1498
    ^ listOfNodes first
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1499
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1500
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1501
selectorName
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1502
    ^ (listOfNodes first contents label) asSymbol
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1503
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1504
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1505
!MenuEditor::Painter methodsFor:'building'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1506
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1507
buildFrom:aClass andSelector:aSelector
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1508
    |spec cls menu node|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1509
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1510
    (aClass notNil and:[aSelector notNil]) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1511
        aClass isBehavior ifFalse:[cls := Smalltalk at:aClass asSymbol]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1512
                           ifTrue:[cls := aClass].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1513
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1514
        (cls respondsTo:aSelector) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1515
            spec := cls perform:aSelector
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1516
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1517
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1518
    spec isNil ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1519
        menu := Menu new fromLiteralArrayEncoding:spec.
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1520
        node := self nodeLabel:(aSelector asString).
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1521
        self subMenu:menu parent:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1522
    ] ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1523
        aSelector notNil ifTrue:[cls := aSelector asString]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1524
                        ifFalse:[cls := 'menu'].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1525
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1526
        node := self nodeLabel:cls.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1527
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1528
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1529
    node hasChildren ifFalse:[
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1530
        node add:(self nodeLabel:'undefined')
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1531
    ].
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1532
    node expand.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1533
    model root:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1534
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1535
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1536
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1537
buildFromMenu:aMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1538
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1539
    |spec cls node|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1540
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1541
    node := self nodeLabel:'menu'.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1542
    self subMenu:aMenu parent:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1543
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1544
    node hasChildren ifFalse:[
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1545
        node add:(self nodeLabel:'undefined')
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1546
    ].
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1547
    node expand.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1548
    model root:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1549
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1550
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1551
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1552
menuItem:anItem
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1553
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1554
    |level node submenu grp ctr sep|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1555
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1556
    node := self nodeLabel:(anItem label).
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1557
    node contents buildFromMenuItem:anItem.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1558
    node name:(node contents label).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1559
    self subMenu:(anItem submenu) parent:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1560
  ^ node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1561
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1562
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1563
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1564
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1565
subMenu:aMenu parent:aParent
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1566
    |idx grp|
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1567
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1568
    aMenu isNil ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1569
        grp := aMenu groupSizes.
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1570
        aMenu itemsDo:[:i| aParent add:(self menuItem:i)].
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1571
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1572
        grp notNil ifTrue:[
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1573
            idx := 0.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1574
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1575
            grp do:[:i|
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1576
                idx := idx + i + 1.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1577
                aParent add:(self nodeLabel:nil) beforeIndex:idx.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1578
            ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1579
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1580
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1581
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1582
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1583
!MenuEditor::Painter methodsFor:'conversion'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1584
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1585
asMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1586
    |menu root|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1587
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1588
    root := self root.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1589
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1590
    root hasChildren ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1591
        menu := Menu new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1592
        root children do:[:aChild| menu addItem:(self asMenuItem:aChild)].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1593
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1594
  ^ menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1595
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1596
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1597
asMenuItem:aNode
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1598
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1599
    |menu item|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1600
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1601
    item := aNode contents asMenuItem.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1602
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1603
    aNode hasChildren ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1604
        menu := Menu new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1605
        aNode children do:[:aChild| menu addItem:(self asMenuItem:aChild)].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1606
        item submenu:menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1607
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1608
  ^ item
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1609
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1610
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1611
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1612
!MenuEditor::Painter methodsFor:'drawing basics'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1613
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1614
drawLabelIndex:anIndex atX:x y:yCenter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1615
    "draw text label assigned to a node at x y( center)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1616
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1617
    |y w item|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1618
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1619
    item := (listOfNodes at:anIndex) contents.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1620
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1621
    item isSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1622
        ^ super drawLabelIndex:anIndex atX:x y:yCenter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1623
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1624
    self displayLineFromX:x y:yCenter toX:(x + 80) y:yCenter.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1625
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1626
    item isSimpleSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1627
        self displayLineFromX:x y:(yCenter + 2) toX:(x + 80) y:(yCenter + 2).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1628
    ]    
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1629
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1630
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1631
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1632
!MenuEditor::Painter methodsFor:'initialization'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1633
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1634
initialize
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1635
    super initialize.
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1636
    self multipleSelectOk:true.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1637
    self model:(SelectionInTree new).
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1638
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1639
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1640
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1641
!MenuEditor::Painter methodsFor:'menus'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1642
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1643
doCopy
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1644
    self hasSelection ifTrue:[
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1645
        CopyBuffer := OrderedCollection new.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1646
        self selectionDo:[:i| CopyBuffer add:((listOfNodes at:i) copy)]
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1647
    ]
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1648
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1649
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1650
doCreateItem
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1651
    self addElement:(self nodeLabel:'undefined')
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1652
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1653
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1654
doCreateMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1655
    |node|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1656
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1657
    node := self nodeLabel:'undefined'.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1658
    node add:(self nodeLabel:'undefined').
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1659
    self addElement:node
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1660
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1661
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1662
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1663
doCreateSep
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1664
    self addElement:(self nodeLabel:nil)
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1665
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1666
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1667
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1668
doCut
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1669
    self doCopy.
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1670
    model removeSelection.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1671
    self selection:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1672
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1673
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1674
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1675
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1676
doPaste
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1677
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1678
    (CopyBuffer notNil and:[self selectedNode notNil]) ifTrue:[
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1679
        self addElement:(CopyBuffer collect:[:el| el copy])
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1680
    ]
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1681
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1682
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1683
menu
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1684
    |menu subm sz inclRoot|
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1685
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1686
    (sz := self numberOfSelections) == 0 ifTrue:[
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1687
        ^ self
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1688
    ].
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1689
213
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1690
    inclRoot := self isInSelection:1.
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1691
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1692
    sz > 1 ifTrue:[
71b11a173f87 change model; supports multiple selection
ca
parents: 209
diff changeset
  1693
          inclRoot ifTrue:[^ nil ].
71b11a173f87 change model; supports multiple selection
ca
parents: 209