[Cuis-dev] [IMPROV] <some improvement> ...

Gerald Klix cuis.01 at klix.ch
Thu Aug 25 13:35:44 PDT 2022


Hi all, Hi Juan,

I miss the possibility to pin the “Open” and “Window” menus.
Therefore I created a patch that adds
a handler to `MenuItem` for mouse “button 2 up” events
that duplicates either the menu item or -- if
available -- the sub menu.


HTH and Best Regards,

Gerald
-------------- next part --------------
'From Haver 6.0 [latest update: #5466] on 25 August 2022 at 9:16:55 pm'!

!MenuItemMorph methodsFor: 'events' stamp: 'KLG 8/25/2022 21:11:47'!
mouseButton2Up: aMouseButtonEvent localPosition: localEventPosition
	"Create a copy of me or my submenu."

	aMouseButtonEvent shiftPressed ifTrue: [
		subMenu
			ifNil: [ self duplicate ]
			ifNotNil: [
				(subMenu duplicate)
					addTitle: contents;
					addStayUpIcons;
					stayUp;
					adjustSubmorphsLayout;
					yourself ] ::
						openInHand ].
	^ super mouseButton2Down: aMouseButtonEvent localPosition: localEventPosition
	! !


More information about the Cuis-dev mailing list