Here is an example for a date entry dialog box:

/*=========================================================================*/

/* edit date dialog */

uint8_t dt_day;

uint8_t dt_month;

uint8_t dt_year;

void dt_get_from_RTC(void)

{

RTC.getTime();

dt_day = RTC.day;

dt_month = RTC.month;

dt_year = (RTC.year-2000);

}

void dt_put_to_RTC(void)

{

RTC.getTime();

RTC.fillByYMD(dt_year+2000, dt_month, dt_day);

RTC.setTime();

RTC.startClock();

}

void dt_ok_fn(m2_el_fnarg_p fnarg)

{

dt_put_to_RTC();

m2.setRoot(&el_top);

}

M2_U8NUM(el_dt_day, "c2", 1,31,&dt_day);

M2_LABEL(el_dt_sep1, NULL, ".");

M2_U8NUM(el_dt_month, "c2", 1,12,&dt_month);

M2_LABEL(el_dt_sep2, NULL, ".");

M2_U8NUM(el_dt_year, "c2", 0,99,&dt_year);

M2_LIST(list_date) = { &el_dt_day, &el_dt_sep1, &el_dt_month, &el_dt_sep2, &el_dt_year };

M2_HLIST(el_date, NULL, list_date);

M2_ROOT(el_dt_cancel, NULL, "cancel", &el_top)

M2_BUTTON(el_dt_ok, NULL, "ok", dt_ok_fn);

M2_LIST(list_dt_buttons) = {&el_dt_cancel, &el_dt_ok };

M2_HLIST(el_dt_buttons, NULL, list_dt_buttons);

M2_LIST(list_dt) = {&el_date, &el_dt_buttons };

M2_VLIST(el_top_dt, NULL, list_dt);

The "dt_put_to_RTC" procedure will be different for your, but the element hierarchy might be the same.

The top level element is "el_top_dt".

This means that your data for the 2L-Menu might look like this:

`m2_menu_entry m2_2lmenu_data[] = `

{

{ "Date/Time 1", NULL },

{ ". Set Date 1-1", &el_top_dt },

...

{ NULL, NULL },

};

The 2L-Menu is another element hierarchy. For example:

`M2_2LMENU(el_2lmenu,"l4F3e15W43",&m2_2lmenu_first,&m2_2lmenu_cnt, m2_2lmenu_data,65,102,'\0');`

M2_SPACE(el_space, "W1h1");

M2_VSB(el_vsb, "l4W2r1", &m2_2lmenu_first, &m2_2lmenu_cnt);

M2_LIST(list_2lmenu) = { &el_2lmenu, &el_space, &el_vsb };

M2_HLIST(el_hlist, NULL, list_2lmenu);

M2_ALIGN(top_el_expandable_menu, "-1|1W64H64", &el_hlist);

The toplevel (root) element is "top_el_expandable_menu".

Oliver