MenuEditor.st
author Stefan Vogel <sv@exept.de>
Fri, 17 May 2019 16:59:23 +0200
changeset 3664 0d01da886d5a
parent 3636 197a2fbb8c5d
child 3751 5c7bb0559dc1
permissions -rw-r--r--
#REFACTORING by stefan
Sanitize BlockValues

class: MenuEditor
changed: #hasNonLinkedMenuSelectedHolder
cg@3582
     1
"{ Encoding: utf8 }"
cg@3582
     2
ca@199
     3
"
tz@738
     4
 COPYRIGHT (c) 1997 by eXept Software AG
ca@1606
     5
	      All Rights Reserved
ca@199
     6
ca@199
     7
 This software is furnished under a license and may be used
ca@199
     8
 only in accordance with the terms of that license and with the
tz@738
     9
 inclusion of the above copyright notice. This software may not
ca@199
    10
 be provided or otherwise made available to, or used by, any
ca@199
    11
 other person.  No title to or ownership of the software is
ca@199
    12
 hereby transferred.
ca@199
    13
"
cg@1372
    14
"{ Package: 'stx:libtool2' }"
cg@1372
    15
cg@3178
    16
"{ NameSpace: Smalltalk }"
cg@3178
    17
tz@738
    18
ResourceSpecEditor subclass:#MenuEditor
ca@1606
    19
	instanceVariableNames:'selectionHolder tabHolder listOfItems listOfTabs
ca@1618
    20
		selectedSuperItems notifyDisabledCounter wizards listOfItemsView
cg@2569
    21
		dropOverLine savedSpec'
ca@1462
    22
	classVariableNames:'ImageRetrieverClasses'
ca@220
    23
	poolDictionaries:''
ca@220
    24
	category:'Interface-UIPainter'
ca@199
    25
!
ca@199
    26
ca@1606
    27
HierarchicalItem subclass:#Item
ca@1606
    28
	instanceVariableNames:'menuItem'
cg@1407
    29
	classVariableNames:''
cg@1407
    30
	poolDictionaries:''
cg@1407
    31
	privateIn:MenuEditor
cg@1407
    32
!
cg@1407
    33
cg@2850
    34
ApplicationModel subclass:#ImageResourceEditor
cg@2850
    35
	instanceVariableNames:'selectorHolder iconAndLabelHolder retrieverHolder imageHolder
cg@2850
    36
		imageList selectorFilterHolder imageListView'
cg@2850
    37
	classVariableNames:''
cg@2850
    38
	poolDictionaries:''
cg@2850
    39
	privateIn:MenuEditor
cg@2850
    40
!
cg@2850
    41
cg@2850
    42
HierarchicalItem subclass:#ImageResourceEditorItem
cg@2850
    43
	instanceVariableNames:'selector icon'
cg@2850
    44
	classVariableNames:''
cg@2850
    45
	poolDictionaries:''
cg@2850
    46
	privateIn:MenuEditor::ImageResourceEditor
cg@2850
    47
!
cg@2850
    48
cg@1631
    49
MenuEditor::Item subclass:#ActionItem
sv@1454
    50
	instanceVariableNames:''
sv@1454
    51
	classVariableNames:''
sv@1454
    52
	poolDictionaries:''
sv@1454
    53
	privateIn:MenuEditor
sv@1454
    54
!
sv@1454
    55
cg@1631
    56
MenuEditor::Item subclass:#LinkedMenuItem
ca@1606
    57
	instanceVariableNames:''
ca@1606
    58
	classVariableNames:''
ca@1606
    59
	poolDictionaries:''
ca@1606
    60
	privateIn:MenuEditor
ca@1606
    61
!
ca@1606
    62
ca@1844
    63
MenuEditor::Item subclass:#MenuSliceItem
ca@1844
    64
	instanceVariableNames:''
ca@1844
    65
	classVariableNames:''
ca@1844
    66
	poolDictionaries:''
ca@1844
    67
	privateIn:MenuEditor
ca@1844
    68
!
ca@1844
    69
ca@1633
    70
MenuEditor::Item subclass:#RegularMenuItem
ca@1606
    71
	instanceVariableNames:''
ca@1606
    72
	classVariableNames:''
ca@1606
    73
	poolDictionaries:''
ca@1606
    74
	privateIn:MenuEditor
ca@1606
    75
!
ca@1606
    76
ca@1633
    77
MenuEditor::RegularMenuItem subclass:#RootItem
cg@1631
    78
	instanceVariableNames:''
cg@1631
    79
	classVariableNames:''
cg@1631
    80
	poolDictionaries:''
cg@1631
    81
	privateIn:MenuEditor
cg@1631
    82
!
cg@1631
    83
cg@1631
    84
MenuEditor::Item subclass:#SeparatorItem
cg@1631
    85
	instanceVariableNames:''
cg@1631
    86
	classVariableNames:''
cg@1631
    87
	poolDictionaries:''
cg@1631
    88
	privateIn:MenuEditor
cg@1631
    89
!
cg@1631
    90
ca@199
    91
!MenuEditor class methodsFor:'documentation'!
ca@199
    92
ca@199
    93
copyright
ca@199
    94
"
tz@738
    95
 COPYRIGHT (c) 1997 by eXept Software AG
ca@1606
    96
	      All Rights Reserved
ca@199
    97
ca@199
    98
 This software is furnished under a license and may be used
ca@199
    99
 only in accordance with the terms of that license and with the
tz@738
   100
 inclusion of the above copyright notice. This software may not
ca@199
   101
 be provided or otherwise made available to, or used by, any
ca@199
   102
 other person.  No title to or ownership of the software is
ca@199
   103
 hereby transferred.
ca@199
   104
"
ca@199
   105
!
ca@199
   106
ca@199
   107
documentation
ca@199
   108
"
tz@728
   109
    The MenuEditor allows you to create, modify or just inspect
cg@2936
   110
    menu specifications. Such specifications are returned by menu-spec methods
cg@2936
   111
    of the application class. These methods are typically tagged with a menu-resource.
cg@2936
   112
    The menu editor is able to retrieve such specifications and generate new menu-spec
cg@2936
   113
    methods.
cg@2936
   114
cg@2936
   115
    The editor is typically opened by double-clicking on a menu-spec method in the browser.
ca@1606
   116
ca@1606
   117
    [Instance variables:]
ca@1606
   118
cg@3013
   119
	listOfItemsView         <HierarcicalListView>  the view which shows the list of items
cg@3013
   120
	listOfItems             <HierarchicalList>     hierarchical list of menu items
cg@3013
   121
	listOfTabs              <List>                 list of current shown tab-labels
cg@3013
   122
cg@3013
   123
	selectionHolder         <ValueHolder>          collection of current selected items
cg@3013
   124
	selectedSuperItems      <Collection>           collection of superItems derived from selection
cg@3013
   125
cg@3013
   126
	tabHolder               <ValueHolder>          selected tab label holder
cg@3013
   127
	notifyDisabledCounter   <SmallInteger>         ~~ 0 than change notifications are discard
cg@3013
   128
	wizards                 <IdentityDictionary>   keeps all created wizard dialogs
cg@3013
   129
cg@3013
   130
	dropOverLine            <nil or SmallInteger>  nil: drop context not dropabel.
cg@3013
   131
						       = 0: drop context dropable but no item specified
cg@3013
   132
						       ~ 0: drop context dropable for item at lineNumber
cg@3013
   133
						       used t6o restore drop indication drawings
cg@2188
   134
ca@1606
   135
    [Class variables:]
cg@3013
   136
	ImageRetrieverClasses   <Collection>        sorted collection of image receivers
ca@199
   137
ca@199
   138
    [start with:]
cg@3013
   139
	MenuEditor open
cg@3013
   140
	MenuEditor openOnClass:MenuEditor andSelector:#menu
ca@199
   141
ca@199
   142
    [author:]
cg@3013
   143
	Claus Atzkern, eXept Software AG
cg@3013
   144
	Thomas Zwick, eXept Software AG
ca@199
   145
"
ca@199
   146
! !
ca@199
   147
ca@1462
   148
!MenuEditor class methodsFor:'initialization'!
ca@1462
   149
ca@1462
   150
initialize
cg@2188
   151
    ImageRetrieverClasses := #(
ca@1606
   152
				Icon
cg@2188
   153
				SystemBrowser
ca@1606
   154
				ToolbarIconLibrary
cg@2188
   155
			      ).
cg@1546
   156
cg@1546
   157
    "
cg@1546
   158
     self initialize
cg@1546
   159
    "
ca@1462
   160
! !
ca@1462
   161
tz@728
   162
!MenuEditor class methodsFor:'instance creation'!
tz@728
   163
tz@728
   164
openModalOnMenu: aMenu
ca@1606
   165
    "Open a MenuEditor modal on aMenu
ca@1606
   166
     self openModalOnMenu: (self perform: #menu) decodeAsLiteralArray
tz@734
   167
    "
ca@1606
   168
    ^self new openModalOnMenu:aMenu
tz@508
   169
! !
tz@508
   170
ca@1462
   171
!MenuEditor class methodsFor:'accessing image retriever'!
ca@1462
   172
ca@1462
   173
addNewImageRetriever:aSymbolOrClass
cg@1546
   174
    "add a class to the imageRetriever list"
cg@1546
   175
ca@1462
   176
    |key|
ca@1462
   177
cg@1546
   178
    aSymbolOrClass isBehavior ifTrue:[
ca@1606
   179
	key := aSymbolOrClass nameWithNameSpacePrefix
cg@1546
   180
    ] ifFalse:[
ca@1606
   181
	key := aSymbolOrClass
ca@1462
   182
    ].
ca@1463
   183
ca@1462
   184
    key size ~~ 0 ifTrue:[
ca@1606
   185
	key := key asSymbol.
ca@1606
   186
ca@1606
   187
	(ImageRetrieverClasses includes:key) ifFalse:[
ca@1606
   188
	    ImageRetrieverClasses := ImageRetrieverClasses asOrderedCollection.
ca@1606
   189
	    ImageRetrieverClasses add:key.
ca@1606
   190
	    ImageRetrieverClasses sort.
ca@1606
   191
	]
ca@1462
   192
    ].
ca@1462
   193
!
ca@1462
   194
ca@1462
   195
imageRetrieverClasses
ca@1462
   196
    "returns a collection of image retrievers
ca@1462
   197
    "
ca@1462
   198
    ^ ImageRetrieverClasses
ca@1462
   199
! !
ca@1462
   200
tz@633
   201
!MenuEditor class methodsFor:'aspects'!
tz@633
   202
tz@633
   203
aspects
tz@728
   204
    "get the aspects for the attributes of the menu components"
tz@728
   205
tz@728
   206
    ^#(
cg@3587
   207
        rawLabel
cg@3587
   208
        accessCharacterPosition
cg@3587
   209
        showBusyCursorWhilePerforming
cg@3587
   210
        horizontalLayout
cg@3587
   211
        triggerOnDown
cg@3587
   212
        font
cg@3587
   213
        argument
cg@3587
   214
        submenuChannel
cg@3587
   215
        keepLinkedMenu
cg@3587
   216
        enabled
cg@3587
   217
        itemValue
cg@3587
   218
        nameKey
cg@3587
   219
        indication
cg@3587
   220
        choice
cg@3587
   221
        choiceValue
cg@3587
   222
        translateLabel
cg@3587
   223
        isButton
cg@3587
   224
        shortcutKeyCharacter
cg@3587
   225
        startGroup
cg@3587
   226
        isVisible
cg@3587
   227
        hideMenuOnActivated
cg@3587
   228
        auxValue
cg@3587
   229
        activeHelpKey
cg@3587
   230
        resourceRetriever
cg@3587
   231
        sendToOriginator
cg@3587
   232
        ignoreMnemonicKeys
cg@3587
   233
        ignoreShortcutKeys
cg@3587
   234
        isMenuSlice
cg@3587
   235
        hasMenuIndicator
tz@633
   236
     )
cg@3587
   237
cg@3587
   238
    "Modified: / 09-08-2018 / 17:03:56 / Claus Gittinger"
tz@633
   239
! !
tz@633
   240
ca@1606
   241
!MenuEditor class methodsFor:'defaults'!
ca@1606
   242
ca@1606
   243
resourceType
ca@1606
   244
    "get the type of the resource of the method generated by the MenuEditor
ca@1606
   245
    "
ca@1606
   246
    ^ #menu
ca@1606
   247
! !
ca@1606
   248
ca@371
   249
!MenuEditor class methodsFor:'help specs'!
ca@371
   250
ca@371
   251
helpSpec
cg@3587
   252
    ^super helpSpec addPairsFrom: #(
cg@1629
   253
cg@1820
   254
#editCut
cg@1820
   255
'Cut Item'
cg@1820
   256
cg@1820
   257
#editCopy
cg@1820
   258
'Copy Item'
cg@1820
   259
cg@1820
   260
#editPaste
cg@1820
   261
'Paste Item'
cg@1820
   262
cg@2569
   263
#fileSaveSpec
cg@2569
   264
'Save Menuspec'
cg@2569
   265
cg@1891
   266
#addMenuSlice
cg@1891
   267
'Add Menuslice'
cg@1891
   268
cg@2850
   269
#addDelayedMenu
cg@2850
   270
'Add a new delayed menu to item.'
cg@2850
   271
cg@2850
   272
#addDelayedSubMenuLink
cg@2850
   273
'Add a new linked delayed menu to item.'
cg@2850
   274
cg@2850
   275
#addMenuItem
cg@2850
   276
'Add a new menu item.'
cg@2850
   277
cg@2850
   278
#addMenuSeparator
cg@2850
   279
'Add a new menu separator.'
cg@2850
   280
cg@2850
   281
#addMenuSliceItem
cg@2850
   282
'Add a new menu slice.'
cg@2850
   283
cg@1629
   284
#addSubMenu
cg@2850
   285
'Add a new sub menu.'
cg@1629
   286
cg@1629
   287
#addSubMenuLink
cg@2850
   288
'Add a new linked sub menu.'
cg@2850
   289
cg@2850
   290
#basicsAction
cg@2850
   291
'An action selector with 0, 1 (the argument field), or 2 (the selected item) arguments.'
cg@2850
   292
cg@2850
   293
#browseMethod
cg@2850
   294
'Open a browser on this method in the application. Create the method, if it does not exist.'
cg@2850
   295
cg@2850
   296
#basicsArgument
cg@2850
   297
'An optional arg passed with above selector, if it is a 1 or 2 arg selector (enter a Smalltalk literal).'
cg@2850
   298
cg@2850
   299
#basicsChoice
cg@2850
   300
'Aspect for a boolean holder, block or method, specifying the choices state (RadioButton behavior).'
cg@2850
   301
cg@2850
   302
#basicsChoiceValue
cg@2850
   303
'That choices value (typically number or symbol).'
cg@2850
   304
cg@2850
   305
#basicsIndication
cg@2850
   306
'Aspect for boolean holder, block, or method, specifying the indication state (CheckToggle behavior).'
cg@2850
   307
cg@2850
   308
#basicsIsButton
cg@2850
   309
'Button-like look and behavior.'
cg@2850
   310
cg@2850
   311
#basicsKey
cg@2850
   312
'Internal key of the item (optional, for programmed accesses).'
cg@2850
   313
cg@2850
   314
#basicsLabel
cg@2850
   315
'Label of the item.'
cg@2850
   316
cg@2850
   317
#basicsMenu
cg@2850
   318
'Aspect providing the sub menu to be opened if item is selected (provide spec or valueHolder).'
cg@2850
   319
cg@2850
   320
#basicsMenuArgument
cg@2850
   321
'An argument passed with the menu selector.'
cg@2850
   322
cg@2850
   323
#basicsNameKey
cg@2850
   324
'Unique identifier of the item (optional).'
cg@2850
   325
cg@2850
   326
#basicsSelector
cg@2850
   327
'Selector under which the generated menu spec is saved.'
cg@2850
   328
cg@2850
   329
#basicsSeparatorType
cg@2850
   330
'List of valid separators.'
cg@2850
   331
cg@2850
   332
#basicsTranslateLabel
cg@2850
   333
'Translate the label via the classes resource file (internationalization).'
cg@2850
   334
cg@2850
   335
#browseResource
cg@2850
   336
'Search for methods with image resource.'
cg@2850
   337
cg@2850
   338
#detailsAccelerator
cg@2850
   339
'Accelerator key to select the menu item from the keyboard (Cmdx or Ctrlx).'
cg@2850
   340
cg@2850
   341
#detailsAccessCharaterPosition
cg@2850
   342
'Index of the access character position of the textual label (obsolete, VW compatibility).'
cg@2850
   343
cg@2850
   344
#detailsAuxValue
cg@2850
   345
'Some additional value - for arbitrary use by the program.'
cg@2850
   346
cg@2850
   347
#detailsEnabled
cg@2850
   348
'Aspect or binding providing a boolean value holder to enable/disable the menu item.'
cg@2850
   349
cg@2850
   350
#detailsIgnoreAcceleratorKeys
cg@2850
   351
'Ignore accelerator keys in submenu(s).'
cg@2850
   352
cg@2850
   353
#detailsIgnoreMnemonicKeys
cg@2850
   354
'Ignore mnemonic keys (access characters) in submenu(s).'
cg@2850
   355
cg@2850
   356
#detailsStartGroup
cg@2850
   357
'Specify start of a specially aligned group.'
cg@2850
   358
cg@2850
   359
#detailsVisibility
cg@2850
   360
'Boolean, or aspect or binding for a boolean holder controlling the visibility of the menu item.'
cg@2850
   361
cg@2850
   362
#fileLoad
cg@2850
   363
'Load a menu spec from a class.'
cg@1629
   364
cg@1629
   365
#fileNew
cg@2850
   366
'Create a new menu spec.'
cg@2850
   367
cg@2850
   368
#filePickAMenu
cg@2850
   369
'Select a menu from an open view and read its specification'
cg@2850
   370
cg@2850
   371
#fileChooseAMenu
cg@2850
   372
'Select a menu from an open view and edit its spec-method'
cg@2850
   373
cg@2850
   374
#fileSave
cg@2850
   375
'Save the menu spec (and the help spec, if modified).'
cg@2850
   376
cg@2850
   377
#fileSaveAs
cg@2850
   378
'Open a dialog to save the menu spec (and the help spec, if modified).'
cg@2850
   379
cg@2850
   380
#fileShowMenuSpec
cg@2850
   381
'Opens a Workspace showing the current menu spec.'
cg@2850
   382
