WiringProject/Wiring — pull request #30 by kerinin (2013-01-06 04:43:43+00:00)
Title: Adding MenuItem-level callbacks for MenuBackend

The previous implementation allowed 3 callbacks to be defined on the
root-level MenuBackend instance (`menuUse`, `menuChange` and `itemChange`).
This commit introduces 8 callbacks for MenuItems:

* `onChangeFrom` / `onChangeTo` - called when the current menu is changed
away from/to the base MenuItem
* `onUp` / `onDown` / `onLeft` / `onRight` - called when `moveUp`, etc is called
with the base MenuItem as the current menu
* `onUse` - called when `use` is called with the base MenuItem as the
current menu

These callbacks should simplify code organization in some cases by
eliminating the need for a complex case statement to handle all menu
events.