Bills User Menu update - CHDK Releases - CHDK Forum supplierdeeply

Bills User Menu update

  • 6 Replies
  • 5616 Views
Bills User Menu update
« on: 22 / August / 2008, 13:49:25 »
Advertisements
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


*

Offline Hacki

  • ****
  • 358
  • SX100
Re: Bills User Menu update
« Reply #1 on: 22 / August / 2008, 14:10:28 »
Cool. Just tried it, and i like it. Wanted to implement something like this, but i suck at C. Thanks! :)






*

Offline dzsemx

  • ****
  • 302
  • [SX40HS][A650][A630]
Re: Bills User Menu update
« Reply #2 on: 22 / August / 2008, 14:58:10 »
yes, there are cameras without zoom ring, like A450, a470...

Re: Bills User Menu update
« Reply #3 on: 22 / August / 2008, 16:10:43 »
yes, there are cameras without zoom ring, like A450, a470...
Hmmm. bummer....

Well, I see there is already some special code that uses the display button in a special way when in
user menu edit mode and when the user menu is displayed.

I could use the display button to toggle the meaning of the up/down keys when in user menu edit mode and
when the user menu is currently be displayed.
You could then move up/down using the up/down keys then push the <disp> button and now the up/down keys can be used
like the zoom in/out buttons to drag the menu item up and down.
Down would drag the menu item down, an up would drag the menu item up.
Push the <disp> button again and the up/down works again.
(This mode shifting would only happen during user menu edit mode and when the user menu was being displayed).

I think I'd leave it in this shifted mode, until any other key but up or down is pressed.
This way, it wouldn't necessarily have to  display some sort of prompt/icon/character on the screen to show that
this mode shift is active and it would turn itself off as soon as any other key was pressed.

The only problem with this method is that you would lose the ability to go back from the user menu when
in edit mode.
This seems a little bit odd. But then again, the <disp> button for going back
has pretty much been disabled on cameras without a zoom bar to support the int_incr increment stuff,
so those users aren't really used to being able to use the <disp> for jumping back in menus anyway.

I'll have to think a bit more on this but so far I kind of like the above approach.

If people wanted consistency, this could be handled this way for all the cameras.
Or on cameras with a zoom lever, support both methods.

If anyone has any other ideas on how to make this work for cameras without a zoom,
or any other methods for handling this across all the cameras, please post your ideas.

--- bill




*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Bills User Menu update
« Reply #4 on: 25 / November / 2008, 17:44:39 »
added in #593.
about the zoom lever thingy, well for now people without this zoom thing would have to sort the usermenu by adding them in the right order from the getgo, or wait for a better fix.

Re: Bills User Menu update
« Reply #5 on: 18 / April / 2009, 05:19:13 »
I haven't looked at this in a while.
I can easily update this to be better and do things like
move the main menu to the bottom (or perhaps even let it be moved but not removed)
and put in a better/alternate way to drag the menu items up/down
so that there is a way to do it on cameras without a zoom bar.

If folks are interested in getting this updated let me know and I'll go off and
work up a new method of handling this that is simple and works for
all cameras so that the non zoom bar cameras can enjoy the ability of
moving menu items around.
It shouldn't be much work.

--- bill

*

Offline Jucifer

  • *****
  • 251
  • [A710IS]
Re: Bills User Menu update
« Reply #6 on: 18 / April / 2009, 15:34:18 »
Strange, I was thinking about your menu mod (and if you'd make it even better) just yesterday...

move the main menu to the bottom
Yeah, it'd be better at the bottom.

Quote
(or perhaps even let it be moved but not removed)
I'd prefer it to be removed altogether... :] Maybe make it removable, and require shoot_half/something else to be pressed when removing?
Or make it optional?
Maybe main menu could be added by adding the user menu? Ok, that might be a bit counterintuitive... :P

Quote
and put in a better/alternate way to drag the menu items up/down
so that there is a way to do it on cameras without a zoom bar.
(shoot_half +) left/right?

 

Related Topics