cg@3587
   383
#forceMenuIndicator
cg@3587
   384
'Always show a menu indicator in horizontal menu (little down-arrow).'
cg@3587
   385
cg@2850
   386
#generateAspectMethods
cg@2850
   387
'Generates aspect methods for defined aspect selectors of the menu.'
cg@2850
   388
cg@2850
   389
#hideMenuOnActivated
cg@2850
   390
'If on, the menu hides itself after the item was activated (PopUp/PullDown-Menus only).'
cg@2850
   391
cg@2850
   392
#horizontalLayout
cg@3013
   393
'If on, the submenu organizes its items horizontal instead of vertical (default).'
cg@2850
   394
cg@2850
   395
#imageImageAndLabel
cg@2850
   396
'Toggle display of both image and textual label.'
cg@2850
   397
cg@2850
   398
#imageImageEditor
cg@2850
   399
'Open an Image Editor on the resource method defined by retriever and selector.'
cg@2850
   400
cg@2850
   401
#imageBrowseImageClass
cg@2850
   402
'Open a Browser on the resource retriever class.'
cg@2850
   403
cg@2850
   404
#imageImageList
cg@2850
   405
'Currently existing image resources.'
cg@2850
   406
cg@2850
   407
#imageRetriever
cg@3071
   408
'Class implementing the image resource method. If unspecified, the application instance / class are asked.'
cg@2850
   409
cg@2850
   410
#imageSelector
cg@2850
   411
'Selector returning an image (sent to above or the application).'
cg@2850
   412
cg@2850
   413
#keepLinkedMenu
cg@2850
   414
'Keep the linked menu after activation (do not destroy; if off, menu is rebuild for every activation).'
cg@2850
   415
cg@2850
   416
#sendToOriginator
cg@2850
   417
'Send action-Message to widget (instead of application); only valid for PopUpMenus.'
cg@2850
   418
cg@2850
   419
#settingsRedefineAspectMethods
cg@2850
   420
'Toggles the permission to overwrite existing aspect methods.'
cg@2850
   421
cg@2850
   422
#showBusyCursorWhilePerforming
cg@2850
   423
'If on, a busy cursor is shown while the items action is performing.'
cg@2850
   424
cg@2850
   425
#triggerOnDown
cg@2850
   426
'If on, the items action is performed on mouse-button press (default is: on button-release).'
cg@2850
   427
cg@2850
   428
#selectorFilter
cg@2850
   429
'In the list below, only matching selectors are shown'
cg@1629
   430
)
cg@2850
   431
cg@3587
   432
    "Modified: / 09-08-2018 / 17:09:02 / Claus Gittinger"
ca@371
   433
! !
ca@371
   434
tz@734
   435
!MenuEditor class methodsFor:'image specs'!
tz@734
   436
cg@2297
   437
browseActionImage
cg@2297
   438
    <resource: #programImage>
cg@2297
   439
cg@2297
   440
    ^ UIPainter browseActionImage
cg@2297
   441
!
cg@2297
   442
sv@2156
   443
defaultIcon
sv@2156
   444
    <resource: #programImage>
sv@2156
   445
sv@2156
   446
    ^ ToolbarIconLibrary startMenuEditorIcon
sv@2156
   447
!
sv@2156
   448
ca@1606
   449
iconUnknown
ca@1606
   450
    "returns an image used for picked items containing an image
ca@1606
   451
    "
cg@2271
   452
    <resource: #programImage>
ca@1606
   453
ca@1606
   454
    ^ MenuPanelSpec icon
ca@1606
   455
! !
ca@1606
   456
ca@1606
   457
!MenuEditor class methodsFor:'interface specs'!
ca@1606
   458
ca@1606
   459
windowSpec
ca@1606
   460
    "This resource specification was automatically generated
ca@1606
   461
     by the UIPainter of ST/X."
ca@1606
   462
ca@1606
   463
    "Do not manually edit this!! If it is corrupted,
ca@1606
   464
     the UIPainter may not be able to read the specification."
ca@1606
   465
ca@1606
   466
    "
ca@1606
   467
     UIPainter new openOnClass:MenuEditor andSelector:#windowSpec
ca@1606
   468
     MenuEditor new openInterface:#windowSpec
ca@1606
   469
     MenuEditor open
ca@1606
   470
    "
ca@1606
   471
ca@1606
   472
    <resource: #canvas>
ca@1606
   473
mawalch@3545
   474
    ^ 
mawalch@3545
   475
    #(FullSpec
mawalch@3545
   476
       name: windowSpec
mawalch@3545
   477
       uuid: '7d4bc1c6-2067-11b2-b33d-3065ec8abe8a'
mawalch@3545
   478
       window: 
mawalch@3545
   479
      (WindowSpec
mawalch@3545
   480
         label: 'Menu Editor'
mawalch@3545
   481
         name: 'Menu Editor'
mawalch@3545
   482
         uuid: '7d4bc6f8-2067-11b2-b33d-3065ec8abe8a'
mawalch@3545
   483
         min: (Point 550 385)
mawalch@3545
   484
         bounds: (Rectangle 0 0 574 473)
mawalch@3545
   485
         menu: menu
mawalch@3545
   486
         icon: defaultIcon
mawalch@3545
   487
         returnIsOKInDialog: false
mawalch@3545
   488
         escapeIsCancelInDialog: false
mawalch@3545
   489
       )
mawalch@3545
   490
       component: 
mawalch@3545
   491
      (SpecCollection
mawalch@3545
   492
         collection: (
mawalch@3545
   493
          (MenuPanelSpec
mawalch@3545
   494
             name: 'toolbar'
mawalch@3545
   495
             layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
mawalch@3545
   496
             uuid: '7d4bcc98-2067-11b2-b33d-3065ec8abe8a'
mawalch@3545
   497
             tabable: true
mawalch@3545
   498
             menu: toolbar
mawalch@3545
   499
             showSeparatingLines: true
mawalch@3545
   500
           )
mawalch@3545
   501
          (VariableHorizontalPanelSpec
mawalch@3545
   502
             name: 'mainPanel'
mawalch@3545
   503
             layout: (LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
mawalch@3545
   504
             uuid: '7d4bd2ba-2067-11b2-b33d-3065ec8abe8a'
mawalch@3545
   505
             component: 
mawalch@3545
   506
            (SpecCollection
mawalch@3545
   507
               collection: (
mawalch@3545
   508
                (HierarchicalListViewSpec
mawalch@3545
   509
                   name: 'ListOfItemsView'
mawalch@3545
   510
                   uuid: '7d4bd7ba-2067-11b2-b33d-3065ec8abe8a'
mawalch@3545
   511
                   model: selectionHolder
mawalch@3545
   512
                   menu: editMenu
mawalch@3545
   513
                   hasHorizontalScrollBar: true
mawalch@3545
   514
                   hasVerticalScrollBar: true
mawalch@3545
   515
                   miniScrollerHorizontal: true
mawalch@3545
   516
                   miniScrollerVertical: true
mawalch@3545
   517
                   listModel: listOfItems
mawalch@3545
   518
                   multipleSelectOk: true
mawalch@3545
   519
                   useIndex: false
mawalch@3545
   520
                   highlightMode: label
mawalch@3545
   521
                   doubleClickSelector: indicatorClickedAt:
mawalch@3545
   522
                   selectConditionSelector: canSelect:
mawalch@3545
   523
                   showLeftIndicators: false
mawalch@3545
   524
                   indicatorSelector: indicatorClickedAt:
mawalch@3545
   525
                   postBuildCallback: postBuildListOfItemsView:
mawalch@3545
   526
                   properties: 
mawalch@3545
   527
                  (PropertyListDictionary
mawalch@3545
   528
                     dropSelector: doDrop:
mawalch@3545
   529
                     dragArgument: nil
mawalch@3545
   530
                     overSelector: dropOver:
mawalch@3545
   531
                     canDropSelector: canDrop:
mawalch@3545
   532
                     dropObjectSelector: dropObjects
mawalch@3545
   533
                     enterSelector: dropEnter:
mawalch@3545
   534
                     dropArgument: nil
mawalch@3545
   535
                     leaveSelector: dropLeave:
mawalch@3545
   536
                   )
mawalch@3545
   537
                 )
mawalch@3545
   538
                (ViewSpec
mawalch@3545
   539
                   name: 'Box'
mawalch@3545
   540
                   uuid: '7d4be156-2067-11b2-b33d-3065ec8abe8a'
mawalch@3545
   541
                   level: -1
mawalch@3545
   542
                   component: 
mawalch@3545
   543
                  (SpecCollection
mawalch@3545
   544
                     collection: (
mawalch@3545
   545
                      (NoteBookViewSpec
mawalch@3545
   546
                         name: 'NoteBook'
mawalch@3545
   547
                         layout: (LayoutFrame 1 0.0 0 0.0 1 1.0 -39 1.0)
mawalch@3545
   548
                         uuid: '7d4be430-2067-11b2-b33d-3065ec8abe8a'
mawalch@3545
   549
                         enableChannel: hasSingleSelectionChannel
mawalch@3545
   550
                         tabable: true
mawalch@3545
   551
                         model: tabHolder
mawalch@3545
   552
                         menu: listOfTabs
mawalch@3545
   553
                         fitLastRow: false
mawalch@3545
   554
                         translateLabel: true
mawalch@3545
   555
                         canvas: wizardHolder
mawalch@3545
   556
                         keepCanvasAlive: true
mawalch@3545
   557
                         postBuildCallback: postBuildNoteBook:
mawalch@3545
   558
                       )
mawalch@3545
   559
                      (UISubSpecification
mawalch@3545
   560
                         name: 'SubSpecification'
mawalch@3545
   561
                         layout: (LayoutFrame 2 0.0 -35 1.0 -2 1.0 -2 1.0)
mawalch@3545
   562
                         uuid: '7d4beab6-2067-11b2-b33d-3065ec8abe8a'
mawalch@3545
   563
                         majorKey: ToolApplicationModel
mawalch@3545
   564
                         minorKey: windowSpecForCommit
mawalch@3545
   565
                       )
mawalch@3545
   566
                      )
mawalch@3545
   567
                    
mawalch@3545
   568
                   )
mawalch@3545
   569
                 )
mawalch@3545
   570
                )
mawalch@3545
   571
              
mawalch@3545
   572
             )
mawalch@3545
   573
             handles: (Any 0.29999999999999999 1.0)
mawalch@3545
   574
           )
mawalch@3545
   575
          (UISubSpecification
mawalch@3545
   576
             name: 'infoBarSubSpec'
mawalch@3545
   577
             layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
mawalch@3545
   578
             uuid: '7d4bee30-2067-11b2-b33d-3065ec8abe8a'
mawalch@3545
   579
             majorKey: ToolApplicationModel
mawalch@3545
   580
             minorKey: windowSpecForInfoBar
mawalch@3545
   581
           )
mawalch@3545
   582
          )
mawalch@3545
   583
        
mawalch@3545
   584
       )
mawalch@3545
   585
     )
ca@1606
   586
! !
ca@1606
   587
ca@1606
   588
!MenuEditor class methodsFor:'menu specs'!
ca@1606
   589
ca@1606
   590
addMenu
ca@1606
   591
    "This resource specification was automatically generated
ca@1606
   592
     by the MenuEditor of ST/X."
ca@1606
   593
ca@1606
   594
    "Do not manually edit this!! If it is corrupted,
ca@1606
   595
     the MenuEditor may not be able to read the specification."
ca@1606
   596
ca@1606
   597
    "
ca@1606
   598
     MenuEditor new openOnClass:MenuEditor andSelector:#addMenu
ca@1606
   599
     (Menu new fromLiteralArrayEncoding:(MenuEditor addMenu)) startUp
ca@1606
   600
    "
ca@1606
   601
ca@1606
   602
    <resource: #menu>
ca@1606
   603
cg@2188
   604
    ^
ca@1844
   605
     #(Menu
cg@3013
   606
	(
cg@3013
   607
	 (MenuItem
cg@3013
   608
	    activeHelpKey: addMenuSeparator
cg@3013
   609
	    label: 'Separator'
cg@3013
   610
	    itemValue: doCreateSep
cg@3013
   611
	    translateLabel: true
cg@3013
   612
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconSeparator '')
cg@3013
   613
	  )
cg@3013
   614
	 (MenuItem
cg@3013
   615
	    activeHelpKey: addMenuItem
cg@3013
   616
	    label: 'Item'
cg@3013
   617
	    itemValue: doCreateItem
cg@3013
   618
	    translateLabel: true
cg@3013
   619
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconItem '')
cg@3013
   620
	  )
cg@3013
   621
	 (MenuItem
cg@3013
   622
	    activeHelpKey: addMenuSliceItem
cg@3013
   623
	    label: 'Menu Slice'
cg@3013
   624
	    itemValue: doCreateMenuSliceItem
cg@3013
   625
	    translateLabel: true
cg@3013
   626
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconSliceMenu '')
cg@3013
   627
	  )
cg@3013
   628
	 (MenuItem
cg@3013
   629
	    activeHelpKey: addMenuItem
cg@3013
   630
	    label: 'Menu'
cg@3013
   631
	    itemValue: doCreateMenu
cg@3013
   632
	    translateLabel: true
cg@3013
   633
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconMenu '')
cg@3013
   634
	  )
cg@3013
   635
	 (MenuItem
cg@3013
   636
	    activeHelpKey: addSubMenuLink
cg@3013
   637
	    label: 'Linked Menu'
cg@3013
   638
	    itemValue: doCreateLinkedMenu
cg@3013
   639
	    translateLabel: true
cg@3013
   640
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconLinkedMenu '')
cg@3013
   641
	  )
cg@3013
   642
	 (MenuItem
cg@3013
   643
	    label: '-'
cg@3013
   644
	  )
cg@3013
   645
	 (MenuItem
cg@3013
   646
	    activeHelpKey: addDelayedMenu
cg@3013
   647
	    enabled: canCreateDelayedMenuChannel
cg@3013
   648
	    label: 'Delayed Menu'
cg@3013
   649
	    itemValue: doCreateDelayedMenu:
cg@3013
   650
	    translateLabel: true
cg@3013
   651
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedMenu '')
cg@3013
   652
	    argument: menu
cg@3013
   653
	  )
cg@3013
   654
	 (MenuItem
cg@3013
   655
	    activeHelpKey: addDelayedSubMenuLink
cg@3013
   656
	    enabled: canCreateDelayedMenuChannel
cg@3013
   657
	    label: 'Delayed Linked Menu'
cg@3013
   658
	    itemValue: doCreateDelayedMenu:
cg@3013
   659
	    translateLabel: true
cg@3013
   660
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedLinkedMenu '')
cg@3013
   661
	    argument: linkedMenu
cg@3013
   662
	  )
cg@3013
   663
	 (MenuItem
cg@3013
   664
	    label: '-'
cg@3013
   665
	  )
cg@3013
   666
	 (MenuItem
cg@3013
   667
	    label: 'Standard Menus'
cg@3013
   668
	    translateLabel: true
cg@3013
   669
	    submenuChannel: standardMenus
cg@3013
   670
	    keepLinkedMenu: true
cg@3013
   671
	  )
cg@3013
   672
	 )
cg@2275
   673
"/        nil
cg@2275
   674
"/        nil
ca@1606
   675
      )
ca@1606
   676
!
ca@1606
   677
ca@1606
   678
editMenu
ca@1606
   679
    "This resource specification was automatically generated
ca@1606
   680
     by the MenuEditor of ST/X."
ca@1606
   681
ca@1606
   682
    "Do not manually edit this!! If it is corrupted,
ca@1606
   683
     the MenuEditor may not be able to read the specification."
ca@1606
   684
ca@1606
   685
    "
ca@1606
   686
     MenuEditor new openOnClass:MenuEditor andSelector:#editMenu
ca@1606
   687
     (Menu new fromLiteralArrayEncoding:(MenuEditor editMenu)) startUp
ca@1606
   688
    "
ca@1606
   689
ca@1606
   690
    <resource: #menu>
ca@1606
   691
cg@3013
   692
    ^
cg@2186
   693
     #(Menu
