MenuPanel.st
changeset 5978 ff8cdfcb7007
parent 5972 ff50c3fbee4f
child 5995 2acec64a833b
equal deleted inserted replaced
5977:41e5b13a7ad6 5978:ff8cdfcb7007
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1997 by eXept Software AG
     4  COPYRIGHT (c) 1997 by eXept Software AG
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  1724 !
  1726 !
  1725 
  1727 
  1726 enteredBackgroundColor
  1728 enteredBackgroundColor
  1727     "return the background color for entered items"
  1729     "return the background color for entered items"
  1728 
  1730 
  1729     ^ styleSheet colorAt:#'menu.enteredBackgroundColor'
  1731     ^ styleSheet 
  1730                  default:(self backgroundColor)
  1732         colorAt:#'menu.enteredBackgroundColor'
       
  1733         default:(self backgroundColor)
       
  1734 
       
  1735     "Modified (format): / 23-12-2018 / 00:30:28 / Claus Gittinger"
  1731 !
  1736 !
  1732 
  1737 
  1733 enteredForegroundColor
  1738 enteredForegroundColor
  1734     "return the foreground color for entered items"
  1739     "return the foreground color for entered items"
  1735 
  1740 
  1736     ^ styleSheet colorAt:#'menu.enteredForegroundColor' default:fgColor
  1741     ^ styleSheet 
       
  1742         colorAt:#'menu.enteredForegroundColor' 
       
  1743         default:fgColor
       
  1744 
       
  1745     "Modified (format): / 23-12-2018 / 00:30:37 / Claus Gittinger"
  1737 !
  1746 !
  1738 
  1747 
  1739 font:aFont
  1748 font:aFont
  1740     "set the font"
  1749     "set the font"
  1741 
  1750 
  4318             ) ifTrue:[
  4327             ) ifTrue:[
  4319                 newItem := anItemOrNil
  4328                 newItem := anItemOrNil
  4320             ]
  4329             ]
  4321         ] ifFalse:[
  4330         ] ifFalse:[
  4322             (self enteredLevel ~~ 0
  4331             (self enteredLevel ~~ 0
  4323               or:[self enteredBackgroundColor ~= self backgroundColor]
  4332               or:[ (self enteredBackgroundColor ~= self backgroundColor)
       
  4333               or:[self enteredForegroundColor ~= self foregroundColor ]]
  4324             ) ifTrue:[
  4334             ) ifTrue:[
  4325                 newItem := anItemOrNil
  4335                 newItem := anItemOrNil
  4326             ]
  4336             ]
  4327         ]
  4337         ]
  4328     ].
  4338     ].
  4338         enteredItem notNil ifTrue:[
  4348         enteredItem notNil ifTrue:[
  4339             self invalidateItem:enteredItem repairNow:true.
  4349             self invalidateItem:enteredItem repairNow:true.
  4340         ].
  4350         ].
  4341     ].
  4351     ].
  4342 
  4352 
  4343     "Modified: / 19-11-2018 / 15:08:49 / Claus Gittinger"
  4353     "Modified: / 23-12-2018 / 00:31:33 / Claus Gittinger"
  4344 !
  4354 !
  4345 
  4355 
  4346 processHideMenuEvent:ev
  4356 processHideMenuEvent:ev
  4347     "to be filled..."
  4357     "to be filled..."
  4348 
  4358 
  5182      the submenu can be cached,
  5192      the submenu can be cached,
  5183      so if we don't care about resources here (which seams like a performance optimization),
  5193      so if we don't care about resources here (which seams like a performance optimization),
  5184      we have non translated sub menus (when using them later for viewing).
  5194      we have non translated sub menus (when using them later for viewing).
  5185      Problem expecco Menu 'View' was somethimes untranslated and somethimes not.
  5195      Problem expecco Menu 'View' was somethimes untranslated and somethimes not.
  5186      Dependent if this code was called before the user did open (instantiate) the menu via the application.
  5196      Dependent if this code was called before the user did open (instantiate) the menu via the application.
  5187      May also the shortcuts itself could vary when translated 'Open &File' -> 'Datei &öffnen' ????"
  5197      May also the shortcuts itself could vary when translated 'Open &File' -> 'Datei &öffnen' ????"
  5188     Menu::NeedResourcesQuery answer:true do:[
  5198     Menu::NeedResourcesQuery answer:true do:[
  5189 "/    Menu::NeedResourcesQuery answer:false do:[
  5199 "/    Menu::NeedResourcesQuery answer:false do:[
  5190         [true] whileTrue:[
  5200         [true] whileTrue:[
  5191             list := menu
  5201             list := menu
  5192                         selectItemIndicesFor:[:el|
  5202                         selectItemIndicesFor:[:el|