MenuEditor.st
changeset 571 1e362121fe32
parent 557 de8d8782486c
child 576 c357919e636f
equal deleted inserted replaced
570:f79a0178adc1 571:1e362121fe32
   888      
   888      
   889        #(#FullSpec
   889        #(#FullSpec
   890           #'window:' 
   890           #'window:' 
   891            #(#WindowSpec
   891            #(#WindowSpec
   892               #'name:' 'Menu Builder'
   892               #'name:' 'Menu Builder'
   893               #'layout:' #(#LayoutFrame 221 0 394 0 800 0 777 0)
   893               #'layout:' #(#LayoutFrame 324 0 233 0 903 0 616 0)
   894               #'label:' 'Menu Builder'
   894               #'label:' 'Menu Builder'
   895               #'min:' #(#Point 10 10)
   895               #'min:' #(#Point 10 10)
   896               #'max:' #(#Point 1152 900)
   896               #'max:' #(#Point 1152 900)
   897               #'bounds:' #(#Rectangle 221 394 801 778)
   897               #'bounds:' #(#Rectangle 324 233 904 617)
   898               #'menu:' #menu
   898               #'menu:' #menu
   899               #'usePreferredExtent:' false
   899               #'usePreferredExtent:' false
   900           )
   900           )
   901           #'component:' 
   901           #'component:' 
   902            #(#SpecCollection
   902            #(#SpecCollection
   908                     #'menu:' #menuToolbar
   908                     #'menu:' #menuToolbar
   909                     #'showSeparatingLines:' true
   909                     #'showSeparatingLines:' true
   910                 )
   910                 )
   911                  #(#VariableHorizontalPanelSpec
   911                  #(#VariableHorizontalPanelSpec
   912                     #'name:' 'variableHorizontalPanel1'
   912                     #'name:' 'variableHorizontalPanel1'
   913                     #'layout:' #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -22 1.0)
   913                     #'layout:' #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
   914                     #'component:' 
   914                     #'component:' 
   915                      #(#SpecCollection
   915                      #(#SpecCollection
   916                         #'collection:' 
   916                         #'collection:' 
   917                          #(
   917                          #(
   918                            #(#ArbitraryComponentSpec
   918                            #(#ArbitraryComponentSpec
   948                               )
   948                               )
   949                               #'level:' -1
   949                               #'level:' -1
   950                           )
   950                           )
   951                         )
   951                         )
   952                     )
   952                     )
   953                     #'level:' 1
       
   954                     #'handles:' #(#Any 0.384483 1.0)
   953                     #'handles:' #(#Any 0.384483 1.0)
   955                 )
   954                 )
   956                  #(#UISubSpecification
   955                  #(#UISubSpecification
   957                     #'name:' 'infoBarSubSpec'
   956                     #'name:' 'infoBarSubSpec'
   958                     #'layout:' #(#LayoutFrame 0 0.0 -22 1 0 1.0 0 1.0)
   957                     #'layout:' #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
   959                     #'majorKey:' #ToolApplicationModel
   958                     #'majorKey:' #ToolApplicationModel
   960                     #'minorKey:' #windowSpecForInfoBarWithClock
   959                     #'minorKey:' #windowSpecForInfoBarWithClock
   961                 )
   960                 )
   962               )
   961               )
   963           )
   962           )
  1473 
  1472 
  1474     self noteBookView.
  1473     self noteBookView.
  1475     self helpTool dictionary:aDictionary
  1474     self helpTool dictionary:aDictionary
  1476 ! !
  1475 ! !
  1477 
  1476 
  1478 !MenuEditor methodsFor:'active help'!
       
  1479 
       
  1480 defaultInfoLabel
       
  1481 
       
  1482     specClass isNil ifTrue: [^'No menu class defined'].
       
  1483     ^specClass printString, ' >> ', self treeView selectorName
       
  1484   
       
  1485 ! !
       
  1486 
       
  1487 !MenuEditor methodsFor:'aspects'!
  1477 !MenuEditor methodsFor:'aspects'!
  1488 
  1478 
  1489 aspectFor:aKey
  1479 aspectFor:aKey
  1490     "returns aspect for a key or nil"
  1480     "returns aspect for a key or nil"
  1491 
  1481 
  1641     super doesNotUnderstand:aMessage
  1631     super doesNotUnderstand:aMessage
  1642 
  1632 
  1643 
  1633 
  1644 ! !
  1634 ! !
  1645 
  1635 
       
  1636 !MenuEditor methodsFor:'help'!
       
  1637 
       
  1638 defaultInfoLabel
       
  1639 
       
  1640     specClass isNil ifTrue: [^'No menu class defined'].
       
  1641     ^specClass printString, ' >> ', self treeView selectorName
       
  1642   
       
  1643 !
       
  1644 
       
  1645 openTutorial
       
  1646 
       
  1647     self openTutorial: 'tools/uipainter/TOP.html#ADDINGMENUBAR'.
       
  1648 
       
  1649 ! !
       
  1650 
  1646 !MenuEditor methodsFor:'private'!
  1651 !MenuEditor methodsFor:'private'!
  1647 
  1652 
  1648 checkMenuItemModified
  1653 checkMenuItemModified
  1649     "check menu item modification"
  1654     "check menu item modification"
  1650 
  1655 
  1828         aClass isString ifTrue: [className := aClass].
  1833         aClass isString ifTrue: [className := aClass].
  1829         message := className, ' ', aSelector.
  1834         message := className, ' ', aSelector.
  1830         self addToHistory: message -> #loadFromMessage:
  1835         self addToHistory: message -> #loadFromMessage:
  1831     ].
  1836     ].
  1832 
  1837 
  1833     self valueOfInfoLabel value: self defaultInfoLabel.
  1838     self updateInfoLabel.
  1834     self treeView selection: 2.
  1839     self treeView selection: 2.
  1835     self menuChanged
  1840     self menuChanged
  1836 
  1841 
  1837 !
  1842 !
  1838 
  1843 
  1898     ].
  1903     ].
  1899 
  1904 
  1900     aspects at:#seperatorSelection put:(holder := SelectionInList new).
  1905     aspects at:#seperatorSelection put:(holder := SelectionInList new).
  1901     holder list: Item separatorList.
  1906     holder list: Item separatorList.
  1902     holder addDependent:self.
  1907     holder addDependent:self.
       
  1908 
  1903 !
  1909 !
  1904 
  1910 
  1905 loadFromMessage: aMessage
  1911 loadFromMessage: aMessage
  1906 
  1912 
  1907     (((aMessage size > 0) and: [self checkMenuItemModified]) and: [self checkModified])
  1913     (((aMessage size > 0) and: [self checkMenuItemModified]) and: [self checkModified])