Example #1
0
/* the exit char is the last child of the text element */
static uint8_t m2_is_exit_char(m2_nav_p nav)
{
  uint8_t len, pos;
  
  /* depth is at least 2, because this is a virtual field of a text entry field */
  pos = nav->pos[nav->depth-2];
  
  /* also, the parent must be the text-element, return the "len" content */
  len = m2_rom_get_u8(m2_nav_get_parent_element(nav), offsetof(m2_el_text_t, len));
  
  /* the text has "len" chars, but the parent has "len+1" children, so "pos" can be from 1 to "len" */
  if ( len == pos )
    return 1;
  
  return 0;
}
Example #2
0
static uint8_t m2_el_combofn_get_len(m2_el_fnarg_p fn_arg)
{
  return m2_rom_get_u8(fn_arg->element, offsetof(m2_el_combofn_t, cnt));
}
Example #3
0
static uint8_t m2_el_text_get_len(m2_el_fnarg_p fn_arg)
{
  return m2_rom_get_u8(fn_arg->element, offsetof(m2_el_text_t, len));
}
Example #4
0
uint8_t m2_el_u8_get_min(m2_el_fnarg_p fn_arg)
{
  return m2_rom_get_u8(fn_arg->element, offsetof(m2_el_u8_t, min));
}
Example #5
0
uint8_t m2_el_2lmenu_get_expanded_char(m2_rom_void_p element)
{
  return m2_rom_get_u8(element, offsetof(m2_el_2lmenu_t, expanded_char));
}
Example #6
0
uint8_t m2_el_2lmenu_get_submenu_char(m2_rom_void_p element)
{
  return m2_rom_get_u8(element, offsetof(m2_el_2lmenu_t, submenu_char));
}