rjrahul25 / m2tklib

Automatically exported from code.google.com/p/m2tklib
0 stars 0 forks source link

M2_SPACECB #86

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
add a space element which gets called with NEW_DIALOG msg
--> add to m2elspace.c

Original issue reported on code.google.com by olikr...@gmail.com on 16 Nov 2012 at 11:28

GoogleCodeExporter commented 8 years ago
example does not work with
m2_SetRootExtended

Original comment by olikr...@gmail.com on 17 Nov 2012 at 11:37

GoogleCodeExporter commented 8 years ago
M2_EXTERN_ALIGN(top_el_spacecb_menu);

uint8_t el_space_u8 = 0;

void fn_space_cb_zero(m2_el_fnarg_p fnarg) {
  el_space_u8 = 0;
  m2_SetRootExtended(&top_el_spacecb_menu, 0, 0);
}

void fn_space_cb_inc(m2_el_fnarg_p fnarg) {
  puts("inc");
  el_space_u8++;
  m2_SetRootExtended(&top_el_spacecb_menu, 1, 0);
}

void fn_space_cb_dec(m2_el_fnarg_p fnarg) {
  el_space_u8--;
  m2_SetRootExtended(&top_el_spacecb_menu, 2, 0);
}

M2_SPACECB(el_space_cb_zero, NULL, fn_space_cb_zero);
M2_SPACECB(el_space_cb_inc, NULL, fn_space_cb_inc);
M2_SPACECB(el_space_cb_dec, NULL, fn_space_cb_dec);

m2_menu_entry space_cb_menu_data[] = 
{
  { "Zero", &el_space_cb_zero },
  { "Inc", &el_space_cb_inc },
  { "Dec", &el_space_cb_dec },
  { NULL, NULL },
};

uint8_t el_2lspace_first = 0;
uint8_t el_2lspace_cnt = 3;

/* for m2icon fonts, 65: closed folder, 102: open folder */
M2_U8NUM(el_2lspace_u8, "r1c3", 0, 255, &el_space_u8);
M2_2LMENU(el_2lspace_strlist, "l3e15F3W47", &el_2lspace_first, &el_2lspace_cnt, 
space_cb_menu_data, 65, 102, '\0');
//M2_SPACE(el_2lspace_space, "W1h1");
//M2_VSB(el_2lspace_vsb, "l4W4r1", &el_2lspace_first, &el_2lspace_cnt);
M2_LIST(list_2lspace_strlist) = { &el_2lspace_u8, &el_2lspace_strlist };
M2_VLIST(el_2lspace_hlist, NULL, list_2lspace_strlist);
M2_ALIGN(top_el_spacecb_menu, "-1|1W64H64", &el_2lspace_hlist);

Original comment by olikr...@gmail.com on 17 Nov 2012 at 9:22

GoogleCodeExporter commented 8 years ago
todo: Add documentation

Original comment by olikr...@gmail.com on 17 Nov 2012 at 9:23

GoogleCodeExporter commented 8 years ago
done

Original comment by olikr...@gmail.com on 16 Feb 2013 at 3:11