Help in menus - General Discussion and Assistance - CHDK Forum

Help in menus

  • 8 Replies
  • 4001 Views
Help in menus
« on: 23 / January / 2012, 09:08:25 »
Advertisements
Hi

I have made a help system for the menus. It shows a help message at the end of the menu or if the menu is to long at the end of the screen.

If you apply the attached patch (made for rev 1607) you can use MENU_ITEM_HELP, MENU_ENUM2_HELP and MENU_ENUM2a_HELP with a help message as last argument.
If you then enable "show help" in the "visual settings" menu the message will be shown. If no help is available (if you use MENU_ITEM, MENU_ENUM2 or MENU_ENUM2a) it shows "No Help Available".

The patch adds an "Show Help" and help color items to the "visual settings" menu, also an show and an color item to the configuration and a few lines to gui_menu.c and gui_menu.h.

Please Test it!!

EDIT: I've forgotten the attachment

TobiMarg
« Last Edit: 23 / January / 2012, 09:17:53 by TobiMarg »

Re: Help in menus
« Reply #1 on: 23 / January / 2012, 09:09:41 »
I guess you would need to attach the patch for us to try it ?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Help in menus
« Reply #2 on: 23 / January / 2012, 09:12:20 »
Oh thanks, here is it.  :D
« Last Edit: 23 / January / 2012, 09:16:59 by TobiMarg »

Re: Help in menus
« Reply #3 on: 23 / January / 2012, 09:24:29 »
Hmm ... looks simple enough.  I'm sure there will be some discussion about this.  With the use of modules (ELF) in the  new trunk,  it would not add the memory hit that would have been unacceptable in the current stable version.   Looks like a lot of work to actually get text for each menu and do the translations.  But that could be something for all the CHDK users  to do who have volunteered to help out but who can't program.

Ported :   A1200    SD940   G10    Powershot N    G16


Re: Help in menus
« Reply #4 on: 23 / January / 2012, 09:30:29 »
I think if it will be included in trunk everyone ho makes a new entry should use the MENU_*_HELP macros.
Then (if all old items have an help) we could rename the MENU_*_HELP macros to the normal MENU_* macros and rename the MENU_* macros to MENU_*_NO_HELP.

Re: Help in menus
« Reply #5 on: 23 / January / 2012, 09:35:25 »
Nice idea but all this help messages will be build-in into the core. And this will increase core size significantelly.

IMO better but not so simple solution is second layer of lng files. Same filename but different extension "english.hlp" if "english.lng" selected.
Probably this strings could be load when correspondent submenu is raised and unallocated when it changed/closed.

Re: Help in menus
« Reply #6 on: 23 / January / 2012, 10:02:59 »
IMO better but not so simple solution is second layer of lng files. Same filename but different extension "english.hlp" if "english.lng" selected.
Probably this strings could be load when correspondent submenu is raised and unallocated when it changed/closed.

Yes I think it's possible, but more complex.
There could be another header file (like gui_lang.h) with the numbers of the help strings and the we could load the needed parts at runtime, but its difficult because we can seek (in a file) to a byte but not to a line.

Re: Help in menus
« Reply #7 on: 23 / January / 2012, 10:31:57 »
Anyway whole file should be loaded because load one string and load whole file take same time.
And so we no need in really load precise set of string, we need to load file when menu raise and unload when it go down.

Also this intersect with unresolved yet .lng problem. Help file (and  .lng file) have global ids and so they should be in sync with core and modules versions (which is strong dependencies for modules).
But this is different issue and it will be discussed in different thread.


Re: Help in menus
« Reply #8 on: 23 / January / 2012, 11:06:46 »
I will think about that and try to implement it.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal