Пример #1
0
uint8_t m2_eh_4bs(m2_p ep, uint8_t msg, uint8_t arg)
{
  m2_nav_p nav = m2_get_nav(ep);
  switch(msg)
  {
    case M2_EP_MSG_SELECT:
      
      /* if the field has data entry, than increment the data */
      if ( m2_nav_is_data_entry(nav) )
	return m2_nav_data_up(m2_get_nav(ep));
      
      /* else go down: do not use m2_nav_down, instead use m2_nav_user_down to skip design elements */
      return m2_nav_user_down(nav, 1);

    case M2_EP_MSG_EXIT:
      return m2_nav_user_up(m2_get_nav(ep));
      
    case M2_EP_MSG_NEXT:
      return m2_nav_user_next(m2_get_nav(ep));

    case M2_EP_MSG_PREV:
      return m2_nav_user_prev(m2_get_nav(ep));

  }
  return 0;
}
Пример #2
0
uint8_t m2_eh_2bd(m2_p ep, uint8_t msg, uint8_t arg)
{
  m2_nav_p nav = m2_get_nav(ep);
  switch(msg)
  {
    case M2_EP_MSG_SELECT:
      /* if this is data entry mode, switch back */
      if ( nav->is_data_entry_active != 0 )
      {
	nav->is_data_entry_active = 0;
	return 1;
      }
      
      /* data entry mode not active; if we could enter data entry mode, then activate it */
      if ( m2_nav_is_data_entry(nav) )
      {
	nav->is_data_entry_active = 1;
	return 1;
      }
      
      /* go down: do not use m2_nav_down, instead use m2_nav_user_down to skip design elements */
      return m2_nav_user_down(nav, 1);
      
    case M2_EP_MSG_NEXT:
      if ( nav->is_data_entry_active != 0 )
	return m2_nav_data_up(m2_get_nav(ep));
      return m2_nav_user_next(m2_get_nav(ep));
  }
  return 0;
}
Пример #3
0
uint8_t m2_eh_6bs(m2_p ep, uint8_t msg, uint8_t arg1, uint8_t arg2)
{
	(void)arg1; 
	(void)arg2; 
  m2_nav_p nav = m2_get_nav(ep);
  switch(msg)
  {
    case M2_EP_MSG_SELECT:
      
      /* if the field has data entry, than increment the data */
      if ( m2_nav_is_data_entry(nav) )
	return m2_nav_data_up(m2_get_nav(ep));
      
      /* else go down: do not use m2_nav_down, instead use m2_nav_user_down to skip design elements */
      return m2_nav_user_down(nav, 1);

    case M2_EP_MSG_EXIT:
      return m2_nav_user_up(m2_get_nav(ep));
      
    case M2_EP_MSG_NEXT:
      return m2_nav_user_next(m2_get_nav(ep));

    case M2_EP_MSG_PREV:
      return m2_nav_user_prev(m2_get_nav(ep));
    
    case M2_EP_MSG_DATA_DOWN:
	if ( m2_nav_data_down(nav) == 0 )
          return m2_nav_user_next(nav);
        return 1;
    case M2_EP_MSG_DATA_UP:
	if ( m2_nav_data_up(nav) == 0 )
          return m2_nav_user_prev(nav);
        return 1;
  }
  if ( msg >= M2_KEY_Q1 && msg <= M2_KEY_LOOP_END )
  {
    if ( m2_nav_quick_key(nav, msg - M2_KEY_Q1 + 1) != 0 )
    {
      if ( m2_nav_is_data_entry(nav) )
	    return m2_nav_data_up(m2_get_nav(ep));
      return m2_nav_user_down(nav, 1);
    }
  }
  return 0;
}