MenuEditor.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 12:07:51 +0100
branchjv
changeset 3630 5e718e0a754e
parent 3365 51b676d98742
child 3396 efbf0e6f05b4
permissions -rw-r--r--
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present

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