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