MenuItem.st
changeset 1360 2b17ce81a790
parent 1347 e033db194238
child 1369 281acc9f1a73
equal deleted inserted replaced
1359:f40bfb94f862 1360:2b17ce81a790
    20 !
    20 !
    21 
    21 
    22 Object subclass:#MenuItemAdornment
    22 Object subclass:#MenuItemAdornment
    23 	instanceVariableNames:'color indication submenu submenuChannel shortcutKey labelText
    23 	instanceVariableNames:'color indication submenu submenuChannel shortcutKey labelText
    24 		labelImage accessCharacterPosition argument choice choiceValue
    24 		labelImage accessCharacterPosition argument choice choiceValue
    25 		auxValue showBusyCursorWhilePerforming'
    25 		font auxValue showBusyCursorWhilePerforming'
    26 	classVariableNames:''
    26 	classVariableNames:''
    27 	poolDictionaries:''
    27 	poolDictionaries:''
    28 	privateIn:MenuItem
    28 	privateIn:MenuItem
    29 !
    29 !
    30 
    30 
   167     (something notNil or:[adornment notNil]) ifTrue:[
   167     (something notNil or:[adornment notNil]) ifTrue:[
   168         self adornment auxValue:something
   168         self adornment auxValue:something
   169     ]
   169     ]
   170 
   170 
   171     "Modified: / 4.2.2000 / 12:38:44 / cg"
   171     "Modified: / 4.2.2000 / 12:38:44 / cg"
       
   172 !
       
   173 
       
   174 font
       
   175     "get the specific font for an item or nil
       
   176     "
       
   177     adornment notNil ifTrue:[
       
   178         ^ adornment font
       
   179     ].
       
   180     ^ nil
       
   181 !
       
   182 
       
   183 font:aFont
       
   184     "set the index of the access character in the label text or string, or nil if none
       
   185     "
       
   186 
       
   187     (aFont isNil and:[adornment isNil]) ifFalse:[
       
   188         self adornment font:aFont
       
   189     ]
   172 !
   190 !
   173 
   191 
   174 hideMenuOnActivated
   192 hideMenuOnActivated
   175     "hide the menu when the item was activated; the default is true
   193     "hide the menu when the item was activated; the default is true
   176     "
   194     "
   577     ].
   595     ].
   578 
   596 
   579     adornment notNil ifTrue:[
   597     adornment notNil ifTrue:[
   580         (something := self shortcutKeyCharacter) notNil ifTrue:[
   598         (something := self shortcutKeyCharacter) notNil ifTrue:[
   581             coll add:#shortcutKeyCharacter: ; add:(something literalArrayEncoding)
   599             coll add:#shortcutKeyCharacter: ; add:(something literalArrayEncoding)
       
   600         ].
       
   601         (something := self font) notNil ifTrue:[
       
   602             coll add:#font: ; add:(something literalArrayEncoding)
   582         ].
   603         ].
   583 
   604 
   584         (something := self accessCharacterPosition) notNil ifTrue:[
   605         (something := self accessCharacterPosition) notNil ifTrue:[
   585             coll add:#accessCharacterPosition: ; add:(something literalArrayEncoding)
   606             coll add:#accessCharacterPosition: ; add:(something literalArrayEncoding)
   586         ].
   607         ].
   823     color := something.
   844     color := something.
   824 
   845 
   825     "Created: 25.2.1997 / 20:59:28 / cg"
   846     "Created: 25.2.1997 / 20:59:28 / cg"
   826 !
   847 !
   827 
   848 
       
   849 font
       
   850     "get the specific font for an item or nil
       
   851     "
       
   852     ^ font
       
   853 !
       
   854 
       
   855 font:aFont
       
   856     "set a specific font for an item
       
   857     "
       
   858     font := aFont.
       
   859 !
       
   860 
   828 indication
   861 indication
   829     "test whether the menu item has an on/off indicator (CheckToggle)
   862     "test whether the menu item has an on/off indicator (CheckToggle)
   830     "
   863     "
   831     ^ indication
   864     ^ indication
   832 
   865 
   954 ! !
   987 ! !
   955 
   988 
   956 !MenuItem class methodsFor:'documentation'!
   989 !MenuItem class methodsFor:'documentation'!
   957 
   990 
   958 version
   991 version
   959     ^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.37 2000-02-12 13:24:31 cg Exp $'
   992     ^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.38 2000-02-25 17:53:54 ca Exp $'
   960 ! !
   993 ! !