cg@3135
   694
        (
cg@3135
   695
         (MenuItem
cg@3135
   696
            activeHelpKey: editCut
cg@3135
   697
            enabled: hasSelectionChannel
cg@3135
   698
            label: 'Cut'
cg@3135
   699
            itemValue: doCut
cg@3135
   700
            translateLabel: true
cg@3135
   701
            shortcutKey: Cut
cg@3135
   702
          )
cg@3135
   703
         (MenuItem
cg@3135
   704
            activeHelpKey: editCopy
cg@3135
   705
            enabled: hasSelectionChannel
cg@3135
   706
            label: 'Copy'
cg@3135
   707
            itemValue: doCopy
cg@3135
   708
            translateLabel: true
cg@3135
   709
            shortcutKey: Copy
cg@3135
   710
          )
cg@3135
   711
         (MenuItem
cg@3135
   712
            activeHelpKey: editPaste
cg@3135
   713
            enabled: canPasteHolder
cg@3135
   714
            label: 'Paste'
cg@3135
   715
            itemValue: doPaste
cg@3135
   716
            translateLabel: true
cg@3135
   717
            shortcutKey: Paste
cg@3135
   718
          )
cg@3135
   719
         (MenuItem
cg@3135
   720
            activeHelpKey: editDelete
cg@3135
   721
            enabled: hasSelectionChannel
cg@3135
   722
            label: 'Delete'
cg@3135
   723
            itemValue: doDelete
cg@3135
   724
            translateLabel: true
cg@3135
   725
            isVisible: false
cg@3135
   726
          )
cg@3135
   727
         (MenuItem
cg@3135
   728
            label: '-'
cg@3135
   729
          )
cg@3135
   730
         (MenuItem
cg@3135
   731
            activeHelpKey: makeLinkedMenu
cg@3135
   732
            enabled: hasNonLinkedMenuSelectedHolder
cg@3135
   733
            label: 'Make Linked Menu...'
cg@3135
   734
            itemValue: doMakeLinkedMenu
cg@3135
   735
            translateLabel: true
cg@3135
   736
          )
cg@3135
   737
         (MenuItem
cg@3135
   738
            label: '-'
cg@3135
   739
          )
cg@3135
   740
         (MenuItem
cg@3135
   741
            activeHelpKey: editMoveUp
cg@3135
   742
            enabled: enableMovingUpOrDownHolder
cg@3135
   743
            label: 'Move Up'
cg@3135
   744
            itemValue: doMoveUpOrDown:
cg@3135
   745
            translateLabel: true
cg@3135
   746
            startGroup: right
cg@3135
   747
            shortcutKey: CtrlCursorUp
cg@3135
   748
            labelImage: (ResourceRetriever Icon upIcon 'Move Up')
cg@3135
   749
            argument: up
cg@3135
   750
          )
cg@3135
   751
         (MenuItem
cg@3135
   752
            activeHelpKey: editMoveDown
cg@3135
   753
            enabled: enableMovingUpOrDownHolder
cg@3135
   754
            label: 'Move Down'
cg@3135
   755
            itemValue: doMoveUpOrDown:
cg@3135
   756
            translateLabel: true
cg@3135
   757
            shortcutKey: CtrlCursorDown
cg@3135
   758
            labelImage: (ResourceRetriever Icon downIcon 'Move Down')
cg@3135
   759
            argument: down
cg@3135
   760
          )
cg@3135
   761
         (MenuItem
cg@3135
   762
            activeHelpKey: editMoveIn
cg@3135
   763
            enabled: enableMovingInHolder
cg@3135
   764
            label: 'Move Into Next'
cg@3135
   765
            itemValue: doMoveIn:
cg@3135
   766
            translateLabel: true
cg@3135
   767
            shortcutKey: CtrlCursorRight
cg@3135
   768
            labelImage: (ResourceRetriever Icon downRightIcon 'Move Into Next')
cg@3135
   769
            argument: inNext
cg@3135
   770
          )
cg@3135
   771
         (MenuItem
cg@3135
   772
            activeHelpKey: editMoveInAbove
cg@3135
   773
            enabled: enableMovingInAboveHolder
cg@3135
   774
            label: 'Move Into Previous'
cg@3135
   775
            itemValue: doMoveIn:
cg@3135
   776
            translateLabel: true
cg@3135
   777
            labelImage: (ResourceRetriever Icon upRightIcon 'Move Into Previous' )
cg@3135
   778
            argument: inPrev
cg@3135
   779
          )
cg@3135
   780
         (MenuItem
cg@3135
   781
            activeHelpKey: editMoveOut
cg@3135
   782
            enabled: enableMovingOutHolder
cg@3135
   783
            label: 'Move Out'
cg@3135
   784
            itemValue: doMoveOut
cg@3135
   785
            translateLabel: true
cg@3135
   786
            shortcutKey: CtrlCursorLeft
cg@3135
   787
            labelImage: (ResourceRetriever Icon leftDownIcon 'Move Out' )
cg@3135
   788
          )
cg@3135
   789
         )
cg@3135
   790
        nil
cg@3135
   791
        nil
ca@1606
   792
      )
ca@1606
   793
!
ca@1606
   794
cg@2187
   795
editMenuForMainMenuWithoutAccelerators
cg@2187
   796
    "This resource specification was automatically generated
cg@2187
   797
     by the MenuEditor of ST/X."
cg@2187
   798
cg@2187
   799
    "Do not manually edit this!! If it is corrupted,
cg@2187
   800
     the MenuEditor may not be able to read the specification."
cg@2187
   801
cg@2187
   802
    "
cg@2187
   803
     MenuEditor new openOnClass:MenuEditor andSelector:#editMenuForMainMenuWithoutAccelerators
cg@2187
   804
     (Menu new fromLiteralArrayEncoding:(MenuEditor editMenuForMainMenuWithoutAccelerators)) startUp
cg@2187
   805
    "
cg@2187
   806
cg@2187
   807
    <resource: #menu>
cg@2187
   808
cg@2188
   809
    ^
cg@2187
   810
     #(Menu
cg@2188
   811
	(
cg@2188
   812
	 (MenuItem
cg@2188
   813
	    activeHelpKey: editCut
cg@2188
   814
	    enabled: hasSelectionChannel
cg@2188
   815
	    label: 'Cut'
cg@2188
   816
	    itemValue: doCut
cg@2188
   817
	    translateLabel: true
cg@2188
   818
	  )
cg@2188
   819
	 (MenuItem
cg@2188
   820
	    activeHelpKey: editCopy
cg@2188
   821
	    enabled: hasSelectionChannel
cg@2188
   822
	    label: 'Copy'
cg@2188
   823
	    itemValue: doCopy
cg@2188
   824
	    translateLabel: true
cg@2188
   825
	  )
cg@2188
   826
	 (MenuItem
cg@2188
   827
	    activeHelpKey: editPaste
cg@2188
   828
	    enabled: canPasteHolder
cg@2188
   829
	    label: 'Paste'
cg@2188
   830
	    itemValue: doPaste
cg@2188
   831
	    translateLabel: true
cg@2188
   832
	  )
cg@2188
   833
	 (MenuItem
cg@2188
   834
	    activeHelpKey: editDelete
cg@2188
   835
	    enabled: hasSelectionChannel
cg@2188
   836
	    label: 'Delete'
cg@2188
   837
	    itemValue: doDelete
cg@2188
   838
	    translateLabel: true
cg@2188
   839
	    isVisible: false
cg@2188
   840
	  )
cg@2188
   841
	 (MenuItem
cg@2188
   842
	    label: '-'
cg@2188
   843
	  )
cg@2188
   844
	 (MenuItem
cg@2188
   845
	    activeHelpKey: editMoveUp
cg@2188
   846
	    enabled: enableMovingUpOrDownHolder
cg@2188
   847
	    label: 'Move Up'
cg@2188
   848
	    itemValue: doMoveUpOrDown:
cg@2188
   849
	    translateLabel: true
cg@2188
   850
	    startGroup: right
cg@2188
   851
	    labelImage: (ResourceRetriever Icon upIcon 'Move Up')
cg@2188
   852
	    argument: up
cg@2188
   853
	  )
cg@2188
   854
	 (MenuItem
cg@2188
   855
	    activeHelpKey: editMoveDown
cg@2188
   856
	    enabled: enableMovingUpOrDownHolder
cg@2188
   857
	    label: 'Move Down'
cg@2188
   858
	    itemValue: doMoveUpOrDown:
cg@2188
   859
	    translateLabel: true
cg@2188
   860
	    labelImage: (ResourceRetriever Icon downIcon 'Move Down')
cg@2188
   861
	    argument: down
cg@2188
   862
	  )
cg@2188
   863
	 (MenuItem
cg@2188
   864
	    activeHelpKey: editMoveIn
cg@2188
   865
	    enabled: enableMovingInHolder
cg@2188
   866
	    label: 'Move Into Next'
cg@2188
   867
	    itemValue: doMoveIn:
cg@2188
   868
	    translateLabel: true
cg@2188
   869
	    labelImage: (ResourceRetriever Icon downRightIcon 'Move Into Next')
cg@2188
   870
	    argument: inNext
cg@2188
   871
	  )
cg@2188
   872
	 (MenuItem
cg@2188
   873
	    activeHelpKey: editMoveInAbove
cg@2188
   874
	    enabled: enableMovingInAboveHolder
cg@2188
   875
	    label: 'Move Into Previous'
cg@2188
   876
	    itemValue: doMoveIn:
cg@2188
   877
	    translateLabel: true
cg@2188
   878
	    labelImage: (ResourceRetriever Icon upRightIcon 'Move Into Previous')
cg@2188
   879
	    argument: inPrev
cg@2188
   880
	  )
cg@2188
   881
	 (MenuItem
cg@2188
   882
	    activeHelpKey: editMoveOut
cg@2188
   883
	    enabled: enableMovingOutHolder
cg@2188
   884
	    label: 'Move Out'
cg@2188
   885
	    itemValue: doMoveOut
cg@2188
   886
	    translateLabel: true
cg@2188
   887
	    labelImage: (ResourceRetriever Icon leftDownIcon 'Move Out')
cg@2188
   888
	  )
cg@2188
   889
	 )
cg@2188
   890
	nil
cg@2188
   891
	nil
cg@2187
   892
      )
cg@2187
   893
!
cg@2187
   894
ca@1606
   895
fileMenu
ca@1606
   896
    "This resource specification was automatically generated
ca@1606
   897
     by the MenuEditor of ST/X."
ca@1606
   898
ca@1606
   899
    "Do not manually edit this!! If it is corrupted,
ca@1606
   900
     the MenuEditor may not be able to read the specification."
ca@1606
   901
ca@1606
   902
    "
ca@1606
   903
     MenuEditor new openOnClass:MenuEditor andSelector:#fileMenu
ca@1606
   904
     (Menu new fromLiteralArrayEncoding:(MenuEditor fileMenu)) startUp
ca@1606
   905
    "
ca@1606
   906
ca@1606
   907
    <resource: #menu>
ca@1606
   908
cg@3013
   909
    ^
cg@1971
   910
     #(Menu
cg@3013
   911
	(
cg@3013
   912
	 (MenuItem
cg@3013
   913
	    isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser
cg@3013
   914
	    activeHelpKey: fileNew
cg@3013
   915
	    label: 'New'
cg@3013
   916
	    itemValue: doNew
cg@3013
   917
	    translateLabel: true
cg@3013
   918
	  )
cg@3013
   919
	 (MenuItem
cg@3013
   920
	    isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser
cg@3013
   921
	    label: '-'
cg@3013
   922
	  )
cg@3013
   923
	 (MenuItem
cg@3013
   924
	    isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser
cg@3013
   925
	    activeHelpKey: fileLoad
cg@3013
   926
	    label: 'Load...'
cg@3013
   927
	    itemValue: doLoad
cg@3013
   928
	    translateLabel: true
cg@3013
   929
	  )
cg@3013
   930
	 (MenuItem
cg@3013
   931
	    isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser
cg@3013
   932
	    label: '-'
cg@3013
   933
	  )
cg@3013
   934
	 (MenuItem
cg@3013
   935
	    isVisible: isEditingSpecOnly
cg@3013
   936
	    activeHelpKey: fileSaveSpec
cg@3013
   937
	    label: 'Save'
cg@3013
   938
	    itemValue: doSave
cg@3013
   939
	    translateLabel: true
cg@3013
   940
	  )
cg@3013
   941
	 (MenuItem
cg@3013
   942
	    isVisible: isNotEditingSpecOnly
cg@3013
   943
	    activeHelpKey: fileSave
cg@3013
   944
	    label: 'Save'
cg@3013
   945
	    itemValue: doSave
cg@3013
   946
	    translateLabel: true
cg@3013
   947
	  )
cg@3013
   948
	 (MenuItem
cg@3013
   949
	    isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser
cg@3013
   950
	    activeHelpKey: fileSaveAs
cg@3013
   951
	    label: 'Save As...'
cg@3013
   952
	    itemValue: doSaveAs
cg@3013
   953
	    translateLabel: true
cg@3013
   954
	  )
cg@3013
   955
	 (MenuItem
cg@3013
   956
	    label: '-'
cg@3013
   957
	  )
cg@3013
   958
	 (MenuItem
cg@3013
   959
	    activeHelpKey: filePickAMenu
cg@3013
   960
	    label: 'Pick a Menu...'
cg@3013
   961
	    itemValue: doPickAMenu
cg@3013
   962
	    translateLabel: true
cg@3013
   963
	  )
cg@3013
   964
	 (MenuItem
cg@3013
   965
	    activeHelpKey: fileChooseAMenu
cg@3013
   966
	    label: 'Choose a Menu...'
cg@3013
   967
	    itemValue: doChooseAMenu
cg@3013
   968
	    translateLabel: true
cg@3013
   969
	  )
cg@3013
   970
	 (MenuItem
cg@3013
   971
	    label: '-'
cg@3013
   972
	    isVisible: isStandAlone
cg@3013
   973
	  )
cg@3013
   974
	 (MenuItem
cg@3013
   975
	    activeHelpKey: fileBrowseClass
cg@3013
   976
	    enabled: hasValidSpecClass
cg@3013
   977
	    label: 'Browse Class'
cg@3013
   978
	    itemValue: doBrowseClass
cg@3013
   979
	    translateLabel: true
cg@3013
   980
	    isVisible: isStandAlone
cg@3013
   981
	  )
cg@3013
   982
	 (MenuItem
cg@3013
   983
	    activeHelpKey: fileShowMenuSpec
cg@3013
   984
	    label: 'Show Menu Spec'
cg@3013
   985
	    itemValue: doShowMenuSpec
cg@3013
   986
	    translateLabel: true
cg@3013
   987
	    isVisible: isStandAlone
cg@3013
   988
	  )
cg@3013
   989
	 (MenuItem
cg@3013
   990
	    label: '-'
cg@3013
   991
	    isVisible: isStandAlone
cg@3013
   992
	  )
cg@3013
   993
	 (MenuItem
cg@3013
   994
	    activeHelpKey: fileExit
cg@3013
   995
	    label: 'Exit'
cg@3013
   996
	    itemValue: closeRequest
cg@3013
   997
	    translateLabel: true
cg@3013
   998
	    isVisible: isStandAlone
cg@3013
   999
	  )
cg@3013
  1000
	 )
cg@3013
  1001
	nil
cg@3013
  1002
	nil
ca@1606
  1003
      )
ca@1606
  1004
!
ca@1606
  1005
ca@1614
  1006
generateMenu
ca@1614
  1007
    "This resource specification was automatically generated
ca@1614
  1008
     by the MenuEditor of ST/X."
ca@1614
  1009
ca@1614
  1010
    "Do not manually edit this!! If it is corrupted,
ca@1614
  1011
     the MenuEditor may not be able to read the specification."
ca@1614
  1012
ca@1614
  1013
    "
ca@1614
  1014
     MenuEditor new openOnClass:MenuEditor andSelector:#generateMenu
ca@1614
  1015
     (Menu new fromLiteralArrayEncoding:(MenuEditor generateMenu)) startUp
ca@1614
  1016
    "
ca@1614
  1017
ca@1614
  1018
    <resource: #menu>
ca@1614
  1019
cg@2188
  1020
    ^
ca@1614
  1021
     #(#Menu
cg@2188
  1022
	#(
cg@2188
  1023
	 #(#MenuItem
cg@2188
  1024
	    #activeHelpKey: #generateAspectMethods
cg@2188
  1025
	    #enabled: #hasValidSpecClass
cg@2188
  1026
	    #label: 'Aspect Methods'
cg@2188
  1027
	    #itemValue: #doGenerateAspectMethods
cg@2188
  1028
	    #translateLabel: true
cg@2188
  1029
	  )
cg@2188
  1030
	 )
cg@2188
  1031
	nil
cg@2188
  1032
	nil
ca@1614
  1033
      )
ca@1614
  1034
!
ca@1614
  1035
ca@1606
  1036
helpMenu
ca@1606
  1037
    "This resource specification was automatically generated
ca@1606
  1038
     by the MenuEditor of ST/X."
ca@1606
  1039
ca@1606
  1040
    "Do not manually edit this!! If it is corrupted,
ca@1606
  1041
     the MenuEditor may not be able to read the specification."
ca@1606
  1042
ca@1606
  1043
    "
ca@1606
  1044
     MenuEditor new openOnClass:MenuEditor andSelector:#helpMenu
ca@1606
  1045
     (Menu new fromLiteralArrayEncoding:(MenuEditor helpMenu)) startUp
ca@1606
  1046
    "
ca@1606
  1047
ca@1606
  1048
    <resource: #menu>
ca@1606
  1049
cg@2188
  1050
    ^
ca@1606
  1051
     #(#Menu
cg@2188
  1052
	#(
cg@2188
  1053
	 #(#MenuItem
cg@2188
  1054
	    #activeHelpKey: #helpTutorial
cg@2188
  1055
	    #label: 'Documentation'
cg@2188
  1056
	    #itemValue: #openHTMLDocument:
cg@2188
  1057
	    #translateLabel: true
cg@2188
  1058
	    #argument: 'tools/uipainter/MenuEditor.html'
cg@2188
  1059
	  )
cg@2188
  1060
	 #(#MenuItem
cg@2188
  1061
	    #label: '-'
cg@2188
  1062
	  )
cg@2188
  1063
	 #(#MenuItem
cg@2188
  1064
	    #activeHelpKey: #helpHelpTool
cg@2188
  1065
	    #label: 'Help Tool'
cg@2188
  1066
	    #itemValue: #openHTMLDocument:
cg@2188
  1067
	    #translateLabel: true
cg@2188
  1068
	    #argument: 'tools/uipainter/HelpTool.html'
cg@2188
  1069
	  )
cg@2188
  1070
	 #(#MenuItem
cg@2188
  1071
	    #label: '-'
cg@2188
  1072
	  )
cg@2188
  1073
	 #(#MenuItem
cg@2188
  1074
	    #activeHelpKey: #helpShowHelp
cg@2188
  1075
	    #label: 'Show Help Texts'
cg@2188
  1076
	    #translateLabel: true
cg@2188
  1077
	    #indication: #showingHelp:
cg@2188
  1078
	  )
cg@2188
  1079
	 #(#MenuItem
cg@2188
  1080
	    #label: '-'
cg@2188
  1081
	  )
cg@2188
  1082
	 #(#MenuItem
cg@2188
  1083
	    #activeHelpKey: #aboutThisAppliaction
cg@2188
  1084
	    #label: 'About MenuEditor...'
cg@2188
  1085
	    #itemValue: #openAboutThisApplication
cg@2188
  1086
	    #translateLabel: true
cg@2188
  1087
	  )
cg@2188
  1088
	 )
cg@2188
  1089
	nil
cg@2188
  1090
	nil
ca@1606
  1091
      )
ca@1606
  1092
!
ca@1606
  1093
ca@1606
  1094
menu
ca@1606
  1095
    "This resource specification was automatically generated
ca@1606
  1096
     by the MenuEditor of ST/X."
ca@1606
  1097
ca@1606
  1098
    "Do not manually edit this!! If it is corrupted,
ca@1606
  1099
     the MenuEditor may not be able to read the specification."
ca@1606
  1100
ca@1606
  1101
    "
ca@1606
  1102
     MenuEditor new openOnClass:MenuEditor andSelector:#menu
ca@1606
  1103
     (Menu new fromLiteralArrayEncoding:(MenuEditor menu)) startUp
ca@1606
  1104
    "
ca@1606
  1105
ca@1606
  1106
    <resource: #menu>
ca@1606
  1107
cg@3013
  1108
    ^
ca@1775
  1109
     #(Menu
