Closed kerinin closed 11 years ago
Thank you for this! I've actually intended to implement it for some time but you beat me to it! Thanks again.
No problem! I also have a branch that splits the function implementations out into the *.cpp file if that's useful. I was did it trying to fix a problem that turned out to be unrelated.
-Ryan
On Tue, Jan 8, 2013 at 5:35 AM, Alexander Brevig notifications@github.comwrote:
Thank you for this! I've actually intended to implement it for some time but you beat me to it! Thanks again.
— Reply to this email directly or view it on GitHubhttps://github.com/WiringProject/Wiring/pull/30#issuecomment-11993919.
The previous implementation allowed 3 callbacks to be defined on the root-level MenuBackend instance (
menuUse
,menuChange
anditemChange
). This commit introduces 8 callbacks for MenuItems:onChangeFrom
/onChangeTo
- called when the current menu is changed away from/to the base MenuItemonUp
/onDown
/onLeft
/onRight
- called whenmoveUp
, etc is called with the base MenuItem as the current menuonUse
- called whenuse
is called with the base MenuItem as the current menuThese callbacks should simplify code organization in some cases by eliminating the need for a complex case statement to handle all menu events.