MenuEditor.st
author Claus Gittinger <cg@exept.de>
Tue, 14 May 2019 09:46:21 +0200
changeset 3663 9d49ecf8661a
parent 3636 197a2fbb8c5d
child 3664 0d01da886d5a
permissions -rw-r--r--
#UI_ENHANCEMENT by cg
class: TabListEditor class
changed:
#canvasSpec
#menu
#windowSpec
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
cg@3135
  1766
    "boolean holder, true if a single non linked menu item is selected
cg@3135
  1767
    "
cg@3135
  1768
    ^ BlockValue
cg@3135
  1769
        with:[:m | 
cg@3135
  1770
                |items| 
cg@3135
  1771
cg@3135
  1772
                items := self selectionHolder value.
cg@3135
  1773
                (items size == 1) 
cg@3135
  1774
                and:[items first isKindOfNonLinkedMenu
cg@3135
  1775
                and:[items first isRootItem not]]
cg@3135
  1776
             ]
cg@3135
  1777
        argument:(self selectionHolder)
cg@3135
  1778
!
cg@3135
  1779
ca@1606
  1780
hasSelectionChannel
ca@1606
  1781
    "boolean holder, true if any item is selected
ca@1606
  1782
    "
ca@1606
  1783
    ^ builder booleanValueAspectFor:#hasSelectionChannel
ca@1606
  1784
!
ca@1606
  1785
ca@1606
  1786
hasSingleSelectionChannel
ca@1606
  1787
    "boolean holder, true if one item is selected
ca@1606
  1788
    "
ca@1606
  1789
    ^ builder booleanValueAspectFor:#hasSingleSelectionChannel
ca@1606
  1790
!
ca@1606
  1791
ca@1606
  1792
listOfItems
ca@1606
  1793
    "returns the hierarchical list of menuItems
ca@1606
  1794
    "
ca@1606
  1795
    ^ listOfItems
ca@1606
  1796
!
ca@1606
  1797
ca@1606
  1798
listOfTabs
ca@1606
  1799
    "returns the list of current shown tab-labels retrieved
ca@1606
  1800
     from the current selected item.
ca@1606
  1801
    "
ca@1606
  1802
    ^ listOfTabs
ca@1606
  1803
!
ca@1606
  1804
ca@1617
  1805
redefineAspectMethodsChannel
cg@2188
  1806
    "boolean holder, true if aspects should be generated in only implemented
ca@1617
  1807
     in superClass by calling #super ...
ca@1617
  1808
    "
ca@1617
  1809
    ^ builder booleanValueAspectFor:#redefineAspectMethodsChannel
ca@1617
  1810
!
ca@1617
  1811
ca@1606
  1812
selectionHolder
ca@1606
  1813
    "value holder, which keeps the current selected items
ca@1606
  1814
    "
ca@1606
  1815
    ^ selectionHolder
ca@1606
  1816
!
ca@1606
  1817
ca@1606
  1818
tabHolder
ca@1606
  1819
    "value holder, which keeps the current selected tab label or nil
ca@1606
  1820
    "
ca@1606
  1821
    ^ tabHolder
ca@1606
  1822
!
ca@1606
  1823
ca@1606
  1824
wizardHolder
ca@1606
  1825
    "holder, which keeps the current wizard window
ca@1606
  1826
    "
ca@1606
  1827
    |holder|
ca@1606
  1828
ca@1606
  1829
    holder := builder bindingAt:#wizardHolder.
ca@1606
  1830
cg@2151
  1831
    holder isNil ifTrue:[
cg@2188
  1832
	holder := nil asValue.
cg@2188
  1833
	builder aspectAt:#wizardHolder put:holder.
ca@1606
  1834
    ].
ca@1606
  1835
    ^ holder
ca@1606
  1836
! !
ca@1606
  1837
ca@1606
  1838
!MenuEditor methodsFor:'building'!
ca@1606
  1839
ca@1606
  1840
buildFromMenu:aMenu selector:aSelector
ca@1606
  1841
    "rebuild menu from a Menu
ca@1606
  1842
    "
ca@1606
  1843
    |root menu|
ca@1606
  1844
ca@1606
  1845
    aMenu isCollection ifTrue:[menu := aMenu decodeAsLiteralArray]
cg@2188
  1846
		      ifFalse:[menu := aMenu].
cg@1988
  1847
cg@1988
  1848
    self enablingCommitButtonsHolder value:false.
ca@1606
  1849
    root := listOfItems root.
ca@1606
  1850
ca@1606
  1851
    self withoutNotifyDo:[
cg@2188
  1852
	selectionHolder setValue:#().
cg@2188
  1853
	root menu:aMenu labeled:(aSelector ? specSelector).
ca@1606
  1854
    ].
ca@1606
  1855
    self selectedItem:root.
ca@1606
  1856
    self updateHistory.
ca@1606
  1857
!
ca@1606
  1858
cg@2019
  1859
buildFromResourceSpec:aResourceSpec
cg@2019
  1860
    "rebuild the menu from a resource spec"
cg@2019
  1861
cg@2019
  1862
    self buildFromMenu:aResourceSpec selector:nil
cg@2019
  1863
!
cg@2019
  1864
cg@1971
  1865
loadFromClass:aClass andSelector:aSelector
cg@1971
  1866
    "rebuild menu from a class and selector"
cg@1971
  1867
cg@1971
  1868
    |cls menu|
cg@1971
  1869
cg@1971
  1870
    self assert:(aClass isNil or:[aClass isClass]).
cg@1971
  1871
cg@1971
  1872
    menu := nil.
cg@1971
  1873
cg@2188
  1874
    self isStandAlone ifTrue:[ self helpTool loadFromClass:aClass ].
cg@1971
  1875
cg@1971
  1876
    specClass := aClass.
cg@1971
  1877
    specSelector := aSelector.
cg@1971
  1878
cg@1971
  1879
    aSelector notNil ifTrue:[
cg@3013
  1880
	aClass notNil ifTrue:[
cg@3013
  1881
	    cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass].
cg@3013
  1882
cg@3013
  1883
	    (cls respondsTo:aSelector) ifTrue:[
cg@3013
  1884
		menu := cls perform: aSelector.
cg@3013
  1885
	    ].
cg@3013
  1886
	].
cg@1971
  1887
    ].
cg@2569
  1888
    self loadFromMenu:menu selector:aSelector.
cg@2569
  1889
!
cg@2569
  1890
cg@2569
  1891
loadFromMenu:menuArg selector:selectorOrNil
cg@2569
  1892
    "rebuild menu"
cg@2569
  1893
cg@2569
  1894
    |menu|
cg@2569
  1895
cg@2569
  1896
    menu := menuArg.
cg@2569
  1897
    menu notNil ifTrue:[
cg@3013
  1898
	(menu isCollection) ifTrue:[
cg@3013
  1899
	    menu := Menu decodeFromLiteralArray:menu
cg@3013
  1900
	].
cg@2569
  1901
    ].
cg@2569
  1902
    self buildFromMenu:menu selector:selectorOrNil.
cg@1971
  1903
    self clearModified.
cg@2168
  1904
cg@2169
  1905
    "Modified: / 27-03-2007 / 11:16:47 / cg"
ca@1606
  1906
! !
ca@1606
  1907
ca@1606
  1908
!MenuEditor methodsFor:'change & update'!
ca@1606
  1909
ca@1606
  1910
selectedSuperItems
ca@1606
  1911
    "returns collection of superItems derived from selection
ca@1606
  1912
    "
ca@1606
  1913
    |selection size root|
