MenuButton.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 02 Sep 2022 11:25:39 +0100
branchjv
changeset 6261 9b7eb7159d29
parent 4770 6634b540fea2
permissions -rw-r--r--
Fix loong standing bug with some menus not being translated / resolved This has happened with browser "View" menu when sometimes it had the slice resolved and sometimes not. It turned out that it was because the code disabled resources (and therefore slices) resolution when processing shortcuts, so the menu was created and cached unresolved. This fixes the issue. eXept apparently run into the same problem.

"
 COPYRIGHT (c) 1989 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libwidg2' }"

"{ NameSpace: Smalltalk }"

Button subclass:#MenuButton
	instanceVariableNames:'enterAction'
	classVariableNames:''
	poolDictionaries:''
	category:'Views-Obsolete'
!

!MenuButton class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1989 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    this is obsolete

    these objects implement the special buttons used for pull-down-menu-bars.
    they highlight on enter events (while pressed) and perform their
    action on release.
    This is no longer needed, since every button (& buttonController)
    now supports this behavior.
"
! !

!MenuButton methodsFor:'accessing'!

enterAction:aBlock
    enterAction := aBlock
! !

!MenuButton methodsFor:'events'!

pointerEnter:state x:x y:y
    (state bitTest:(device bitButton1)) ifTrue:[
	self turnOn.
	enterAction notNil ifTrue:[enterAction value]
    ]
! !

!MenuButton methodsFor:'initialization'!

initEvents
    super initEvents.
    self enableEnterEvents
! !

!MenuButton class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libwidg2/MenuButton.st,v 1.7 2013-08-31 09:10:41 cg Exp $'
! !