MenuEditor.st
author ca
Fri, 04 Jul 1997 20:44:11 +0200
changeset 209 b2fa6f8d4808
parent 199 6ce84c1270a6
child 213 71b11a173f87
permissions -rw-r--r--
postBuildWith:builder
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
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   866
openOnClass:aClass andSelector:aSelector
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   867
    ^ self new openOnClass:aClass andSelector:aSelector
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   868
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   869
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   870
! !
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
   871
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   872
!MenuEditor methodsFor:'accessing'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   873
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   874
specClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   875
    ^ specClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   876
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   877
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   878
specClass:aClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   879
    aClass isBehavior ifTrue:[specClass := aClass name]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   880
                     ifFalse:[specClass := aClass].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   881
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   882
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   883
!MenuEditor methodsFor:'actions'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   884
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   885
accept
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   886
    "automatically generated by UIPainter ..."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   887
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   888
    |node cont|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   889
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   890
    node := self painter selectedNode.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   891
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   892
    node notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   893
        self isHelpToolSelected ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   894
            self helpTool accept
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   895
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   896
        cont := node contents buildFromAspects:aspects.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   897
        self painter selectedNodeChanged
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   898
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   899
    self modifiedChannel value:false.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   900
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   901
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   902
cancel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   903
    |node|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   904
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   905
    (node := self painter selectedNode) notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   906
        aspects do:[:anAspect| anAspect value:nil ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   907
        node contents toAspects:aspects.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   908
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   909
    self modifiedChannel value:false.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   910
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   911
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   912
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   913
!MenuEditor methodsFor:'aspects'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   914
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   915
aspectFor:aKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   916
    "returns aspect for a key or nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   917
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   918
  ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   919
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   920
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   921
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   922
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   923
menuPullDown
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   924
    |menu|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   925
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   926
    menu := Menu new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   927
    menu fromLiteralArrayEncoding:(self class menuPullDown).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   928
    menu receiver:self.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   929
  ^ menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   930
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   931
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   932
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   933
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   934
modifiedChannel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   935
    "automatically generated by UIPainter ..."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   936
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   937
    |holder|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   938
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   939
    (holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   940
        builder aspectAt:#modifiedChannel put:(holder :=  false asValue).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   941
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   942
    ^ holder
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   943
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   944
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   945
tabCanvas
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   946
    "automatically generated by UIPainter ..."
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
    (holder := builder bindingAt:#tabCanvas) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   951
        builder aspectAt:#tabCanvas put:(holder :=  SubCanvas new).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   952
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   953
    ^ holder
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   954
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   955
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   956
tabList
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   957
    "automatically generated by UIPainter ..."
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
    (holder := builder bindingAt:#tabList) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   962
        builder aspectAt:#tabList put:(holder := ValueHolder new)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   963
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   964
    ^ holder
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   965
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   966
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   967
tabModel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   968
    "automatically generated by UIPainter ..."
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
    (holder := builder bindingAt:#tabModel) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   973
        holder := AspectAdaptor new subject:self; forAspect:#tabSelection.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   974
        builder aspectAt:#tabModel put:holder.
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
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   979
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   980
!MenuEditor methodsFor:'change & update'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   981
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   982
update:something with:aParameter from:changedObject
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   983
    "one of my models changed its value
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   984
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   985
    self modifiedChannel value:true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   986
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   987
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   988
!MenuEditor methodsFor:'queries'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   989
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   990
isHelpToolSelected
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   991
    "returns true if current selection is help tool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   992
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   993
    (slices notNil and:[tabSelection notNil]) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   994
        ^ (slices at:tabSelection) last == #help
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   995
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   996
  ^ false
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   997
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   998
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
   999
!MenuEditor methodsFor:'selection'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1000
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1001
menuChanged
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1002
    |node item slc sel|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1003
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1004
    (node := self painter selectedNode) notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1005
        aspects do:[:anAspect| anAspect value:nil ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1006
        item := node contents.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1007
        item toAspects:aspects.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1008
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1009
        item isSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1010
            node parent isNil ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1011
                node hasChildren ifTrue:[slc := #slicesMenu]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1012
                                ifFalse:[slc := #slicesItem].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1013
            ] ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1014
                slc := #slicesRootMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1015
            ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1016
        ] ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1017
            slc := #slicesSeperatorMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1018
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1019
        slc := self class perform:slc.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1020
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1021
    self modifiedChannel value:false.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1022
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1023
    slc ~= slices  ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1024
        (slices := slc) notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1025
            tabSelection notNil ifTrue:[sel := tabSelection min:(slices size)]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1026
                               ifFalse:[sel := 1].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1027
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1028
            self tabList value:(slices collect:[:s| s first]).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1029
            self tabModel setValue:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1030
            self tabModel value:sel.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1031
        ] ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1032
            self tabList value:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1033
            self tabSelection:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1034
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1035
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1036
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1037
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1038
tabSelection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1039
    ^ tabSelection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1040
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1041
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1042
tabSelection:aSelection
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1043
    |tool sel|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1044
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1045
    tabSelection == aSelection ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1046
        ^ self
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1047
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1048
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1049
    (tabSelection := aSelection) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1050
      ^ self tabCanvas client:nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1051
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1052
    self isHelpToolSelected ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1053
        self tabCanvas client:(tool := self helpTool).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1054
        tool model:(self aspectFor:#activeHelpKey)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1055
    ] ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1056
        sel := (slices at:tabSelection) last.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1057
        self tabCanvas client:self spec:(self class perform:sel) builder:builder
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1058
    ]    
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1059
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1060
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1061
!MenuEditor methodsFor:'startup / release'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1062
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1063
buildFrom:aClass andSelector:aSelector
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1064
    |oldClass newClass|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1065
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1066
    oldClass := self specClass.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1067
    self specClass:aClass.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1068
    newClass := self specClass.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1069
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1070
    oldClass ~= newClass ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1071
        self helpTool helpSpecFrom:newClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1072
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1073
    self painter buildFrom:newClass andSelector:aSelector.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1074
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1075
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1076
initialize
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1077
    "initialize channels
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1078
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1079
    super initialize.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1080
    aspects := IdentityDictionary new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1081
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1082
    #(
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1083
        label
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1084
        accessCharaterPos
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1085
        activeHelpKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1086
        enabled
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1087
        value
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1088
        nameKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1089
        indication
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1090
        shortcutKey
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1091
        doubleSeperator
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1092
        retriever
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1093
        iconAndLabel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1094
        icon
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1095
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1096
     ) do:[:aKey||holder|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1097
        holder := ValueHolder new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1098
        holder addDependent:self.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1099
        aspects at:aKey put:holder.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1100
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1101
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1102
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1103
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1104
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1105
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1106
openOnClass:aClass andSelector:aSelector
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1107
    super openInterface.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1108
    self buildFrom:aClass andSelector:aSelector.
209
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
  1109
!
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
  1110
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
  1111
postBuildWith:builder
b2fa6f8d4808 postBuildWith:builder
ca
parents: 199
diff changeset
  1112
    self buildFrom:nil andSelector:nil.
199
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1113
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1114
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1115
!MenuEditor methodsFor:'user interactions'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1116
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1117
doBrowseAppClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1118
    "open a browser on the class"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1119
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1120
    |cls|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1121
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1122
    (cls := self specClass) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1123
        ^ self information:'no class yet'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1124
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1125
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1126
    cls isBehavior ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1127
        (cls := Smalltalk at:cls asSymbol) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1128
            ^ self information:'no valid class defined'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1129
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1130
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1131
    SystemBrowser openInClass:cls
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1132
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1133
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1134
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1135
doDefineClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1136
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1137
    aspects at:#classNameChannel  put:(self specClass asValue).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1138
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1139
    (self openDialogInterface:#classDefineSpec) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1140
        self specClass:((aspects at:#classNameChannel) value)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1141
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1142
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1143
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1144
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1145
doFromClass
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1146
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1147
    aspects at:#classNameChannel  put:(self specClass asValue).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1148
    aspects at:#methodNameChannel put:(self painter selectorName asValue).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1149
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1150
    (self openDialogInterface:#classAndMethodSpec) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1151
        self buildFrom:(aspects at:#classNameChannel) value
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1152
           andSelector:(aspects at:#methodNameChannel) value
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
doInstallHelp
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1157
    "install help text
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1158
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1159
    self helpTool installHelpSpecInto:(self specClass)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1160
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1161
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1162
doInstallSpec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1163
    |cls selector painter menu spec mthd category code|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1164
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1165
    (cls := self specClass) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1166
        ^ self information:'no class yet'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1167
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1168
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1169
    cls isBehavior ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1170
        (cls := Smalltalk at:cls asSymbol) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1171
            ^ self information:'no valid class defined'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1172
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1173
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1174
    painter  := self painter.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1175
    selector := painter selectorName.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1176
    menu     := painter asMenu.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1177
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1178
    menu isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1179
        ^ self information:'no menu defined'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1180
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1181
    menu := menu literalArrayEncoding.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1182
    spec := WriteStream on:String new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1183
    UISpecification prettyPrintSpecArray:menu on:spec indent:5.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1184
    spec := spec contents.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1185
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1186
    "/ if that method already exists, do not overwrite the category
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1187
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1188
    category := 'interface specs'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1189
    (mthd := cls class compiledMethodAt:selector) notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1190
        category := mthd category.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1191
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1192
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1193
    code := Character excla asString 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1194
            , cls name , ' class methodsFor:' , category storeString
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1195
            , Character excla asString , '\\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1196
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1197
            , selector , '\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1198
            , '    "this window spec was automatically generated by the ST/X MenuEditor"\\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1199
            , '    "do not manually edit this - the builder may not be able to\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1200
            , '     handle the specification if its corrupted."\\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1201
            , '    "\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1202
            , '     MenuEditor new openOnClass:' , cls name , ' andSelector:#' , selector , '\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1203
            , '     (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , selector , ')) startUp\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1204
            , '    "\'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1205
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1206
    code := code 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1207
            , '\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1208
            , '    <resource: #menu>\\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1209
            , '    ^\' 
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1210
            , '     ', spec
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1211
            , '\'
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1212
            , Character excla asString
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1213
            , ' '
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1214
            , Character excla asString
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1215
            , '\\'.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1216
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1217
    code := code withCRs.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1218
    (ReadStream on:code) fileIn.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1219
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1220
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1221
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1222
doNew
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1223
    self buildFrom:nil andSelector:(self painter selectorName)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1224
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1225
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1226
doPickAMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1227
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1228
    |menu|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1229
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1230
    menu := Screen current viewFromUser.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1231
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1232
    (menu isNil or:[menu == Screen current rootView]) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1233
        ^ self
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1234
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1235
    (menu isKindOf:MenuPanel) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1236
        ^ self painter buildFromMenu:(menu asMenu)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1237
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1238
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1239
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1240
doTest
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1241
    "open current editing menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1242
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1243
    |menu value|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1244
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1245
    menu := self painter asMenu.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1246
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1247
    menu notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1248
        menu receiver:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1249
        value := menu startUp.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1250
        Transcript showCR:'result from test: ', value printString
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1251
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1252
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1253
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1254
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1255
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1256
!MenuEditor methodsFor:'values'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1257
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1258
helpTool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1259
    |tool|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1260
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1261
    (tool := builder bindingAt:#helpTool) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1262
        tool := UIHelpTool new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1263
        tool masterApplication:self.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1264
        builder aspectAt:#helpTool put:tool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1265
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1266
  ^ tool
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1267
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1268
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1269
painter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1270
    "automatically generated by UIPainter ..."
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1271
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1272
    |painter|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1273
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1274
    (painter := builder bindingAt:#painter) isNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1275
        painter := Painter new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1276
        painter action:[:dummy| self menuChanged ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1277
        builder aspectAt:#painter put:painter.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1278
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1279
  ^ painter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1280
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1281
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1282
!MenuEditor::Item class methodsFor:'documentation'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1283
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1284
documentation
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1285
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1286
    implements the contents assigned to a HierarchyNode. An instance
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1287
    is associated with one item and keeps all its information
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1288
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1289
    [see also:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1290
        HierarchyNode
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1291
        MenuEditor
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1292
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1293
    [author:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1294
        Claus Atzkern
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1295
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1296
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1297
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1298
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1299
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1300
!MenuEditor::Item methodsFor:'accessing'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1301
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1302
label
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1303
    "return the value of the instance variable 'label' (automatically generated)"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1304
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1305
    ^ label!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1306
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1307
label:something
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1308
    "set the value of the instance variable 'label' (automatically generated)"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1309
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1310
    label := something.! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1311
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1312
!MenuEditor::Item methodsFor:'conversion'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1313
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1314
asMenuItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1315
    "converts self to a menu item
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1316
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1317
    |item rcv|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1318
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1319
    item := MenuItem labeled:(label ? '-').
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1320
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1321
    self isSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1322
        item activeHelpKey:activeHelpKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1323
        item enabled:enabled.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1324
        item accessCharacterPosition:accessCharaterPos.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1325
        item nameKey:nameKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1326
        item shortcutKeyCharacter:shortcutKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1327
        item value:value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1328
        item indication:indication.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1329
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1330
        icon notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1331
            rcv := ResourceRetriever new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1332
            rcv className:retriever.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1333
            rcv selector:icon.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1334
            iconAndLabel == true ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1335
                rcv labelText:label
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1336
            ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1337
            item labelImage:rcv
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1338
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1339
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1340
  ^ item.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1341
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1342
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1343
buildFromAspects:aspects
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1344
    |name|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1345
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1346
    self isSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1347
        name  := label.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1348
        label := (aspects at:#label) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1349
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1350
        self isSeperator ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1351
            (aspects at:#label) value:(label := name)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1352
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1353
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1354
        activeHelpKey       := (aspects at:#activeHelpKey) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1355
        enabled             := (aspects at:#enabled) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1356
        value               := (aspects at:#value) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1357
        nameKey             := (aspects at:#nameKey) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1358
        indication          := (aspects at:#indication) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1359
        shortcutKey         := (aspects at:#shortcutKey) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1360
        accessCharaterPos   := (aspects at:#accessCharaterPos) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1361
        retriever           := (aspects at:#retriever) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1362
        icon                := (aspects at:#icon) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1363
        iconAndLabel        := (aspects at:#iconAndLabel) value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1364
    ] ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1365
        (aspects at:#doubleSeperator) value ifTrue:[label := '=']
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1366
                                           ifFalse:[label := nil].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1367
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1368
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1369
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1370
buildFromMenuItem:anItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1371
    |rtv|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1372
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1373
    label               := anItem label.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1374
    activeHelpKey       := anItem activeHelpKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1375
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1376
    (enabled := anItem enabled) isSymbol ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1377
        enabled := nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1378
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1379
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1380
    (value := anItem value) isSymbol ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1381
        value := nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1382
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1383
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1384
    (indication := anItem indication) isSymbol ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1385
        indication := nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1386
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1387
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1388
    nameKey           := anItem nameKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1389
    shortcutKey       := anItem shortcutKeyCharacter.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1390
    accessCharaterPos := anItem accessCharacterPosition.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1391
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1392
    (    ((rtv := anItem adornment) notNil)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1393
     and:[(rtv := rtv labelImage) isKindOf:ResourceRetriever]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1394
    ) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1395
        retriever := rtv className.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1396
        icon      := rtv selector.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1397
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1398
        (iconAndLabel := rtv labelText notNil) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1399
            label := rtv labelText.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1400
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1401
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1402
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1403
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1404
toAspects:aspects
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1405
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1406
    self isSeperator ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1407
        (aspects at:#doubleSeperator) value:(label notNil).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1408
    ] ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1409
        (aspects at:#label)                 value:label.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1410
        (aspects at:#activeHelpKey)         value:activeHelpKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1411
        (aspects at:#enabled)               value:enabled.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1412
        (aspects at:#value)                 value:value.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1413
        (aspects at:#nameKey)               value:nameKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1414
        (aspects at:#indication)            value:indication.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1415
        (aspects at:#shortcutKey)           value:shortcutKey.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1416
        (aspects at:#accessCharaterPos)     value:accessCharaterPos.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1417
        (aspects at:#retriever)             value:retriever.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1418
        (aspects at:#icon)                  value:icon.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1419
        (aspects at:#iconAndLabel)          value:iconAndLabel.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1420
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1421
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1422
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1423
!MenuEditor::Item methodsFor:'queries'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1424
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1425
isSeperator
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1426
    |c|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1427
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1428
    label size > 1 ifTrue:[^ false].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1429
    label size == 1 ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1430
        (c := label first) == $= ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1431
            ^ true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1432
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1433
        c == $- ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1434
            ^ false
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1435
        ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1436
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1437
    label := nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1438
  ^ true
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1439
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1440
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1441
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1442
isSimpleSeperator
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1443
    ^ label isNil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1444
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1445
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1446
!MenuEditor::Painter class methodsFor:'defaults'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1447
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1448
defaultMenuMessage   
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1449
    "This message is the default yo be sent to the menuHolder to get a menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1450
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1451
    ^ #menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1452
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1453
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1454
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1455
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1456
!MenuEditor::Painter class methodsFor:'documentation'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1457
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1458
documentation
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1459
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1460
    menu selection list
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1461
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1462
    [see also:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1463
        SelectionInTreeView
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1464
        SelectionInHierarchy
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1465
        HierarchyNode
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1466
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1467
    [author:]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1468
        Claus Atzkern
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1469
"
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1470
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1471
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1472
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1473
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1474
!MenuEditor::Painter methodsFor:'accessing'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1475
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1476
root
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1477
    ^ listOfNodes first
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1478
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1479
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1480
selectorName
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1481
    ^ (listOfNodes first contents label) asSymbol
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1482
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1483
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1484
!MenuEditor::Painter methodsFor:'building'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1485
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1486
buildFrom:aClass andSelector:aSelector
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1487
    |spec cls menu node|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1488
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1489
    (aClass notNil and:[aSelector notNil]) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1490
        aClass isBehavior ifFalse:[cls := Smalltalk at:aClass asSymbol]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1491
                           ifTrue:[cls := aClass].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1492
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1493
        (cls respondsTo:aSelector) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1494
            spec := cls perform:aSelector
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1495
        ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1496
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1497
    spec isNil ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1498
        menu := Menu new fromLiteralArrayEncoding:spec.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1499
        node := self nodeLabel:(aSelector asString) level:1.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1500
        self subMenu:menu parent:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1501
    ] ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1502
        aSelector notNil ifTrue:[cls := aSelector asString]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1503
                        ifFalse:[cls := 'menu'].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1504
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1505
        node := self nodeLabel:cls level:1.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1506
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1507
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1508
    node hasChildren ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1509
        node addChild:(self nodeLabel:'undefined' level:1)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1510
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1511
    model root:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1512
    model setHideToChildren:true startingAt:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1513
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1514
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1515
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1516
buildFromMenu:aMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1517
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1518
    |spec cls node|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1519
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1520
    node := self nodeLabel:'menu' level:1.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1521
    self subMenu:aMenu parent:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1522
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1523
    node hasChildren ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1524
        node addChild:(self nodeLabel:'undefined' level:1)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1525
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1526
    model root:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1527
    model setHideToChildren:true startingAt:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1528
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1529
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1530
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1531
item:anItem level:aLevel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1532
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1533
    |level node submenu grp ctr sep|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1534
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1535
    node := self nodeLabel:(anItem label) level:aLevel.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1536
    node contents buildFromMenuItem:anItem.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1537
    node name:(node contents label).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1538
    node hide:true.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1539
    self subMenu:(anItem submenu) parent:node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1540
  ^ node.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1541
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1542
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1543
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1544
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1545
subMenu:aMenu parent:aParent
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1546
    |lvl grp sep|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1547
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1548
    aMenu isNil ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1549
        lvl := (aParent level) + 1.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1550
        grp := aMenu groupSizes.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1551
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1552
        aMenu itemsDo:[:i| aParent addChild:(self item:i level:lvl)].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1553
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1554
        grp notNil ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1555
            sep := self nodeLabel:nil level:lvl.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1556
            lvl := 0.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1557
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1558
            grp do:[:i|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1559
                lvl := lvl + i + 1.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1560
                aParent addChildAndSubChildren:sep at:lvl
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
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1566
!MenuEditor::Painter methodsFor:'conversion'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1567
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1568
asMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1569
    |menu root|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1570
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1571
    root := self root.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1572
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1573
    root hasChildren ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1574
        menu := Menu new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1575
        root children do:[:aChild| menu addItem:(self asMenuItem:aChild)].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1576
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1577
  ^ menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1578
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1579
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1580
asMenuItem:aNode
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1581
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1582
    |menu item|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1583
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1584
    item := aNode contents asMenuItem.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1585
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1586
    aNode hasChildren ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1587
        menu := Menu new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1588
        aNode children do:[:aChild| menu addItem:(self asMenuItem:aChild)].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1589
        item submenu:menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1590
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1591
  ^ item
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1592
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1593
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1594
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1595
!MenuEditor::Painter methodsFor:'drawing basics'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1596
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1597
drawLabelIndex:anIndex atX:x y:yCenter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1598
    "draw text label assigned to a node at x y( center)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1599
    "
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1600
    |y w item|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1601
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1602
    item := (listOfNodes at:anIndex) contents.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1603
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1604
    item isSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1605
        ^ super drawLabelIndex:anIndex atX:x y:yCenter
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1606
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1607
    self displayLineFromX:x y:yCenter toX:(x + 80) y:yCenter.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1608
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1609
    item isSimpleSeperator ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1610
        self displayLineFromX:x y:(yCenter + 2) toX:(x + 80) y:(yCenter + 2).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1611
    ]    
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1612
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1613
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1614
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1615
!MenuEditor::Painter methodsFor:'initialization'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1616
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1617
initialize
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1618
    super initialize.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1619
    super model:(SelectionInHierarchy new).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1620
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1621
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1622
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1623
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1624
!MenuEditor::Painter methodsFor:'menus'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1625
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1626
doCopy
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1627
    CopyBuffer := listOfNodes at:selection.
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
doCreateItem
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1633
    self addNode:(self nodeLabel:'undefined' level:1)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1634
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1635
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1636
doCreateMenu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1637
    |node|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1638
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1639
    node := self nodeLabel:'undefined' level:1.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1640
    node addChild:(self nodeLabel:'undefined' level:2).
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1641
    self addNode:node
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1642
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1643
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1644
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1645
doCreateSep
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1646
    self addNode:(self nodeLabel:nil level:1)
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1647
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1648
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1649
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1650
doCut
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1651
    self doCopy.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1652
    model removeIndex:selection.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1653
    self selection:nil.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1654
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1655
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1656
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1657
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1658
doPaste
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1659
    self addNode:CopyBuffer
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1660
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1661
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1662
menu
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1663
    |menu subm|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1664
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1665
    selection isNumber ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1666
        ^ nil
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1667
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1668
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1669
    menu := PopUpMenu labels:#( 'copy'   'cut'   'paste'  '-' 'create' )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1670
                   selectors:#( #doCopy  #doCut  #doPaste nil #create  )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1671
                    receiver:self.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1672
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1673
    selection == 1 ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1674
        menu disable:#doCopy.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1675
        menu disable:#doCut.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1676
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1677
    subm :=  PopUpMenu labels:#( 'menu'        'item'        'seperator'  )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1678
                    selectors:#( #doCreateMenu #doCreateItem #doCreateSep )
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1679
                     receiver:self.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1680
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1681
    menu subMenuAt:#create put:subm.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1682
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1683
  ^ menu.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1684
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1685
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1686
! !
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1687
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1688
!MenuEditor::Painter methodsFor:'private'!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1689
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1690
addNode:aNode
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1691
    |node parent|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1692
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1693
    (aNode notNil and:[(node := self selectedNode) notNil]) ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1694
        ^ self
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1695
    ].
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1696
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1697
    (node isCollapsable or:[node parent isNil]) ifTrue:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1698
        model addChildAndSubChildren:aNode below:node at:1
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1699
    ] ifFalse:[
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1700
        model addChildAndSubChildren:aNode below:(node parent) after:node
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1701
    ]
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1702
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1703
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1704
!
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1705
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1706
nodeLabel:aLabel level:aLevel
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1707
    |node|
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1708
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1709
    node := HierarchyNode new.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1710
    node childCollectionClass:OrderedCollection.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset
  1711
    node  name:aLabel.
6ce84c1270a6 intitial checkin
ca
parents:
diff changeset