ca@1606
  1914
cg@2862
  1915
    selectedSuperItems notNil ifTrue:[ ^ selectedSuperItems ].
ca@1606
  1916
ca@1606
  1917
    selection := selectionHolder value.
ca@1606
  1918
    size      := selection size.
ca@1606
  1919
ca@1606
  1920
    size <= 1 ifTrue:[
cg@3013
  1921
	selectedSuperItems := selection ? #().
ca@1606
  1922
      ^ selectedSuperItems
ca@1606
  1923
    ].
ca@1606
  1924
ca@1606
  1925
    root := listOfItems root.
ca@1606
  1926
ca@1606
  1927
    (selection includesIdentical:root) ifTrue:[
cg@3013
  1928
	selectedSuperItems := Array with:root.
cg@2188
  1929
      ^ selectedSuperItems
ca@1606
  1930
    ].
ca@1606
  1931
    selectedSuperItems := OrderedCollection new.
ca@1606
  1932
ca@1606
  1933
    selection do:[:anItem|
cg@3013
  1934
	anItem parentsDetect:[:el| selection includesIdentical:el ]
cg@3013
  1935
		      ifNone:[ selectedSuperItems add:anItem ].
ca@1606
  1936
    ].
ca@1606
  1937
    ^ selectedSuperItems
cg@2862
  1938
cg@2862
  1939
    "Modified: / 29-11-2011 / 11:28:23 / cg"
ca@1606
  1940
!
ca@1606
  1941
ca@1606
  1942
selectionChanged
ca@1606
  1943
    "called if the selection has changed
ca@1606
  1944
    "
ca@1606
  1945
    |newTabList selection|
ca@1606
  1946
ca@1606
  1947
    selection := selectionHolder value.
ca@1606
  1948
ca@1606
  1949
    selection size == 1 ifTrue:[
cg@2188
  1950
	selectedSuperItems := selection.
cg@2188
  1951
cg@2188
  1952
	newTabList := selection first slices collect:[:el| el first ].
cg@2188
  1953
	newTabList = listOfTabs ifFalse:[
cg@2188
  1954
	    listOfTabs contents:newTabList.
cg@2188
  1955
	].
ca@1606
  1956
    ] ifFalse:[
cg@2188
  1957
	"must compute selected super items on request
cg@2188
  1958
	"
cg@2188
  1959
	selectedSuperItems := nil.
ca@1606
  1960
    ].
ca@1606
  1961
    self cancel.
ca@1606
  1962
    self tabChanged.
ca@1606
  1963
    self updateChannels.
ca@1606
  1964
!
ca@1606
  1965
ca@1606
  1966
tabChanged
cg@2593
  1967
    "called if the tab changed"
cg@2593
  1968
ca@1606
  1969
    |tab selector item canvas wizardHolder|
ca@1606
  1970
ca@1606
  1971
    wizardHolder := self wizardHolder.
ca@1606
  1972
    item := self selectedItem.
cg@3013
  1973
    item isNil ifTrue:[
cg@3013
  1974
	wizardHolder value:nil.
cg@3013
  1975
	^ self
cg@2593
  1976
    ].
ca@1606
  1977
ca@1606
  1978
    tab := tabHolder value.
ca@1606
  1979
ca@1676
  1980
    tab notNil ifTrue:[
cg@3013
  1981
	tab := item slices detect:[:el| el first = tab ] ifNone:nil.
ca@1606
  1982
    ].
ca@1676
  1983
    tab isNil ifTrue:[
cg@3013
  1984
	tabHolder value:( listOfTabs at:1 ifAbsent:nil ).
cg@3013
  1985
	^ self.
ca@1606
  1986
    ].
ca@1606
  1987
    selector := tab last.
ca@1606
  1988
cg@3013
  1989
    selector == #help  ifTrue:[
cg@3013
  1990
	wizardHolder value:(self helpTool  window).
cg@3013
  1991
	^ self
cg@2593
  1992
    ].
cg@3013
  1993
    selector == #image ifTrue:[
cg@3013
  1994
	wizardHolder value:(self imageTool window).
cg@3013
  1995
	^ self
cg@2593
  1996
    ].
cg@2593
  1997
cg@3013
  1998
    canvas := wizards
cg@3013
  1999
		at:(item class name, selector) asSymbol
cg@3013
  2000
		ifAbsentPut:[
cg@3013
  2001
		    SimpleView new
cg@3013
  2002
			client:self
cg@3013
  2003
			spec:(item class perform:selector)
cg@3013
  2004
			builder:(self builder)
cg@3013
  2005
		].
ca@1606
  2006
ca@1606
  2007
    wizardHolder value:canvas.
ca@1606
  2008
!
ca@1606
  2009
ca@1606
  2010
update:something with:aParameter from:changedObject
cg@1711
  2011
    |lbl|
cg@1711
  2012
ca@1606
  2013
    notifyDisabledCounter ~~ 0 ifTrue:[ ^ self ].
ca@1606
  2014
ca@1606
  2015
    changedObject == selectionHolder ifTrue:[ ^ self selectionChanged ].
ca@1606
  2016
    changedObject == tabHolder       ifTrue:[ ^ self tabChanged ].
ca@1606
  2017
cg@1711
  2018
    changedObject == self autoAcceptOnSelectionChange ifTrue:[
cg@2188
  2019
	lbl := changedObject value ifTrue:['Apply'] ifFalse:['OK'].
cg@2188
  2020
	(builder componentAt:'okButton') label:(resources string:lbl).
cg@2188
  2021
	^ self
cg@1711
  2022
    ].
cg@1711
  2023
ca@1606
  2024
    super update:something with:aParameter from:changedObject
ca@1606
  2025
!
ca@1606
  2026
ca@1606
  2027
updateChannels
cg@2869
  2028
    "update all channels"
cg@2869
  2029
cg@2869
  2030
    |selection sizeOfSel selectedItem hasSelection|
ca@1606
  2031
ca@1606
  2032
    super updateChannels.
ca@1606
  2033
ca@1606
  2034
    selection := selectionHolder value.
ca@1606
  2035
    sizeOfSel := selection size.
ca@1606
  2036
cg@2869
  2037
    hasSelection := sizeOfSel ~~ 0.
ca@1606
  2038
    sizeOfSel == 1 ifTrue:[selectedItem := selection at:1]
cg@3013
  2039
		  ifFalse:[selectedItem := nil].
cg@2869
  2040
cg@2869
  2041
    self hasSelectionChannel       value:hasSelection.
ca@1606
  2042
    self hasSingleSelectionChannel value:(selectedItem notNil).
ca@1606
  2043
ca@1606
  2044
    selectedItem isNil ifTrue:[
cg@2869
  2045
"/        self enableMovingUpOrDownHolder  value:false.
cg@3013
  2046
	self enableMovingInHolder        value:false.
cg@3013
  2047
	self enableMovingOutHolder       value:false.
cg@3013
  2048
	self enableMovingInAboveHolder   value:false.
cg@3013
  2049
	self canCreateDelayedMenuChannel value:false.
ca@1606
  2050
    ] ifFalse:[
cg@2869
  2051
"/        self enableMovingUpOrDownHolder  value:(selectedItem canMoveUpOrDown).
cg@3013
  2052
	self enableMovingInHolder        value:(selectedItem canMoveInNext).
cg@3013
  2053
	self enableMovingOutHolder       value:(selectedItem canMoveOut).
cg@3013
  2054
	self enableMovingInAboveHolder   value:(selectedItem canMoveInAbove).
cg@3013
  2055
	self canCreateDelayedMenuChannel value:(selectedItem canAddDelayedMenu).
ca@1606
  2056
    ].