cg@3013
  1110
	(
cg@3013
  1111
	 (MenuItem
cg@3013
  1112
	    label: '&File'
cg@3013
  1113
	    translateLabel: true
cg@3013
  1114
	    submenuChannel: fileMenu
cg@3013
  1115
	    keepLinkedMenu: true
cg@3013
  1116
	    ignoreMnemonicKeys: true
cg@3013
  1117
	    ignoreShortcutKeys: true
cg@3013
  1118
	  )
cg@3013
  1119
	 (MenuItem
cg@3013
  1120
	    label: '&Edit'
cg@3013
  1121
	    translateLabel: true
cg@3013
  1122
	    submenuChannel: editMenuForMainMenuWithoutAccelerators
cg@3013
  1123
	    keepLinkedMenu: true
cg@3013
  1124
	  )
cg@3013
  1125
	 (MenuItem
cg@3013
  1126
	    enabled: hasSingleSelectionChannel
cg@3013
  1127
	    label: 'Item'
cg@3013
  1128
	    translateLabel: true
cg@3013
  1129
	    submenuChannel: addMenu
cg@3013
  1130
	    keepLinkedMenu: true
cg@3013
  1131
	    ignoreMnemonicKeys: true
cg@3013
  1132
	    ignoreShortcutKeys: true
cg@3013
  1133
	  )
cg@3013
  1134
	 (MenuItem
cg@3013
  1135
	    isVisible: isNotEditingSpecOnly
cg@3013
  1136
	    label: 'Generate'
cg@3013
  1137
	    translateLabel: true
cg@3013
  1138
	    submenuChannel: generateMenu
cg@3013
  1139
	    keepLinkedMenu: true
cg@3013
  1140
	    ignoreMnemonicKeys: true
cg@3013
  1141
	    ignoreShortcutKeys: true
cg@3013
  1142
	  )
cg@3013
  1143
	 (MenuItem
cg@3013
  1144
	    label: 'Test'
cg@3013
  1145
	    translateLabel: true
cg@3013
  1146
	    submenuChannel: submenuTest
cg@3013
  1147
	    ignoreMnemonicKeys: true
cg@3013
  1148
	    ignoreShortcutKeys: true
cg@3013
  1149
	  )
cg@3013
  1150
	 (MenuItem
cg@3013
  1151
	    label: 'Settings'
cg@3013
  1152
	    translateLabel: true
cg@3013
  1153
	    submenuChannel: settingsMenu
cg@3013
  1154
	    keepLinkedMenu: true
cg@3013
  1155
	    ignoreMnemonicKeys: true
cg@3013
  1156
	    ignoreShortcutKeys: true
cg@3013
  1157
	  )
cg@3013
  1158
	 (MenuItem
cg@3013
  1159
	    label: 'History'
cg@3013
  1160
	    translateLabel: true
cg@3013
  1161
	    isVisible: isStandAlone
cg@3013
  1162
	    submenuChannel: menuHistory
cg@3013
  1163
	    ignoreMnemonicKeys: true
cg@3013
  1164
	    ignoreShortcutKeys: true
cg@3013
  1165
	  )
cg@3013
  1166
	 (MenuItem
cg@3013
  1167
	    label: 'MENU_Help'
cg@3013
  1168
	    translateLabel: true
cg@3013
  1169
	    startGroup: conditionalRight
cg@3013
  1170
	    submenuChannel: helpMenu
cg@3013
  1171
	    keepLinkedMenu: true
cg@3013
  1172
	    ignoreMnemonicKeys: true
cg@3013
  1173
	    ignoreShortcutKeys: true
cg@3013
  1174
	  )
cg@3013
  1175
	 )
cg@3013
  1176
	nil
cg@3013
  1177
	nil
ca@1606
  1178
      )
ca@1606
  1179
!
ca@1606
  1180
cg@1631
  1181
settingsMenu
cg@1631
  1182
    "This resource specification was automatically generated
cg@1631
  1183
     by the MenuEditor of ST/X."
cg@1631
  1184
cg@1631
  1185
    "Do not manually edit this!! If it is corrupted,
cg@1631
  1186
     the MenuEditor may not be able to read the specification."
cg@1631
  1187
cg@1631
  1188
    "
cg@1632
  1189
     MenuEditor new openOnClass:MenuEditor andSelector:#settingsMenu
cg@1632
  1190
     (Menu new fromLiteralArrayEncoding:(MenuEditor settingsMenu)) startUp
cg@1631
  1191
    "
cg@1631
  1192
cg@1631
  1193
    <resource: #menu>
cg@1631
  1194
cg@2188
  1195
    ^
cg@1631
  1196
     #(#Menu
cg@3013
  1197
	#(
cg@3013
  1198
	 #(#MenuItem
cg@3013
  1199
	    isVisible: isNotEditingSpecOnly
cg@3013
  1200
	    #activeHelpKey: #settingsRedefineAspectMethods
cg@3013
  1201
	    #enabled: #hasValidSpecClass
cg@3013
  1202
	    #label: 'Redefine Aspect Methods'
cg@3013
  1203
	    #translateLabel: true
cg@3013
  1204
	    #hideMenuOnActivated: false
cg@3013
  1205
	    #indication: #redefineAspectMethodsChannel
cg@3013
  1206
	  )
cg@3013
  1207
	 #(#MenuItem
cg@3013
  1208
	    #activeHelpKey: #settingsRedefineAspectMethods
cg@3013
  1209
	    #label: 'AutoAccept on Selection-Change'
cg@3013
  1210
	    #translateLabel: true
cg@3013
  1211
	    #hideMenuOnActivated: false
cg@3013
  1212
	    #indication: #autoAcceptOnSelectionChange
cg@3013
  1213
	  )
cg@3013
  1214
	 )
cg@3013
  1215
	nil
cg@3013
  1216
	nil
cg@1631
  1217
      )
cg@1631
  1218
!
cg@1631
  1219
ca@1606
  1220
standardMenus
ca@1606
  1221
    "This resource specification was automatically generated
ca@1606
  1222
     by the MenuEditor of ST/X."
ca@1606
  1223
ca@1606
  1224
    "Do not manually edit this!! If it is corrupted,
ca@1606
  1225
     the MenuEditor may not be able to read the specification."
ca@1606
  1226
ca@1606
  1227
    "
ca@1606
  1228
     MenuEditor new openOnClass:MenuEditor andSelector:#standardMenus
ca@1606
  1229
     (Menu new fromLiteralArrayEncoding:(MenuEditor standardMenus)) startUp
ca@1606
  1230
    "
ca@1606
  1231
ca@1606
  1232
    <resource: #menu>
ca@1606
  1233
cg@2188
  1234
    ^
ca@1606
  1235
     #(#Menu
cg@2188
  1236
	#(
cg@2188
  1237
	 #(#MenuItem
cg@2188
  1238
	    #label: 'Standard Menu: File'
cg@2188
  1239
	    #itemValue: #doCreateStandardFileMenu
cg@2188
  1240
	    #translateLabel: true
cg@2188
  1241
	  )
cg@2188
  1242
	 #(#MenuItem
cg@2188
  1243
	    #label: 'Standard Menu: Edit'
cg@2188
  1244
	    #itemValue: #doCreateStandardEditMenu
cg@2188
  1245
	    #translateLabel: true
cg@2188
  1246
	  )
cg@2188
  1247
	 #(#MenuItem
cg@2188
  1248
	    #label: 'Standard Menu: Help'
cg@2188
  1249
	    #itemValue: #doCreateStandardHelpMenu
cg@2188
  1250
	    #translateLabel: true
cg@2188
  1251
	  )
cg@2188
  1252
	 )
cg@2188
  1253
	nil
cg@2188
  1254
	nil
ca@1606
  1255
      )
ca@1606
  1256
!
ca@1606
  1257
ca@1606
  1258
toolbar
ca@1606
  1259
    "This resource specification was automatically generated
ca@1606
  1260
     by the MenuEditor of ST/X."
ca@1606
  1261
ca@1606
  1262
    "Do not manually edit this!! If it is corrupted,
ca@1606
  1263
     the MenuEditor may not be able to read the specification."
ca@1606
  1264
ca@1606
  1265
    "
ca@1606
  1266
     MenuEditor new openOnClass:MenuEditor andSelector:#toolbar
ca@1606
  1267
     (Menu new fromLiteralArrayEncoding:(MenuEditor toolbar)) startUp
ca@1606
  1268
    "
ca@1606
  1269
ca@1606
  1270
    <resource: #menu>
ca@1606
  1271
cg@3013
  1272
    ^
cg@1749
  1273
     #(Menu
cg@3013
  1274
	(
cg@3013
  1275
	 (MenuItem
cg@3013
  1276
	    activeHelpKey: fileNew
cg@3013
  1277
	    label: 'New'
cg@3013
  1278
	    itemValue: doNew
cg@3013
  1279
	    translateLabel: true
cg@3013
  1280
	    isButton: true
cg@3013
  1281
	    labelImage: (ResourceRetriever ToolbarIconLibrary newMenuIcon)
cg@3013
  1282
	  )
cg@3013
  1283
	 (MenuItem
cg@3013
  1284
	    label: '-'
cg@3013
  1285
	  )
cg@3013
  1286
	 (MenuItem
cg@3013
  1287
	    activeHelpKey: fileLoad
cg@3013
  1288
	    label: 'Load'
cg@3013
  1289
	    itemValue: doLoad
cg@3013
  1290
	    translateLabel: true
cg@3013
  1291
	    isButton: true
cg@3013
  1292
	    isVisible: isNotEditingSpecOnly
cg@3013
  1293
	    submenuChannel: menuHistory
cg@3013
  1294
	    labelImage: (ResourceRetriever ToolbarIconLibrary loadFromMethodIcon)
cg@3013
  1295
	    keepLinkedMenu: true
cg@3013
  1296
	  )
cg@3013
  1297
	 (MenuItem
cg@3013
  1298
	    activeHelpKey: fileSave
cg@3013
  1299
	    label: 'Save'
cg@3013
  1300
	    itemValue: doSave
cg@3013
  1301
	    translateLabel: true
cg@3013
  1302
	    isButton: true
cg@3013
  1303
	    isVisible: isNotEditingSpecOnly
cg@3013
  1304
	    labelImage: (ResourceRetriever ToolbarIconLibrary saveAsMethodIcon)
cg@3013
  1305
	  )
cg@3013
  1306
	 (MenuItem
cg@3013
  1307
	    activeHelpKey: fileSaveSpec
cg@3013
  1308
	    label: 'Save'
cg@3013
  1309
	    itemValue: doSave
cg@3013
  1310
	    translateLabel: true
cg@3013
  1311
	    isButton: true
cg@3013
  1312
	    isVisible: isEditingSpecOnly
cg@3013
  1313
	    labelImage: (ResourceRetriever XPToolbarIconLibrary saveImageIcon)
cg@3013
  1314
	  )
cg@3013
  1315
	 (MenuItem
cg@3013
  1316
	    label: '-'
cg@3013
  1317
	  )
cg@3013
  1318
	 (MenuItem
cg@3013
  1319
	    activeHelpKey: editCut
cg@3013
  1320
	    enabled: hasSelectionChannel
cg@3013
  1321
	    label: 'Cut'
cg@3013
  1322
	    itemValue: doCut
cg@3013
  1323
	    translateLabel: true
cg@3013
  1324
	    isButton: true
cg@3013
  1325
	    labelImage: (ResourceRetriever ToolbarIconLibrary cutMenuItemIcon)
cg@3013
  1326
	  )
cg@3013
  1327
	 (MenuItem
cg@3013
  1328
	    activeHelpKey: editCopy
cg@3013
  1329
	    enabled: hasSelectionChannel
cg@3013
  1330
	    label: 'Copy'
cg@3013
  1331
	    itemValue: doCopy
cg@3013
  1332
	    translateLabel: true
cg@3013
  1333
	    isButton: true
cg@3013
  1334
	    labelImage: (ResourceRetriever ToolbarIconLibrary copyMenuItemIcon)
cg@3013
  1335
	  )
cg@3013
  1336
	 (MenuItem
cg@3013
  1337
	    activeHelpKey: editPaste
cg@3013
  1338
	    enabled: canPasteHolder
cg@3013
  1339
	    label: 'Paste'
cg@3013
  1340
	    itemValue: doPaste
cg@3013
  1341
	    translateLabel: true
cg@3013
  1342
	    isButton: true
cg@3013
  1343
	    labelImage: (ResourceRetriever ToolbarIconLibrary pasteMenuItemIcon)
cg@3013
  1344
	  )
cg@3013
  1345
	 (MenuItem
cg@3013
  1346
	    label: '-'
cg@3013
  1347
	  )
cg@3013
  1348
	 (MenuItem
cg@3013
  1349
	    activeHelpKey: addMenuItem
cg@3013
  1350
	    enabled: hasSingleSelectionChannel
cg@3013
  1351
	    label: 'Add Item'
cg@3013
  1352
	    itemValue: doCreateItem
cg@3013
  1353
	    translateLabel: true
cg@3013
  1354
	    isButton: true
cg@3013
  1355
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconItem)
cg@3013
  1356
	  )
cg@3013
  1357
	 (MenuItem
cg@3013
  1358
	    activeHelpKey: addMenuSeparator
cg@3013
  1359
	    enabled: hasSingleSelectionChannel
cg@3013
  1360
	    label: 'Add Separator'
cg@3013
  1361
	    itemValue: doCreateSep
cg@3013
  1362
	    translateLabel: true
cg@3013
  1363
	    isButton: true
cg@3013
  1364
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconSeparator)
cg@3013
  1365
	  )
cg@3013
  1366
	 (MenuItem
cg@3013
  1367
	    activeHelpKey: addMenuSlice
cg@3013
  1368
	    enabled: hasSingleSelectionChannel
cg@3013
  1369
	    label: 'Menu Slice'
cg@3013
  1370
	    itemValue: doCreateMenuSliceItem
cg@3013
  1371
	    translateLabel: true
cg@3013
  1372
	    isButton: true
cg@3013
  1373
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconSliceMenu)
cg@3013
  1374
	  )
cg@3013
  1375
	 (MenuItem
cg@3013
  1376
	    activeHelpKey: addSubMenu
cg@3013
  1377
	    enabled: hasSingleSelectionChannel
cg@3013
  1378
	    label: 'Add Menu'
cg@3013
  1379
	    itemValue: doCreateMenu
cg@3013
  1380
	    translateLabel: true
cg@3013
  1381
	    isButton: true
cg@3013
  1382
	    submenuChannel: standardMenus
cg@3013
  1383
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconMenu)
cg@3013
  1384
	    keepLinkedMenu: true
cg@3013
  1385
	  )
cg@3013
  1386
	 (MenuItem
cg@3013
  1387
	    activeHelpKey: addSubMenuLink
cg@3013
  1388
	    enabled: hasSingleSelectionChannel
cg@3013
  1389
	    label: 'Add Linked Menu'
cg@3013
  1390
	    itemValue: doCreateLinkedMenu
cg@3013
  1391
	    translateLabel: true
cg@3013
  1392
	    isButton: true
cg@3013
  1393
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconLinkedMenu)
cg@3013
  1394
	  )
cg@3013
  1395
	 (MenuItem
cg@3013
  1396
	    activeHelpKey: addDelayedMenu
cg@3013
  1397
	    enabled: canCreateDelayedMenuChannel
cg@3013
  1398
	    label: 'Add Delayed Menu'
cg@3013
  1399
	    itemValue: doCreateDelayedMenu:
cg@3013
  1400
	    translateLabel: true
cg@3013
  1401
	    isButton: true
cg@3013
  1402
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedMenu)
cg@3013
  1403
	    argument: menu
cg@3013
  1404
	  )
cg@3013
  1405
	 (MenuItem
cg@3013
  1406
	    activeHelpKey: addDelayedSubMenuLink
cg@3013
  1407
	    enabled: canCreateDelayedMenuChannel
cg@3013
  1408
	    label: 'Add Delayed Linked Menu'
cg@3013
  1409
	    itemValue: doCreateDelayedMenu:
cg@3013
  1410
	    translateLabel: true
cg@3013
  1411
	    isButton: true
cg@3013
  1412
	    labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedLinkedMenu)
cg@3013
  1413
	    argument: linkedMenu
cg@3013
  1414
	  )
cg@3013
  1415
	 (MenuItem
cg@3013
  1416
	    label: ''
cg@3013
  1417
	  )
cg@3013
  1418
	 (MenuItem
cg@3013
  1419
	    activeHelpKey: editMoveUp
cg@3013
  1420
	    enabled: enableMovingUpOrDownHolder
cg@3013
  1421
	    label: 'Move Up'
cg@3013
  1422
	    itemValue: doMoveUp
cg@3013
  1423
	    translateLabel: true
cg@3013
  1424
	    isButton: true
cg@3013
  1425
	    startGroup: right
cg@3013
  1426
	    labelImage: (ResourceRetriever Icon upIcon)
cg@3013
  1427
	  )
cg@3013
  1428
	 (MenuItem
cg@3013
  1429
	    activeHelpKey: editMoveDown
cg@3013
  1430
	    enabled: enableMovingUpOrDownHolder
cg@3013
  1431
	    label: 'Move Down'
cg@3013
  1432
	    itemValue: doMoveDown
cg@3013
  1433
	    translateLabel: true
cg@3013
  1434
	    isButton: true
cg@3013
  1435
	    labelImage: (ResourceRetriever Icon downIcon)
cg@3013
  1436
	  )
cg@3013
  1437
	 (MenuItem
cg@3013
  1438
	    activeHelpKey: editMoveIn
cg@3013
  1439
	    enabled: enableMovingInHolder
cg@3013
  1440
	    label: 'Move Into Next'
cg@3013
  1441
	    itemValue: doMoveInNext
cg@3013
  1442
	    translateLabel: true
cg@3013
  1443
	    isButton: true
cg@3013
  1444
	    labelImage: (ResourceRetriever Icon downRightIcon)
cg@3013
  1445
	  )
cg@3013
  1446
	 (MenuItem
cg@3013
  1447
	    activeHelpKey: editMoveInAbove
cg@3013
  1448
	    enabled: enableMovingInAboveHolder
cg@3013
  1449
	    label: 'Move Into Previous'
cg@3013
  1450
	    itemValue: doMoveInPrevious
cg@3013
  1451
	    translateLabel: true
cg@3013
  1452
	    isButton: true
cg@3013
  1453
	    labelImage: (ResourceRetriever Icon upRightIcon)
cg@3013
  1454
	  )
