Beispiel #1
0
// Tab-Order:  Force a re-sort, even if was already sorted
void ssd_dialog_resort_tab_order()
{
   SsdDialog dialog = RoadMapDialogCurrent;
   SsdWidget in_focus;
   SsdWidget in_focus_def;
   BOOL      focus_set = FALSE;

   if( !dialog)
      return;

   in_focus    = dialog->in_focus;
   in_focus_def= dialog->in_focus_default;

   ssd_dialog_invalidate_tab_order();
   draw_dialog(RoadMapDialogCurrent);

   if( in_focus_def && ssd_dialog_set_focus( in_focus_def))
   {
      dialog->in_focus_default= in_focus_def;
      dialog->in_focus        = in_focus_def;
      focus_set               = TRUE;
   }

   if( in_focus && ssd_dialog_set_focus( in_focus))
      focus_set = TRUE;

   if( focus_set)
      draw_dialog(RoadMapDialogCurrent);

   roadmap_canvas_refresh ();
}
Beispiel #2
0
static void move_down(){
   menu_list_data *data;
   int i;
   //div_t n;
   int relative_index;

   data = (menu_list_data *)   ssd_dialog_get_current_data();

   //n = div (data->CurrentIndex, data->num_rows);
   relative_index = data->CurrentIndex % data->num_rows;

      if (((data->CurrentIndex == data->num_rows -1) || (relative_index == data->num_rows -1) || (data->CurrentIndex == data->num_items -1)) && (data->num_items > data->num_rows)){
          int index;

         for (i=0; i<data->num_items;i++)
               ssd_widget_hide(data->MenuWidgets[i]);

         if (data->CurrentIndex == data->num_items -1)
            index = 0;
         else
            index = data->CurrentIndex +1;

         for (i=index; i<index+data->num_rows;i++)
            if (i < data->num_items)
               ssd_widget_show(data->MenuWidgets[i]);
      }

      if (data->CurrentIndex < data->num_items-1)
         data->CurrentIndex++;
      else
         data->CurrentIndex = 0;

      ssd_dialog_resort_tab_order();
      ssd_dialog_set_focus(ssd_widget_get(data->MenuWidgets[data->CurrentIndex],"button"));
}
Beispiel #3
0
static void move_up(){
      menu_list_data *data;
      int i;
      int n_quot;
   	int relative_index;

      data = (menu_list_data *)   ssd_dialog_get_current_data();
      n_quot = data->CurrentIndex / data->num_rows;
      relative_index = data->CurrentIndex % data->num_rows;

      if (((data->CurrentIndex == 0) || (relative_index == 0) || (data->CurrentIndex == data->num_rows )) && (data->num_items > data->num_rows)){
          int index;

         for (i=0; i<data->num_items;i++)
            ssd_widget_hide(data->MenuWidgets[i]);

         if (relative_index == 0)
         	if (n_quot == 0){
         		//div_t n2;
         		int n2_rem = data->num_items % data->num_rows;
         		int n2_quot = data->num_items / data->num_rows;
         		if (n2_rem == 0)
         			index = (n2_quot -1) * data->num_rows;
         		else
         			index = n2_quot * data->num_rows ;
         	}
         	else
         		index = (n_quot -1) * data->num_rows;
         else
            index =0;

         for (i=index; i<index+data->num_rows;i++)
            if (i < data->num_items)
               ssd_widget_show(data->MenuWidgets[i]);
      }


      if (data->CurrentIndex > 0)
         data->CurrentIndex--;
      else
         data->CurrentIndex = data->num_items -1;

      ssd_dialog_resort_tab_order();
      ssd_dialog_set_focus(ssd_widget_get(data->MenuWidgets[data->CurrentIndex],"button"));

}
Beispiel #4
0
static int roadmap_exclusive_mood_call_back (SsdWidget widget, const char *new_value, const void *value) {

   RoadMapCallback cb = (RoadMapCallback)widget->parent->context;
   int iMood = roadmap_mood_from_string( value);

   if ( (iMood <= Mood_Gold) && (iMood >= Mood_Bronze) && (iMood - Mood_Bronze) > roadmap_mood_get_exclusive_moods() -1) {
      ssd_dialog_set_focus(NULL);
      ssd_dialog_draw();

      return 0;
   }
   roadmap_analytics_log_event(ANALYTICS_EVENT_MOOD, ANALYTICS_EVENT_INFO_CHANGED_TO, value);

   roadmap_mood_set(value);
   ssd_dialog_hide ( "MoodDlg", dec_close );

   if (cb)
         (*cb)();

   return 1;
}
Beispiel #5
0
static void move_to_start(){
	  menu_list_data *data;
	  int i;
	  int num_items;

	  data = (menu_list_data *)	ssd_dialog_get_current_data();

	  for (i=0; i<data->num_items;i++)
         ssd_widget_hide(data->MenuWidgets[i]);


     if (data->num_items < data->num_rows)
     	num_items = data->num_items;
     else
     	num_items = data->num_rows;
     for (i=0; i<num_items;i++)
         		ssd_widget_show(data->MenuWidgets[i]);
	  ssd_dialog_resort_tab_order();
	  ssd_dialog_set_focus(ssd_widget_get(data->MenuWidgets[0],"button"));
	  data->CurrentIndex = 0;
}