cg@2869
  2057
    self enableMovingUpOrDownHolder value:(selection conform:[:i | i canMoveUpOrDown]).
cg@2869
  2058
cg@2869
  2059
    "Modified (comment): / 18-01-2012 / 11:24:07 / cg"
ca@1606
  2060
! !
ca@1606
  2061
ca@1606
  2062
!MenuEditor methodsFor:'drag & drop'!
ca@1606
  2063
cg@2118
  2064
canDrop:aDropContext
ca@1618
  2065
    "return true, if the DropContext can be dropped into the list of items.
cg@1953
  2066
     The dropable objects are already validated by: #dropEnter:"
cg@1953
  2067
ca@1618
  2068
    ^ (dropOverLine notNil and:[dropOverLine ~~ 0])
cg@2118
  2069
cg@2118
  2070
    "Modified: / 13-10-2006 / 16:03:47 / cg"
ca@1618
  2071
!
ca@1618
  2072
ca@1618
  2073
changeDropLineTo:aLineOrNil in:aContext
ca@1618
  2074
    "the over dropLine changed; redraw drop indication stuff
ca@1618
  2075
    "
ca@1618
  2076
    |x0 x1 y0|
ca@1618
  2077
ca@1618
  2078
    aLineOrNil == dropOverLine ifTrue:[
cg@2188
  2079
	^ self. "/ nothing changed
ca@1606
  2080
    ].
ca@1618
  2081
    x0 := listOfItemsView margin + 2.
ca@1618
  2082
    x1 := listOfItemsView width - x0.
ca@1618
  2083
ca@1618
  2084
    "/ inform the DragAndDrop handler that the draw contents will change
ca@1618
  2085
    aContext contentsWillChange.
ca@1618
  2086
ca@1618
  2087
    (dropOverLine notNil and:[dropOverLine ~~ 0]) ifTrue:[
cg@2188
  2088
	"/ restore old draw
cg@2188
  2089
	y0 := listOfItemsView yVisibleOfLine:(dropOverLine + 1).
cg@2188
  2090
	y0 := y0 - 3.
cg@2188
  2091
cg@2188
  2092
	listOfItemsView invalidate:(Rectangle left:x0 top:y0 width:(x1-x0+1) height:2)
cg@2188
  2093
			 repairNow:true.
ca@1606
  2094
    ].
ca@1618
  2095
ca@1618
  2096
    dropOverLine := aLineOrNil.
ca@1618
  2097
ca@1618
  2098
    (dropOverLine notNil and:[dropOverLine ~~ 0]) ifTrue:[
cg@2188
  2099
	"/ highlight new drop target
cg@2188
  2100
	y0 := listOfItemsView yVisibleOfLine:(dropOverLine + 1).
cg@2188
  2101
	y0 := y0 - 3.
cg@2188
  2102
cg@2188
  2103
	listOfItemsView paint:(Color white).
cg@2188
  2104
	listOfItemsView displayLineFromX:x0 y:y0 toX:x1 y:y0.
cg@2188
  2105
	y0 := y0 + 1.
cg@2188
  2106
	listOfItemsView paint:(Color black).
cg@2188
  2107
	listOfItemsView displayLineFromX:x0 y:y0 toX:x1 y:y0.
ca@1618
  2108
    ].
ca@1606
  2109
!
ca@1606
  2110
cg@2118
  2111
doDrop:aDropContext
cg@1702
  2112
    "drop the dropContext into the hierachical list of items
ca@1606
  2113
    "
ca@1618
  2114
    |done item|
ca@1618
  2115
cg@2151
  2116
    dropOverLine isNil ifTrue:[^ false ].      "/ context not valid to me ...
ca@1618
  2117
ca@1618
  2118
    item := listOfItems at:dropOverLine ifAbsent:nil.
cg@2118
  2119
    self dropLeave:aDropContext.
cg@2151
  2120
    item isNil ifTrue:[^ false].
ca@1618
  2121
ca@1618
  2122
    selectionHolder setValue:(Array with:item).
ca@1618
  2123
ca@1618
  2124
    done := false.
ca@1618
  2125
cg@1702
  2126
    self addAndSelectValueOf:[
cg@2188
  2127
	done := true.
cg@2188
  2128
	aDropContext dropObjects collect:[:el| Item menuItem:(el theObject) ]
ca@1618
  2129
    ].
ca@1618
  2130
    ^ done
cg@2118
  2131
cg@2118
  2132
    "Modified: / 13-10-2006 / 16:03:54 / cg"
cg@2118
  2133
!
cg@2118
  2134
cg@2118
  2135
dropEnter:aDropContext
ca@1618
  2136
    "a drop operation enters my widget; validate dropable objects.
ca@1618
  2137
     If the objects are not dropable, dropOverLine is set to nil,
ca@1618
  2138
     otherwise to 0 (can drop the contents but not).
ca@1618
  2139
    "
ca@1606
  2140
    |objects|
ca@1606
  2141
ca@1618
  2142
    dropOverLine := nil.
ca@1618
  2143
cg@1988
  2144
    self enablingCommitButtonsHolder value ifTrue:[
cg@2188
  2145
	"/ current editing spec is modified (couldn't accept operation)
cg@2188
  2146
	^ self
ca@1618
  2147
    ].
cg@2118
  2148
    objects := aDropContext dropObjects.
ca@1618
  2149
    objects isEmpty ifTrue:[ ^ self ].  "/ nothing to drop ???
ca@1618
  2150
ca@1618
  2151
    "/ test whether all objects are dropable (kind of MenuItem)