cg@3013
  1455
	 (MenuItem
cg@3013
  1456
	    activeHelpKey: editMoveOut
cg@3013
  1457
	    enabled: enableMovingOutHolder
cg@3013
  1458
	    label: 'Move Out'
cg@3013
  1459
	    itemValue: doMoveOut
cg@3013
  1460
	    translateLabel: true
cg@3013
  1461
	    isButton: true
cg@3013
  1462
	    labelImage: (ResourceRetriever Icon leftDownIcon)
cg@3013
  1463
	  )
cg@3013
  1464
	 )
cg@3013
  1465
	nil
cg@3013
  1466
	nil
ca@1606
  1467
      )
ca@1606
  1468
! !
ca@1606
  1469
cg@1725
  1470
!MenuEditor class methodsFor:'menu specs-standard'!
ca@1606
  1471
ca@1606
  1472
standardEditMenu
ca@1606
  1473
    "This resource specification was automatically generated
ca@1606
  1474
     by the MenuEditor of ST/X."
ca@1606
  1475
ca@1606
  1476
    "Do not manually edit this!! If it is corrupted,
ca@1606
  1477
     the MenuEditor may not be able to read the specification."
ca@1606
  1478
ca@1606
  1479
    "
ca@1606
  1480
     MenuEditor new openOnClass:MenuEditor andSelector:#standardEditMenu
ca@1606
  1481
     (Menu new fromLiteralArrayEncoding:(MenuEditor standardEditMenu)) startUp
ca@1606
  1482
    "
ca@1606
  1483
ca@1606
  1484
    <resource: #menu>
ca@1606
  1485
cg@2188
  1486
    ^
ca@1606
  1487
     #(#Menu
cg@2188
  1488
	#(
cg@2188
  1489
	 #(#MenuItem
cg@2188
  1490
	    #label: 'Cut'
cg@2188
  1491
	    #translateLabel: true
cg@2188
  1492
	    #value: #cutSelection
cg@2188
  1493
	  )
cg@2188
  1494
	 #(#MenuItem
cg@2188
  1495
	    #label: 'Copy'
cg@2188
  1496
	    #translateLabel: true
cg@2188
  1497
	    #value: #copySelection
cg@2188
  1498
	  )
cg@2188
  1499
	 #(#MenuItem
cg@2188
  1500
	    #label: 'Paste'
cg@2188
  1501
	    #translateLabel: true
cg@2188
  1502
	    #value: #paste
cg@2188
  1503
	  )
cg@2188
  1504
	 )
cg@2188
  1505
	nil
cg@2188
  1506
	nil
ca@1606
  1507
      )
ca@1606
  1508
!
ca@1606
  1509
ca@1606
  1510
standardFileMenu
ca@1606
  1511
    "This resource specification was automatically generated
ca@1606
  1512
     by the MenuEditor of ST/X."
ca@1606
  1513
ca@1606
  1514
    "Do not manually edit this!! If it is corrupted,
ca@1606
  1515
     the MenuEditor may not be able to read the specification."
ca@1606
  1516
ca@1606
  1517
    "
ca@1606
  1518
     MenuEditor new openOnClass:MenuEditor andSelector:#standardFileMenu
ca@1606
  1519
     (Menu new fromLiteralArrayEncoding:(MenuEditor standardFileMenu)) startUp
ca@1606
  1520
    "
ca@1606
  1521
ca@1606
  1522
    <resource: #menu>
ca@1606
  1523
cg@2188
  1524
    ^
ca@1606
  1525
     #(#Menu
ca@1606
  1526
	#(
ca@1606
  1527
	 #(#MenuItem
ca@1606
  1528
	    #label: 'New'
ca@1606
  1529
	    #translateLabel: true
ca@1606
  1530
	    #value: #menuNew
ca@1606
  1531
	  )
ca@1606
  1532
	 #(#MenuItem
ca@1606
  1533
	    #label: '-'
ca@1606
  1534
	  )
ca@1606
  1535
	 #(#MenuItem
ca@1606
  1536
	    #label: 'Open...'
ca@1606
  1537
	    #translateLabel: true
ca@1606
  1538
	    #value: #menuOpen
ca@1606
  1539
	  )
ca@1606
  1540
	 #(#MenuItem
ca@1606
  1541
	    #label: '-'
ca@1606
  1542
	  )
ca@1606
  1543
	 #(#MenuItem
ca@1606
  1544
	    #label: 'Save'
ca@1606
  1545
	    #translateLabel: true
ca@1606
  1546
	    #value: #menuSave
ca@1606
  1547
	  )
ca@1606
  1548
	 #(#MenuItem
ca@1606
  1549
	    #label: 'Save As...'
ca@1606
  1550
	    #translateLabel: true
ca@1606
  1551
	    #value: #menuSaveAs
ca@1606
  1552
	  )
ca@1606
  1553
	 #(#MenuItem
ca@1606
  1554
	    #label: '-'
ca@1606
  1555
	  )
ca@1606
  1556
	 #(#MenuItem
ca@1606
  1557
	    #label: 'Exit'
ca@1606
  1558
	    #translateLabel: true
ca@1606
  1559
	    #value: #closeRequest
ca@1606
  1560
	  )
ca@1606
  1561
	 )
ca@1606
  1562
	nil
ca@1606
  1563
	nil
ca@1606
  1564
      )
ca@1606
  1565
!
ca@1606
  1566
ca@1606
  1567
standardHelpMenu
ca@1606
  1568
    "This resource specification was automatically generated
ca@1606
  1569
     by the MenuEditor of ST/X."
ca@1606
  1570
ca@1606
  1571
    "Do not manually edit this!! If it is corrupted,
ca@1606
  1572
     the MenuEditor may not be able to read the specification."
ca@1606
  1573
ca@1606
  1574
    "
ca@1606
  1575
     MenuEditor new openOnClass:MenuEditor andSelector:#standardHelpMenu
ca@1606
  1576
     (Menu new fromLiteralArrayEncoding:(MenuEditor standardHelpMenu)) startUp
ca@1606
  1577
    "
ca@1606
  1578
ca@1606
  1579
    <resource: #menu>
ca@1606
  1580
cg@2188
  1581
    ^
ca@1606
  1582
     #(#Menu
cg@2188
  1583
	#(
cg@2188
  1584
	 #(#MenuItem
cg@2188
  1585
	    #label: 'Documentation'
cg@2188
  1586
	    #translateLabel: true
cg@2188
  1587
	    #value: #openDocumentation
cg@2188
  1588
	  )
cg@2188
  1589
	 #(#MenuItem
cg@2188
  1590
	    #label: '-'
cg@2188
  1591
	  )
cg@2188
  1592
	 #(#MenuItem
cg@2188
  1593
	    #label: 'About this Application...'
cg@2188
  1594
	    #translateLabel: true
cg@2188
  1595
	    #value: #openAboutThisApplication
cg@2188
  1596
	  )
cg@2188
  1597
	 )
cg@2188
  1598
	nil
cg@2188
  1599
	nil
ca@1606
  1600
      )
ca@1606
  1601
! !
ca@1606
  1602
ca@1606
  1603
!MenuEditor methodsFor:'accessing'!
ca@1606
  1604
cg@2123
  1605
helpSpec
sv@3016
  1606
    |spec t g|
cg@2123
  1607
cg@2123
  1608
    spec := super helpSpec.
cg@2123
  1609
    t := spec at:#detailsStartGroup.
cg@2123
  1610
    g := (aspects at:#startGroup ifAbsent:nil) value.
cg@2123
  1611
    g == #conditionalRight ifTrue:[
sv@3016
  1612
        t := t , ' #conditionalRight means: "right on non-win32 systems"'
cg@2123
  1613
    ].
cg@2123
  1614
    g == #right ifTrue:[
sv@3016
  1615
        t := t , ' #right means: "right align from here"'
cg@2123
  1616
    ].
cg@2123
  1617
    g == #left ifTrue:[
sv@3016
  1618
        t := t , ' #left means: "left align group"'
cg@2123
  1619
    ].
cg@2123
  1620
    spec at:#detailsStartGroup put:t.
cg@2123
  1621
cg@2123
  1622
    ^ spec.
cg@2123
  1623
"/ #detailsStartGroup
cg@2123
  1624
"/ 'Specify start of a right-aligned item group.'
cg@2123
  1625
cg@2123
  1626
    "Created: / 16-10-2006 / 13:19:14 / cg"
cg@2123
  1627
!
cg@2123
  1628
ca@1606
  1629
helpTool
ca@1606
  1630
    "get the help tool application
ca@1606
  1631
    "
ca@1669
  1632
    ^ wizards at:#help ifAbsentPut:[ |tool|
cg@2188
  1633
	tool := UIHelpTool new.
cg@2188
  1634
	tool masterApplication:self.
cg@2188
  1635
	tool modifiedHolder: self enablingCommitButtonsHolder.
cg@2188
  1636
	tool builder window:(ApplicationSubView new client:tool spec:#innerSpec).
cg@2188
  1637
	tool masterApplication:self.
cg@2188
  1638
	tool
ca@1606
  1639
    ]
ca@1606
  1640
!
ca@1606
  1641
ca@1606
  1642
imageTool
cg@2850
  1643
    "get the image tool application"
cg@2850
  1644
cg@3013
  1645
    ^ wizards
cg@3013
  1646
	at:#image
cg@3013
  1647
	ifAbsentPut:[
cg@3013
  1648
	    |tool|
cg@3013
  1649
cg@3013
  1650
	    tool := ImageResourceEditor new createBuilder.
cg@3013
  1651
	    tool masterApplication:self.
cg@3013
  1652
	    tool modifiedChannel: self enablingCommitButtonsHolder.
cg@3013
  1653
	    tool builder window:(ApplicationSubView new client:tool).
cg@3013
  1654
	    tool
cg@3013
  1655
	]
cg@2850
  1656
cg@2850
  1657
    "Modified: / 03-08-2011 / 10:03:08 / cg"
ca@1606
  1658
!
ca@1606
  1659
cg@2569
  1660
savedSpec
cg@2569
  1661
    ^ savedSpec
cg@2569
  1662
!
cg@2569
  1663
ca@1606
  1664
useHelpTool:aHelpTool
ca@1606
  1665
    "take the help dictionaries from aHelpTool into my helpTool
ca@1606
  1666
    "
cg@1971
  1667
    self helpTool loadFromHelpTool:aHelpTool.
ca@1606
  1668
! !
ca@1606
  1669
ca@1606
  1670
!MenuEditor methodsFor:'actions'!
ca@1606
  1671
ca@1606
  1672
accept
ca@1606
  1673
    "accept modifications
ca@1606
  1674
    "
ca@1606
  1675
    self accept:true.
ca@1606
  1676
!
ca@1606
  1677
ca@1606
  1678
accept:ok
cg@2297
  1679
    "if ok is true, the modifications are accepted.
cg@2297
  1680
     then reload from item
ca@1606
  1681
    "
ca@1606
  1682
    |selectedItem rscRetrHolder helpKeyHolder helpTool imageTool acceptChannel|
ca@1606
  1683
ca@1606
  1684
    selectedItem := self selectedItem.
ca@1606
  1685
cg@2862
  1686
    selectedItem notNil ifTrue:[
cg@3013
  1687
	self withoutNotifyDo:[
cg@3013
  1688
	    rscRetrHolder := aspects at:#resourceRetriever.
cg@3013
  1689
	    helpKeyHolder := aspects at:#activeHelpKey.
cg@3013
  1690
	    imageTool     := self imageTool.
cg@3013
  1691
	    helpTool      := self helpTool.
cg@3013
  1692
	    acceptChannel := self acceptChannel.
cg@3013
  1693
cg@3013
  1694
	    acceptChannel triggerValue:true.
cg@3013
  1695
	    acceptChannel setValue:false.
cg@3013
  1696
cg@3013
  1697
	    ok ifTrue:[
cg@3013
  1698
		helpTool accept.
cg@3013
  1699
		rscRetrHolder value:(imageTool resourceRetriever).
cg@3013
  1700
		helpKeyHolder value:(helpTool helpKey).
cg@3013
  1701
		selectedItem  fromAspects:aspects.
cg@3013
  1702
		self setModified.
cg@3013
  1703
cg@3013
  1704
		selectedItem isRootItem ifTrue:[
cg@3013
  1705
		    "/ update specSelector
cg@3013
  1706
		    specSelector := selectedItem rawLabel.
cg@3013
  1707
		].
cg@3013
  1708
	    ].
cg@3013
  1709
	    selectedItem toAspects:aspects.
cg@3013
  1710
	    helpTool     helpKey:(helpKeyHolder value).
cg@3013
  1711
	    imageTool    resourceRetriever:(rscRetrHolder value).
cg@3013
  1712
	]
ca@1606
  1713
    ].
ca@1606
  1714
    self updateChannels.
cg@2075
  1715
"/    self clearModified.
cg@2075
  1716
    self clearModifiedFlag.
cg@2075
  1717
cg@2075
  1718
    self enablingCommitButtonsHolder value:false.
cg@2075
  1719
cg@2862
  1720
    "Modified: / 29-11-2011 / 11:28:02 / cg"
ca@1606
  1721
!
ca@1606
  1722
ca@1606
  1723
cancel
cg@2070
  1724
    "reload aspects from current selected item; reset modification flag"
cg@2070
  1725
ca@1606
  1726
    self accept:false.
cg@2070
  1727
cg@2070
  1728
    "Modified: / 29-08-2006 / 10:20:46 / cg"
ca@1606
  1729
!
ca@1606
  1730
ca@1606
  1731
indicatorClickedAt:atLine
ca@1606
  1732
    "indicator clicked at line number; toggle expand of item at line
ca@1606
  1733
    "
ca@1606
  1734
    |item|
ca@1606
  1735
ca@1606
  1736
    item := listOfItems at:atLine ifAbsent:nil.
cg@2862
  1737
    item notNil ifTrue:[
cg@3013
  1738
	item toggleExpand.
cg@3013
  1739
	self hasSelection ifFalse:[
cg@3013
  1740
	    self selectedItem:item
cg@3013
  1741
	]
ca@1610
  1742
    ].
cg@2862
  1743
cg@2862
  1744
    "Modified: / 29-11-2011 / 11:28:20 / cg"
ca@1606
  1745
! !
ca@1606
  1746
ca@1606
  1747
!MenuEditor methodsFor:'aspects'!
ca@1606
  1748
ca@1606
  1749
canCreateDelayedMenuChannel
ca@1606
  1750
    "boolean holder, true if the current selected item accepts a delayed menu
ca@1606
  1751
    "
ca@1606
  1752
    ^ builder booleanValueAspectFor:#canCreateDelayedMenuChannel
ca@1606
  1753
!
ca@1606
  1754
cg@1636
  1755
hasItemValue
cg@1636
  1756
    "boolean holder, true if any item is selected
cg@1636
  1757
    "
cg@2188
  1758
    ^ BlockValue
cg@2188
  1759
	with:[:holder | holder size > 0]
cg@2188
  1760
	argument:(self aspectFor:#itemValue)
cg@2161
  1761
cg@2161
  1762
    "Modified: / 08-03-2007 / 22:59:42 / cg"
cg@1636
  1763
!
cg@1636
  1764
cg@3135
  1765
hasNonLinkedMenuSelectedHolder
sv@3664
  1766
    "boolean holder, true if a single non linked menu item is selected"
sv@3664
  1767
cg@3135
  1768
    ^ BlockValue
sv@3664
  1769
        with:[:selection | 
sv@3664
  1770
                (selection size == 1) 
sv@3664
  1771
                 and:[selection first isKindOfNonLinkedMenu
sv@3664
  1772
                 and:[selection first isRootItem not]]
cg@3135
  1773
             ]
cg@3135
  1774
        argument:(self selectionHolder)
sv@3664
  1775
sv@3664
  1776
    "Modified: / 17-05-2019 / 16:18:19 / Stefan Vogel"
cg@3135
  1777
!
cg@3135
  1778
ca@1606
  1779
hasSelectionChannel
ca@1606
  1780
    "boolean holder, true if any item is selected
ca@1606
  1781
    "
ca@1606
  1782
    ^ builder booleanValueAspectFor:#hasSelectionChannel
ca@1606
  1783
!
ca@1606
  1784
ca@1606
  1785
hasSingleSelectionChannel
ca@1606
  1786
    "boolean holder, true if one item is selected
ca@1606
  1787
    "
ca@1606
  1788
    ^ builder booleanValueAspectFor:#hasSingleSelectionChannel
ca@1606
  1789
!
ca@1606
  1790
ca@1606
  1791
listOfItems
ca@1606
  1792
    "returns the hierarchical list of menuItems
ca@1606
  1793
    "
ca@1606
  1794
    ^ listOfItems
ca@1606
  1795
!
ca@1606
  1796
ca@1606
  1797
listOfTabs
ca@1606
  1798
    "returns the list of current shown tab-labels retrieved
ca@1606
  1799
     from the current selected item.
ca@1606
  1800
    "
ca@1606
  1801
    ^ listOfTabs
ca@1606
  1802
!
ca@1606
  1803
ca@1617
  1804
redefineAspectMethodsChannel
cg@2188
  1805
    "boolean holder, true if aspects should be generated in only implemented
ca@1617
  1806
     in superClass by calling #super ...
ca@1617
  1807
    "
ca@1617
  1808
    ^ builder booleanValueAspectFor:#redefineAspectMethodsChannel
ca@1617
  1809
!
ca@1617
  1810
ca@1606
  1811
selectionHolder
ca@1606
  1812
    "value holder, which keeps the current selected items
ca@1606
  1813
    "
ca@1606
  1814
    ^ selectionHolder
ca@1606
  1815
!
ca@1606
  1816
ca@1606
  1817
tabHolder
ca@1606
  1818
    "value holder, which keeps the current selected tab label or nil
ca@1606
  1819
    "
ca@1606
  1820
    ^ tabHolder
ca@1606
  1821
!
ca@1606
  1822
ca@1606
  1823
wizardHolder
ca@1606
  1824
    "holder, which keeps the current wizard window
ca@1606
  1825
    "
ca@1606
  1826
    |holder|
ca@1606
  1827
ca@1606
  1828
    holder := builder bindingAt:#wizardHolder.
ca@1606
  1829
cg@2151
  1830
    holder isNil ifTrue:[
cg@2188
  1831
	holder := nil asValue.
cg@2188
  1832
	builder aspectAt:#wizardHolder put:holder.
ca@1606
  1833
    ].
ca@1606
  1834
    ^ holder
ca@1606
  1835
! !
ca@1606
  1836
ca@1606
  1837
!MenuEditor methodsFor:'building'!
ca@1606
  1838
ca@1606
  1839
buildFromMenu:aMenu selector:aSelector
ca@1606
  1840
    "rebuild menu from a Menu
ca@1606
  1841
    "
ca@1606
  1842
    |root menu|
ca@1606
  1843
ca@1606
  1844
    aMenu isCollection ifTrue:[menu := aMenu decodeAsLiteralArray]
cg@2188
  1845
		      ifFalse:[menu := aMenu].
cg@1988
  1846
cg@1988
  1847
    self enablingCommitButtonsHolder value:false.
ca@1606
  1848
    root := listOfItems root.
ca@1606
  1849
ca@1606
  1850
    self withoutNotifyDo:[
cg@2188
  1851
	selectionHolder setValue:#().
cg@2188
  1852
	root menu:aMenu labeled:(aSelector ? specSelector).
ca@1606
  1853
    ].
ca@1606
  1854
    self selectedItem:root.
ca@1606
  1855
    self updateHistory.
ca@1606
  1856
!
ca@1606
  1857
cg@2019
  1858
buildFromResourceSpec:aResourceSpec
cg@2019
  1859
    "rebuild the menu from a resource spec"
cg@2019
  1860
cg@2019
  1861
    self buildFromMenu:aResourceSpec selector:nil
cg@2019
  1862
!
cg@2019
  1863
cg@1971
  1864
loadFromClass:aClass andSelector:aSelector
cg@1971
  1865
    "rebuild menu from a class and selector"
cg@1971
  1866
cg@1971
  1867
    |cls menu|
cg@1971
  1868
cg@1971
  1869
    self assert:(aClass isNil or:[aClass isClass]).
cg@1971
  1870
cg@1971
  1871
    menu := nil.
cg@1971
  1872
cg@2188
  1873
    self isStandAlone ifTrue:[ self helpTool loadFromClass:aClass ].
cg@1971
  1874
cg@1971
  1875
    specClass := aClass.
cg@1971
  1876
    specSelector := aSelector.
cg@1971
  1877
cg@1971
  1878
    aSelector notNil ifTrue:[
cg@3013
  1879
	aClass notNil ifTrue:[
cg@3013
  1880
	    cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass].
cg@3013
  1881
cg@3013
  1882
	    (cls respondsTo:aSelector) ifTrue:[
cg@3013
  1883
		menu := cls perform: aSelector.
cg@3013
  1884
	    ].
cg@3013
  1885
	].
cg@1971
  1886
    ].
