MenuEditor.st
changeset 3587 438cc8200c87
parent 3585 3b557739ccb5
child 3589 e76569140275
equal deleted inserted replaced
3586:87081b50bb22 3587:438cc8200c87
   202 
   202 
   203 aspects
   203 aspects
   204     "get the aspects for the attributes of the menu components"
   204     "get the aspects for the attributes of the menu components"
   205 
   205 
   206     ^#(
   206     ^#(
   207 	rawLabel
   207         rawLabel
   208 	accessCharacterPosition
   208         accessCharacterPosition
   209 	showBusyCursorWhilePerforming
   209         showBusyCursorWhilePerforming
   210 	horizontalLayout
   210         horizontalLayout
   211 	triggerOnDown
   211         triggerOnDown
   212 	font
   212         font
   213 	argument
   213         argument
   214 	submenuChannel
   214         submenuChannel
   215 	keepLinkedMenu
   215         keepLinkedMenu
   216 	enabled
   216         enabled
   217 	itemValue
   217         itemValue
   218 	nameKey
   218         nameKey
   219 	indication
   219         indication
   220 	choice
   220         choice
   221 	choiceValue
   221         choiceValue
   222 	translateLabel
   222         translateLabel
   223 	isButton
   223         isButton
   224 	shortcutKeyCharacter
   224         shortcutKeyCharacter
   225 	startGroup
   225         startGroup
   226 	isVisible
   226         isVisible
   227 	hideMenuOnActivated
   227         hideMenuOnActivated
   228 	auxValue
   228         auxValue
   229 	activeHelpKey
   229         activeHelpKey
   230 	resourceRetriever
   230         resourceRetriever
   231 	sendToOriginator
   231         sendToOriginator
   232 	ignoreMnemonicKeys
   232         ignoreMnemonicKeys
   233 	ignoreShortcutKeys
   233         ignoreShortcutKeys
   234 	isMenuSlice
   234         isMenuSlice
       
   235         hasMenuIndicator
   235      )
   236      )
       
   237 
       
   238     "Modified: / 09-08-2018 / 17:03:56 / Claus Gittinger"
   236 ! !
   239 ! !
   237 
   240 
   238 !MenuEditor class methodsFor:'defaults'!
   241 !MenuEditor class methodsFor:'defaults'!
   239 
   242 
   240 resourceType
   243 resourceType
   244 ! !
   247 ! !
   245 
   248 
   246 !MenuEditor class methodsFor:'help specs'!
   249 !MenuEditor class methodsFor:'help specs'!
   247 
   250 
   248 helpSpec
   251 helpSpec
   249     ^super helpSpec addPairsFrom:(self localHelpSpecStrings)
   252     ^super helpSpec addPairsFrom: #(
   250 !
       
   251 
       
   252 localHelpSpecStrings
       
   253     "This resource specification was automatically generated
       
   254      by the UIHelpTool of ST/X."
       
   255 
       
   256     "Do not manually edit this!! If it is corrupted,
       
   257      the UIHelpTool may not be able to read the specification."
       
   258 
       
   259     "
       
   260      UIHelpTool openOnClass:MenuEditor
       
   261     "
       
   262 
       
   263     <resource: #help>
       
   264 
       
   265     ^ #(
       
   266 
   253 
   267 #editCut
   254 #editCut
   268 'Cut Item'
   255 'Cut Item'
   269 
   256 
   270 #editCopy
   257 #editCopy
   390 #fileSaveAs
   377 #fileSaveAs
   391 'Open a dialog to save the menu spec (and the help spec, if modified).'
   378 'Open a dialog to save the menu spec (and the help spec, if modified).'
   392 
   379 
   393 #fileShowMenuSpec
   380 #fileShowMenuSpec
   394 'Opens a Workspace showing the current menu spec.'
   381 'Opens a Workspace showing the current menu spec.'
       
   382 
       
   383 #forceMenuIndicator
       
   384 'Always show a menu indicator in horizontal menu (little down-arrow).'
   395 
   385 
   396 #generateAspectMethods
   386 #generateAspectMethods
   397 'Generates aspect methods for defined aspect selectors of the menu.'
   387 'Generates aspect methods for defined aspect selectors of the menu.'
   398 
   388 
   399 #hideMenuOnActivated
   389 #hideMenuOnActivated
   437 
   427 
   438 #selectorFilter
   428 #selectorFilter
   439 'In the list below, only matching selectors are shown'
   429 'In the list below, only matching selectors are shown'
   440 )
   430 )
   441 
   431 
   442     "Modified: / 03-08-2011 / 10:17:05 / cg"
   432     "Modified: / 09-08-2018 / 17:09:02 / Claus Gittinger"
   443 ! !
   433 ! !
   444 
   434 
   445 !MenuEditor class methodsFor:'image specs'!
   435 !MenuEditor class methodsFor:'image specs'!
   446 
   436 
   447 browseActionImage
   437 browseActionImage
  3149     newLinkedMenuItem submenuChannel:subSelector.
  3139     newLinkedMenuItem submenuChannel:subSelector.
  3150     newLinkedMenuItem menuItem nameKey:(oldMenuItem menuItem nameKey).
  3140     newLinkedMenuItem menuItem nameKey:(oldMenuItem menuItem nameKey).
  3151     newLinkedMenuItem menuItem label:oldMenuItem menuItem label.
  3141     newLinkedMenuItem menuItem label:oldMenuItem menuItem label.
  3152     newLinkedMenuItem menuItem rawLabel:oldMenuItem menuItem rawLabel.
  3142     newLinkedMenuItem menuItem rawLabel:oldMenuItem menuItem rawLabel.
  3153     newLinkedMenuItem menuItem translateLabel:(oldMenuItem menuItem translateLabel).
  3143     newLinkedMenuItem menuItem translateLabel:(oldMenuItem menuItem translateLabel).
       
  3144     newLinkedMenuItem menuItem hasMenuIndicator:(oldMenuItem menuItem hasMenuIndicator).
  3154 
  3145 
  3155     index := oldMenuItem parent identityIndexOf:oldMenuItem.
  3146     index := oldMenuItem parent identityIndexOf:oldMenuItem.
  3156     oldMenuItem parent at:index put:newLinkedMenuItem.
  3147     oldMenuItem parent at:index put:newLinkedMenuItem.
  3157 
  3148 
  3158     self selectedItem:newLinkedMenuItem.
  3149     self selectedItem:newLinkedMenuItem.
       
  3150 
       
  3151     "Modified: / 09-08-2018 / 17:09:40 / Claus Gittinger"
  3159 !
  3152 !
  3160 
  3153 
  3161 doMoveDown
  3154 doMoveDown
  3162     "move selected item down"
  3155     "move selected item down"
  3163 
  3156 
  3810 
  3803 
  3811 children
  3804 children
  3812     "optimize access; do not ask the model for unspecified children
  3805     "optimize access; do not ask the model for unspecified children
  3813     "
  3806     "
  3814     ^ children
  3807     ^ children
       
  3808 !
       
  3809 
       
  3810 hasMenuIndicator:aBoolean
       
  3811     menuItem hasMenuIndicator:aBoolean
       
  3812 
       
  3813     "Created: / 09-08-2018 / 17:03:06 / Claus Gittinger"
  3815 !
  3814 !
  3816 
  3815 
  3817 menuItem
  3816 menuItem
  3818      "returns self as a MenuItem
  3817      "returns self as a MenuItem
  3819     "
  3818     "
  5786      UIPainter new openOnClass:MenuEditor::RegularMenuItem andSelector:#basicsEditSpec
  5785      UIPainter new openOnClass:MenuEditor::RegularMenuItem andSelector:#basicsEditSpec
  5787     "
  5786     "
  5788 
  5787 
  5789     <resource: #canvas>
  5788     <resource: #canvas>
  5790 
  5789 
  5791     ^
  5790     ^ 
  5792      #(FullSpec
  5791     #(FullSpec
  5793 	name: basicsEditSpec
  5792        name: basicsEditSpec
  5794 	window:
  5793        uuid: 'd6768576-9be5-11e8-8c6e-b8f6b1108e05'
  5795        (WindowSpec
  5794        window: 
  5796 	  label: 'basicsEditSpec'
  5795       (WindowSpec
  5797 	  name: 'basicsEditSpec'
  5796          label: 'basicsEditSpec'
  5798 	  min: (Point 10 10)
  5797          name: 'basicsEditSpec'
  5799 	  bounds: (Rectangle 0 0 340 340)
  5798          uuid: 'd6768940-9be5-11e8-8c6e-b8f6b1108e05'
  5800 	)
  5799          min: (Point 10 10)
  5801 	component:
  5800          bounds: (Rectangle 0 0 340 340)
  5802        (SpecCollection
  5801        )
  5803 	  collection: (
  5802        component: 
  5804 	   (LabelSpec
  5803       (SpecCollection
  5805 	      label: 'Name Key:'
  5804          collection: (
  5806 	      name: 'nameKeyLabel'
  5805           (LabelSpec
  5807 	      layout: (AlignmentOrigin 107 0 25 0 1 0.5)
  5806              label: 'Name Key:'
  5808 	      activeHelpKey: basicsKey
  5807              name: 'nameKeyLabel'
  5809 	      visibilityChannel: notDelayedMenu
  5808              layout: (AlignmentOrigin 107 0 25 0 1 0.5)
  5810 	      translateLabel: true
  5809              activeHelpKey: basicsKey
  5811 	      resizeForLabel: true
  5810              uuid: 'd676e930-9be5-11e8-8c6e-b8f6b1108e05'
  5812 	      adjust: right
  5811              visibilityChannel: notDelayedMenu
  5813 	    )
  5812              translateLabel: true
  5814 	   (InputFieldSpec
  5813              resizeForLabel: true
  5815 	      name: 'nameKeyField'
  5814              adjust: right
  5816 	      layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0)
  5815            )
  5817 	      activeHelpKey: basicsKey
  5816           (InputFieldSpec
  5818 	      visibilityChannel: notDelayedMenu
  5817              name: 'nameKeyField'
  5819 	      tabable: true
  5818              layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0)
  5820 	      model: nameKey
  5819              activeHelpKey: basicsKey
  5821 	      group: inputGroup
  5820              uuid: 'd676ec64-9be5-11e8-8c6e-b8f6b1108e05'
  5822 	      type: symbolOrNil
  5821              visibilityChannel: notDelayedMenu
  5823 	      immediateAccept: false
  5822              tabable: true
  5824 	      acceptOnLeave: false
  5823              model: nameKey
  5825 	      acceptOnReturn: true
  5824              group: inputGroup
  5826 	      acceptOnTab: true
  5825              type: symbolOrNil
  5827 	      acceptOnLostFocus: false
  5826              immediateAccept: false
  5828 	      acceptChannel: acceptChannel
  5827              acceptOnLeave: false
  5829 	      modifiedChannel: modifiedChannel
  5828              acceptOnReturn: true
  5830 	      acceptOnPointerLeave: false
  5829              acceptOnTab: true
  5831 	    )
  5830              acceptOnLostFocus: false
  5832 	   (LabelSpec
  5831              acceptChannel: acceptChannel
  5833 	      label: 'Label:'
  5832              modifiedChannel: modifiedChannel
  5834 	      name: 'labelLabel'
  5833              acceptOnPointerLeave: false
  5835 	      layout: (AlignmentOrigin 107 0 51 0 1 0.5)
  5834            )
  5836 	      activeHelpKey: basicsLabel
  5835           (LabelSpec
  5837 	      visibilityChannel: notDelayedMenu
  5836              label: 'Label:'
  5838 	      translateLabel: true
  5837              name: 'labelLabel'
  5839 	      resizeForLabel: true
  5838              layout: (AlignmentOrigin 107 0 51 0 1 0.5)
  5840 	      adjust: right
  5839              activeHelpKey: basicsLabel
  5841 	    )
  5840              uuid: 'd676effc-9be5-11e8-8c6e-b8f6b1108e05'
  5842 	   (InputFieldSpec
  5841              visibilityChannel: notDelayedMenu
  5843 	      name: 'labelField'
  5842              translateLabel: true
  5844 	      layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0)
  5843              resizeForLabel: true
  5845 	      activeHelpKey: basicsLabel
  5844              adjust: right
  5846 	      visibilityChannel: notDelayedMenu
  5845            )
  5847 	      tabable: true
  5846           (InputFieldSpec
  5848 	      model: rawLabel
  5847              name: 'labelField'
  5849 	      group: inputGroup
  5848              layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0)
  5850 	      immediateAccept: false
  5849              activeHelpKey: basicsLabel
  5851 	      acceptOnReturn: true
  5850              uuid: 'd676f150-9be5-11e8-8c6e-b8f6b1108e05'
  5852 	      acceptOnTab: true
  5851              visibilityChannel: notDelayedMenu
  5853 	      acceptOnLostFocus: false
  5852              tabable: true
  5854 	      acceptChannel: acceptChannel
  5853              model: rawLabel
  5855 	      modifiedChannel: modifiedChannel
  5854              group: inputGroup
  5856 	      acceptOnPointerLeave: false
  5855              immediateAccept: false
  5857 	    )
  5856              acceptOnReturn: true
  5858 	   (CheckBoxSpec
  5857              acceptOnTab: true
  5859 	      label: 'Translate Label'
  5858              acceptOnLostFocus: false
  5860 	      name: 'translateLabelCheckBox'
  5859              acceptChannel: acceptChannel
  5861 	      layout: (Point 20 213)
  5860              modifiedChannel: modifiedChannel
  5862 	      activeHelpKey: basicsTranslateLabel
  5861              acceptOnPointerLeave: false
  5863 	      visibilityChannel: notDelayedMenu
  5862            )
  5864 	      tabable: true
  5863           (VerticalPanelViewSpec
  5865 	      model: translateLabel
  5864              name: 'VerticalPanel1'
  5866 	      translateLabel: true
  5865              layout: (LayoutFrame 6 0 188 0 340 0 323 0)
  5867 	    )
  5866              uuid: 'd676f326-9be5-11e8-8c6e-b8f6b1108e05'
  5868 	   (CheckBoxSpec
  5867              horizontalLayout: left
  5869 	      label: 'Is Button'
  5868              verticalLayout: top
  5870 	      name: 'isButtonCheckBox'
  5869              horizontalSpace: 3
  5871 	      layout: (Point 20 238)
  5870              verticalSpace: 3
  5872 	      activeHelpKey: basicsIsButton
  5871              component: 
  5873 	      visibilityChannel: notDelayedMenu
  5872             (SpecCollection
  5874 	      tabable: true
  5873                collection: (
  5875 	      model: isButton
  5874                 (CheckBoxSpec
  5876 	      translateLabel: true
  5875                    label: 'Translate Label'
  5877 	    )
  5876                    name: 'translateLabelCheckBox'
  5878 	   (CheckBoxSpec
  5877                    activeHelpKey: basicsTranslateLabel
  5879 	      label: 'Horizontal Layout'
  5878                    uuid: 'd676f54c-9be5-11e8-8c6e-b8f6b1108e05'
  5880 	      name: 'horizontalLayout'
  5879                    visibilityChannel: notDelayedMenu
  5881 	      layout: (Point 20 263)
  5880                    tabable: true
  5882 	      activeHelpKey: horizontalLayout
  5881                    model: translateLabel
  5883 	      tabable: true
  5882                    translateLabel: true
  5884 	      model: horizontalLayout
  5883                    extent: (Point 149 30)
  5885 	      translateLabel: true
  5884                  )
  5886 	    )
  5885                 (CheckBoxSpec
  5887 	   )
  5886                    label: 'Is Button'
  5888 
  5887                    name: 'isButtonCheckBox'
  5889 	)
  5888                    activeHelpKey: basicsIsButton
  5890       )
  5889                    uuid: 'd676f786-9be5-11e8-8c6e-b8f6b1108e05'
       
  5890                    visibilityChannel: notDelayedMenu
       
  5891                    tabable: true
       
  5892                    model: isButton
       
  5893                    translateLabel: true
       
  5894                    extent: (Point 100 30)
       
  5895                  )
       
  5896                 (CheckBoxSpec
       
  5897                    label: 'Horizontal Layout'
       
  5898                    name: 'horizontalLayout'
       
  5899                    activeHelpKey: horizontalLayout
       
  5900                    uuid: 'd676f8d0-9be5-11e8-8c6e-b8f6b1108e05'
       
  5901                    tabable: true
       
  5902                    model: horizontalLayout
       
  5903                    translateLabel: true
       
  5904                    extent: (Point 163 30)
       
  5905                  )
       
  5906                 (CheckBoxSpec
       
  5907                    label: 'Force Menu Indicator'
       
  5908                    name: 'CheckBox1'
       
  5909                    activeHelpKey: forceMenuIndicator
       
  5910                    uuid: 'd676fa06-9be5-11e8-8c6e-b8f6b1108e05'
       
  5911                    tabable: true
       
  5912                    model: hasMenuIndicator
       
  5913                    translateLabel: true
       
  5914                    extent: (Point 163 30)
       
  5915                  )
       
  5916                 )
       
  5917               
       
  5918              )
       
  5919            )
       
  5920           )
       
  5921         
       
  5922        )
       
  5923      )
  5891 ! !
  5924 ! !
  5892 
  5925 
  5893 !MenuEditor::RegularMenuItem methodsFor:'accessing'!
  5926 !MenuEditor::RegularMenuItem methodsFor:'accessing'!
  5894 
  5927 
  5895 argument:aValue
  5928 argument:aValue