cg@2113
  2152
    (objects conform:[:el | (el theObject askFor:#isMenuItem)]) ifTrue:[
cg@2188
  2153
	"/ ok, the contents is dropable
cg@2188
  2154
	dropOverLine := 0.
cg@2113
  2155
    ]
cg@2113
  2156
cg@2118
  2157
    "Modified: / 13-10-2006 / 16:04:14 / cg"
cg@2118
  2158
!
cg@2118
  2159
cg@2118
  2160
dropLeave:aDropContext
cg@2729
  2161
    "restore drop indications drawn..."
cg@2729
  2162
cg@2118
  2163
    self changeDropLineTo:nil in:aDropContext.
cg@2118
  2164
cg@2118
  2165
    "Modified: / 13-10-2006 / 16:03:59 / cg"
ca@1606
  2166
!
ca@1606
  2167
ca@1606
  2168
dropObjects
ca@1606
  2169
    "returns list of DropObjects
ca@1606
  2170
    "
ca@1606
  2171
    |obj items|
ca@1606
  2172
ca@1606
  2173
    items := self selectedSuperItems.
ca@1606
  2174
    items isEmpty ifTrue:[ ^ nil ].
ca@1606
  2175
ca@1606
  2176
  ^ items collect:[:el|
cg@2188
  2177
	obj := DropObject new:(el menuItem).
cg@2188
  2178
	obj displayObject:(el rawLabel).
cg@2188
  2179
	obj
ca@1606
  2180
    ].
ca@1618
  2181
!
ca@1618
  2182
cg@2118
  2183
dropOver:aDropContext
cg@1685
  2184
    "called during drag & drop while moving over the widget."
cg@1685
  2185
ca@1618
  2186
    |lnNr item|
ca@1618
  2187
cg@2151
  2188
    dropOverLine isNil ifTrue:[^ self ].       "/ context not valid to me ...
ca@1618
  2189
cg@3566
  2190
    lnNr := listOfItemsView yVisibleToLineNr:(aDropContext targetPointInDeviceCoordinates y).
ca@1618
  2191
    item := nil.
ca@1618
  2192
cg@2862
  2193
    lnNr notNil ifTrue:[
cg@3566
  2194
        item := listOfItems at:lnNr ifAbsent:nil.
cg@3566
  2195
        item notNil ifTrue:[
cg@3566
  2196
            (item isAction and:[item hasDelayedMenu]) ifTrue:[
cg@3566
  2197
                item := nil
cg@3566
  2198
            ]
cg@3566
  2199
        ]
ca@1618
  2200
    ].
cg@2151
  2201
    item isNil ifTrue:[ lnNr := 0 ].   "/ not dropable for item
ca@1618
  2202
ca@1618
  2203
    "/ redraw drop indication
cg@2118
  2204
    self changeDropLineTo:lnNr in:aDropContext.
cg@2118
  2205
cg@2862
  2206
    "Modified: / 29-11-2011 / 11:28:17 / cg"
cg@3566
  2207
    "Modified: / 15-06-2018 / 02:27:44 / Claus Gittinger"
ca@1606
  2208
! !
ca@1606
  2209
ca@1606
  2210
!MenuEditor methodsFor:'event processing'!
ca@1606
  2211
ca@1606
  2212
processEvent:anEvent
cg@1895
  2213
    "filter keyboard edit-events typed into the listOfItemsView.
cg@1895
  2214
     Return true, if I have eaten the event"
cg@1895
  2215
cg@2946
  2216
    <resource: #keyboard (#Delete #BackSpace #Cut #Copy #Paste #CtrlCursorUp #CtrlCursorDown
cg@3636
  2217
                          #CtrlCursorLeft #CtrlCursorRight #Accept)>
cg@2946
  2218
cg@2275
  2219
    |evView rawKey key|
ca@1606
  2220
cg@2187
  2221
    anEvent isKeyPressEvent ifFalse:[^ false].
ca@1606
  2222
cg@3636
  2223
    key    := anEvent key.
cg@3636
  2224
ca@1606
  2225
    evView := anEvent targetView.
cg@3636
  2226
    evView isNil ifTrue:[^ false ].
ca@1606
  2227
cg@2263
  2228
    "/ only handle keyboard events for the left item list
cg@2263
  2229
    "/ (otherwise, copy-paste would not work in the editFields on the right)
cg@3636
  2230
    (evView isSameOrComponentOf:listOfItemsView) ifFalse:[
cg@3636
  2231
        key == #Accept ifTrue:[
cg@3636
  2232
            self accept.
cg@3636
  2233
        ].
cg@3636
  2234
        ^ false
cg@3636
  2235
    ].
cg@3636
  2236
ca@1606
  2237
    rawKey := anEvent rawKey.
ca@1606
  2238
ca@1606
  2239
    (    key == #Delete
ca@1606
  2240
     or:[key == #BackSpace
ca@1606
  2241
     or:[key == #Cut]]
ca@1606
  2242
    ) ifTrue:[
cg@3636
  2243
        self doCut.
cg@3636
  2244
        ^ true.
ca@1606
  2245
    ].
ca@1606
  2246
ca@1606
  2247
    key == #Copy  ifTrue:[ self doCopy.  ^ true ].
ca@1606
  2248
    key == #Paste ifTrue:[ self doPaste. ^ true ].
ca@1606
  2249
cg@2188
  2250
    (rawKey == #CtrlCursorUp) ifTrue:[
cg@3636
  2251
        self doMoveUp.
cg@3636
  2252
        ^ true.
cg@1958
  2253
    ].
cg@2188
  2254
    (rawKey == #CtrlCursorDown) ifTrue:[
cg@3636
  2255
        self doMoveDown.
cg@3636
  2256
        ^ true.
cg@1958
  2257
    ].
cg@2188
  2258
    (rawKey == #CtrlCursorLeft) ifTrue:[
cg@3636
  2259
        self doMoveOut.
cg@3636
  2260
        ^ true.
cg@1958
  2261
    ].
cg@2188
  2262
    (rawKey == #CtrlCursorRight) ifTrue:[
cg@3636
  2263
        self doMoveInNext.
cg@3636
  2264
        ^ true.
cg@1958
  2265
    ].
cg@1958
  2266
cg@1958
  2267
    ^ false.
cg@3636
  2268
cg@3636
  2269
    "Modified: / 12-02-2019 / 10:56:08 / Claus Gittinger"
ca@1606
  2270
! !
ca@1606
  2271
ca@1606
  2272
!MenuEditor methodsFor:'initialization & release'!
ca@1606
  2273
ca@1606
  2274
closeRequest
cg@2036
  2275
    "asks for permission before closing"
cg@2036
  2276
cg@2075
  2277
    self askForModification ifFalse:[^self].
cg@2075
  2278
cg@2075
  2279
"/    self enablingCommitButtonsHolder value ifTrue:[
cg@2075
  2280
"/        self setModified.
cg@2075
  2281
"/        self askForListModification.
cg@2075
  2282
"/        modified ifTrue:[^ self].
cg@2075
  2283
"/        self clearModified.
cg@2075
  2284
"/    ].
cg@2036
  2285
    super closeRequest
cg@2075
  2286
cg@2075
  2287
    "Modified: / 05-09-2006 / 18:44:15 / cg"
ca@1606
  2288
!
ca@1606
  2289
cg@1992
  2290
commonPostBuild
cg@1711
  2291
    self autoAcceptOnSelectionChange addDependent:self.
cg@1711
  2292
    self autoAcceptOnSelectionChange value ifTrue:[
sv@3536
  2293
        (builder componentAt:'okButton') label:(resources string:'Apply')
cg@1711
  2294
    ].
cg@1992
  2295
cg@1997
  2296
    "/ using masters infoHolder ?
sv@3541
  2297
    self useAlienInfoLabel ifTrue:[
sv@3536
  2298
        (builder componentAt:#mainPanel) layout bottomOffset:0.
sv@3536
  2299
        (builder componentAt:#infoBarSubSpec) beInvisible
cg@1997
  2300
    ]
sv@3536
  2301
sv@3536
  2302
    "Modified: / 20-02-2018 / 13:05:21 / stefan"
cg@1992
  2303
!
cg@1992
  2304
cg@2581
  2305
commonPostOpen
cg@2581
  2306
    "reset keyboardProcessor for menuBar"
cg@2581
  2307
cg@2581
  2308
    super commonPostOpen.
cg@2581
  2309
    builder keyboardProcessor menuBar:nil.
cg@2581
  2310
    self windowGroup addPreEventHook:self.
cg@2581
  2311
!
cg@2581
  2312
cg@1992
  2313
initialize
cg@1992
  2314
    "setup aspects, ...
cg@1992
  2315
    "
cg@1992
  2316
    super initialize.
cg@1992
  2317
    notifyDisabledCounter := 0.
cg@1992
  2318
cg@1992
  2319
    Item withAllSubclasses do:[:aClass|
cg@2188
  2320
	aClass addBindingsTo:aspects for:self.
cg@1992
  2321
    ].
cg@1992
  2322
cg@1992
  2323
    selectionHolder    := #() asValue.
cg@1992
  2324
    selectionHolder addDependent:self.
cg@1992
  2325
cg@1992
  2326
    listOfItems := HierarchicalList new.
cg@1992
  2327
    listOfItems application:self.
cg@1992
  2328
    listOfItems root:(RootItem new).
cg@1992
  2329
cg@1992
  2330
    tabHolder := nil asValue.
cg@1992
  2331
    tabHolder addDependent:self.
cg@1992
  2332
cg@1992
  2333
    listOfTabs := List new.
cg@1992
  2334
    wizards    := IdentityDictionary new.
cg@1992
  2335
!
cg@1992
  2336
cg@2569
  2337
loadFromResourceSpec:aResourceSpec
cg@2569
  2338
    self loadFromMenu:aResourceSpec selector:nil
cg@2569
  2339
!
cg@2569
  2340
cg@2569
  2341
openModalOnMenu:aMenuOrNil
cg@2569
  2342
    "build a tree from aMenu and open it modal"
cg@2569
  2343
cg@2569
  2344
    self openModalOnResourceSpec:aMenuOrNil
cg@1992
  2345
!
cg@1992
  2346
cg@1992
  2347
postBuildListOfItemsView:aSrollableView
cg@1992
  2348
    listOfItemsView := aSrollableView scrolledView.
cg@1992
  2349
!
cg@1992
  2350
cg@1992
  2351
postBuildNoteBook:aNoteBook
cg@1992
  2352
    aNoteBook tabLabelInset:16@4.
ca@1606
  2353
! !
ca@1606
  2354
cg@2275
  2355
!MenuEditor methodsFor:'menus-dynamic'!
cg@2275
  2356
cg@2275
  2357
submenuTest
cg@2275
  2358
    "returns a menu on the current editing menu
cg@2275
  2359
    "
cg@2275
  2360
    |menu indication choice submenu retriever|
cg@2275
  2361
cg@2275
  2362
    menu := listOfItems root submenu.
cg@2275
  2363
    menu isNil ifTrue:[^ nil ].
cg@2275
  2364
cg@2275
  2365
    menu allItemsDo:[:anItem|
cg@3138
  2366
        anItem ignoreShortcutKeys:true.
cg@3138
  2367
        anItem isVisible:true.
cg@3138
  2368
        anItem enabled:true.
cg@3138
  2369
        anItem translateLabel:false.
cg@3138
  2370
cg@3138
  2371
        anItem itemValue notNil ifTrue:[
cg@3138
  2372
            anItem itemValue:[ Transcript showCR:(anItem label) ].
cg@3138
  2373
        ].
cg@3138
  2374
        anItem indication notNil ifTrue:[
cg@3138
  2375
            indication isNil ifTrue:[ indication := true asValue ].
cg@3138
  2376
            anItem indication:indication
cg@3138
  2377
        ].
cg@3138
  2378
        anItem choice notNil ifTrue:[
cg@3138
  2379
            choice isNil ifTrue:[ choice := anItem choiceValue asValue ].
cg@3138
  2380
            anItem choice:choice
cg@3138
  2381
        ].
cg@3138
  2382
        anItem isMenuSlice ifTrue:[
cg@3138
  2383
            anItem submenuChannel:nil.
cg@3138
  2384
            anItem label:'... Slice Menu ...'.
cg@3138
  2385
        ].
cg@3138
  2386
        anItem submenuChannel notNil ifTrue:[
cg@3138
  2387
            anItem submenuChannel:nil.
cg@3138
  2388
            anItem submenu isNil ifTrue:[
cg@3138
  2389
                submenu isNil ifTrue:[
cg@3138
  2390
                    submenu := Menu new.
cg@3138
  2391
                    submenu addItem:(MenuItem label:'Linked Menu...').
cg@3138
  2392
                ].
cg@3138
  2393
                anItem submenu:submenu.
cg@3138
  2394
            ].
cg@3138
  2395
        ].
cg@3138
  2396
        retriever := anItem resourceRetriever.
cg@3138
  2397
        retriever notNil ifTrue:[
cg@3138
  2398
            retriever labelText notNil ifTrue:[ retriever labelText:(anItem label) ]
cg@3138
  2399
        ].
cg@2275
  2400
    ].
cg@2275
  2401
    menu findGuiResourcesIn:(self resolveName:specClass).
cg@2275
  2402
    ^ menu
cg@2275
  2403
! !
cg@2275
  2404
ca@1606
  2405
!MenuEditor methodsFor:'private'!
ca@1606
  2406
cg@1702
  2407
addAndSelectValueOf:aBlockOrItem
ca@1606
  2408
    "add an item(s) derived from the block; test if add operation
ca@1606
  2409
     is enabled. On success the new item(s) are returned otherwise nil.
ca@1606
  2410
    "
ca@1606
  2411
    |intoItem index newItem|
ca@1606
  2412
ca@1606
  2413
    intoItem := self selectedItem.
cg@2151
  2414
    intoItem isNil ifTrue:[ ^ nil].
ca@1606
  2415
ca@1606
  2416
    self askForItemModification ifFalse:[ ^ nil ].
ca@1606
  2417
ca@1606
  2418
    index := 1.
ca@1606
  2419
ca@1618
  2420
    (intoItem canAddChildren and:[intoItem isExpanded]) ifFalse:[
cg@3013
  2421
	intoItem parent notNil ifTrue:[
cg@3013
  2422
	    [ intoItem parent canAddChildren ] whileFalse:[
cg@3013
  2423
		intoItem := intoItem parent.
cg@3013
  2424
	    ].
cg@3013
  2425
	    index := intoItem parent identityIndexOf:intoItem.
cg@3013
  2426
	    index := index + 1.
cg@3013
  2427
	    intoItem := intoItem parent.
cg@3013
  2428
	].
ca@1606
  2429
    ].
cg@1702
  2430
    newItem := aBlockOrItem value.
ca@1606
  2431
cg@2862
  2432
    newItem notNil ifTrue:[
cg@3013
  2433
	selectionHolder setValue:nil.
cg@3013
  2434
	intoItem expand.
cg@3013
  2435
cg@3013
  2436
	newItem isCollection ifTrue:[
cg@3013
  2437
	    intoItem addAll:newItem beforeIndex:index.
cg@3013
  2438
	    selectionHolder value:newItem.
cg@3013
  2439
	] ifFalse:[
cg@3013
  2440
	    intoItem add:newItem beforeIndex:index.
cg@3013
  2441
	    selectionHolder value:(Array with:newItem).
cg@3013
  2442
	].
cg@3013
  2443
	self setModified.
ca@1606
  2444
    ].
ca@1606
  2445
    ^ newItem
cg@2862
  2446
cg@2862
  2447
    "Modified: / 29-11-2011 / 11:28:06 / cg"
ca@1606
  2448
!
ca@1606
  2449
ca@1606
  2450
clearModified
cg@1971
  2451
    "clear the modifiedChannel and the commitPanel"
cg@1971
  2452
cg@2008
  2453
    super clearModified.
cg@1988
  2454
    self enablingCommitButtonsHolder value:false.
ca@1606
  2455
    self clearModifiedFlag.
ca@1606
  2456
!
ca@1606
  2457
ca@1606
  2458
generateMenuSpec
cg@2569
  2459
    "generate and returns the current menu spec or nil"
cg@2569
  2460
cg@3135
  2461
    ^ self generateMenuSpecFor:listOfItems root
cg@3135
  2462
!
cg@3135
  2463
cg@3135
  2464
generateMenuSpecFor:aMenuItem
cg@3135
  2465
    "generate and returns a menu spec or nil"
cg@3135
  2466
cg@2569
  2467
    |menu|
ca@1606
  2468
cg@3135
  2469
    menu := aMenuItem submenu.
cg@2151
  2470
    menu isNil ifTrue:[^ nil].
cg@2569
  2471
cg@2569
  2472
    ^ menu literalArrayEncoding.
cg@2569
  2473
!
cg@2569
  2474
cg@2569
  2475
generateMenuSpecString
cg@2569
  2476
    "generate and returns the current menu spec as string or nil"
cg@2569
  2477
cg@3135
  2478
    ^ self generateMenuSpecStringFor:listOfItems root 
cg@3135
  2479
!
cg@3135
  2480
cg@3135
  2481
generateMenuSpecStringFor:aMenuItem
cg@3135
  2482
    "generate and returns the current menu spec as string or nil"
cg@3135
  2483
cg@2569
  2484
    |menu specStream|
cg@2569
  2485
cg@3135
  2486
    menu := self generateMenuSpecFor:aMenuItem.
cg@2569
  2487
    menu isNil ifTrue:[^ nil].
cg@2569
  2488
sv@3328
  2489
    specStream := WriteStream on:''.
cg@2569
  2490
    UISpecification prettyPrintSpecArray:menu on:specStream indent:5.
cg@2569
  2491
    ^ specStream contents.
ca@1606
  2492
!
ca@1606
  2493
ca@1606
  2494
withoutNotifyDo:aBlock
ca@1606
  2495
    "evaluate the block; all change notifications are
sv@1722
  2496
     discard during the block is evaluated"
sv@1722
  2497
ca@1606
  2498
    |blockResult|
ca@1606
  2499
cg@2188
  2500
    [
cg@2188
  2501
	notifyDisabledCounter := notifyDisabledCounter + 1.
cg@2188
  2502
	blockResult := aBlock value.
sv@1722
  2503
    ] ensure:[
cg@2188
  2504
	notifyDisabledCounter := notifyDisabledCounter - 1
cg@2188
  2505
    ].
ca@1606
  2506
    ^ blockResult
ca@1606
  2507
! !
ca@1606
  2508
ca@1606
  2509
!MenuEditor methodsFor:'queries'!
ca@1606
  2510
ca@1606
  2511
hasValidSpecClass
ca@1606
  2512
    "returns true if a valid specClass exists
ca@1606
  2513
    "
cg@2151
  2514
    specClass isNil ifTrue:[^ false].
cg@3353
  2515
    ^ (self resolveName:specClass) notNil
cg@3353
  2516
cg@3353
  2517
    "Modified: / 19-11-2016 / 20:19:30 / cg"
cg@2569
  2518
!
cg@2569
  2519
cg@2569
  2520
isEditingSpecOnly
cg@2581
  2521
    ^ masterApplication notNil
cg@2581
  2522
    and:[ masterApplication perform:#isEditingSpecOnly ifNotUnderstood:false]
cg@2569
  2523
!
cg@2569
  2524
cg@2569
  2525
isNotEditingSpecOnly
cg@2569
  2526
    ^ self isEditingSpecOnly not
cg@2581
  2527
!
cg@2581
  2528
cg@2581
  2529
isNotEditingSpecOnlyAndNotEmbeddedInBrowser
cg@2581
  2530
    ^ self isNotEditingSpecOnly and:[ self isEmbeddedInBrowser not ]
ca@1606
  2531
! !
ca@1606
  2532
ca@1606
  2533
!MenuEditor methodsFor:'selection'!
ca@1606
  2534
ca@1606
  2535
canSelect:anIndex
ca@1606
  2536
    "called whenever the selection changed; test whether
ca@1606
  2537
     current item is not modified ....
ca@1606
  2538
    "
cg@1711
  2539
    |oldSelectedItem newSelectedItem anythingChanged|
ca@1606
  2540
cg@1988
  2541
    self enablingCommitButtonsHolder value ifFalse:[
cg@2188
  2542
	^ true
ca@1606
  2543
    ].
ca@1606
  2544
    oldSelectedItem := self selectedItem.
cg@2151
  2545
    oldSelectedItem isNil ifTrue:[^ true].
ca@1606
  2546
ca@1606
  2547
    newSelectedItem := listOfItems at:anIndex ifAbsent:nil.
ca@1606
  2548
    oldSelectedItem == newSelectedItem ifTrue:[
cg@2188
  2549
	^ true
ca@1606
  2550
    ].
cg@1711
  2551
cg@1988
  2552
    anythingChanged := self enablingCommitButtonsHolder value.
cg@2188
  2553
    anythingChanged ifTrue:[
cg@2188
  2554
	self autoAcceptOnSelectionChange value ifTrue:[
cg@2188
  2555
	    self accept.
cg@2188
  2556
	    ^ true
cg@2188
  2557
	].
cg@1711
  2558
    ].
cg@1711
  2559
ca@1606
  2560
    ^ self askForItemModification
ca@1606
  2561
!
ca@1606
  2562
ca@1610
  2563
hasSelection
ca@1610
  2564
    "returns true if a selection exists
ca@1610
  2565
    "
ca@1610
  2566
    ^ selectionHolder value size ~~ 0
ca@1610
  2567
!
ca@1610
  2568
ca@1606
  2569
selectedItem
cg@2869
  2570
    "returns the selected item or nil (none or multiple selected)"
cg@2869
  2571
ca@1606
  2572
    |selection|
ca@1606
  2573
ca@1606
  2574
    selection := selectionHolder value.
ca@1606
  2575
    selection size == 1 ifTrue:[ ^ selection first ].
cg@2869
  2576
    ^ nil
cg@2869
  2577
cg@2869
  2578
    "Modified: / 18-01-2012 / 11:33:42 / cg"
ca@1606
  2579
!
ca@1606
  2580
ca@1606
  2581
selectedItem:anItem
ca@1606
  2582
    "change selection to an item
ca@1606
  2583
    "
ca@1606
  2584
    |selection|
ca@1606
  2585
ca@1606
  2586
    anItem notNil ifTrue:[ selection := Array with:anItem ]
ca@1606
  2587
		 ifFalse:[ selection := #() ].
ca@1606
  2588
ca@1606
  2589
    selectionHolder value:selection.
cg@2869
  2590
!
cg@2869
  2591
cg@2869
  2592
selectedItems
cg@2869
  2593
    "returns the selected items or an empty collection"
cg@2869
  2594
cg@2869
  2595
    ^ selectionHolder value.
cg@2869
  2596
cg@2869
  2597
    "Created: / 18-01-2012 / 11:32:20 / cg"
cg@2869
  2598
!
cg@2869
  2599
cg@2869
  2600
selectedItems:aCollectionOfItems
cg@2869
  2601
    "set the selected items"
cg@2869
  2602
cg@2869
  2603
    selectionHolder value:aCollectionOfItems.
cg@2869
  2604
cg@2869
  2605
    "Created: / 18-01-2012 / 11:32:37 / cg"
ca@1606
  2606
! !
ca@1606
  2607
cg@1715
  2608
!MenuEditor methodsFor:'user actions-aspects'!
ca@1614
  2609
ca@1614
  2610
collectActionSelectors
ca@1614
  2611
    |selectors|
ca@1614
  2612
ca@1614
  2613
    selectors := IdentitySet new.
ca@1614
  2614
ca@1614
  2615
    listOfItems root recursiveDo:[:el|
cg@2188
  2616
	el actionSelectors do:[:s| selectors add:s ].
ca@1614
  2617
    ].
ca@1614
  2618
    ^ selectors asOrderedCollection
ca@1614
  2619
!
ca@1614
  2620
ca@1614
  2621
collectAspectSelectors
ca@1614
  2622
    |selectors|
ca@1614
  2623
ca@1614
  2624
    selectors := IdentitySet new.
ca@1614
  2625
ca@1614
  2626
    listOfItems root recursiveDo:[:el|
cg@3013
  2627
	selectors addAll:(el aspectSelectors).
ca@1614
  2628
    ].
ca@1614
  2629
    ^ selectors asOrderedCollection
ca@1614
  2630
!
ca@1614
  2631
cg@2297
  2632
doBrowseActionMethod
cg@3029
  2633
    "open a browser on the action callback method (create if not yet existing)"
cg@2810
  2634
cg@2810
  2635
    self doBrowseApplicationMethodFor:#itemValue
cg@2810
  2636
cg@2810
  2637
    "Modified: / 21-10-2010 / 14:09:33 / cg"
cg@2810
  2638
!
cg@2810
  2639
cg@2810
  2640
doBrowseApplicationMethodFor:aspect
cg@3028
  2641
    |selector cls implClass browsedClass category|
cg@2297
  2642
cg@2810
  2643
    specClass isNil ifTrue:[
cg@3585
  2644
        self warn:('Please define the application class first.').
cg@3026
  2645
        ^ self
cg@2297
  2646
    ].
cg@2297
  2647
cg@3237
  2648
    selector := (self aspectValueFor:aspect).
cg@2810
  2649
    selector isEmptyOrNil ifTrue:[
cg@3029
  2650
        Dialog information:(resources string:'Missing name for the action/aspect method.').
cg@3026
  2651
        ^ self
cg@2297
  2652
    ].
cg@2810
  2653
    (selector = 'true' or:[selector = 'false']) ifTrue:[^ self].
cg@2810
  2654
    (selector == true or:[selector == false]) ifTrue:[^ self].
cg@2810
  2655
cg@2810
  2656
    selector := selector asSymbol.
cg@2297
  2657
cg@2297
  2658
    cls := self resolveName:specClass.
cg@2297
  2659
    cls isNil ifTrue:[
cg@3026
  2660
        self warn:(resources string:'Class %1 does not exist!!' with:specClass asString).
cg@3026
  2661
        ^ self
cg@2297
  2662
    ].
cg@2297
  2663
cg@3028
  2664
    browsedClass := cls.
cg@2630
  2665
    (cls includesSelector:selector) ifFalse:[
jan@3099
  2666
        | generate |    
cg@3028
  2667
        (implClass := cls whichClassImplements:selector) notNil ifTrue:[
jan@3099
  2668
            generate := (Dialog 
cg@3029
  2669
                confirm:(resources 
cg@3029
  2670
                            stringWithCRs:'The application does not directly implement %1.\However it inherits this from %2.\\Create a redefinition in %1?'
cg@3029
  2671
                            with:cls name
cg@3029
  2672
                            with:implClass name)
cg@3029
  2673
                initialAnswer:false)
jan@3099
  2674
        ] ifFalse:[ 
jan@3099
  2675
            generate := true.
jan@3099
  2676
        ].
jan@3099
  2677
        category := UserPreferences current categoryForMenuActionsMethods.
jan@3099
  2678
jan@3099
  2679
        SmalltalkCodeGeneratorTool
jan@3099
  2680
            createActionMethodFor:selector in:cls
jan@3099
  2681
            category:category
jan@3099
  2682
            redefine:(self redefineAspectMethodsChannel value).
cg@2297
  2683
    ].
cg@2297
  2684
cg@3243
  2685
    browsedClass browserClass openInClass:browsedClass selector:selector
cg@2810
  2686
cg@2810
  2687
    "Created: / 21-10-2010 / 14:07:32 / cg"
cg@2833
  2688
    "Modified: / 31-01-2011 / 18:28:59 / cg"
jan@3099
  2689
    "Modified: / 17-03-2014 / 12:25:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
cg@3585
  2690
    "Modified: / 09-08-2018 / 15:31:11 / Claus Gittinger"
cg@2810
  2691
!
cg@2810
  2692
cg@3029
  2693
doBrowseChoiceMethod
cg@3029
  2694
    "open a browser on the choice aspect method (create if not yet existing)"
cg@3029
  2695
cg@3029
  2696
    self doBrowseApplicationMethodFor:#choice
cg@3029
  2697
!
cg@3029
  2698
cg@2810
  2699
doBrowseEnabledMethod
cg@2810
  2700
    "open a browser on the enabled method (create if not yet existing)"
cg@2810
  2701
cg@2810
  2702
    self doBrowseApplicationMethodFor:#enabled
cg@2810
  2703
cg@2810
  2704
    "Created: / 21-10-2010 / 14:09:41 / cg"
cg@2810
  2705
!
cg@2810
  2706
cg@3029
  2707
doBrowseIndicationMethod
cg@3029
  2708
    "open a browser on the indicator aspect method (create if not yet existing)"
cg@3029
  2709
cg@3029
  2710
    self doBrowseApplicationMethodFor:#indication
cg@3029
  2711
!
cg@3029
  2712
cg@2810
  2713
doBrowseVisibilityMethod
cg@2810
  2714
    "open a browser on the visibility method (create if not yet existing)"
cg@2810
  2715
cg@2810
  2716
    self doBrowseApplicationMethodFor:#isVisible
cg@2810
  2717
cg@2810
  2718
    "Created: / 21-10-2010 / 14:09:56 / cg"
cg@2297
  2719
!
cg@2297
  2720
ca@1614
  2721
doGenerateAspectMethods
cg@1805
  2722
    "compile aspect and action methods"
cg@1805
  2723
cg@1805
  2724
    |cls redefineAspectMethods category|
ca@1614
  2725
cg@2151
  2726
    specClass isNil ifTrue:[
cg@3013
  2727
	self warn:'Define the class first !!'.
cg@3013
  2728
	^ self
ca@1614
  2729
    ].
ca@1617
  2730
    redefineAspectMethods := self redefineAspectMethodsChannel value.
ca@1614
  2731
ca@1614
  2732
    cls := self resolveName:specClass.
cg@2151
  2733
    cls isNil ifTrue:[
cg@3013
  2734
	self warn:'Class ', specClass asString, ' does not exist!!'.
cg@3013
  2735
	^ self
ca@1614
  2736
    ].
ca@1617
  2737
cg@1805
  2738
    category := UserPreferences current categoryForMenuActionsMethods.
cg@1805
  2739
ca@1617
  2740
    self collectActionSelectors do:[:aSelector|
cg@3013
  2741
	SmalltalkCodeGeneratorTool
cg@3013
  2742
	    createActionMethodFor:aSelector in:cls
cg@3013
  2743
	    category:category
cg@3013
  2744
	    redefine:redefineAspectMethods.
ca@1614
  2745
    ].
ca@1614
  2746
ca@1617
  2747
    self collectAspectSelectors do:[:anAspect|
cg@3013
  2748
	SmalltalkCodeGeneratorTool
cg@3013
  2749
	    createAspectMethodFor:anAspect in:cls
cg@3013
  2750
	    category:category
cg@3013
  2751
	    redefine:redefineAspectMethods
ca@1614
  2752
    ].
cg@2833
  2753
cg@2833
  2754
    "Modified: / 31-01-2011 / 18:29:06 / cg"
ca@1614
  2755
! !
ca@1614
  2756
cg@1715
  2757
!MenuEditor methodsFor:'user actions-building'!
ca@1606
  2758
cg@3135
  2759
compileSpecMethodFor:aMenuItem selector:specSelector
cg@3135
  2760
    "save current editing menu to
cg@3135
  2761
           class: specClass
cg@3135
  2762
        selector: specSelector
cg@3135
  2763
    "
cg@3135
  2764
    |cls specCode mthd category s|
cg@3135
  2765
cg@3135
  2766
    specCode := self generateMenuSpecStringFor:aMenuItem.
cg@3135
  2767
    specCode isNil ifTrue:[^ nil].
cg@3135
  2768
cg@3135
  2769
    cls  := self resolveName:specClass.
cg@3135
  2770
cg@3135
  2771
    "/ if that method already exists, do not overwrite the category
cg@3135
  2772
cg@3135
  2773
    category := 'menu specs'.
cg@3135
  2774
    (mthd := cls theMetaclass compiledMethodAt:specSelector) notNil ifTrue:[
cg@3135
  2775
        category := mthd category.
cg@3135
  2776
    ].
cg@3135
  2777
cg@3135
  2778
    s := '' writeStream.
cg@3135
  2779
cg@3135
  2780
    s nextPutChunkSeparator;
cg@3135
  2781
      nextPutAll:(cls name);
cg@3135
  2782
      nextPutAll:' class methodsFor:';
cg@3135
  2783
      nextPutAll:category storeString;
cg@3135
  2784
      nextPutChunkSeparator;
cg@3135
  2785
      cr; cr;
cg@3135
  2786
      nextPutAll:specSelector;
cg@3135
  2787
      cr;
cg@3135
  2788
      nextPutAllAsChunk:(self class codeGenerationComment) withCRs;
cg@3135
  2789
      cr; cr;
cg@3135
  2790
      nextPutLine:'    "';
cg@3135
  2791
      nextPutLine:('     MenuEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector);
cg@3135
  2792
      nextPutLine:('     (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , specSelector , ')) startUp');
cg@3135
  2793
      nextPutLine:'    "';
cg@3135
  2794
      cr;
cg@3135
  2795
      nextPutLine:'    <resource: #menu>';
cg@3135
  2796
      cr;
cg@3135
  2797
      nextPutAll:'    ^ ';
cg@3135
  2798
      nextChunkPut:specCode;
cg@3135
  2799
      space;
cg@3135
  2800
      nextPutChunkSeparator;
cg@3135
  2801
      cr.
cg@3135
  2802
cg@3135
  2803
    Class packageQuerySignal answer:cls package do:[
cg@3135
  2804
        (ReadStream on:s contents) fileIn.
cg@3135
  2805
    ].
cg@3135
  2806
!
cg@3135
  2807
cg@2331
  2808
doChooseAMenu
cg@2331
  2809
    "pick a menu and edit its spec method"
cg@2331
  2810
cg@2331
  2811
    |view subSpec app bldr spec menuSelector1 menuSelector2 info|
cg@2331
  2812
cg@2331
  2813
    self askForModification ifTrue:[
cg@3013
  2814
	view := Screen current viewFromUser.
cg@3013
  2815
	(view isNil or:[view == Screen current rootView]) ifTrue:[
cg@3013
  2816
	    ^ self
cg@3013
  2817
	].
cg@3013
  2818
	view specClass == MenuPanelSpec ifTrue:[
cg@3013
  2819
	    (app := view application) isNil ifTrue:[
cg@3013
  2820
		info := 'Could not figure out the application class.'
cg@3013
  2821
	    ] ifFalse:[
cg@3013
  2822
		(bldr := app builder) isNil ifTrue:[
cg@3013
  2823
		    info := 'Application has no builder.'
cg@3013
  2824
		] ifFalse:[
cg@3013
  2825
		    menuSelector1 := bldr namedComponents keyAtValue:view ifAbsent:nil.
cg@3013
  2826
		    (spec := bldr spec) isNil ifTrue:[
cg@3013
  2827
			info := 'Cannot fetch spec from applications builder.'
cg@3013
  2828
		    ] ifFalse:[
cg@3013
  2829
			subSpec := spec findSpecForWhich:[:subSpec | subSpec name = view name].
cg@3013
  2830
			subSpec isNil ifTrue:[
cg@3013
  2831
			    info := 'Cannot find view-spec for ',view name asString,'.'
cg@3013
  2832
			] ifFalse:[
cg@3013
  2833
			    menuSelector2 := subSpec menu.
cg@3013
  2834
			]
cg@3013
  2835
		    ].
cg@3013
  2836
		    (menuSelector1 isNil and:[ menuSelector2 isNil ]) ifTrue:[
cg@3013
  2837
			info := 'menu is probably not provided by a menuSelector.'
cg@3013
  2838
		    ] ifFalse:[
cg@3013
  2839
			(app class respondsTo:menuSelector1) ifTrue:[
cg@3013
  2840
			    self loadFromClass:app class andSelector:menuSelector1.
cg@3013
  2841
			    ^ self.
cg@3013
  2842
			].
cg@3013
  2843
			(app class respondsTo:menuSelector2) ifTrue:[
cg@3013
  2844
			    self loadFromClass:app class andSelector:menuSelector2.
cg@3013
  2845
			    ^ self.
cg@3013
  2846
			].
cg@3013
  2847
			info := 'menu is probably not provided by a menuSelector.'
cg@3013
  2848
		    ].
cg@3013
  2849
		]
cg@3013
  2850
	    ].
cg@3013
  2851
	    info notNil ifTrue:[
cg@3013
  2852
		app notNil ifTrue:[
cg@3013
  2853
		    (Dialog confirm:(info,'\\Browse ?' withCRs)) ifTrue:[
cg@3013
  2854
			app browse.
cg@3013
  2855
		    ].
cg@3013
  2856
		] ifFalse:[
cg@3013
  2857
		    Dialog information:info.
cg@3013
  2858
		].
cg@3013
  2859
	    ].
cg@3013
  2860
	    ^ self.
cg@3013
  2861
	].
cg@2331
  2862
    ].
cg@2331
  2863
!
cg@2331
  2864
ca@1606
  2865
doNew
ca@1606
  2866
    "clear editing menu; start from scratch
ca@1606
  2867
    "
ca@1606
  2868
    super doNew ifTrue:[ self helpTool doNew ].
ca@1606
  2869
!
ca@1606
  2870
ca@1606
  2871
doPickAMenu
cg@2331
  2872
    "let user pick a menu and create a new spec"
cg@1971
  2873
ca@1606
  2874
    |view|
ca@1606
  2875
ca@1606
  2876
    self askForModification ifTrue:[
cg@3013
  2877
	view := Screen current viewFromUser.
cg@3013
  2878
	(view isNil or:[view == Screen current rootView]) ifTrue:[
cg@3013
  2879
	    ^ self
cg@3013
  2880
	].
cg@3013
  2881
	view specClass == MenuPanelSpec ifTrue:[
cg@3013
  2882
	    specSelector := #pickedMenu.
cg@3013
  2883
	    self buildFromMenu:(view asMenu) selector:specSelector.
cg@3013
  2884
	].
ca@1606
  2885
    ].
ca@1606
  2886
!
ca@1606
  2887
ca@1606
  2888
doSave
ca@1606
  2889
    "save current editing menu to
sv@3016
  2890
           class: specClass
sv@3016
  2891
        selector: specSelector
sv@3016
  2892
    "
cg@2569
  2893
    self isEditingSpecOnly ifTrue:[
sv@3016
  2894
        savedSpec := self generateMenuSpec.
sv@3016
  2895
        hasSaved := true.
sv@3016
  2896
        self clearModified.
sv@3016
  2897
        ^ self
cg@2569
  2898
    ].
ca@1606
  2899
ca@1606
  2900
    super doSave ifFalse: [^nil].