cg@2569
  1887
    self loadFromMenu:menu selector:aSelector.
cg@2569
  1888
!
cg@2569
  1889
cg@2569
  1890
loadFromMenu:menuArg selector:selectorOrNil
cg@2569
  1891
    "rebuild menu"
cg@2569
  1892
cg@2569
  1893
    |menu|
cg@2569
  1894
cg@2569
  1895
    menu := menuArg.
cg@2569
  1896
    menu notNil ifTrue:[
cg@3013
  1897
	(menu isCollection) ifTrue:[
cg@3013
  1898
	    menu := Menu decodeFromLiteralArray:menu
cg@3013
  1899
	].
cg@2569
  1900
    ].
cg@2569
  1901
    self buildFromMenu:menu selector:selectorOrNil.
cg@1971
  1902
    self clearModified.
cg@2168
  1903
cg@2169
  1904
    "Modified: / 27-03-2007 / 11:16:47 / cg"
ca@1606
  1905
! !
ca@1606
  1906
ca@1606
  1907
!MenuEditor methodsFor:'change & update'!
ca@1606
  1908
ca@1606
  1909
selectedSuperItems
ca@1606
  1910
    "returns collection of superItems derived from selection
ca@1606
  1911
    "
ca@1606
  1912
    |selection size root|
ca@1606
  1913
cg@2862
  1914
    selectedSuperItems notNil ifTrue:[ ^ selectedSuperItems ].
ca@1606
  1915
ca@1606
  1916
    selection := selectionHolder value.
ca@1606
  1917
    size      := selection size.
ca@1606
  1918
ca@1606
  1919
    size <= 1 ifTrue:[
cg@3013
  1920
	selectedSuperItems := selection ? #().
ca@1606
  1921
      ^ selectedSuperItems
ca@1606
  1922
    ].
ca@1606
  1923
ca@1606
  1924
    root := listOfItems root.
ca@1606
  1925
ca@1606
  1926
    (selection includesIdentical:root) ifTrue:[
cg@3013
  1927
	selectedSuperItems := Array with:root.
cg@2188
  1928
      ^ selectedSuperItems
ca@1606
  1929
    ].
ca@1606
  1930
    selectedSuperItems := OrderedCollection new.
ca@1606
  1931
ca@1606
  1932
    selection do:[:anItem|
cg@3013
  1933
	anItem parentsDetect:[:el| selection includesIdentical:el ]
cg@3013
  1934
		      ifNone:[ selectedSuperItems add:anItem ].
ca@1606
  1935
    ].
ca@1606
  1936
    ^ selectedSuperItems
cg@2862
  1937
cg@2862
  1938
    "Modified: / 29-11-2011 / 11:28:23 / cg"
ca@1606
  1939
!
ca@1606
  1940
ca@1606
  1941
selectionChanged
ca@1606
  1942
    "called if the selection has changed
ca@1606
  1943
    "
ca@1606
  1944
    |newTabList selection|
ca@1606
  1945
ca@1606
  1946
    selection := selectionHolder value.
ca@1606
  1947
ca@1606
  1948
    selection size == 1 ifTrue:[
cg@2188
  1949
	selectedSuperItems := selection.
cg@2188
  1950
cg@2188
  1951
	newTabList := selection first slices collect:[:el| el first ].
cg@2188
  1952
	newTabList = listOfTabs ifFalse:[
cg@2188
  1953
	    listOfTabs contents:newTabList.
cg@2188
  1954
	].
ca@1606
  1955
    ] ifFalse:[
cg@2188
  1956
	"must compute selected super items on request
cg@2188
  1957
	"
cg@2188
  1958
	selectedSuperItems := nil.
ca@1606
  1959
    ].
ca@1606
  1960
    self cancel.
ca@1606
  1961
    self tabChanged.
ca@1606
  1962
    self updateChannels.
ca@1606
  1963
!
ca@1606
  1964
ca@1606
  1965
tabChanged
cg@2593
  1966
    "called if the tab changed"
cg@2593
  1967
ca@1606
  1968
    |tab selector item canvas wizardHolder|
ca@1606
  1969
ca@1606
  1970
    wizardHolder := self wizardHolder.
ca@1606
  1971
    item := self selectedItem.
cg@3013
  1972
    item isNil ifTrue:[
cg@3013
  1973
	wizardHolder value:nil.
cg@3013
  1974
	^ self
cg@2593
  1975
    ].
ca@1606
  1976
ca@1606
  1977
    tab := tabHolder value.
ca@1606
  1978
ca@1676
  1979
    tab notNil ifTrue:[
cg@3013
  1980
	tab := item slices detect:[:el| el first = tab ] ifNone:nil.
ca@1606
  1981
    ].
ca@1676
  1982
    tab isNil ifTrue:[
cg@3013
  1983
	tabHolder value:( listOfTabs at:1 ifAbsent:nil ).
cg@3013
  1984
	^ self.
ca@1606
  1985
    ].
ca@1606
  1986
    selector := tab last.
ca@1606
  1987
cg@3013
  1988
    selector == #help  ifTrue:[
cg@3013
  1989
	wizardHolder value:(self helpTool  window).
cg@3013
  1990
	^ self
cg@2593
  1991
    ].
cg@3013
  1992
    selector == #image ifTrue:[
cg@3013
  1993
	wizardHolder value:(self imageTool window).
cg@3013
  1994
	^ self
cg@2593
  1995
    ].
cg@2593
  1996
cg@3013
  1997
    canvas := wizards
cg@3013
  1998
		at:(item class name, selector) asSymbol
cg@3013
  1999
		ifAbsentPut:[
cg@3013
  2000
		    SimpleView new
cg@3013
  2001
			client:self
cg@3013
  2002
			spec:(item class perform:selector)
cg@3013
  2003
			builder:(self builder)
cg@3013
  2004
		].
ca@1606
  2005
ca@1606
  2006
    wizardHolder value:canvas.
ca@1606
  2007
!
ca@1606
  2008
ca@1606
  2009
update:something with:aParameter from:changedObject
cg@1711
  2010
    |lbl|
cg@1711
  2011
ca@1606
  2012
    notifyDisabledCounter ~~ 0 ifTrue:[ ^ self ].
ca@1606
  2013
ca@1606
  2014
    changedObject == selectionHolder ifTrue:[ ^ self selectionChanged ].
ca@1606
  2015
    changedObject == tabHolder       ifTrue:[ ^ self tabChanged ].
ca@1606
  2016
cg@1711
  2017
    changedObject == self autoAcceptOnSelectionChange ifTrue:[
cg@2188
  2018
	lbl := changedObject value ifTrue:['Apply'] ifFalse:['OK'].
cg@2188
  2019
	(builder componentAt:'okButton') label:(resources string:lbl).
cg@2188
  2020
	^ self
cg@1711
  2021
    ].
cg@1711
  2022
ca@1606
  2023
    super update:something with:aParameter from:changedObject
ca@1606
  2024
!
ca@1606
  2025
ca@1606
  2026
updateChannels
cg@2869
  2027
    "update all channels"
cg@2869
  2028
cg@2869
  2029
    |selection sizeOfSel selectedItem hasSelection|
ca@1606
  2030
ca@1606
  2031
    super updateChannels.
ca@1606
  2032
ca@1606
  2033
    selection := selectionHolder value.
ca@1606
  2034
    sizeOfSel := selection size.
ca@1606
  2035
cg@2869
  2036
    hasSelection := sizeOfSel ~~ 0.
ca@1606
  2037
    sizeOfSel == 1 ifTrue:[selectedItem := selection at:1]
cg@3013
  2038
		  ifFalse:[selectedItem := nil].
cg@2869
  2039
cg@2869
  2040
    self hasSelectionChannel       value:hasSelection.
ca@1606
  2041
    self hasSingleSelectionChannel value:(selectedItem notNil).
ca@1606
  2042
ca@1606
  2043
    selectedItem isNil ifTrue:[
cg@2869
  2044
"/        self enableMovingUpOrDownHolder  value:false.
cg@3013
  2045
	self enableMovingInHolder        value:false.
cg@3013
  2046
	self enableMovingOutHolder       value:false.
cg@3013
  2047
	self enableMovingInAboveHolder   value:false.
cg@3013
  2048
	self canCreateDelayedMenuChannel value:false.
ca@1606
  2049
    ] ifFalse:[
cg@2869
  2050
"/        self enableMovingUpOrDownHolder  value:(selectedItem canMoveUpOrDown).
cg@3013
  2051
	self enableMovingInHolder        value:(selectedItem canMoveInNext).
cg@3013
  2052
	self enableMovingOutHolder       value:(selectedItem canMoveOut).
cg@3013
  2053
	self enableMovingInAboveHolder   value:(selectedItem canMoveInAbove).
cg@3013
  2054
	self canCreateDelayedMenuChannel value:(selectedItem canAddDelayedMenu).
ca@1606
  2055
    ].
cg@2869
  2056
    self enableMovingUpOrDownHolder value:(selection conform:[:i | i canMoveUpOrDown]).
cg@2869
  2057
cg@2869
  2058
    "Modified (comment): / 18-01-2012 / 11:24:07 / cg"
ca@1606
  2059
! !
ca@1606
  2060
ca@1606
  2061
!MenuEditor methodsFor:'drag & drop'!
ca@1606
  2062
cg@2118
  2063
canDrop:aDropContext
ca@1618
  2064
    "return true, if the DropContext can be dropped into the list of items.
cg@1953
  2065
     The dropable objects are already validated by: #dropEnter:"
cg@1953
  2066
ca@1618
  2067
    ^ (dropOverLine notNil and:[dropOverLine ~~ 0])
cg@2118
  2068
cg@2118
  2069
    "Modified: / 13-10-2006 / 16:03:47 / cg"
ca@1618
  2070
!
ca@1618
  2071
ca@1618
  2072
changeDropLineTo:aLineOrNil in:aContext
ca@1618
  2073
    "the over dropLine changed; redraw drop indication stuff
ca@1618
  2074
    "
ca@1618
  2075
    |x0 x1 y0|
ca@1618
  2076
ca@1618
  2077
    aLineOrNil == dropOverLine ifTrue:[
cg@2188
  2078
	^ self. "/ nothing changed
ca@1606
  2079
    ].
ca@1618
  2080
    x0 := listOfItemsView margin + 2.
ca@1618
  2081
    x1 := listOfItemsView width - x0.
ca@1618
  2082
ca@1618
  2083
    "/ inform the DragAndDrop handler that the draw contents will change
ca@1618
  2084
    aContext contentsWillChange.
ca@1618
  2085
ca@1618
  2086
    (dropOverLine notNil and:[dropOverLine ~~ 0]) ifTrue:[
cg@2188
  2087
	"/ restore old draw
cg@2188
  2088
	y0 := listOfItemsView yVisibleOfLine:(dropOverLine + 1).
cg@2188
  2089
	y0 := y0 - 3.
cg@2188
  2090
cg@2188
  2091
	listOfItemsView invalidate:(Rectangle left:x0 top:y0 width:(x1-x0+1) height:2)
cg@2188
  2092
			 repairNow:true.
ca@1606
  2093
    ].
ca@1618
  2094
ca@1618
  2095
    dropOverLine := aLineOrNil.
ca@1618
  2096
ca@1618
  2097
    (dropOverLine notNil and:[dropOverLine ~~ 0]) ifTrue:[
cg@2188
  2098
	"/ highlight new drop target
cg@2188
  2099
	y0 := listOfItemsView yVisibleOfLine:(dropOverLine + 1).
cg@2188
  2100
	y0 := y0 - 3.
cg@2188
  2101
cg@2188
  2102
	listOfItemsView paint:(Color white).
cg@2188
  2103
	listOfItemsView displayLineFromX:x0 y:y0 toX:x1 y:y0.
cg@2188
  2104
	y0 := y0 + 1.
cg@2188
  2105
	listOfItemsView paint:(Color black).
cg@2188
  2106
	listOfItemsView displayLineFromX:x0 y:y0 toX:x1 y:y0.
ca@1618
  2107
    ].
ca@1606
  2108
!
ca@1606
  2109
cg@2118
  2110
doDrop:aDropContext
cg@1702
  2111
    "drop the dropContext into the hierachical list of items
ca@1606
  2112
    "
ca@1618
  2113
    |done item|
ca@1618
  2114
cg@2151
  2115
    dropOverLine isNil ifTrue:[^ false ].      "/ context not valid to me ...
ca@1618
  2116
ca@1618
  2117
    item := listOfItems at:dropOverLine ifAbsent:nil.
cg@2118
  2118
    self dropLeave:aDropContext.
cg@2151
  2119
    item isNil ifTrue:[^ false].
ca@1618
  2120
ca@1618
  2121
    selectionHolder setValue:(Array with:item).
ca@1618
  2122
ca@1618
  2123
    done := false.
ca@1618
  2124
cg@1702
  2125
    self addAndSelectValueOf:[
cg@2188
  2126
	done := true.
cg@2188
  2127
	aDropContext dropObjects collect:[:el| Item menuItem:(el theObject) ]
ca@1618
  2128
    ].
ca@1618
  2129
    ^ done
cg@2118
  2130
cg@2118
  2131
    "Modified: / 13-10-2006 / 16:03:54 / cg"
cg@2118
  2132
!
cg@2118
  2133
cg@2118
  2134
dropEnter:aDropContext
ca@1618
  2135
    "a drop operation enters my widget; validate dropable objects.
ca@1618
  2136
     If the objects are not dropable, dropOverLine is set to nil,
ca@1618
  2137
     otherwise to 0 (can drop the contents but not).
ca@1618
  2138
    "
ca@1606
  2139
    |objects|
ca@1606
  2140
ca@1618
  2141
    dropOverLine := nil.
ca@1618
  2142
cg@1988
  2143
    self enablingCommitButtonsHolder value ifTrue:[
cg@2188
  2144
	"/ current editing spec is modified (couldn't accept operation)
cg@2188
  2145
	^ self
ca@1618
  2146
    ].
cg@2118
  2147
    objects := aDropContext dropObjects.
ca@1618
  2148
    objects isEmpty ifTrue:[ ^ self ].  "/ nothing to drop ???
ca@1618
  2149
ca@1618
  2150
    "/ test whether all objects are dropable (kind of MenuItem)
