So I've updated the user menu feature.
This patch modifies this user menus in a number ways that I find useful and more intuitive.
Externally visible features:
- The "Main Menu" is now the first entry in the User menu (not movable and not removable)
(this was to support dynamic resizing and mainly to the fix the sizing issue for user_submenu_items[] described below)
- The size of the user menu on the screen will dynamically grow/shrink as items are added/removed from the user menu
- New entries are always added to the bottom of the list of existing entries.
- When in "edit" mode, the zoom lever can be used to drag entries up/down in the user menu.
- When a menu item is deleted (use same button as before, edit mode), all the existing menu items are moved up and the menu is re-sized.
Internally non visible updates:
- The size of user_submenu_items[] is no longer magically and manually tied the sizeof conf.user.menu_vars[]
and def_user_menu_vars[].
Before, the size of user_submenu_items[] had to be manually adjusted to match the sizes of these, which in the trunk
is hard coded to 10 and in the juciphox branch it is set to USER_MENU_ITEMS.
Now the user_submenu_items[] array is controlled by USER_MENU_ITEMS so that changing this value will properly
adjust everything everywhere.
The value of USER_MENU_ITEMS (which didn't previously exist on the main trunk) has been set to 10
on the trunk version of the patch to match the existing size of the user menu,
to ensure that the config file is not corrupted. It is left at 14 for the juciphox branch patch for the same reason.
I've attached 2 patches. 1 for the head of the trunk and 1 for the head of juciphox.
I've tested the patches on my trees, but as this is my first patch posting, be careful.
The patches for each build are different.
These files are modified for the trunk: include/conf.h core/conf.c core/gui.c core/gui_menu.c core/gui_menu.h
These files are modified for the jucipihox build: core/gui.c core/gui_menu.c core/gui_menu.h
You may want to save those files prior to applying this patch
And yes while the trend seems to be that code is self commenting and doesn't need comments,
I did use comments as I am a firm believer in commenting code.
NOTE/WARNING:The one downside to this is for cameras that do not have a Zoom lever. Are there really any of these out there?
Those units will not be able to drag menu items around and so will only be able to add
new menu items to the end of existing items and not will not be able to overwrite an existing menu item as they can now.
So while I think this update makes user menus work nicer for the cameras with a zoom lever,
it may make organizing the order of user menu items more difficult for those without a zoom lever.
All the resizing will still work when new items are added or existing items are removed.
Enjoy,
--- bill