MenuEditor.st
changeset 1629 a79dce7e7045
parent 1623 3fac80dbb0b3
child 1631 d7979e4253fd
equal deleted inserted replaced
1628:bc3362031d0b 1629:a79dce7e7045
   188 
   188 
   189 aspects
   189 aspects
   190     "get the aspects for the attributes of the menu components"
   190     "get the aspects for the attributes of the menu components"
   191 
   191 
   192     ^#(
   192     ^#(
   193 	rawLabel
   193         rawLabel
   194 	accessCharacterPosition
   194         accessCharacterPosition
   195 	showBusyCursorWhilePerforming
   195         showBusyCursorWhilePerforming
   196 	horizontalLayout
   196         horizontalLayout
   197 	triggerOnDown
   197         triggerOnDown
   198 	font
   198         font
   199 	argument
   199         argument
   200 	submenuChannel
   200         submenuChannel
   201 	keepLinkedMenu
   201         keepLinkedMenu
   202 	enabled
   202         enabled
   203 	value
   203         itemValue
   204 	nameKey
   204         nameKey
   205 	indication
   205         indication
   206 	choice
   206         choice
   207 	choiceValue
   207         choiceValue
   208 	translateLabel
   208         translateLabel
   209 	isButton
   209         isButton
   210 	shortcutKeyCharacter
   210         shortcutKeyCharacter
   211 	startGroup
   211         startGroup
   212 	isVisible
   212         isVisible
   213 	hideMenuOnActivated
   213         hideMenuOnActivated
   214 	auxValue
   214         auxValue
   215 	activeHelpKey
   215         activeHelpKey
   216 	resourceRetriever
   216         resourceRetriever
   217      )
   217      )
   218 ! !
   218 ! !
   219 
   219 
   220 !MenuEditor class methodsFor:'defaults'!
   220 !MenuEditor class methodsFor:'defaults'!
   221 
   221 
   233 ! !
   233 ! !
   234 
   234 
   235 !MenuEditor class methodsFor:'help specs'!
   235 !MenuEditor class methodsFor:'help specs'!
   236 
   236 
   237 flyByHelpSpec
   237 flyByHelpSpec
   238     ^super flyByHelpSpec addPairsFrom:(self localHelpSpecStrings)
   238     ^super flyByHelpSpec addPairsFrom:(self localFlyHelpSpecStrings)
   239 !
   239 !
   240 
   240 
   241 helpSpec
   241 helpSpec
   242     ^super helpSpec addPairsFrom:(self localHelpSpecStrings)
   242     ^super helpSpec addPairsFrom:(self localHelpSpecStrings)
       
   243 !
       
   244 
       
   245 localFlyHelpSpecStrings
       
   246     "This resource specification was automatically generated
       
   247      by the UIHelpTool of ST/X."
       
   248 
       
   249     "Do not manually edit this!! If it is corrupted,
       
   250      the UIHelpTool may not be able to read the specification."
       
   251 
       
   252     "
       
   253      UIHelpTool openOnClass:MenuEditor    
       
   254     "
       
   255 
       
   256     <resource: #help>
       
   257 
       
   258     ^ #(
       
   259 
       
   260 #fileLoad
       
   261 'Load Spec from Class'
       
   262 
       
   263 #fileSave
       
   264 'Save Spec'
       
   265 
       
   266 #fileSaveAs
       
   267 'Save Spec As'
       
   268 
       
   269 #addMenuSeparator
       
   270 'Add Separator'
       
   271 
       
   272 #addMenuItem
       
   273 'Add Item'
       
   274 
       
   275 #addSubMenu
       
   276 'Add Submenu'
       
   277 
       
   278 #addDelayedMenu
       
   279 'Add Delayed Menu'
       
   280 
       
   281 #addDelayedSubMenuLink
       
   282 'Add linked Delayed Menu'
       
   283 
       
   284 #addSubMenuLink
       
   285 'Add Linked Submenu.'
       
   286 
       
   287 #browseResource
       
   288 'Search for methods with image resource.'
       
   289 
       
   290 #fileNew
       
   291 'New Spec'
       
   292 
       
   293 #filePickAMenu
       
   294 'Pick from View'
       
   295 
       
   296 #fileShowMenuSpec
       
   297 'Show Spec'
       
   298 )
   243 !
   299 !
   244 
   300 
   245 localHelpSpecStrings
   301 localHelpSpecStrings
   246     "This resource specification was automatically generated
   302     "This resource specification was automatically generated
   247      by the UIHelpTool of ST/X."
   303      by the UIHelpTool of ST/X."
  2054     menu allItemsDo:[:anItem|
  2110     menu allItemsDo:[:anItem|
  2055         anItem isVisible:true.
  2111         anItem isVisible:true.
  2056         anItem   enabled:true.
  2112         anItem   enabled:true.
  2057         anItem translateLabel:false.
  2113         anItem translateLabel:false.
  2058 
  2114 
  2059         anItem value ifNotNil:[
  2115         anItem itemValue notNil ifTrue:[
  2060             anItem value:[ Transcript showCR:(anItem label) ].
  2116             anItem itemValue:[ Transcript showCR:(anItem label) ].
  2061         ].
  2117         ].
  2062         anItem indication ifNotNil:[
  2118         anItem indication notNil ifTrue:[
  2063             indication ifNil:[ indication := true asValue ].
  2119             indication isNil ifTrue:[ indication := true asValue ].
  2064             anItem indication:indication
  2120             anItem indication:indication
  2065         ].
  2121         ].
  2066         anItem choice ifNotNil:[
  2122         anItem choice notNil ifTrue:[
  2067             choice ifNil:[ choice := anItem choiceValue asValue ].
  2123             choice isNil ifTrue:[ choice := anItem choiceValue asValue ].
  2068             anItem choice:choice
  2124             anItem choice:choice
  2069         ].
  2125         ].
  2070 
  2126 
  2071         anItem submenuChannel ifNotNil:[
  2127         anItem submenuChannel notNil ifTrue:[
  2072             anItem submenuChannel:nil.
  2128             anItem submenuChannel:nil.
  2073             anItem submenu ifNil:[    
  2129             anItem submenu isNil ifTrue:[    
  2074                 submenu ifNil:[
  2130                 submenu isNil ifTrue:[
  2075                     submenu := Menu new.
  2131                     submenu := Menu new.
  2076                     submenu addItem:(MenuItem labeled:'Linked Menu...').
  2132                     submenu addItem:(MenuItem labeled:'Linked Menu...').
  2077                 ].
  2133                 ].
  2078                 anItem submenu:submenu.
  2134                 anItem submenu:submenu.
  2079             ].
  2135             ].
  2080         ].
  2136         ].
  2081         retriever := anItem resourceRetriever.
  2137         retriever := anItem resourceRetriever.
  2082         retriever ifNotNil:[
  2138         retriever notNil ifTrue:[
  2083             retriever labelText ifNotNil:[ retriever labelText:(anItem label) ]
  2139             retriever labelText notNil ifTrue:[ retriever labelText:(anItem label) ]
  2084         ].
  2140         ].
  2085     ].
  2141     ].
  2086     menu findGuiResourcesIn:(self resolveName:specClass).
  2142     menu findGuiResourcesIn:(self resolveName:specClass).
  2087   ^ menu
  2143   ^ menu
  2088 !
  2144 !