cg@2113
  2151
    (objects conform:[:el | (el theObject askFor:#isMenuItem)]) ifTrue:[
cg@2188
  2152
	"/ ok, the contents is dropable
cg@2188
  2153
	dropOverLine := 0.
cg@2113
  2154
    ]
cg@2113
  2155
cg@2118
  2156
    "Modified: / 13-10-2006 / 16:04:14 / cg"
cg@2118
  2157
!
cg@2118
  2158
cg@2118
  2159
dropLeave:aDropContext
cg@2729
  2160
    "restore drop indications drawn..."
cg@2729
  2161
cg@2118
  2162
    self changeDropLineTo:nil in:aDropContext.
cg@2118
  2163
cg@2118
  2164
    "Modified: / 13-10-2006 / 16:03:59 / cg"
ca@1606
  2165
!
ca@1606
  2166
ca@1606
  2167
dropObjects
ca@1606
  2168
    "returns list of DropObjects
ca@1606
  2169
    "
ca@1606
  2170
    |obj items|
ca@1606
  2171
ca@1606
  2172
    items := self selectedSuperItems.
ca@1606
  2173
    items isEmpty ifTrue:[ ^ nil ].
ca@1606
  2174
ca@1606
  2175
  ^ items collect:[:el|
cg@2188
  2176
	obj := DropObject new:(el menuItem).
cg@2188
  2177
	obj displayObject:(el rawLabel).
cg@2188
  2178
	obj
ca@1606
  2179
    ].
ca@1618
  2180
!
ca@1618
  2181
cg@2118
  2182
dropOver:aDropContext
cg@1685
  2183
    "called during drag & drop while moving over the widget."
cg@1685
  2184
ca@1618
  2185
    |lnNr item|
ca@1618
  2186
cg@2151
  2187
    dropOverLine isNil ifTrue:[^ self ].       "/ context not valid to me ...
ca@1618
  2188
cg@3566
  2189
    lnNr := listOfItemsView yVisibleToLineNr:(aDropContext targetPointInDeviceCoordinates y).
ca@1618
  2190
    item := nil.
ca@1618
  2191
cg@2862
  2192
    lnNr notNil ifTrue:[
cg@3566
  2193
        item := listOfItems at:lnNr ifAbsent:nil.
cg@3566
  2194
        item notNil ifTrue:[
cg@3566
  2195
            (item isAction and:[item hasDelayedMenu]) ifTrue:[
cg@3566
  2196
                item := nil
cg@3566
  2197
            ]
cg@3566
  2198
        ]
ca@1618
  2199
    ].
cg@2151
  2200
    item isNil ifTrue:[ lnNr := 0 ].   "/ not dropable for item
ca@1618
  2201
ca@1618
  2202
    "/ redraw drop indication
cg@2118
  2203
    self changeDropLineTo:lnNr in:aDropContext.
cg@2118
  2204
cg@2862
  2205
    "Modified: / 29-11-2011 / 11:28:17 / cg"
cg@3566
  2206
    "Modified: / 15-06-2018 / 02:27:44 / Claus Gittinger"
ca@1606
  2207
! !
ca@1606
  2208
ca@1606
  2209
!MenuEditor methodsFor:'event processing'!
ca@1606
  2210
ca@1606
  2211
processEvent:anEvent
cg@1895
  2212
    "filter keyboard edit-events typed into the listOfItemsView.
cg@1895
  2213
     Return true, if I have eaten the event"
cg@1895
  2214
cg@2946
  2215
    <resource: #keyboard (#Delete #BackSpace #Cut #Copy #Paste #CtrlCursorUp #CtrlCursorDown
cg@3636
  2216
                          #CtrlCursorLeft #CtrlCursorRight #Accept)>
cg@2946
  2217
cg@2275
  2218
    |evView rawKey key|
ca@1606
  2219
cg@2187
  2220
    anEvent isKeyPressEvent ifFalse:[^ false].
ca@1606
  2221
cg@3636
  2222
    key    := anEvent key.
cg@3636
  2223
ca@1606
  2224
    evView := anEvent targetView.
cg@3636
  2225
    evView isNil ifTrue:[^ false ].
ca@1606
  2226
cg@2263
  2227
    "/ only handle keyboard events for the left item list
cg@2263
  2228
    "/ (otherwise, copy-paste would not work in the editFields on the right)
cg@3636
  2229
    (evView isSameOrComponentOf:listOfItemsView) ifFalse:[
cg@3636
  2230
        key == #Accept ifTrue:[
cg@3636
  2231
            self accept.
cg@3636
  2232
        ].
cg@3636
  2233
        ^ false
cg@3636
  2234
    ].
cg@3636
  2235
ca@1606
  2236
    rawKey := anEvent rawKey.
ca@1606
  2237
ca@1606
  2238
    (    key == #Delete
ca@1606
  2239
     or:[key == #BackSpace
ca@1606
  2240
     or:[key == #Cut]]
ca@1606
  2241
    ) ifTrue:[
cg@3636
  2242
        self doCut.
cg@3636
  2243
        ^ true.
ca@1606
  2244
    ].
ca@1606
  2245
ca@1606
  2246
    key == #Copy  ifTrue:[ self doCopy.  ^ true ].
ca@1606
  2247
    key == #Paste ifTrue:[ self doPaste. ^ true ].
ca@1606
  2248
cg@2188
  2249
    (rawKey == #CtrlCursorUp) ifTrue:[
cg@3636
  2250
        self doMoveUp.
cg@3636
  2251
        ^ true.
cg@1958
  2252
    ].
cg@2188
  2253
    (rawKey == #CtrlCursorDown) ifTrue:[
cg@3636
  2254
        self doMoveDown.
cg@3636
  2255
        ^ true.
cg@1958
  2256
    ].
cg@2188
  2257
    (rawKey == #CtrlCursorLeft) ifTrue:[
cg@3636
  2258
        self doMoveOut.
cg@3636
  2259
        ^ true.
cg@1958
  2260
    ].
cg@2188
  2261
    (rawKey == #CtrlCursorRight) ifTrue:[
cg@3636
  2262
        self doMoveInNext.
cg@3636
  2263
        ^ true.
cg@1958
  2264
    ].
cg@1958
  2265
cg@1958
  2266
    ^ false.
cg@3636
  2267
cg@3636
  2268
    "Modified: / 12-02-2019 / 10:56:08 / Claus Gittinger"
ca@1606
  2269
! !
ca@1606
  2270
ca@1606
  2271
!MenuEditor methodsFor:'initialization & release'!
ca@1606
  2272
ca@1606
  2273
closeRequest
cg@2036
  2274
    "asks for permission before closing"
cg@2036
  2275
cg@2075
  2276
    self askForModification ifFalse:[^self].
cg@2075
  2277
cg@2075
  2278
"/    self enablingCommitButtonsHolder value ifTrue:[
cg@2075
  2279
"/        self setModified.
cg@2075
  2280
"/        self askForListModification.
cg@2075
  2281
"/        modified ifTrue:[^ self].
cg@2075
  2282
"/        self clearModified.
cg@2075
  2283
"/    ].
cg@2036
  2284
    super closeRequest
cg@2075
  2285
cg@2075
  2286
    "Modified: / 05-09-2006 / 18:44:15 / cg"
ca@1606
  2287
!
ca@1606
  2288
cg@1992
  2289
commonPostBuild
cg@1711
  2290
    self autoAcceptOnSelectionChange addDependent:self.
cg@1711
  2291
    self autoAcceptOnSelectionChange value ifTrue:[
sv@3536
  2292
        (builder componentAt:'okButton') label:(resources string:'Apply')
cg@1711
  2293
    ].
cg@1992
  2294
cg@1997
  2295
    "/ using masters infoHolder ?
sv@3541
  2296
    self useAlienInfoLabel ifTrue:[
sv@3536
  2297
        (builder componentAt:#mainPanel) layout bottomOffset:0.
sv@3536
  2298
        (builder componentAt:#infoBarSubSpec) beInvisible
cg@1997
  2299
    ]
sv@3536
  2300
sv@3536
  2301
    "Modified: / 20-02-2018 / 13:05:21 / stefan"
cg@1992
  2302
!
cg@1992
  2303
cg@2581
  2304
commonPostOpen
cg@2581
  2305
    "reset keyboardProcessor for menuBar"
cg@2581
  2306
cg@2581
  2307
    super commonPostOpen.
cg@2581
  2308
    builder keyboardProcessor menuBar:nil.
cg@2581
  2309
    self windowGroup addPreEventHook:self.
cg@2581
  2310
!
cg@2581
  2311
cg@1992
  2312
initialize
cg@1992
  2313
    "setup aspects, ...
cg@1992
  2314
    "
cg@1992
  2315
    super initialize.
cg@1992
  2316
    notifyDisabledCounter := 0.
cg@1992
  2317
cg@1992
  2318
    Item withAllSubclasses do:[:aClass|
cg@2188
  2319
	aClass addBindingsTo:aspects for:self.
cg@1992
  2320
    ].
cg@1992
  2321
cg@1992
  2322
    selectionHolder    := #() asValue.
cg@1992
  2323
    selectionHolder addDependent:self.
cg@1992
  2324
cg@1992
  2325
    listOfItems := HierarchicalList new.
cg@1992
  2326
    listOfItems application:self.
cg@1992
  2327
    listOfItems root:(RootItem new).
cg@1992
  2328
cg@1992
  2329
    tabHolder := nil asValue.
cg@1992
  2330
    tabHolder addDependent:self.
cg@1992
  2331
cg@1992
  2332
    listOfTabs := List new.
cg@1992
  2333
    wizards    := IdentityDictionary new.
cg@1992
  2334
!
cg@1992
  2335
cg@2569
  2336
loadFromResourceSpec:aResourceSpec
cg@2569
  2337
    self loadFromMenu:aResourceSpec selector:nil
cg@2569
  2338
!
cg@2569
  2339
cg@2569
  2340
openModalOnMenu:aMenuOrNil
cg@2569
  2341
    "build a tree from aMenu and open it modal"
cg@2569
  2342
cg@2569
  2343
    self openModalOnResourceSpec:aMenuOrNil
cg@1992
  2344
!
cg@1992
  2345
cg@1992
  2346
postBuildListOfItemsView:aSrollableView
cg@1992
  2347
    listOfItemsView := aSrollableView scrolledView.
cg@1992
  2348
!
cg@1992
  2349
cg@1992
  2350
postBuildNoteBook:aNoteBook
cg@1992
  2351
    aNoteBook tabLabelInset:16@4.
ca@1606
  2352
! !
ca@1606
  2353
cg@2275
  2354
!MenuEditor methodsFor:'menus-dynamic'!
cg@2275
  2355
cg@2275
  2356
submenuTest
cg@2275
  2357
    "returns a menu on the current editing menu
cg@2275
  2358
    "
cg@2275
  2359
    |menu indication choice submenu retriever|
cg@2275
  2360
cg@2275
  2361
    menu := listOfItems root submenu.
cg@2275
  2362
    menu isNil ifTrue:[^ nil ].
cg@2275
  2363
cg@2275
  2364
    menu allItemsDo:[:anItem|
cg@3138
  2365
        anItem ignoreShortcutKeys:true.
cg@3138
  2366
        anItem isVisible:true.
cg@3138
  2367
        anItem enabled:true.
cg@3138
  2368
        anItem translateLabel:false.
cg@3138
  2369
cg@3138
  2370
        anItem itemValue notNil ifTrue:[
cg@3138
  2371
            anItem itemValue:[ Transcript showCR:(anItem label) ].
cg@3138
  2372
        ].
cg@3138
  2373
        anItem indication notNil ifTrue:[
cg@3138
  2374
            indication isNil ifTrue:[ indication := true asValue ].
cg@3138
  2375
            anItem indication:indication
cg@3138
  2376
        ].
cg@3138
  2377
        anItem choice notNil ifTrue:[
cg@3138
  2378
            choice isNil ifTrue:[ choice := anItem choiceValue asValue ].
cg@3138
  2379
            anItem choice:choice
cg@3138
  2380
        ].
cg@3138
  2381
        anItem isMenuSlice ifTrue:[
cg@3138
  2382
            anItem submenuChannel:nil.
cg@3138
  2383
            anItem label:'... Slice Menu ...'.
cg@3138
  2384
        ].
cg@3138
  2385
        anItem submenuChannel notNil ifTrue:[
cg@3138
  2386
            anItem submenuChannel:nil.
cg@3138
  2387
            anItem submenu isNil ifTrue:[
cg@3138
  2388
                submenu isNil ifTrue:[
cg@3138
  2389
                    submenu := Menu new.
cg@3138
  2390
                    submenu addItem:(MenuItem label:'Linked Menu...').
cg@3138
  2391
                ].
cg@3138
  2392
                anItem submenu:submenu.
cg@3138
  2393
            ].
cg@3138
  2394
        ].
cg@3138
  2395
        retriever := anItem resourceRetriever.
cg@3138
  2396
        retriever notNil ifTrue:[
cg@3138
  2397
            retriever labelText notNil ifTrue:[ retriever labelText:(anItem label) ]
cg@3138
  2398
        ].
cg@2275
  2399
    ].
cg@2275
  2400
    menu findGuiResourcesIn:(self resolveName:specClass).
cg@2275
  2401
    ^ menu
cg@2275
  2402
! !
cg@2275
  2403
ca@1606
  2404
!MenuEditor methodsFor:'private'!
ca@1606
  2405
cg@1702
  2406
addAndSelectValueOf:aBlockOrItem
ca@1606
  2407
    "add an item(s) derived from the block; test if add operation
ca@1606
  2408
     is enabled. On success the new item(s) are returned otherwise nil.
ca@1606
  2409
    "
ca@1606
  2410
    |intoItem index newItem|
ca@1606
  2411
ca@1606
  2412
    intoItem := self selectedItem.
cg@2151
  2413
    intoItem isNil ifTrue:[ ^ nil].
ca@1606
  2414
ca@1606
  2415
    self askForItemModification ifFalse:[ ^ nil ].
ca@1606
  2416
ca@1606
  2417
    index := 1.
ca@1606
  2418
ca@1618
  2419
    (intoItem canAddChildren and:[intoItem isExpanded]) ifFalse:[
cg@3013
  2420
	intoItem parent notNil ifTrue:[
cg@3013
  2421
	    [ intoItem parent canAddChildren ] whileFalse:[
cg@3013
  2422
		intoItem := intoItem parent.
cg@3013
  2423
	    ].
cg@3013
  2424
	    index := intoItem parent identityIndexOf:intoItem.
cg@3013
  2425
	    index := index + 1.
cg@3013
  2426
	    intoItem := intoItem parent.
cg@3013
  2427
	].
ca@1606
  2428
    ].
cg@1702
  2429
    newItem := aBlockOrItem value.
ca@1606
  2430
cg@2862
  2431
    newItem notNil ifTrue:[
cg@3013
  2432
	selectionHolder setValue:nil.
cg@3013
  2433
	intoItem expand.
cg@3013
  2434
cg@3013
  2435
	newItem isCollection ifTrue:[
cg@3013
  2436
	    intoItem addAll:newItem beforeIndex:index.
cg@3013
  2437
	    selectionHolder value:newItem.
cg@3013
  2438
	] ifFalse:[
cg@3013
  2439
	    intoItem add:newItem beforeIndex:index.
cg@3013
  2440
	    selectionHolder value:(Array with:newItem).
cg@3013
  2441
	].
cg@3013
  2442
	self setModified.
ca@1606
  2443
    ].
ca@1606
  2444
    ^ newItem
cg@2862
  2445
cg@2862
  2446
    "Modified: / 29-11-2011 / 11:28:06 / cg"
ca@1606
  2447
!
ca@1606
  2448
ca@1606
  2449
clearModified
cg@1971
  2450
    "clear the modifiedChannel and the commitPanel"
cg@1971
  2451
cg@2008
  2452
    super clearModified.
cg@1988
  2453
    self enablingCommitButtonsHolder value:false.
ca@1606
  2454
    self clearModifiedFlag.
ca@1606
  2455
!
ca@1606
  2456
ca@1606
  2457
generateMenuSpec
cg@2569
  2458
    "generate and returns the current menu spec or nil"
cg@2569
  2459
cg@3135
  2460
    ^ self generateMenuSpecFor:listOfItems root
cg@3135
  2461
!
cg@3135
  2462
cg@3135
  2463
generateMenuSpecFor:aMenuItem
cg@3135
  2464
    "generate and returns a menu spec or nil"
cg@3135
  2465
cg@2569
  2466
    |menu|
ca@1606
  2467
cg@3135
  2468
    menu := aMenuItem submenu.
cg@2151
  2469
    menu isNil ifTrue:[^ nil].
cg@2569
  2470
cg@2569
  2471
    ^ menu literalArrayEncoding.
cg@2569
  2472
!
cg@2569
  2473
cg@2569
  2474
generateMenuSpecString
cg@2569
  2475
    "generate and returns the current menu spec as string or nil"
cg@2569
  2476
cg@3135
  2477
    ^ self generateMenuSpecStringFor:listOfItems root 
cg@3135
  2478
!
cg@3135
  2479
cg@3135
  2480
generateMenuSpecStringFor:aMenuItem
cg@3135
  2481
    "generate and returns the current menu spec as string or nil"
cg@3135
  2482
cg@2569
  2483
    |menu specStream|
cg@2569
  2484
cg@3135
  2485
    menu := self generateMenuSpecFor:aMenuItem.
cg@2569
  2486
    menu isNil ifTrue:[^ nil].
cg@2569
  2487
sv@3328
  2488
    specStream := WriteStream on:''.
cg@2569
  2489
    UISpecification prettyPrintSpecArray:menu on:specStream indent:5.
cg@2569
  2490
    ^ specStream contents.
ca@1606
  2491
!
ca@1606
  2492
ca@1606
  2493
withoutNotifyDo:aBlock
ca@1606
  2494
    "evaluate the block; all change notifications are
sv@1722
  2495
     discard during the block is evaluated"
sv@1722
  2496
ca@1606
  2497
    |blockResult|
ca@1606
  2498
cg@2188
  2499
    [
cg@2188
  2500
	notifyDisabledCounter := notifyDisabledCounter + 1.
cg@2188
  2501
	blockResult := aBlock value.
sv@1722
  2502
    ] ensure:[
cg@2188
  2503
	notifyDisabledCounter := notifyDisabledCounter - 1
cg@2188
  2504
    ].
ca@1606
  2505
    ^ blockResult
ca@1606
  2506
! !
ca@1606
  2507
ca@1606
  2508
!MenuEditor methodsFor:'queries'!
ca@1606
  2509
ca@1606
  2510
hasValidSpecClass
ca@1606
  2511
    "returns true if a valid specClass exists
ca@1606
  2512
    "
cg@2151
  2513
    specClass isNil ifTrue:[^ false].
cg@3353
  2514
    ^ (self resolveName:specClass) notNil
cg@3353
  2515
cg@3353
  2516
    "Modified: / 19-11-2016 / 20:19:30 / cg"
cg@2569
  2517
!
cg@2569
  2518
cg@2569
  2519
isEditingSpecOnly
cg@2581
  2520
    ^ masterApplication notNil
cg@2581
  2521
    and:[ masterApplication perform:#isEditingSpecOnly ifNotUnderstood:false]
cg@2569
  2522
!
cg@2569
  2523
cg@2569
  2524
isNotEditingSpecOnly
cg@2569
  2525
    ^ self isEditingSpecOnly not
cg@2581
  2526
!
cg@2581
  2527
cg@2581
  2528
isNotEditingSpecOnlyAndNotEmbeddedInBrowser
cg@2581
  2529
    ^ self isNotEditingSpecOnly and:[ self isEmbeddedInBrowser not ]
ca@1606
  2530
! !
ca@1606
  2531
ca@1606
  2532
!MenuEditor methodsFor:'selection'!
ca@1606
  2533
ca@1606
  2534
canSelect:anIndex
ca@1606
  2535
    "called whenever the selection changed; test whether
ca@1606
  2536
     current item is not modified ....
ca@1606
  2537
    "
cg@1711
  2538
    |oldSelectedItem newSelectedItem anythingChanged|
ca@1606
  2539
cg@1988
  2540
    self enablingCommitButtonsHolder value ifFalse:[
cg@2188
  2541
	^ true
ca@1606
  2542
    ].
ca@1606
  2543
    oldSelectedItem := self selectedItem.
cg@2151
  2544
    oldSelectedItem isNil ifTrue:[^ true].
ca@1606
  2545
ca@1606
  2546
    newSelectedItem := listOfItems at:anIndex ifAbsent:nil.
ca@1606
  2547
    oldSelectedItem == newSelectedItem ifTrue:[
cg@2188
  2548
	^ true
ca@1606
  2549
    ].
cg@1711
  2550
cg@1988
  2551
    anythingChanged := self enablingCommitButtonsHolder value.
cg@2188
  2552
    anythingChanged ifTrue:[
cg@2188
  2553
	self autoAcceptOnSelectionChange value ifTrue:[
cg@2188
  2554
	    self accept.
cg@2188
  2555
	    ^ true
cg@2188
  2556
	].
cg@1711
  2557
    ].
cg@1711
  2558
ca@1606
  2559
    ^ self askForItemModification
ca@1606
  2560
!
ca@1606
  2561
ca@1610
  2562
hasSelection
ca@1610
  2563
    "returns true if a selection exists
ca@1610
  2564
    "
ca@1610
  2565
    ^ selectionHolder value size ~~ 0
ca@1610
  2566
!
ca@1610
  2567
ca@1606
  2568
selectedItem
cg@2869
  2569
    "returns the selected item or nil (none or multiple selected)"
cg@2869
  2570
ca@1606
  2571
    |selection|
ca@1606
  2572
ca@1606
  2573
    selection := selectionHolder value.
ca@1606
  2574
    selection size == 1 ifTrue:[ ^ selection first ].
cg@2869
  2575
    ^ nil
cg@2869
  2576
cg@2869
  2577
    "Modified: / 18-01-2012 / 11:33:42 / cg"
ca@1606
  2578
!
ca@1606
  2579
ca@1606
  2580
selectedItem:anItem
ca@1606
  2581
    "change selection to an item
ca@1606
  2582
    "
ca@1606
  2583
    |selection|
ca@1606
  2584
ca@1606
  2585
    anItem notNil ifTrue:[ selection := Array with:anItem ]
ca@1606
  2586
		 ifFalse:[ selection := #() ].
ca@1606
  2587
ca@1606
  2588
    selectionHolder value:selection.
cg@2869
  2589
!
cg@2869
  2590
cg@2869
  2591
selectedItems
cg@2869
  2592
    "returns the selected items or an empty collection"
cg@2869
  2593
cg@2869
  2594
    ^ selectionHolder value.
cg@2869
  2595
cg@2869
  2596
    "Created: / 18-01-2012 / 11:32:20 / cg"
cg@2869
  2597
!
cg@2869
  2598
cg@2869
  2599
selectedItems:aCollectionOfItems
cg@2869
  2600
    "set the selected items"
cg@2869
  2601
cg@2869
  2602
    selectionHolder value:aCollectionOfItems.
cg@2869
  2603
cg@2869
  2604
    "Created: / 18-01-2012 / 11:32:37 / cg"
ca@1606
  2605
! !
ca@1606
  2606
cg@1715
  2607
!MenuEditor methodsFor:'user actions-aspects'!
ca@1614
  2608
ca@1614
  2609
collectActionSelectors
ca@1614
  2610
    |selectors|
ca@1614
  2611
ca@1614
  2612
    selectors := IdentitySet new.
ca@1614
  2613
ca@1614
  2614
    listOfItems root recursiveDo:[:el|
cg@2188
  2615
	el actionSelectors do:[:s| selectors add:s ].
ca@1614
  2616
    ].
ca@1614
  2617
    ^ selectors asOrderedCollection
ca@1614
  2618
!
ca@1614
  2619
ca@1614
  2620
collectAspectSelectors
ca@1614
  2621
    |selectors|
ca@1614
  2622
ca@1614
  2623
    selectors := IdentitySet new.
ca@1614
  2624
ca@1614
  2625
    listOfItems root recursiveDo:[:el|
cg@3013
  2626
	selectors addAll:(el aspectSelectors).
ca@1614
  2627
    ].
ca@1614
  2628
    ^ selectors asOrderedCollection
ca@1614
  2629
!
ca@1614
  2630
cg@2297
  2631
doBrowseActionMethod
cg@3029
  2632
    "open a browser on the action callback method (create if not yet existing)"
cg@2810
  2633
cg@2810
  2634
    self doBrowseApplicationMethodFor:#itemValue
cg@2810
  2635
cg@2810
  2636
    "Modified: / 21-10-2010 / 14:09:33 / cg"
cg@2810
  2637
!
cg@2810
  2638
cg@2810
  2639
doBrowseApplicationMethodFor:aspect
cg@3028
  2640
    |selector cls implClass browsedClass category|
cg@2297
  2641
cg@2810
  2642
    specClass isNil ifTrue:[
cg@3585
  2643
        self warn:('Please define the application class first.').
cg@3026
  2644
        ^ self
cg@2297
  2645
    ].
cg@2297
  2646
cg@3237
  2647
    selector := (self aspectValueFor:aspect).
cg@2810
  2648
    selector isEmptyOrNil ifTrue:[
cg@3029
  2649
        Dialog information:(resources string:'Missing name for the action/aspect method.').
cg@3026
  2650
        ^ self
cg@2297
  2651
    ].
cg@2810
  2652
    (selector = 'true' or:[selector = 'false']) ifTrue:[^ self].
cg@2810
  2653
    (selector == true or:[selector == false]) ifTrue:[^ self].
cg@2810
  2654
cg@2810
  2655
    selector := selector asSymbol.
cg@2297
  2656
cg@2297
  2657
    cls := self resolveName:specClass.
cg@2297
  2658
    cls isNil ifTrue:[
cg@3026
  2659
        self warn:(resources string:'Class %1 does not exist!!' with:specClass asString).
cg@3026
  2660
        ^ self
cg@2297
  2661
    ].
cg@2297
  2662
cg@3028
  2663
    browsedClass := cls.
cg@2630
  2664
    (cls includesSelector:selector) ifFalse:[
jan@3099
  2665
        | generate |    
cg@3028
  2666
        (implClass := cls whichClassImplements:selector) notNil ifTrue:[
jan@3099
  2667
            generate := (Dialog 
cg@3029
  2668
                confirm:(resources 
cg@3029
  2669
                            stringWithCRs:'The application does not directly implement %1.\However it inherits this from %2.\\Create a redefinition in %1?'
cg@3029
  2670
                            with:cls name
cg@3029
  2671
                            with:implClass name)
cg@3029
  2672
                initialAnswer:false)
jan@3099
  2673
        ] ifFalse:[ 
jan@3099
  2674
            generate := true.
jan@3099
  2675
        ].
jan@3099
  2676
        category := UserPreferences current categoryForMenuActionsMethods.
jan@3099
  2677
jan@3099
  2678
        SmalltalkCodeGeneratorTool
jan@3099
  2679
            createActionMethodFor:selector in:cls
jan@3099
  2680
            category:category
jan@3099
  2681
            redefine:(self redefineAspectMethodsChannel value).
cg@2297
  2682
    ].
cg@2297
  2683
cg@3243
  2684
    browsedClass browserClass openInClass:browsedClass selector:selector
cg@2810
  2685
cg@2810
  2686
    "Created: / 21-10-2010 / 14:07:32 / cg"
cg@2833
  2687
    "Modified: / 31-01-2011 / 18:28:59 / cg"
jan@3099
  2688
    "Modified: / 17-03-2014 / 12:25:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
cg@3585
  2689
    "Modified: / 09-08-2018 / 15:31:11 / Claus Gittinger"
cg@2810
  2690
!
cg@2810
  2691
cg@3029
  2692
doBrowseChoiceMethod
cg@3029
  2693
    "open a browser on the choice aspect method (create if not yet existing)"
cg@3029
  2694
cg@3029
  2695
    self doBrowseApplicationMethodFor:#choice
cg@3029
  2696
!
cg@3029
  2697
cg@2810
  2698
doBrowseEnabledMethod
cg@2810
  2699
    "open a browser on the enabled method (create if not yet existing)"
cg@2810
  2700
cg@2810
  2701
    self doBrowseApplicationMethodFor:#enabled
cg@2810
  2702
cg@2810
  2703
    "Created: / 21-10-2010 / 14:09:41 / cg"
cg@2810
  2704
!
cg@2810
  2705
cg@3029
  2706
doBrowseIndicationMethod
cg@3029
  2707
    "open a browser on the indicator aspect method (create if not yet existing)"
cg@3029
  2708
cg@3029
  2709
    self doBrowseApplicationMethodFor:#indication
cg@3029
  2710
!
cg@3029
  2711
cg@2810
  2712
doBrowseVisibilityMethod
cg@2810
  2713
    "open a browser on the visibility method (create if not yet existing)"
cg@2810
  2714
cg@2810
  2715
    self doBrowseApplicationMethodFor:#isVisible
cg@2810
  2716
cg@2810
  2717
    "Created: / 21-10-2010 / 14:09:56 / cg"
cg@2297
  2718
!
cg@2297
  2719
ca@1614
  2720
doGenerateAspectMethods
cg@1805
  2721
    "compile aspect and action methods"
cg@1805
  2722
cg@1805
  2723
    |cls redefineAspectMethods category|
ca@1614
  2724
cg@2151
  2725
    specClass isNil ifTrue:[
cg@3013
  2726
	self warn:'Define the class first !!'.
cg@3013
  2727
	^ self
ca@1614
  2728
    ].
ca@1617
  2729
    redefineAspectMethods := self redefineAspectMethodsChannel value.
ca@1614
  2730
ca@1614
  2731
    cls := self resolveName:specClass.
cg@2151
  2732
    cls isNil ifTrue:[
cg@3013
  2733
	self warn:'Class ', specClass asString, ' does not exist!!'.
cg@3013
  2734
	^ self
ca@1614
  2735
    ].
ca@1617
  2736
cg@1805
  2737
    category := UserPreferences current categoryForMenuActionsMethods.
cg@1805
  2738
ca@1617
  2739
    self collectActionSelectors do:[:aSelector|
cg@3013
  2740
	SmalltalkCodeGeneratorTool
cg@3013
  2741
	    createActionMethodFor:aSelector in:cls
cg@3013
  2742
	    category:category
cg@3013
  2743
	    redefine:redefineAspectMethods.
ca@1614
  2744
    ].
ca@1614
  2745
ca@1617
  2746
    self collectAspectSelectors do:[:anAspect|
cg@3013
  2747
	SmalltalkCodeGeneratorTool
cg@3013
  2748
	    createAspectMethodFor:anAspect in:cls
cg@3013
  2749
	    category:category
cg@3013
  2750
	    redefine:redefineAspectMethods
ca@1614
  2751
    ].
cg@2833
  2752
cg@2833
  2753
    "Modified: / 31-01-2011 / 18:29:06 / cg"
ca@1614
  2754
! !
ca@1614
  2755
cg@1715
  2756
!MenuEditor methodsFor:'user actions-building'!
ca@1606
  2757
cg@3135
  2758
compileSpecMethodFor:aMenuItem selector:specSelector
cg@3135
  2759
    "save current editing menu to
cg@3135
  2760
           class: specClass
cg@3135
  2761
        selector: specSelector
cg@3135
  2762
    "
cg@3135
  2763
    |cls specCode mthd category s|
cg@3135
  2764
cg@3135
  2765
    specCode := self generateMenuSpecStringFor:aMenuItem.
cg@3135
  2766
    specCode isNil ifTrue:[^ nil].
cg@3135
  2767
cg@3135
  2768
    cls  := self resolveName:specClass.
cg@3135
  2769
cg@3135
  2770
    "/ if that method already exists, do not overwrite the category
cg@3135
  2771
cg@3135
  2772
    category := 'menu specs'.
cg@3135
  2773
    (mthd := cls theMetaclass compiledMethodAt:specSelector) notNil ifTrue:[
cg@3135
  2774
        category := mthd category.
cg@3135
  2775
    ].
cg@3135
  2776
cg@3135
  2777
    s := '' writeStream.
cg@3135
  2778
cg@3135
  2779
    s nextPutChunkSeparator;
cg@3135
  2780
      nextPutAll:(cls name);
cg@3135
  2781
      nextPutAll:' class methodsFor:';
cg@3135
  2782
      nextPutAll:category storeString;
cg@3135
  2783
      nextPutChunkSeparator;
cg@3135
  2784
      cr; cr;
cg@3135
  2785
      nextPutAll:specSelector;
cg@3135
  2786
      cr;
cg@3135
  2787
      nextPutAllAsChunk:(self class codeGenerationComment) withCRs;
cg@3135
  2788
      cr; cr;
cg@3135
  2789
      nextPutLine:'    "';
cg@3135
  2790
      nextPutLine:('     MenuEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector);
cg@3135
  2791
      nextPutLine:('     (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , specSelector , ')) startUp');
cg@3135
  2792
      nextPutLine:'    "';
cg@3135
  2793
      cr;
cg@3135
  2794
      nextPutLine:'    <resource: #menu>';
cg@3135
  2795
      cr;
cg@3135
  2796
      nextPutAll:'    ^ ';
cg@3135
  2797
      nextChunkPut:specCode;
cg@3135
  2798
      space;
cg@3135
  2799
      nextPutChunkSeparator;
cg@3135
  2800
      cr.
cg@3135
  2801
cg@3135
  2802
    Class packageQuerySignal answer:cls package do:[
cg@3135
  2803
        (ReadStream on:s contents) fileIn.
cg@3135
  2804
    ].
cg@3135
  2805
!
cg@3135
  2806
cg@2331
  2807
doChooseAMenu
cg@2331
  2808
    "pick a menu and edit its spec method"
cg@2331
  2809
cg@2331
  2810
    |view subSpec app bldr spec menuSelector1 menuSelector2 info|
cg@2331
  2811
cg@2331
  2812
    self askForModification ifTrue:[
cg@3013
  2813
	view := Screen current viewFromUser.
cg@3013
  2814
	(view isNil or:[view == Screen current rootView]) ifTrue:[
cg@3013
  2815
	    ^ self
cg@3013
  2816
	].
cg@3013
  2817
	view specClass == MenuPanelSpec ifTrue:[
cg@3013
  2818
	    (app := view application) isNil ifTrue:[
cg@3013
  2819
		info := 'Could not figure out the application class.'
cg@3013
  2820
	    ] ifFalse:[
cg@3013
  2821
		(bldr := app builder) isNil ifTrue:[
cg@3013
  2822
		    info := 'Application has no builder.'
cg@3013
  2823
		] ifFalse:[
cg@3013
  2824
		    menuSelector1 := bldr namedComponents keyAtValue:view ifAbsent:nil.
cg@3013
  2825
		    (spec := bldr spec) isNil ifTrue:[
cg@3013
  2826
			info := 'Cannot fetch spec from applications builder.'
cg@3013
  2827
		    ] ifFalse:[
cg@3013
  2828
			subSpec := spec findSpecForWhich:[:subSpec | subSpec name = view name].
cg@3013
  2829
			subSpec isNil ifTrue:[
cg@3013
  2830
			    info := 'Cannot find view-spec for ',view name asString,'.'
cg@3013
  2831
			] ifFalse:[
cg@3013
  2832
			    menuSelector2 := subSpec menu.
cg@3013
  2833
			]
cg@3013
  2834
		    ].
cg@3013
  2835
		    (menuSelector1 isNil and:[ menuSelector2 isNil ]) ifTrue:[
cg@3013
  2836
			info := 'menu is probably not provided by a menuSelector.'
cg@3013
  2837
		    ] ifFalse:[
cg@3013
  2838
			(app class respondsTo:menuSelector1) ifTrue:[
cg@3013
  2839
			    self loadFromClass:app class andSelector:menuSelector1.
cg@3013
  2840
			    ^ self.
cg@3013
  2841
			].
cg@3013
  2842
			(app class respondsTo:menuSelector2) ifTrue:[
cg@3013
  2843
			    self loadFromClass:app class andSelector:menuSelector2.
cg@3013
  2844
			    ^ self.
cg@3013
  2845
			].
cg@3013
  2846
			info := 'menu is probably not provided by a menuSelector.'
cg@3013
  2847
		    ].
cg@3013
  2848
		]
cg@3013
  2849
	    ].
cg@3013
  2850
	    info notNil ifTrue:[
cg@3013
  2851
		app notNil ifTrue:[
cg@3013
  2852
		    (Dialog confirm:(info,'\\Browse ?' withCRs)) ifTrue:[
cg@3013
  2853
			app browse.
cg@3013
  2854
		    ].
cg@3013
  2855
		] ifFalse:[
cg@3013
  2856
		    Dialog information:info.
cg@3013
  2857
		].
cg@3013
  2858
	    ].
cg@3013
  2859
	    ^ self.
cg@3013
  2860
	].
cg@2331
  2861
    ].
cg@2331
  2862
!
cg@2331
  2863
ca@1606
  2864
doNew
ca@1606
  2865
    "clear editing menu; start from scratch
ca@1606
  2866
    "
ca@1606
  2867
    super doNew ifTrue:[ self helpTool doNew ].
ca@1606
  2868
!
ca@1606
  2869
ca@1606
  2870
doPickAMenu
cg@2331
  2871
    "let user pick a menu and create a new spec"
cg@1971
  2872
ca@1606
  2873
    |view|
ca@1606
  2874
ca@1606
  2875
    self askForModification ifTrue:[
cg@3013
  2876
	view := Screen current viewFromUser.
cg@3013
  2877
	(view isNil or:[view == Screen current rootView]) ifTrue:[
cg@3013
  2878
	    ^ self
cg@3013
  2879
	].
cg@3013
  2880
	view specClass == MenuPanelSpec ifTrue:[
cg@3013
  2881
	    specSelector := #pickedMenu.
cg@3013
  2882
	    self buildFromMenu:(view asMenu) selector:specSelector.
cg@3013
  2883
	].
ca@1606
  2884
    ].
ca@1606
  2885
!
ca@1606
  2886
ca@1606
  2887
doSave
ca@1606
  2888
    "save current editing menu to
sv@3016
  2889
           class: specClass
sv@3016
  2890
        selector: specSelector
sv@3016
  2891
    "
cg@2569
  2892
    self isEditingSpecOnly ifTrue:[
sv@3016
  2893
        savedSpec := self generateMenuSpec.
sv@3016
  2894
        hasSaved := true.
sv@3016
  2895
        self clearModified.
sv@3016
  2896
        ^ self
cg@2569
  2897
    ].
ca@1606
  2898
ca@1606
  2899
    super doSave ifFalse: [^nil].
cg@3135
  2900