");
for (Menu = (Mnu_Menu_t) 0;
Menu < Mnu_NUM_MENUS;
Menu++)
{
fprintf (Gbl.F.Out,"
",
Menu == Gbl.Prefs.Menu ? "PREF_ON" :
"PREF_OFF");
Frm_StartForm (ActChgMnu);
Par_PutHiddenParamUnsigned ("Menu",(unsigned) Menu);
Ico_PutPrefIconLink (Mnu_MenuIcons[Menu],Txt_MENU_NAMES[Menu]);
Frm_EndForm ();
fprintf (Gbl.F.Out,"
");
}
fprintf (Gbl.F.Out,"
");
Box_EndBox ();
}
/*****************************************************************************/
/****************** Put contextual icons in menu preference ******************/
/*****************************************************************************/
static void Mnu_PutIconsMenu (void)
{
/***** Put icon to show a figure *****/
Gbl.Figures.FigureType = Fig_MENUS;
Fig_PutIconToShowFigure ();
}
/*****************************************************************************/
/******************************** Change menu ********************************/
/*****************************************************************************/
void Mnu_ChangeMenu (void)
{
/***** Get param with menu *****/
Gbl.Prefs.Menu = Mnu_GetParamMenu ();
/***** Store menu in database *****/
if (Gbl.Usrs.Me.Logged)
DB_QueryUPDATE ("can not update your preference about menu",
"UPDATE usr_data SET Menu=%u WHERE UsrCod=%ld",
(unsigned) Gbl.Prefs.Menu,Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Set preferences from current IP *****/
Pre_SetPrefsFromIP ();
}
/*****************************************************************************/
/************************* Get parameter with menu ***************************/
/*****************************************************************************/
Mnu_Menu_t Mnu_GetParamMenu (void)
{
return (Mnu_Menu_t)
Par_GetParToUnsignedLong ("Menu",
0,
Mnu_NUM_MENUS - 1,
(unsigned long) Mnu_MENU_DEFAULT);
}
/*****************************************************************************/
/*************************** Get menu from string ****************************/
/*****************************************************************************/
Mnu_Menu_t Mnu_GetMenuFromStr (const char *Str)
{
unsigned UnsignedNum;
if (sscanf (Str,"%u",&UnsignedNum) == 1)
if (UnsignedNum < Mnu_NUM_MENUS)
return (Mnu_Menu_t) UnsignedNum;
return Mnu_MENU_DEFAULT;
}