Esempio n. 1
0
static int on_options(SsdWidget widget, const char *new_value, void *context)
{
   int menu_x;

   if(g_context_menu_is_active)
   {
      ssd_dialog_hide_current(dec_ok);
      g_context_menu_is_active = FALSE;
   }

   if (ssd_widget_rtl (NULL))
   menu_x = SSD_X_SCREEN_RIGHT;
   else
   menu_x = SSD_X_SCREEN_LEFT;

   ssd_context_menu_show( menu_x, // X
            SSD_Y_SCREEN_BOTTOM, // Y
            &context_menu,
            on_option_selected,
            NULL,
            dir_default,
            0,
            TRUE);

   g_context_menu_is_active = TRUE;

   return 0;
}
int on_options(SsdWidget widget, const char *new_value, void *context)
{
   int menu_x;
   BOOL add_cancel = TRUE;
   BOOL b_report_wrong_address = ( get_selected_list_item()== COULDNT_FIND_INDEX ) ;
#ifdef TOUCH_SCREEN
   roadmap_screen_refresh();
#endif

   assert( !s_menu);

   if  (ssd_widget_rtl (NULL))
	   menu_x = SSD_X_SCREEN_RIGHT;
	else
		menu_x = SSD_X_SCREEN_LEFT;

   ssd_contextmenu_show_item( &context_menu,
                              cm_navigate,
                              !generic_search_dlg_is_1st(search_address)&&(!b_report_wrong_address),
                              FALSE);
   ssd_contextmenu_show_item( &context_menu,
                              cm_show,
                              !generic_search_dlg_is_1st(search_address)&&(!b_report_wrong_address),
                              FALSE);
   ssd_contextmenu_show_item( &context_menu,
                              cm_add_to_favorites,

                              !generic_search_dlg_is_1st(search_address)&&(!b_report_wrong_address),
                              FALSE);

   ssd_contextmenu_show_item( &context_menu,
                              cm_send,
                              b_report_wrong_address,
                              FALSE);

   ssd_contextmenu_show_item( &context_menu,
                              cm_cancel,
                              add_cancel,
                              FALSE);

   ssd_context_menu_show(  menu_x,              // X
                           SSD_Y_SCREEN_BOTTOM, // Y
                           &context_menu,
                           on_option_selected,
                           NULL,
                           dir_default,
                           0);


   s_menu = TRUE;

   return 0;
}