summaryrefslogtreecommitdiffstats
path: root/apps/menu.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-03-03 14:23:03 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-03-03 14:23:03 +0000
commit97090863a6c7a8e5c785a9bc185482c033e89197 (patch)
treea071c24077c2ca7c9183b17639a5479ee4735071 /apps/menu.h
parent02a871780fdc7e5193028a2eb8b250f88a70074b (diff)
downloadrockbox-97090863a6c7a8e5c785a9bc185482c033e89197.tar.gz
rockbox-97090863a6c7a8e5c785a9bc185482c033e89197.tar.bz2
rockbox-97090863a6c7a8e5c785a9bc185482c033e89197.zip
Allow settings to have a different title in the setting screen than they
have in the menu. Fixes the scroll speed/step settings git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12572 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.h')
-rw-r--r--apps/menu.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/menu.h b/apps/menu.h
index f5bc2dd179..fa5d7e5b93 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -60,6 +60,9 @@ void menu_talk_selected(int m);
enum menu_item_type {
MT_MENU = 0,
MT_SETTING,
+ MT_SETTING_W_TEXT, /* same as setting, but uses different
+ text for the setting title,
+ ID2P() or "literal" for the str param */
MT_FUNCTION_CALL, /* used when the standard code wont work */
MT_FUNCTION_WITH_PARAM,
MT_RETURN_ID, /* returns the position of the selected item (starting at 0)*/
@@ -134,6 +137,14 @@ bool do_setting_from_menu(const struct menu_item_ex *temp);
static const struct menu_item_ex name = \
{MT_SETTING, {.variable = (void*)var},{callback}};
+/* Use this for settings which have a differnt title in their
+ setting screen than in the menu (e.g scroll options */
+#define MENUITEM_SETTING_W_TEXT(name, var, str, callback ) \
+ static const struct menu_callback_with_desc name##__ = {callback,str, Icon_NOICON};\
+ static const struct menu_item_ex name = \
+ {MT_SETTING_W_TEXT|MENU_HAS_DESC, {.variable = (void*)var }, \
+ {.callback_and_desc = & name##__}};
+
/* Use this To create a list of NON-XLATABLE (for the time being) Strings
When the user enters this list and selects one, the menu will exits
and its return value will be the index of the chosen item */