MenuEditor.st
changeset 1244 fd44af858001
parent 1200 3d1b5aceaa49
child 1246 c5425b3c8f3e
equal deleted inserted replaced
1243:03c4a3e4ddd2 1244:fd44af858001
    11 "
    11 "
    12 
    12 
    13 
    13 
    14 
    14 
    15 ResourceSpecEditor subclass:#MenuEditor
    15 ResourceSpecEditor subclass:#MenuEditor
    16 	instanceVariableNames:'specCanvas helpCanvas slices'
    16 	instanceVariableNames:'treeView typeOfCanvas listOfCanvas listOfSlices
       
    17 		lastImageRetriever slices'
    17 	classVariableNames:''
    18 	classVariableNames:''
    18 	poolDictionaries:''
    19 	poolDictionaries:''
    19 	category:'Interface-UIPainter'
    20 	category:'Interface-UIPainter'
    20 !
    21 !
    21 
    22 
   362        #(#WindowSpec
   363        #(#WindowSpec
   363           #label: 'Basics Item'
   364           #label: 'Basics Item'
   364           #name: 'Basics Item'
   365           #name: 'Basics Item'
   365           #min: #(#Point 10 10)
   366           #min: #(#Point 10 10)
   366           #max: #(#Point 1160 870)
   367           #max: #(#Point 1160 870)
   367           #bounds: #(#Rectangle 220 200 487 519)
   368           #bounds: #(#Rectangle 273 266 540 585)
   368         )
   369         )
   369         #component: 
   370         #component: 
   370        #(#SpecCollection
   371        #(#SpecCollection
   371           #collection: #(
   372           #collection: #(
   372            #(#LabelSpec
   373            #(#LabelSpec
   377               #resizeForLabel: true
   378               #resizeForLabel: true
   378               #adjust: #right
   379               #adjust: #right
   379             )
   380             )
   380            #(#InputFieldSpec
   381            #(#InputFieldSpec
   381               #name: 'nameKeyField'
   382               #name: 'nameKeyField'
   382               #layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0)
   383               #layout: #(#LayoutFrame 110 0 16 0 -5 1.0 38 0)
   383               #activeHelpKey: #basicsKey
   384               #activeHelpKey: #basicsKey
   384               #tabable: true
   385               #tabable: true
   385               #model: #nameKey
   386               #model: #nameKey
   386               #group: #inputGroup
   387               #group: #inputGroup1
   387               #type: #symbolOrNil
   388               #type: #symbolOrNil
   388               #acceptOnLeave: false
   389               #acceptOnLeave: false
   389               #acceptOnReturn: true
   390               #acceptOnReturn: true
   390               #acceptOnTab: true
   391               #acceptOnTab: true
   391               #acceptOnLostFocus: false
   392               #acceptOnLostFocus: false
   405               #name: 'labelField'
   406               #name: 'labelField'
   406               #layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0)
   407               #layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0)
   407               #activeHelpKey: #basicsLabel
   408               #activeHelpKey: #basicsLabel
   408               #tabable: true
   409               #tabable: true
   409               #model: #label
   410               #model: #label
   410               #group: #inputGroup
   411               #group: #inputGroup1
   411               #acceptOnReturn: true
   412               #acceptOnReturn: true
   412               #acceptOnTab: true
   413               #acceptOnTab: true
   413               #acceptOnLostFocus: false
   414               #acceptOnLostFocus: false
   414               #acceptChannel: #acceptChannel
   415               #acceptChannel: #acceptChannel
   415               #modifiedChannel: #modifiedChannel
   416               #modifiedChannel: #modifiedChannel
   427               #name: 'valueField'
   428               #name: 'valueField'
   428               #layout: #(#LayoutFrame 110 0 79 0 -5 1.0 101 0)
   429               #layout: #(#LayoutFrame 110 0 79 0 -5 1.0 101 0)
   429               #activeHelpKey: #basicsAction
   430               #activeHelpKey: #basicsAction
   430               #tabable: true
   431               #tabable: true
   431               #model: #value
   432               #model: #value
   432               #group: #inputGroup
   433               #group: #inputGroup1
   433               #type: #symbolOrNil
   434               #type: #symbolOrNil
   434               #acceptOnReturn: true
   435               #acceptOnReturn: true
   435               #acceptOnTab: true
   436               #acceptOnTab: true
   436               #acceptOnLostFocus: false
   437               #acceptOnLostFocus: false
   437               #acceptChannel: #acceptChannel
   438               #acceptChannel: #acceptChannel
   450               #name: 'argumentField'
   451               #name: 'argumentField'
   451               #layout: #(#LayoutFrame 110 0 104 0 -5 1.0 126 0)
   452               #layout: #(#LayoutFrame 110 0 104 0 -5 1.0 126 0)
   452               #activeHelpKey: #basicsArgument
   453               #activeHelpKey: #basicsArgument
   453               #tabable: true
   454               #tabable: true
   454               #model: #argument
   455               #model: #argument
   455               #group: #inputGroup
   456               #group: #inputGroup1
   456               #type: #smalltalkObject
   457               #type: #smalltalkObject
   457               #acceptOnReturn: true
   458               #acceptOnReturn: true
   458               #acceptOnTab: true
   459               #acceptOnTab: true
   459               #acceptOnLostFocus: false
   460               #acceptOnLostFocus: false
   460               #acceptChannel: #acceptChannel
   461               #acceptChannel: #acceptChannel
   474               #layout: #(#LayoutFrame 110 0 144 0 -5 1.0 166 0)
   475               #layout: #(#LayoutFrame 110 0 144 0 -5 1.0 166 0)
   475               #activeHelpKey: #basicsIndication
   476               #activeHelpKey: #basicsIndication
   476               #enableChannel: #indicationEnabled
   477               #enableChannel: #indicationEnabled
   477               #tabable: true
   478               #tabable: true
   478               #model: #indication
   479               #model: #indication
   479               #group: #inputGroup
   480               #group: #inputGroup1
   480               #type: #symbolOrNil
   481               #type: #symbolOrNil
   481               #immediateAccept: true
   482               #immediateAccept: true
   482               #acceptOnReturn: true
   483               #acceptOnReturn: true
   483               #acceptOnTab: true
   484               #acceptOnTab: true
   484               #acceptOnLostFocus: false
   485               #acceptOnLostFocus: false
   500               #layout: #(#LayoutFrame 110 0 169 0 -5 1.0 191 0)
   501               #layout: #(#LayoutFrame 110 0 169 0 -5 1.0 191 0)
   501               #activeHelpKey: #basicsChoice
   502               #activeHelpKey: #basicsChoice
   502               #enableChannel: #choiceEnabled
   503               #enableChannel: #choiceEnabled
   503               #tabable: true
   504               #tabable: true
   504               #model: #choice
   505               #model: #choice
   505               #group: #inputGroup
   506               #group: #inputGroup1
   506               #type: #symbolOrNil
   507               #type: #symbolOrNil
   507               #immediateAccept: true
   508               #immediateAccept: true
   508               #acceptOnReturn: true
   509               #acceptOnReturn: true
   509               #acceptOnTab: true
   510               #acceptOnTab: true
   510               #acceptOnLostFocus: false
   511               #acceptOnLostFocus: false
   526               #layout: #(#LayoutFrame 110 0 194 0 -5 1.0 216 0)
   527               #layout: #(#LayoutFrame 110 0 194 0 -5 1.0 216 0)
   527               #activeHelpKey: #basicsChoiceValue
   528               #activeHelpKey: #basicsChoiceValue
   528               #enableChannel: #choiceValueEnabled
   529               #enableChannel: #choiceValueEnabled
   529               #tabable: true
   530               #tabable: true
   530               #model: #choiceValue
   531               #model: #choiceValue
   531               #group: #inputGroup
   532               #group: #inputGroup1
   532               #type: #smalltalkObject
   533               #type: #smalltalkObject
   533               #acceptOnLeave: false
   534               #acceptOnLeave: false
   534               #acceptOnReturn: true
   535               #acceptOnReturn: true
   535               #acceptOnTab: true
   536               #acceptOnTab: true
   536               #acceptOnLostFocus: false
   537               #acceptOnLostFocus: false
   579         #name: #basicsLinkSpec
   580         #name: #basicsLinkSpec
   580         #window: 
   581         #window: 
   581        #(#WindowSpec
   582        #(#WindowSpec
   582           #label: 'Basics Link'
   583           #label: 'Basics Link'
   583           #name: 'Basics Link'
   584           #name: 'Basics Link'
   584           #layout: #(#LayoutFrame 8 0 143 0 274 0 461 0)
       
   585           #level: 0
       
   586           #min: #(#Point 10 10)
   585           #min: #(#Point 10 10)
   587           #max: #(#Point 1280 1024)
   586           #max: #(#Point 1280 1024)
   588           #bounds: #(#Rectangle 8 143 275 462)
   587           #bounds: #(#Rectangle 94 229 361 548)
   589           #usePreferredExtent: false
       
   590           #returnIsOKInDialog: true
       
   591           #escapeIsCancelInDialog: true
       
   592         )
   588         )
   593         #component: 
   589         #component: 
   594        #(#SpecCollection
   590        #(#SpecCollection
   595           #collection: #(
   591           #collection: #(
   596            #(#LabelSpec
   592            #(#LabelSpec
   605               #name: 'nameKeyField'
   601               #name: 'nameKeyField'
   606               #layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0)
   602               #layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0)
   607               #activeHelpKey: #basicsNameKey
   603               #activeHelpKey: #basicsNameKey
   608               #tabable: true
   604               #tabable: true
   609               #model: #nameKey
   605               #model: #nameKey
   610               #group: #inputGroup
   606               #group: #inputGroup2
   611               #type: #symbolOrNil
   607               #type: #symbolOrNil
   612               #acceptOnReturn: true
   608               #acceptOnReturn: true
   613               #acceptOnTab: true
   609               #acceptOnTab: true
   614               #acceptChannel: #acceptChannel
   610               #acceptChannel: #acceptChannel
   615               #modifiedChannel: #modifiedChannel
   611               #modifiedChannel: #modifiedChannel
   625               #name: 'labelField'
   621               #name: 'labelField'
   626               #layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0)
   622               #layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0)
   627               #activeHelpKey: #basicsLabel
   623               #activeHelpKey: #basicsLabel
   628               #tabable: true
   624               #tabable: true
   629               #model: #label
   625               #model: #label
   630               #group: #inputGroup
   626               #group: #inputGroup2
   631               #acceptOnReturn: true
   627               #acceptOnReturn: true
   632               #acceptOnTab: true
   628               #acceptOnTab: true
   633               #acceptChannel: #acceptChannel
   629               #acceptChannel: #acceptChannel
   634               #modifiedChannel: #modifiedChannel
   630               #modifiedChannel: #modifiedChannel
   635               #acceptOnPointerLeave: false
   631               #acceptOnPointerLeave: false
   644               #name: 'menuField'
   640               #name: 'menuField'
   645               #layout: #(#LayoutFrame 110 0 65 0 -5 1.0 87 0)
   641               #layout: #(#LayoutFrame 110 0 65 0 -5 1.0 87 0)
   646               #activeHelpKey: #basicsMenu
   642               #activeHelpKey: #basicsMenu
   647               #tabable: true
   643               #tabable: true
   648               #model: #submenuChannel
   644               #model: #submenuChannel
   649               #group: #inputGroup
   645               #group: #inputGroup2
   650               #type: #symbolOrNil
   646               #type: #symbolOrNil
   651               #acceptOnReturn: true
   647               #acceptOnReturn: true
   652               #acceptOnTab: true
   648               #acceptOnTab: true
   653               #acceptChannel: #acceptChannel
   649               #acceptChannel: #acceptChannel
   654               #modifiedChannel: #modifiedChannel
   650               #modifiedChannel: #modifiedChannel
   664               #name: 'argumentField'
   660               #name: 'argumentField'
   665               #layout: #(#LayoutFrame 110 0 90 0 -5 1.0 112 0)
   661               #layout: #(#LayoutFrame 110 0 90 0 -5 1.0 112 0)
   666               #activeHelpKey: #basicsMenuArgument
   662               #activeHelpKey: #basicsMenuArgument
   667               #tabable: true
   663               #tabable: true
   668               #model: #argument
   664               #model: #argument
   669               #group: #inputGroup
   665               #group: #inputGroup2
   670               #acceptOnReturn: true
   666               #acceptOnReturn: true
   671               #acceptOnTab: true
   667               #acceptOnTab: true
   672               #acceptChannel: #acceptChannel
   668               #acceptChannel: #acceptChannel
   673               #modifiedChannel: #modifiedChannel
   669               #modifiedChannel: #modifiedChannel
   674               #acceptOnPointerLeave: false
   670               #acceptOnPointerLeave: false
   706         #name: #basicsMenuSpec
   702         #name: #basicsMenuSpec
   707         #window: 
   703         #window: 
   708        #(#WindowSpec
   704        #(#WindowSpec
   709           #label: 'Basics Menu'
   705           #label: 'Basics Menu'
   710           #name: 'Basics Menu'
   706           #name: 'Basics Menu'
   711           #layout: #(#LayoutFrame 50 0 134 0 316 0 452 0)
       
   712           #level: 0
       
   713           #min: #(#Point 10 10)
   707           #min: #(#Point 10 10)
   714           #max: #(#Point 1280 1024)
   708           #max: #(#Point 1280 1024)
   715           #bounds: #(#Rectangle 50 134 317 453)
   709           #bounds: #(#Rectangle 93 223 360 542)
   716           #usePreferredExtent: false
       
   717           #returnIsOKInDialog: true
       
   718           #escapeIsCancelInDialog: true
       
   719         )
   710         )
   720         #component: 
   711         #component: 
   721        #(#SpecCollection
   712        #(#SpecCollection
   722           #collection: #(
   713           #collection: #(
   723            #(#LabelSpec
   714            #(#LabelSpec
   731               #name: 'nameKeyField'
   722               #name: 'nameKeyField'
   732               #layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0)
   723               #layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0)
   733               #activeHelpKey: #basicsNameKey
   724               #activeHelpKey: #basicsNameKey
   734               #tabable: true
   725               #tabable: true
   735               #model: #nameKey
   726               #model: #nameKey
   736               #group: #inputGroup
   727               #group: #inputGroup3
   737               #type: #symbolOrNil
   728               #type: #symbolOrNil
   738               #acceptOnReturn: true
   729               #acceptOnReturn: true
   739               #acceptOnTab: true
   730               #acceptOnTab: true
   740               #acceptChannel: #acceptChannel
   731               #acceptChannel: #acceptChannel
   741               #modifiedChannel: #modifiedChannel
   732               #modifiedChannel: #modifiedChannel
   752               #name: 'labelField'
   743               #name: 'labelField'
   753               #layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0)
   744               #layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0)
   754               #activeHelpKey: #basicsLabel
   745               #activeHelpKey: #basicsLabel
   755               #tabable: true
   746               #tabable: true
   756               #model: #label
   747               #model: #label
   757               #group: #inputGroup
   748               #group: #inputGroup3
   758               #acceptOnReturn: true
   749               #acceptOnReturn: true
   759               #acceptOnTab: true
   750               #acceptOnTab: true
   760               #acceptChannel: #acceptChannel
   751               #acceptChannel: #acceptChannel
   761               #modifiedChannel: #modifiedChannel
   752               #modifiedChannel: #modifiedChannel
   762               #acceptOnPointerLeave: false
   753               #acceptOnPointerLeave: false
   928         #name: #detailsEditSpec
   919         #name: #detailsEditSpec
   929         #window: 
   920         #window: 
   930        #(#WindowSpec
   921        #(#WindowSpec
   931           #label: 'Details Edit'
   922           #label: 'Details Edit'
   932           #name: 'Details Edit'
   923           #name: 'Details Edit'
   933           #layout: #(#LayoutFrame 28 0 94 0 342 0 377 0)
       
   934           #level: 0
       
   935           #min: #(#Point 10 10)
   924           #min: #(#Point 10 10)
   936           #max: #(#Point 1280 1024)
   925           #max: #(#Point 1280 1024)
   937           #bounds: #(#Rectangle 28 94 343 378)
   926           #bounds: #(#Rectangle 5 175 320 459)
   938           #usePreferredExtent: false
       
   939           #returnIsOKInDialog: true
       
   940           #escapeIsCancelInDialog: true
       
   941         )
   927         )
   942         #component: 
   928         #component: 
   943        #(#SpecCollection
   929        #(#SpecCollection
   944           #collection: #(
   930           #collection: #(
   945            #(#LabelSpec
   931            #(#LabelSpec
   954               #name: 'shortcutKeyField'
   940               #name: 'shortcutKeyField'
   955               #layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0)
   941               #layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0)
   956               #activeHelpKey: #detailsAccelerator
   942               #activeHelpKey: #detailsAccelerator
   957               #tabable: true
   943               #tabable: true
   958               #model: #shortcutKey
   944               #model: #shortcutKey
   959               #group: #inputGroup
   945               #group: #inputGroup4
   960               #type: #symbolOrNil
   946               #type: #symbolOrNil
   961               #acceptOnReturn: true
   947               #acceptOnReturn: true
   962               #acceptOnTab: true
   948               #acceptOnTab: true
   963               #acceptChannel: #acceptChannel
   949               #acceptChannel: #acceptChannel
   964               #modifiedChannel: #modifiedChannel
   950               #modifiedChannel: #modifiedChannel
       
   951               #acceptOnPointerLeave: false
   965             )
   952             )
   966            #(#LabelSpec
   953            #(#LabelSpec
   967               #label: 'Enabled:'
   954               #label: 'Enabled:'
   968               #name: 'enabledLabel'
   955               #name: 'enabledLabel'
   969               #layout: #(#AlignmentOrigin 107 0 51 0 1 0.5)
   956               #layout: #(#AlignmentOrigin 107 0 51 0 1 0.5)
   975               #name: 'enabledField'
   962               #name: 'enabledField'
   976               #layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0)
   963               #layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0)
   977               #activeHelpKey: #detailsEnabled
   964               #activeHelpKey: #detailsEnabled
   978               #tabable: true
   965               #tabable: true
   979               #model: #enabled
   966               #model: #enabled
   980               #group: #inputGroup
   967               #group: #inputGroup4
   981               #type: #symbolOrNil
   968               #type: #symbolOrNil
   982               #acceptOnReturn: true
   969               #acceptOnReturn: true
   983               #acceptOnTab: true
   970               #acceptOnTab: true
   984               #acceptChannel: #acceptChannel
   971               #acceptChannel: #acceptChannel
   985               #modifiedChannel: #modifiedChannel
   972               #modifiedChannel: #modifiedChannel
       
   973               #acceptOnPointerLeave: false
   986             )
   974             )
   987            #(#LabelSpec
   975            #(#LabelSpec
   988               #label: 'Visibility:'
   976               #label: 'Visibility:'
   989               #name: 'visibilityLabel'
   977               #name: 'visibilityLabel'
   990               #layout: #(#AlignmentOrigin 107 0 76 0 1 0.5)
   978               #layout: #(#AlignmentOrigin 107 0 76 0 1 0.5)
   996               #name: 'isVisibleInputField'
   984               #name: 'isVisibleInputField'
   997               #layout: #(#LayoutFrame 110 0 65 0 -5 1.0 87 0)
   985               #layout: #(#LayoutFrame 110 0 65 0 -5 1.0 87 0)
   998               #activeHelpKey: #detailsVisibility
   986               #activeHelpKey: #detailsVisibility
   999               #tabable: true
   987               #tabable: true
  1000               #model: #isVisible
   988               #model: #isVisible
  1001               #group: #inputGroup
   989               #group: #inputGroup4
  1002               #type: #symbolOrNil
   990               #type: #symbolOrNil
  1003               #acceptOnReturn: true
   991               #acceptOnReturn: true
  1004               #acceptOnTab: true
   992               #acceptOnTab: true
  1005               #acceptChannel: #acceptChannel
   993               #acceptChannel: #acceptChannel
  1006               #modifiedChannel: #modifiedChannel
   994               #modifiedChannel: #modifiedChannel
       
   995               #acceptOnPointerLeave: false
       
   996             )
       
   997            #(#LabelSpec
       
   998               #label: 'Aux Value'
       
   999               #name: 'auxLabel'
       
  1000               #layout: #(#AlignmentOrigin 107 0 101 0 1 0.5)
       
  1001               #activeHelpKey: #detailsAuxValue
       
  1002               #translateLabel: true
       
  1003               #resizeForLabel: true
       
  1004               #adjust: #right
       
  1005             )
       
  1006            #(#InputFieldSpec
       
  1007               #name: 'auxInputField'
       
  1008               #layout: #(#LayoutFrame 110 0 90 0 -5 1.0 112 0)
       
  1009               #activeHelpKey: #detailsAuxValue
       
  1010               #tabable: true
       
  1011               #model: #auxValue
       
  1012               #group: #inputGroup4
       
  1013               #type: #smalltalkObject
       
  1014               #acceptOnReturn: true
       
  1015               #acceptOnTab: true
       
  1016               #acceptChannel: #acceptChannel
       
  1017               #modifiedChannel: #modifiedChannel
       
  1018               #acceptOnPointerLeave: false
  1007             )
  1019             )
  1008            #(#LabelSpec
  1020            #(#LabelSpec
  1009               #label: 'Start Group:'
  1021               #label: 'Start Group:'
  1010               #name: 'StartGroupLabel'
  1022               #name: 'StartGroupLabel'
  1011               #layout: #(#AlignmentOrigin 107 0 139 0 1 0.5)
  1023               #layout: #(#AlignmentOrigin 107 0 139 0 1 0.5)
  1019               #layout: #(#LayoutFrame 110 0 128 0 -5 1.0 150 0)
  1031               #layout: #(#LayoutFrame 110 0 128 0 -5 1.0 150 0)
  1020               #activeHelpKey: #detailsStartGroup
  1032               #activeHelpKey: #detailsStartGroup
  1021               #tabable: true
  1033               #tabable: true
  1022               #model: #startGroup
  1034               #model: #startGroup
  1023               #menu: 
  1035               #menu: 
  1024              #(nil
  1036              #(#Array
       
  1037                 #Array nil
  1025                 #right
  1038                 #right
  1026               )
  1039               )
  1027               #useIndex: false
  1040               #useIndex: false
  1028             )
  1041             )
  1029            #(#LabelSpec
  1042            #(#LabelSpec
  1038               #name: 'accessCharField'
  1051               #name: 'accessCharField'
  1039               #layout: #(#LayoutFrame 220 0 159 0 -5 1.0 181 0)
  1052               #layout: #(#LayoutFrame 220 0 159 0 -5 1.0 181 0)
  1040               #activeHelpKey: #detailsAccessCharaterPosition
  1053               #activeHelpKey: #detailsAccessCharaterPosition
  1041               #tabable: true
  1054               #tabable: true
  1042               #model: #accessCharacterPos
  1055               #model: #accessCharacterPos
  1043               #group: #inputGroup
  1056               #group: #inputGroup4
  1044               #type: #numberOrNil
  1057               #type: #numberOrNil
  1045               #immediateAccept: false
  1058               #immediateAccept: false
  1046               #acceptOnReturn: true
  1059               #acceptOnReturn: true
  1047               #acceptOnTab: true
  1060               #acceptOnTab: true
  1048               #acceptChannel: #acceptChannel
  1061               #acceptChannel: #acceptChannel
  1049               #modifiedChannel: #modifiedChannel
  1062               #modifiedChannel: #modifiedChannel
  1050             )
  1063               #acceptOnPointerLeave: false
  1051            #(#LabelSpec
       
  1052               #label: 'Aux Value'
       
  1053               #name: 'auxLabel'
       
  1054               #layout: #(#AlignmentOrigin 107 0 101 0 1 0.5)
       
  1055               #activeHelpKey: #detailsAuxValue
       
  1056               #translateLabel: true
       
  1057               #resizeForLabel: true
       
  1058               #adjust: #right
       
  1059             )
       
  1060            #(#InputFieldSpec
       
  1061               #name: 'auxInputField'
       
  1062               #layout: #(#LayoutFrame 110 0 90 0 -5 1.0 112 0)
       
  1063               #activeHelpKey: #detailsAuxValue
       
  1064               #tabable: true
       
  1065               #model: #auxValue
       
  1066               #group: #inputGroup
       
  1067               #type: #smalltalkObject
       
  1068               #acceptOnReturn: true
       
  1069               #acceptOnTab: true
       
  1070               #acceptChannel: #acceptChannel
       
  1071               #modifiedChannel: #modifiedChannel
       
  1072             )
  1064             )
  1073            )
  1065            )
  1074          
  1066          
  1075         )
  1067         )
  1076       )
  1068       )
  1095         #name: #imageEditSpec
  1087         #name: #imageEditSpec
  1096         #window: 
  1088         #window: 
  1097        #(#WindowSpec
  1089        #(#WindowSpec
  1098           #label: 'Image Item'
  1090           #label: 'Image Item'
  1099           #name: 'Image Item'
  1091           #name: 'Image Item'
  1100           #layout: #(#LayoutFrame 21 0 108 0 416 0 384 0)
       
  1101           #level: 0
       
  1102           #min: #(#Point 10 10)
  1092           #min: #(#Point 10 10)
  1103           #max: #(#Point 1280 1024)
  1093           #max: #(#Point 1280 1024)
  1104           #bounds: #(#Rectangle 21 108 417 385)
  1094           #bounds: #(#Rectangle 11 177 407 454)
  1105           #usePreferredExtent: false
       
  1106           #returnIsOKInDialog: true
       
  1107           #escapeIsCancelInDialog: true
       
  1108         )
  1095         )
  1109         #component: 
  1096         #component: 
  1110        #(#SpecCollection
  1097        #(#SpecCollection
  1111           #collection: #(
  1098           #collection: #(
  1112            #(#CheckBoxSpec
  1099            #(#CheckBoxSpec
  1150               #name: 'iconField'
  1137               #name: 'iconField'
  1151               #layout: #(#LayoutFrame 110 0 40 0 -31 1.0 62 0)
  1138               #layout: #(#LayoutFrame 110 0 40 0 -31 1.0 62 0)
  1152               #activeHelpKey: #imageSelector
  1139               #activeHelpKey: #imageSelector
  1153               #tabable: true
  1140               #tabable: true
  1154               #model: #icon
  1141               #model: #icon
  1155               #group: #inputGroup
  1142               #group: #inputGroup5
  1156               #type: #symbolOrNil
  1143               #type: #symbolOrNil
  1157               #acceptOnReturn: true
  1144               #acceptOnReturn: true
  1158               #acceptOnTab: true
  1145               #acceptOnTab: true
  1159               #acceptChannel: #acceptChannel
  1146               #acceptChannel: #acceptChannel
  1160               #modifiedChannel: #modifiedChannel
  1147               #modifiedChannel: #modifiedChannel
  1208      MenuEditor open
  1195      MenuEditor open
  1209     "
  1196     "
  1210 
  1197 
  1211     <resource: #canvas>
  1198     <resource: #canvas>
  1212 
  1199 
  1213     ^
  1200     ^ 
  1214      
  1201      #(#FullSpec
  1215        #(#FullSpec
  1202         #name: #windowSpec
  1216           #window: 
  1203         #window: 
  1217            #(#WindowSpec
  1204        #(#WindowSpec
  1218               #name: 'Menu Editor'
  1205           #label: 'Menu Editor'
  1219               #layout: #(#LayoutFrame 53 0 403 0 609 0 810 0)
  1206           #name: 'Menu Editor'
  1220               #label: 'Menu Editor'
  1207           #min: #(#Point 550 440)
  1221               #min: #(#Point 510 390)
  1208           #max: #(#Point 1152 900)
  1222               #max: #(#Point 1152 900)
  1209           #bounds: #(#Rectangle 162 299 719 739)
  1223               #bounds: #(#Rectangle 53 403 610 811)
  1210           #menu: #menu
  1224               #menu: #menu
  1211         )
  1225               #usePreferredExtent: false
  1212         #component: 
  1226           )
  1213        #(#SpecCollection
  1227           #component: 
  1214           #collection: #(
  1228            #(#SpecCollection
  1215            #(#MenuPanelSpec
  1229               #collection: 
  1216               #name: 'menuToolbarView'
  1230                #(
  1217               #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0)
  1231                  #(#MenuPanelSpec
  1218               #menu: #menuToolbar
  1232                     #name: 'menuToolbarView'
  1219               #showSeparatingLines: true
  1233                     #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0)
  1220             )
  1234                     #menu: #menuToolbar
  1221            #(#VariableHorizontalPanelSpec
  1235                     #showSeparatingLines: true
  1222               #name: 'VariableHorizontalPanel'
  1236                 )
  1223               #layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
  1237                  #(#VariableHorizontalPanelSpec
  1224               #component: 
  1238                     #name: 'VariableHorizontalPanel'
  1225              #(#SpecCollection
  1239                     #layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
  1226                 #collection: #(
       
  1227                  #(#ArbitraryComponentSpec
       
  1228                     #name: 'TreeView'
       
  1229                     #menu: #menuEdit
       
  1230                     #hasHorizontalScrollBar: true
       
  1231                     #hasVerticalScrollBar: true
       
  1232                     #hasBorder: false
       
  1233                     #component: #treeView
       
  1234                   )
       
  1235                  #(#ViewSpec
       
  1236                     #name: 'Box'
       
  1237                     #level: -1
  1240                     #component: 
  1238                     #component: 
  1241                      #(#SpecCollection
  1239                    #(#SpecCollection
  1242                         #collection: 
  1240                       #collection: #(
  1243                          #(
  1241                        #(#NoteBookViewSpec
  1244                            #(#ArbitraryComponentSpec
  1242                           #name: 'NoteBook'
  1245                               #name: 'TreeView'
  1243                           #layout: #(#LayoutFrame 1 0.0 0 0.0 1 1.0 -30 1.0)
  1246                               #menu: #menuEdit
  1244                           #enableChannel: #hasAnySingleSelection
  1247                               #hasHorizontalScrollBar: true
  1245                           #tabable: true
  1248                               #hasVerticalScrollBar: true
  1246                           #model: #tabModel
  1249                               #component: #treeView
  1247                           #menu: #tabList
  1250                               #hasBorder: false
  1248                           #useIndex: true
  1251                           )
  1249                           #canvas: #tabCanvasHolder
  1252                            #(#ViewSpec
  1250                           #keepCanvasAlive: true
  1253                               #name: 'Box'
       
  1254                               #component: 
       
  1255                                #(#SpecCollection
       
  1256                                   #collection: 
       
  1257                                    #(
       
  1258                                      #(#NoteBookViewSpec
       
  1259                                         #name: 'NoteBook'
       
  1260                                         #layout: #(#LayoutFrame 1 0.0 0 0.0 1 1.0 -30 1.0)
       
  1261                                         #tabable: true
       
  1262                                         #model: #tabModel
       
  1263                                         #menu: #tabList
       
  1264                                         #useIndex: true
       
  1265                                         #canvas: #noteBookView
       
  1266                                     )
       
  1267                                      #(#UISubSpecification
       
  1268                                         #name: 'SubSpecification'
       
  1269                                         #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0)
       
  1270                                         #majorKey: #ToolApplicationModel
       
  1271                                         #minorKey: #windowSpecForCommit
       
  1272                                     )
       
  1273                                   )
       
  1274                               )
       
  1275                               #level: -1
       
  1276                           )
       
  1277                         )
  1251                         )
       
  1252                        #(#UISubSpecification
       
  1253                           #name: 'SubSpecification'
       
  1254                           #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0)
       
  1255                           #majorKey: #ToolApplicationModel
       
  1256                           #minorKey: #windowSpecForCommit
       
  1257                         )
       
  1258                        )
       
  1259                      
  1278                     )
  1260                     )
  1279                     #handles: #(#Any 0.30117 1.0)
  1261                   )
  1280                 )
  1262                  )
  1281                  #(#UISubSpecification
  1263                
  1282                     #name: 'InfoBarSubSpec'
       
  1283                     #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
       
  1284                     #majorKey: #ToolApplicationModel
       
  1285                     #minorKey: #windowSpecForInfoBar
       
  1286                 )
       
  1287               )
  1264               )
  1288           )
  1265               #handles: #(#Any 0.346499 1.0)
       
  1266             )
       
  1267            #(#UISubSpecification
       
  1268               #name: 'InfoBarSubSpec'
       
  1269               #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
       
  1270               #majorKey: #ToolApplicationModel
       
  1271               #minorKey: #windowSpecForInfoBar
       
  1272             )
       
  1273            )
       
  1274          
       
  1275         )
  1289       )
  1276       )
  1290 ! !
  1277 ! !
  1291 
  1278 
  1292 !MenuEditor class methodsFor:'menu specs'!
  1279 !MenuEditor class methodsFor:'menu specs'!
  1293 
  1280 
  1949      this is dynamically constructed, to reflect the current
  1936      this is dynamically constructed, to reflect the current
  1950      edited menu."
  1937      edited menu."
  1951 
  1938 
  1952     |menu cls|
  1939     |menu cls|
  1953 
  1940 
  1954     (menu := self treeView asMenu) allItemsDo:
  1941     (menu := treeView asMenu) allItemsDo:[:anItem|
  1955     [:anItem|
       
  1956         anItem value:nil.
  1942         anItem value:nil.
  1957         anItem enabled:true.
  1943         anItem enabled:true.
  1958     ].
  1944     ].
  1959 
  1945 
  1960     cls := self resolveName:specClass.
  1946     cls := self resolveName:specClass.
  1963 !
  1949 !
  1964 
  1950 
  1965 useHelpTool: aHelpTool
  1951 useHelpTool: aHelpTool
  1966     "take the help dictionaries from aHelpTool into my helpTool"
  1952     "take the help dictionaries from aHelpTool into my helpTool"
  1967 
  1953 
  1968     self noteBookView.
       
  1969 
       
  1970     self helpTool buildFromClass: aHelpTool specClass.
  1954     self helpTool buildFromClass: aHelpTool specClass.
  1971     self helpTool dictionaries:   aHelpTool dictionaries.
  1955     self helpTool dictionaries:   aHelpTool dictionaries.
  1972     self helpTool dictionary:     aHelpTool dictionary
  1956     self helpTool dictionary:     aHelpTool dictionary
       
  1957 
       
  1958 
  1973 ! !
  1959 ! !
  1974 
  1960 
  1975 !MenuEditor methodsFor:'aspects'!
  1961 !MenuEditor methodsFor:'aspects'!
  1976 
  1962 
  1977 hasAnySingleSelection
  1963 hasAnySingleSelection
  1982 hasValidSelection
  1968 hasValidSelection
  1983 
  1969 
  1984     ^builder booleanValueAspectFor: #hasValidSelection
  1970     ^builder booleanValueAspectFor: #hasValidSelection
  1985 !
  1971 !
  1986 
  1972 
  1987 hasValidSingleSelection
       
  1988 
       
  1989     ^builder booleanValueAspectFor: #hasValidSingleSelection
       
  1990 !
       
  1991 
       
  1992 listOfImages
  1973 listOfImages
  1993     "get a list of the images"
  1974     "get a list of the images
  1994 
  1975     "
  1995     |holder|
  1976     |list|
  1996     (holder := builder bindingAt:#listOfImages) isNil ifTrue:[
  1977 
  1997         builder aspectAt:#listOfImages put: (holder := List new).
  1978     (list := builder bindingAt:#listOfImages) isNil ifTrue:[
  1998         self updateListOfImages    
  1979         builder aspectAt:#listOfImages put: (list := List new).
  1999     ].
  1980     ].
  2000     ^ holder
  1981     ^ list
  2001 
  1982 
  2002 
  1983 
  2003 !
       
  2004 
       
  2005 noteBookView
       
  2006     "create the note book view containing the attibute sections and the help tool"
       
  2007 
       
  2008     |noteBook helpTool|
       
  2009 
       
  2010     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
       
  2011         noteBook := View new.
       
  2012         helpTool := UIHelpTool new.
       
  2013 
       
  2014         helpTool masterApplication:self.
       
  2015         helpCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
       
  2016         specCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
       
  2017 
       
  2018         helpCanvas client:helpTool.
       
  2019         helpTool masterApplication:self.      
       
  2020         helpTool modifiedHolder: self valueOfEnablingCommitButtons.
       
  2021 
       
  2022         builder aspectAt:#noteBookView put:noteBook.
       
  2023     ].
       
  2024     ^ noteBook
       
  2025 !
  1984 !
  2026 
  1985 
  2027 selectionOfImage
  1986 selectionOfImage
  2028     "get selection of list of the images as value"
  1987     "get selection of list of the images as value"
  2029 
  1988 
  2034     ^ holder
  1993     ^ holder
  2035 
  1994 
  2036 
  1995 
  2037 !
  1996 !
  2038 
  1997 
       
  1998 tabCanvasHolder
       
  1999     "keep the canvas for the current selected item or nil
       
  2000     "
       
  2001     |holder|
       
  2002 
       
  2003     (holder := builder bindingAt:#tabCanvasHolder) isNil ifTrue:[
       
  2004         builder aspectAt:#tabCanvasHolder put: (holder := nil asValue).
       
  2005     ].
       
  2006     ^ holder
       
  2007 
       
  2008 
       
  2009 !
       
  2010 
  2039 tabList
  2011 tabList
  2040     "get a value holder with the list of the attribute sections (slices)"
  2012     "get a value holder with the list of the attribute sections (slices)"
  2041 
  2013 
  2042     |holder|
  2014     |holder|
       
  2015 
  2043     (holder := builder bindingAt:#tabList) isNil ifTrue:[
  2016     (holder := builder bindingAt:#tabList) isNil ifTrue:[
  2044         builder aspectAt:#tabList put:(holder := #(Basics Details Image Help) asValue).
  2017         builder aspectAt:#tabList put:(holder := nil asValue).
  2045     ].
  2018     ].
  2046     ^ holder
  2019     ^ holder
  2047 
  2020 
  2048 
  2021 
  2049 !
  2022 !
  2050 
  2023 
  2051 treeView
  2024 treeView
  2052     "get a tree view representing hierarchically the menu items"
  2025     "get a tree view representing hierarchically the menu items"
  2053 
  2026 
  2054     |treeView|
  2027     ^ treeView
  2055     (treeView := builder bindingAt:#treeView) isNil ifTrue:[
       
  2056         treeView := TreeView new.
       
  2057         treeView action:[:dummy|self menuChanged].
       
  2058         builder aspectAt: #treeView put: treeView
       
  2059     ].
       
  2060     ^treeView
       
  2061 ! !
  2028 ! !
  2062 
  2029 
  2063 !MenuEditor methodsFor:'building'!
  2030 !MenuEditor methodsFor:'building'!
  2064 
  2031 
  2065 buildFromClass:aClass andSelector:aSelector
  2032 buildFromClass:aClass andSelector:aSelector
  2066 
  2033 
  2067     self isStandAlone ifTrue:[
  2034     self isStandAlone ifTrue:[
  2068         self helpTool buildFromClass:specClass
  2035         self helpTool buildFromClass:specClass
  2069     ].              
  2036     ].              
  2070     self treeView buildFromClass: aClass andSelector: aSelector.
  2037     treeView buildFromClass: aClass andSelector: aSelector.
  2071 
  2038 
  2072     self updateHistory.
  2039     self updateHistory.
  2073     self updateInfoLabel.
  2040     self updateInfoLabel.
  2074     self treeView selection: 2.
  2041 
  2075     self menuChanged
  2042 !
  2076 
  2043 
  2077 !
  2044 buildFromResourceSpec:aResourceSpec
  2078 
  2045     |spec|
  2079 buildFromResourceSpec: aResourceSpec
  2046 
  2080 
  2047     spec := aResourceSpec isCollection ifTrue:[aResourceSpec decodeAsLiteralArray]
  2081     self buildFromMenu:  
  2048                                       ifFalse:[aResourceSpec].
  2082         (aResourceSpec class == Menu ifTrue: [aResourceSpec] ifFalse: [aResourceSpec decodeAsLiteralArray])
  2049 
       
  2050     self buildFromMenu:spec  
  2083 ! !
  2051 ! !
  2084 
  2052 
  2085 !MenuEditor methodsFor:'change & update'!
  2053 !MenuEditor methodsFor:'change & update'!
  2086 
  2054 
  2087 update:something with:aParameter from:changedObject
  2055 update:something with:aParameter from:changedObject
  2088     super update:something with:aParameter from:changedObject.
  2056     super update:something with:aParameter from:changedObject.
  2089 
  2057 
  2090     changedObject == (aspects at:#retriever) ifTrue:[
  2058     changedObject == (aspects at:#retriever) ifTrue:[
  2091         "/ self updateListOfImages.
  2059         self updateImageView.
  2092         self updateSelectionOfImage
       
  2093     ].
  2060     ].
  2094 
  2061 
  2095     "Modified: / 24.8.1998 / 21:47:48 / cg"
  2062     "Modified: / 24.8.1998 / 21:47:48 / cg"
  2096 !
  2063 !
  2097 
  2064 
  2098 updateChannels
  2065 updateChannels
  2099     "update channels"
  2066     "update channels"
  2100 
  2067 
  2101     |node parent next state|
  2068     |node parent next state canPaste|
  2102 
  2069 
  2103     self clearModifiedFlag.
       
  2104     state := false.   
  2070     state := false.   
  2105     self updateSelectionOfImage.
  2071     node  := treeView selectedNode.
  2106 
  2072 
  2107     (node  := self treeView selectedNode) notNil
  2073     node notNil ifTrue:[
  2108     ifTrue:
       
  2109     [
       
  2110         self hasAnySingleSelection value:true.
  2074         self hasAnySingleSelection value:true.
  2111         (parent := node parent) notNil
  2075         canPaste := self valueOfCanPaste value.
  2112         ifTrue:
  2076 
  2113         [
  2077         (parent := node parent) notNil ifTrue:[
  2114             next := parent childAt:((parent indexOfChild:node) + 1).
  2078             next := parent childAt:((parent indexOfChild:node) + 1).
  2115             self valueOfEnableMovingIn       value:(next notNil and:[next hasChildren]).
  2079             self valueOfEnableMovingIn       value:(next notNil and:[next hasChildren]).
  2116             self valueOfEnableMovingUpOrDown value:(parent children size > 1).
  2080             self valueOfEnableMovingUpOrDown value:(parent children size > 1).
  2117             self valueOfEnableMovingOut      value:parent parent notNil.
  2081             self valueOfEnableMovingOut      value:parent parent notNil.
  2118             self hasValidSingleSelection     value:true.
       
  2119             self hasValidSelection           value:true.  
  2082             self hasValidSelection           value:true.  
  2120             self valueOfCanPaste             value:true & self valueOfCanPaste value. 
  2083             self valueOfCanPaste             value:canPaste. 
  2121             ^self
  2084           ^ self
  2122         ]
  2085         ].
  2123     ]
  2086     ] ifFalse:[
  2124     ifFalse:
  2087         canPaste := false.
  2125     [
  2088 
  2126         self hasAnySingleSelection value:false.
  2089         self hasAnySingleSelection value:false.
  2127         self treeView numberOfSelections ~~ 0 ifTrue:[
  2090 
  2128             state := (self treeView isInSelection:1) not
  2091         treeView numberOfSelections ~~ 0 ifTrue:[
       
  2092             canPaste := false.
       
  2093             state    := (treeView isInSelection:1) not
  2129         ]
  2094         ]
  2130     ].          
  2095     ].          
  2131     self valueOfEnableMovingUpOrDown value:false.
  2096     self valueOfEnableMovingUpOrDown value:false.
  2132     self valueOfEnableMovingIn       value:false.
  2097     self valueOfEnableMovingIn       value:false.
  2133     self valueOfEnableMovingOut      value:false.
  2098     self valueOfEnableMovingOut      value:false.
  2134     self hasValidSingleSelection     value:false.
       
  2135     self hasValidSelection           value:state.     
  2099     self hasValidSelection           value:state.     
  2136     self valueOfCanPaste             value:(self hasValidSingleSelection value or: [node == self treeView root]) & self valueOfCanPaste value. 
  2100     self valueOfCanPaste             value:canPaste. 
  2137 
  2101 
  2138 !
  2102 !
  2139 
  2103 
  2140 updateListAndSelectionOfImage
  2104 updateImageView
  2141     "updates the list and selection of image"
  2105     "update the image view
  2142 
  2106     "
  2143     self updateListOfImages.
  2107     |cls newList icon|
  2144     self updateSelectionOfImage
  2108 
  2145 !
  2109     self isImageViewSelected ifFalse:[
  2146 
  2110         ^ self
  2147 updateListOfImages
  2111     ].
  2148     "updates the list of images"
  2112     cls := self currentImageRetrieverClass.
  2149 
  2113 
  2150     |iconClass|      
  2114     lastImageRetriever == cls ifTrue:[
  2151 
  2115         newList := self listOfImages
  2152     (iconClass := (aspects at: #retriever) value ? specClass) notNil ifTrue: 
  2116     ] ifFalse:[
  2153     [
  2117         cls notNil ifTrue:[
  2154         iconClass := Smalltalk at: iconClass
  2118             lastImageRetriever := cls.
  2155     ].
  2119 
  2156 
  2120             newList := self class getAllImageSelectorsFrom:cls.
  2157     self listOfImages contents:
  2121             newList := newList collect: [:sel| |img| 
  2158         ((self class getAllImageSelectorsFrom: iconClass)
  2122                             img := cls perform: sel. 
  2159             collect: [:sel| |image| 
  2123                             img height > 22 ifTrue:[
  2160                         image := iconClass perform: sel. 
  2124                                 img := img magnifiedBy: 22 / img extent y
  2161                         image height > 22 ifTrue:[
  2125                             ].
  2162                             image := image magnifiedBy: 22/image extent y
  2126                             LabelAndIcon icon:img string:sel
  2163                         ].
  2127                        ].
  2164                         LabelAndIcon 
  2128         ] ifFalse:[
  2165                             icon:image 
  2129             newList := #()
  2166                             string:sel
  2130         ].
  2167                      ]).
  2131         self listOfImages contents:newList.
  2168 
  2132     ].
  2169 !
  2133 
  2170 
  2134     icon := (aspects at:#icon) value.
  2171 updateSelectionOfImage
  2135 
  2172     "updates the selection of image"
  2136     icon notNil ifTrue:[
  2173 
  2137         icon := newList detect:[:el| el string == icon] ifNone:nil.
  2174     self selectionOfImage value: nil.
  2138     ].
  2175     self updateListOfImages.
  2139     self selectionOfImage value:icon.
  2176     self selectionOfImage value: (self listOfImages detect: [:im| im string == (aspects at: #icon) value] ifNone: nil).
  2140 
  2177 
  2141 
  2178 ! !
  2142 ! !
  2179 
  2143 
  2180 !MenuEditor methodsFor:'defaults'!
  2144 !MenuEditor methodsFor:'defaults'!
  2181 
  2145 
  2192 !MenuEditor methodsFor:'event handling'!
  2156 !MenuEditor methodsFor:'event handling'!
  2193 
  2157 
  2194 doesNotUnderstand: aMessage
  2158 doesNotUnderstand: aMessage
  2195     "detour incoming messages to the tree view"
  2159     "detour incoming messages to the tree view"
  2196 
  2160 
  2197     (self treeView respondsTo: aMessage selector)
  2161     ^ aMessage sendTo:treeView
  2198     ifTrue:
       
  2199     [
       
  2200         ^aMessage sendTo: self treeView
       
  2201     ].
       
  2202     super doesNotUnderstand:aMessage
       
  2203 
       
  2204 
       
  2205 ! !
  2162 ! !
  2206 
  2163 
  2207 !MenuEditor methodsFor:'private'!
  2164 !MenuEditor methodsFor:'private'!
       
  2165 
       
  2166 currentImageRetrieverClass
       
  2167     "returns the current class which provides the images dependent on
       
  2168      the retriver or the current spec.
       
  2169     "
       
  2170     |clsName|
       
  2171 
       
  2172     clsName := (aspects at: #retriever) value.
       
  2173 
       
  2174     clsName size == 0 ifTrue:[
       
  2175         clsName := specClass
       
  2176     ].
       
  2177     ^ Smalltalk at:clsName ifAbsent:nil
       
  2178 !
  2208 
  2179 
  2209 helpKey
  2180 helpKey
  2210     "get the help key of the selected menu item"
  2181     "get the help key of the selected menu item"
  2211 
  2182 
  2212     |node|
  2183     |node|
  2213     (node := self treeView selectedNode) notNil ifTrue:[
  2184 
       
  2185     (node := treeView selectedNode) notNil ifTrue:[
  2214         ^ node contents activeHelpKey
  2186         ^ node contents activeHelpKey
  2215     ].
  2187     ].
  2216     ^ nil
  2188     ^ nil
  2217 !
  2189 !
  2218 
  2190 
  2219 helpTool
  2191 helpTool
  2220     "get the help tool"
  2192     "get the help tool application
  2221 
  2193     "
  2222     ^helpCanvas application
  2194     |helpView helpTool|
       
  2195 
       
  2196     helpTool := listOfCanvas at:#help ifAbsent:nil.
       
  2197 
       
  2198     helpTool isNil ifTrue:[
       
  2199         helpTool := UIHelpTool new createBuilder.
       
  2200         helpTool masterApplication:self.
       
  2201         helpTool modifiedHolder: self valueOfEnablingCommitButtons.
       
  2202         helpView := View new client:helpTool.
       
  2203         helpTool builder window:helpView.
       
  2204         listOfCanvas at:#help put:helpTool.
       
  2205     ].
       
  2206     ^ helpTool
       
  2207 
       
  2208 
  2223 ! !
  2209 ! !
  2224 
  2210 
  2225 !MenuEditor methodsFor:'queries'!
  2211 !MenuEditor methodsFor:'queries'!
  2226 
  2212 
  2227 isHelpToolSelected
  2213 isHelpToolSelected
  2228     "return true if current selection is help tool"
  2214     "return true if current selection is help tool
  2229 
  2215     "
  2230     (tabSelection ~~ 0 and:[slices notNil]) ifTrue:[
  2216     ^ typeOfCanvas == #help
  2231         ^(slices at:tabSelection) first = UIHelpTool label
  2217 
  2232     ].
  2218 !
  2233     ^false
  2219 
       
  2220 isImageViewSelected
       
  2221     "return true if current selection is help tool
       
  2222     "
       
  2223     ^ typeOfCanvas == #imageEditSpec
       
  2224 
  2234 !
  2225 !
  2235 
  2226 
  2236 preferredExtent
  2227 preferredExtent
  2237 
  2228 
  2238     ^super preferredExtent max: (Screen current width//3)@(Screen current height//2.5)
  2229     ^super preferredExtent max: (Screen current width//3)@(Screen current height//2.5)
  2239 
  2230 
  2240 
  2231 
  2241 ! !
  2232 ! !
  2242 
  2233 
  2243 !MenuEditor methodsFor:'selection'!
  2234 !MenuEditor methodsFor:'selection'!
       
  2235 
       
  2236 clearSelection
       
  2237     tabSelection := 0.
       
  2238     typeOfCanvas := nil.
       
  2239 !
  2244 
  2240 
  2245 imageSelected
  2241 imageSelected
  2246     |imgSel|
  2242     |imgSel|
  2247 
  2243 
  2248     imgSel := self selectionOfImage value.
  2244     imgSel := self selectionOfImage value.
  2251     ]
  2247     ]
  2252 !
  2248 !
  2253 
  2249 
  2254 menuChanged
  2250 menuChanged
  2255 
  2251 
  2256     |node item slc sel old myClass|
  2252     |node item myClass oldLabel oldSlices newList index|
  2257 
  2253 
  2258     aspects do: [:holder| holder removeDependent:self].
  2254     node := treeView selectedNode.
  2259     (node := self treeView selectedNode) notNil ifTrue:[
  2255 
  2260         "/ cg: this is rubbish - should only clear
  2256     node isNil ifTrue:[
  2261         "/ item-specific aspects (if at all)
  2257         slices := nil.
  2262         "/ (added a q&d kludge for #retrieverClassList - no time to investigate)
  2258         index  := 0.
  2263 
  2259     ] ifFalse:[
  2264         aspects do:[:anAspect| 
  2260         oldSlices := slices.
  2265                         anAspect isBlock ifFalse:[
  2261         myClass   := self class.
  2266                             anAspect == (aspects at:#retrieverClassList) ifFalse:[
  2262         item      := node contents.
  2267                                 anAspect value:nil
  2263 
  2268                             ]
       
  2269                         ]
       
  2270                    ].
       
  2271         item := node contents.
       
  2272         item toAspects:aspects.
       
  2273 
       
  2274         myClass := self class.
       
  2275         item isSeparator ifFalse:[
  2264         item isSeparator ifFalse:[
  2276             node parent isNil ifFalse:[
  2265             node parent isNil ifFalse:[
  2277                 node hasChildren ifTrue:[
  2266                 node hasChildren ifTrue:[
  2278                     slc := #slicesMenu
  2267                     slices := #slicesMenu
  2279                 ] ifFalse:[
  2268                 ] ifFalse:[
  2280                     item submenuChannel isNil ifTrue:[slc := #slicesItem]
  2269                     item submenuChannel isNil ifTrue:[slices := #slicesItem]
  2281                                              ifFalse:[slc := #slicesLink]
  2270                                              ifFalse:[slices := #slicesLink]
  2282                 ].
  2271                 ].
  2283                 slc := (myClass perform:slc) copyWith:#( 'Help' #dummy ).
  2272                 slices := listOfSlices at:slices
       
  2273                               ifAbsentPut:[(myClass perform:slices) copyWith:#('Help' #help)].
  2284             ] ifTrue:[
  2274             ] ifTrue:[
  2285                 slc := myClass perform:#slicesRootMenu
  2275                 slices := listOfSlices at:#slicesRootMenu
       
  2276                               ifAbsentPut:[myClass perform:#slicesRootMenu].
  2286             ].
  2277             ].
  2287         ] ifTrue:[
  2278         ] ifTrue:[
  2288             slc := myClass perform:#slicesSeparatorMenu.
  2279             slices := myClass perform:#slicesSeparatorMenu.
  2289         ]
       
  2290     ].
       
  2291 
       
  2292     self helpTool helpKey: self helpKey.
       
  2293     "Next line helps me to preserve myself against unnecessary settings of
       
  2294      valueOfEnablingCommitButtons to true in the help tool."
       
  2295 
       
  2296     self valueOfEnablingCommitButtons value: false.
       
  2297     self modifiedChannel value: false.
       
  2298 
       
  2299     slc ~= slices  ifTrue:[
       
  2300         tabSelection ~~ 0 ifTrue:[
       
  2301             old := (slices at:tabSelection) first
       
  2302         ].
  2280         ].
  2303 
  2281         index := tabSelection ? 0.
  2304         (slices := slc) notNil ifTrue:[
  2282         self clearSelection.
  2305             sel := slices collect:[:s| s first].
  2283 
  2306             tabSelection := 0.     
  2284         slices ~~ oldSlices ifTrue:[
  2307             self tabList value:sel.
  2285             newList := slices collect:[:el| el first].
  2308 
  2286 
  2309             (old notNil and:[(sel := sel findFirst:[:n|n = old]) ~~ 0]) ifFalse:[
  2287             index ~~ 0 ifTrue:[
  2310                 sel := 1
  2288                 oldLabel := self tabList value at:index ifAbsent:nil.
       
  2289 
       
  2290                 oldLabel notNil ifTrue:[
       
  2291                     index := newList indexOf:oldLabel.
       
  2292                 ]
  2311             ].
  2293             ].
  2312             self tabModel value:sel
  2294             self tabList value:newList.
  2313         ] ifFalse:[
  2295         ].
  2314             self tabList value:nil.
  2296         index := index max:1.
  2315             self tabSelection:0.
  2297     ].
  2316         ]
  2298     self tabModel value:index.
  2317     ].
       
  2318     self updateChannels.
  2299     self updateChannels.
  2319     aspects do: [:holder| holder addDependent:self].
  2300     self cancel.
  2320 
  2301 
  2321     "Modified: / 4.2.1999 / 17:37:54 / cg"
       
  2322 !
  2302 !
  2323 
  2303 
  2324 tabSelection: aSelection
  2304 tabSelection: aSelection
  2325     "put the section aSelection into the note book"
  2305     "put the section aSelection into the note book
       
  2306     "
       
  2307     |view|
  2326 
  2308 
  2327     tabSelection = aSelection ifTrue:[
  2309     tabSelection = aSelection ifTrue:[
  2328         ^ self
  2310         ^ self
  2329     ].
  2311     ].
  2330     (aSelection ~~ 0 and:[slices isNil]) ifTrue:[
  2312     typeOfCanvas := nil.
  2331         ^ self
  2313 
  2332     ].
  2314     (tabSelection := aSelection) ~~ 0 ifTrue:[
  2333     (tabSelection := aSelection) == 0 ifTrue:[
  2315         typeOfCanvas := (slices at:tabSelection) last.
  2334         slices isNil ifTrue:[
  2316 
  2335             specCanvas client:nil.
  2317         self isHelpToolSelected ifTrue:[
  2336             ^ specCanvas raise.
  2318             view := self helpTool window.
  2337         ].
  2319         ] ifFalse:[
  2338         tabSelection == 1 ifTrue:[^ self].
  2320             self updateImageView.
  2339         tabSelection := 1
  2321             view := listOfCanvas at:typeOfCanvas ifAbsentPut:[View new client:self spec:typeOfCanvas].
  2340     ].
  2322         ]
  2341 
  2323     ].
  2342     self isHelpToolSelected ifTrue:[  
  2324     self tabCanvasHolder value:view
  2343         self helpTool helpKey:(self helpKey).
  2325 
  2344         helpCanvas raise.
       
  2345     ] ifFalse:[       
       
  2346         aspects do: [:holder| holder removeDependent:self].
       
  2347         specCanvas client:self spec:(self class perform:(slices at:tabSelection) last) builder:builder.
       
  2348         aspects do: [:holder| holder addDependent:self].
       
  2349         specCanvas raise.
       
  2350     ]
       
  2351 
       
  2352     "Modified: / 14.8.1998 / 15:07:06 / cg"
       
  2353 ! !
  2326 ! !
  2354 
  2327 
  2355 !MenuEditor methodsFor:'startup / release'!
  2328 !MenuEditor methodsFor:'startup / release'!
  2356 
  2329 
  2357 initialize
  2330 initialize
  2362     super initialize.
  2335     super initialize.
  2363 
  2336 
  2364     aspects at:#seperatorSelection put:(holder := SelectionInList new).
  2337     aspects at:#seperatorSelection put:(holder := SelectionInList new).
  2365     holder list: Item separatorList.
  2338     holder list: Item separatorList.
  2366     holder addDependent:self.
  2339     holder addDependent:self.
       
  2340 
       
  2341     listOfCanvas := IdentityDictionary new.
       
  2342     listOfSlices := IdentityDictionary new.
       
  2343 
       
  2344     treeView := TreeView new.
       
  2345     treeView action:[:dummy| self menuChanged ].
  2367 
  2346 
  2368     aspects at:#indicationEnabled  put:(BlockValue 
  2347     aspects at:#indicationEnabled  put:(BlockValue 
  2369                                             with:[:a | a size == 0]
  2348                                             with:[:a | a size == 0]
  2370                                             argument:(aspects at:#choice)).
  2349                                             argument:(aspects at:#choice)).
  2371     aspects at:#choiceEnabled      put:(BlockValue
  2350     aspects at:#choiceEnabled      put:(BlockValue
  2375                                             with:[:a | a size > 0]
  2354                                             with:[:a | a size > 0]
  2376                                             argument:(aspects at:#choice)).
  2355                                             argument:(aspects at:#choice)).
  2377 
  2356 
  2378     aspects at:#retrieverClassList put:self class defaultRetrieverClassList asValue.
  2357     aspects at:#retrieverClassList put:self class defaultRetrieverClassList asValue.
  2379 
  2358 
  2380     "Modified: / 14.8.1998 / 15:07:58 / cg"
  2359     aspects do: [:holder| holder addDependent:self].
       
  2360 
  2381 !
  2361 !
  2382 
  2362 
  2383 openModalOnMenu: aMenu
  2363 openModalOnMenu: aMenu
  2384     "build a tree from aMenu and open it modal"
  2364     "build a tree from aMenu and open it modal"
  2385 
  2365 
  2386     super openModalOnResourceSpec: aMenu
  2366     super openModalOnResourceSpec: aMenu
  2387 !
       
  2388 
       
  2389 postOpenWith:aBuilder
       
  2390 
       
  2391     super postOpenWith:aBuilder.
       
  2392 
       
  2393     self isHelpToolSelected 
       
  2394         ifTrue:  [helpCanvas raise] 
       
  2395         ifFalse: [specCanvas raise]
       
  2396 
       
  2397 ! !
  2367 ! !
  2398 
  2368 
  2399 !MenuEditor methodsFor:'user actions'!
  2369 !MenuEditor methodsFor:'user actions'!
  2400 
  2370 
  2401 accept
  2371 accept
  2402     "invoked by button 'OK' and by save requests of menu item changes"
  2372     "invoked by button 'OK' and by save requests of menu item changes"
  2403 
  2373 
  2404     |node|
  2374     |node item|
  2405 
  2375 
  2406     super accept.
  2376     super accept.
  2407 
  2377 
  2408     (node := self treeView selectedNode) notNil ifTrue:[
  2378     (node := treeView selectedNode) notNil ifTrue:[
       
  2379         item := node contents.
       
  2380 
  2409         self isHelpToolSelected ifTrue:[
  2381         self isHelpToolSelected ifTrue:[
  2410             self helpTool accept.
  2382             self helpTool accept.
  2411             node contents activeHelpKey: self helpTool helpKey.
  2383             item activeHelpKey: self helpTool helpKey.
  2412             self valueOfEnablingCommitButtons value: false.
  2384             self valueOfEnablingCommitButtons value: false.
  2413             self clearModifiedFlag.
  2385             self clearModifiedFlag.
  2414         ] ifFalse:[
  2386         ] ifFalse:[
  2415             node contents buildFromAspects: aspects.
  2387             item buildFromAspects:aspects.
  2416             node changed.
  2388             node changed.
  2417             specSelector := self treeView selectorName.
  2389             specSelector := treeView selectorName.
  2418         ]
  2390         ]
  2419     ].   
  2391     ].   
  2420     self updateInfoLabel.
  2392     self updateInfoLabel.
  2421     self updateListAndSelectionOfImage.
       
  2422 
  2393 
  2423 !
  2394 !
  2424 
  2395 
  2425 cancel
  2396 cancel
  2426     "invoked by button 'Cancel'"
  2397     "invoked by button 'Cancel'"
  2427 
  2398     |node item|
  2428     |node|
  2399 
  2429 
  2400     node := treeView selectedNode.
  2430     (node := self treeView selectedNode) notNil ifTrue:[          
  2401 
  2431         self helpTool helpKey:(self helpKey).
  2402     aspects keysAndValuesDo:[:aKey :anAspect|
  2432         aspects do:[:anAspect| anAspect value:'' ].
  2403         aKey ~~ #retrieverClassList ifTrue:[
  2433         node contents toAspects:aspects
  2404             anAspect setValue:''.  "/ to clear the field.
  2434     ].
  2405             anAspect value:''
  2435     self valueOfEnablingCommitButtons value: false.
  2406         ]
       
  2407     ].
       
  2408 
       
  2409     node notNil ifTrue:[
       
  2410         item := node contents.
       
  2411         item toAspects:aspects.
       
  2412         self helpTool helpKey:(item activeHelpKey).
       
  2413     ].
       
  2414     self updateImageView.
       
  2415     self valueOfEnablingCommitButtons value:false.
  2436     self clearModifiedFlag.
  2416     self clearModifiedFlag.
  2437     modified := false
       
  2438 !
  2417 !
  2439 
  2418 
  2440 doBrowseForImageResource
  2419 doBrowseForImageResource
  2441     "opens a browser on image-resource methods"
  2420     "opens a browser on image-resource methods"
  2442 
  2421 
  2443     |msg currClass w cls sel|
  2422     |msg currClass w cls sel|
  2444 
  2423 
  2445     currClass := (Smalltalk at: (aspects at: #retriever) value ? specClass).
  2424     currClass := self currentImageRetrieverClass.
  2446     msg := 
  2425     msg := 
  2447         (ResourceSelectionBrowser
  2426         (ResourceSelectionBrowser
  2448             request: 'Use Image From Class'
  2427             request: 'Use Image From Class'
  2449             onSuperclass: nil
  2428             onSuperclass: nil
  2450             andClass: currClass
  2429             andClass: currClass
  2459                 (aspects at: #retriever) value:cls asSymbol.
  2438                 (aspects at: #retriever) value:cls asSymbol.
  2460             ].
  2439             ].
  2461             sel ~= (aspects at:#icon) ifTrue:[
  2440             sel ~= (aspects at:#icon) ifTrue:[
  2462                 (aspects at: #icon) value:sel asSymbol.
  2441                 (aspects at: #icon) value:sel asSymbol.
  2463             ].
  2442             ].
  2464             self updateSelectionOfImage
  2443             self updateImageView.
  2465         ].
  2444         ].
  2466     ].
  2445     ].
  2467 
  2446 
  2468 
  2447 
  2469 !
  2448 !
  2471 doEditImage
  2450 doEditImage
  2472     "opens a Image Editor on the resource retriever and the icon selector;
  2451     "opens a Image Editor on the resource retriever and the icon selector;
  2473      then updates the list of images and select the line of the image"
  2452      then updates the list of images and select the line of the image"
  2474 
  2453 
  2475     super doEditImage.
  2454     super doEditImage.
  2476 
  2455     lastImageRetriever := nil.
  2477     self updateListAndSelectionOfImage
  2456     self updateImageView.
  2478 !
  2457 !
  2479 
  2458 
  2480 doNew
  2459 doNew
  2481 
  2460 
  2482     super doNew ifTrue: [self helpTool doNew]
  2461     super doNew ifTrue: [self helpTool doNew]
  2484 
  2463 
  2485 doPickAMenu
  2464 doPickAMenu
  2486 
  2465 
  2487     |view|
  2466     |view|
  2488 
  2467 
  2489     ((view := Screen current viewFromUser) isNil or:
  2468     self askForModification ifTrue:[
  2490     [view == Screen current rootView]) ifTrue:[
  2469         ((view := Screen current viewFromUser) isNil or:
  2491         ^ self
  2470         [view == Screen current rootView]) ifTrue:[
  2492     ].
  2471             ^ self
  2493     view specClass == MenuPanelSpec ifTrue:[
  2472         ].
  2494         ^ self treeView buildFromMenu: view asMenu
  2473         view specClass == MenuPanelSpec ifTrue:[
       
  2474             ^ treeView buildFromMenu: view asMenu
       
  2475         ].
  2495     ].
  2476     ].
  2496     ^ nil
  2477     ^ nil
  2497 !
  2478 !
  2498 
  2479 
  2499 doRemoveImage
  2480 doRemoveImage
  2500     "removes the image of the selected line"
  2481     "removes the image of the selected line"
  2501 
  2482     |cls sel|
  2502     self selectionOfImage value notNil
  2483 
  2503     ifTrue:
  2484     sel := self selectionOfImage value.
  2504     [
  2485 
  2505         (Smalltalk at: (aspects at: #retriever) value ? specClass) class removeSelector:
  2486     sel size ~~ 0 ifTrue:[
  2506             self selectionOfImage value string.
  2487         cls := self currentImageRetrieverClass.
  2507 
  2488         cls notNil ifTrue:[
  2508         self updateListAndSelectionOfImage.
  2489             cls class removeSelector:(sel string)
  2509         (aspects at:#icon) value: nil
  2490         ].
       
  2491         (aspects at:#icon) value:nil.
       
  2492         lastImageRetriever := nil.
       
  2493         self updateImageView.
  2510     ] 
  2494     ] 
  2511 !
  2495 !
  2512 
  2496 
  2513 doSave
  2497 doSave
  2514     |cls treeView menu spec mthd category code excla|
  2498     |cls menu spec mthd category code excla|
  2515 
  2499 
  2516     super doSave ifFalse: [^nil].
  2500     super doSave ifFalse: [^nil].
  2517 
  2501 
  2518     cls := self resolveName: specClass.
  2502     cls  := self resolveName: specClass.
  2519     treeView := self treeView.
  2503     menu := treeView asMenu literalArrayEncoding.
  2520     menu     := treeView asMenu.
       
  2521     menu := menu literalArrayEncoding.
       
  2522     spec := WriteStream on:String new.
  2504     spec := WriteStream on:String new.
  2523     UISpecification prettyPrintSpecArray:menu on:spec indent:5.
  2505     UISpecification prettyPrintSpecArray:menu on:spec indent:5.
  2524     spec := spec contents.
  2506     spec := spec contents.
  2525 
  2507 
  2526     "/ if that method already exists, do not overwrite the category
  2508     "/ if that method already exists, do not overwrite the category
  2564 
  2546 
  2565 !
  2547 !
  2566 
  2548 
  2567 doSaveAs
  2549 doSaveAs
  2568 
  2550 
  2569     super doSaveAs ifTrue: [self treeView selectorName: specSelector]
  2551     super doSaveAs ifTrue: [treeView selectorName:specSelector]
  2570 !
  2552 !
  2571 
  2553 
  2572 doStepDown
  2554 doStepDown
  2573     "shift selected menu item one step down"
  2555     "shift selected menu item one step down"
  2574 
  2556 
  2575     self treeView selectedNodeChangeSequenceOrder:1.
  2557     treeView selectedNodeChangeSequenceOrder:1.
  2576     modified := true.
  2558     modified := true.
  2577 
  2559 
  2578 
  2560 
  2579 
  2561 
  2580 
  2562 
  2581 !
  2563 !
  2582 
  2564 
  2583 doStepIn
  2565 doStepIn
  2584     "move selected menu item into next submenu"
  2566     "move selected menu item into next submenu"
  2585 
  2567 
  2586     self treeView selectedNodeBecomeChildOfNext.
  2568     treeView selectedNodeBecomeChildOfNext.
  2587     modified := true.
  2569     modified := true.
  2588 
  2570 
  2589 
  2571 
  2590 
  2572 
  2591 
  2573 
  2593 !
  2575 !
  2594 
  2576 
  2595 doStepOut
  2577 doStepOut
  2596     "move selected menu item out from parent submenu"
  2578     "move selected menu item out from parent submenu"
  2597 
  2579 
  2598     self treeView selectedNodeBecomeSisterOfParent.
  2580     treeView selectedNodeBecomeSisterOfParent.
  2599     modified := true.
  2581     modified := true.
  2600 !
  2582 !
  2601 
  2583 
  2602 doStepUp
  2584 doStepUp
  2603     "shift selected menu item one step up"
  2585     "shift selected menu item one step up"
  2604 
  2586 
  2605     self treeView selectedNodeChangeSequenceOrder:-1.
  2587     treeView selectedNodeChangeSequenceOrder:-1.
  2606     modified := true.
  2588     modified := true.
  2607 ! !
  2589 ! !
  2608 
  2590 
  2609 !MenuEditor::Item class methodsFor:'constants'!
  2591 !MenuEditor::Item class methodsFor:'constants'!
  2610 
  2592 
  2929 !
  2911 !
  2930 
  2912 
  2931 treeViewLabel
  2913 treeViewLabel
  2932     "get the label of the menu item for the tree view"
  2914     "get the label of the menu item for the tree view"
  2933 
  2915 
  2934     ^label asBoldText, 
  2916     ^label
       
  2917 " asBoldText, 
  2935         (value notNil ifTrue: [': [', 
  2918         (value notNil ifTrue: [': [', 
  2936                 value ,
  2919                 value ,
  2937                 (argument isString ifTrue: [' ', (Text string: argument emphasis: #italic)] ifFalse: ['']),
  2920                 (argument isString ifTrue: [' ', (Text string: argument emphasis: #italic)] ifFalse: ['']),
  2938                  ']'] ifFalse: [''])
  2921                  ']'] ifFalse: [''])
       
  2922 
       
  2923 
       
  2924 "
  2939 ! !
  2925 ! !
  2940 
  2926 
  2941 !MenuEditor::TreeView class methodsFor:'documentation'!
  2927 !MenuEditor::TreeView class methodsFor:'documentation'!
  2942 
  2928 
  2943 documentation
  2929 documentation
  2977 
  2963 
  2978     |spec cls menu firstNode firstNodeLabel|
  2964     |spec cls menu firstNode firstNodeLabel|
  2979 
  2965 
  2980     "if opened on a menu"
  2966     "if opened on a menu"
  2981     (aClass isNil and: [aSelector isNil and: [listOfNodes size > 0]]) ifTrue: [^nil].
  2967     (aClass isNil and: [aSelector isNil and: [listOfNodes size > 0]]) ifTrue: [^nil].
       
  2968 
       
  2969     self selection:nil.
  2982 
  2970 
  2983     (aClass notNil and:[aSelector notNil]) ifTrue:[
  2971     (aClass notNil and:[aSelector notNil]) ifTrue:[
  2984         cls := self application resolveName:aClass.
  2972         cls := self application resolveName:aClass.
  2985 
  2973 
  2986         (cls respondsTo:aSelector) ifTrue:[
  2974         (cls respondsTo:aSelector) ifTrue:[
  3022 
  3010 
  3023 buildFromMenu:aMenu
  3011 buildFromMenu:aMenu
  3024     "put aMenu into the tree view"
  3012     "put aMenu into the tree view"
  3025 
  3013 
  3026     |node|
  3014     |node|
       
  3015 
       
  3016     self selection:nil.
  3027 
  3017 
  3028     node := self nodeLabel:'menu'.
  3018     node := self nodeLabel:'menu'.
  3029     self subMenu:aMenu parent:node.
  3019     self subMenu:aMenu parent:node.
  3030 
  3020 
  3031     node hasChildren ifFalse:[
  3021     node hasChildren ifFalse:[