Пример #1
0
void ssd_dialog_refresh_current_softkeys(){
   if( !RoadMapDialogCurrent)
   {
      return;
   }
   hide_softkeys(RoadMapDialogCurrent);
   set_softkeys(RoadMapDialogCurrent);
}
Пример #2
0
static void create_dialog (void) {
   SsdWidget dialog;
   SsdWidget box, driving, space, text;
   char *icon[2];
   int i = 0;
   BOOL checked = FALSE;
   int container_height = 24;
   int tab_flag = SSD_WS_TABSTOP;

#ifdef TOUCH_SCREEN
  container_height = ssd_container_get_row_height();
#endif


   dialog = ssd_dialog_new (PRIVACY_DIALOG, roadmap_lang_get (
            PRIVACY_TITLE), on_close_dialog, SSD_CONTAINER_TITLE);

#ifdef TOUCH_SCREEN
   space = ssd_container_new ("spacer", NULL, SSD_MAX_SIZE, 5, SSD_WIDGET_SPACE
            | SSD_END_ROW);
   ssd_widget_set_color (space, NULL, NULL);
   ssd_widget_add (dialog, space);

#endif
   box = ssd_container_new ("Privacy Heading group", NULL, SSD_MIN_SIZE, SSD_MIN_SIZE,
            SSD_WIDGET_SPACE | SSD_END_ROW);

   text = ssd_text_new ("privacy_heading_label",
         roadmap_lang_get ("Display my location on waze mobile and web maps as follows:"), SSD_HEADER_TEXT_SIZE,
         SSD_TEXT_NORMAL_FONT|SSD_TEXT_LABEL | SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE);
   ssd_text_set_color(text, SSD_CONTAINER_TEXT_COLOR);
   ssd_widget_add (box, text);
   ssd_widget_set_color (box, NULL, NULL);


   ssd_widget_set_color (box, NULL, NULL);

   //////////////////////////////////////////////////
   // * Driving
   //////////////////////////////////////////////////
   driving = ssd_container_new ("Report privacy", NULL, ssd_container_get_width(),
            SSD_MIN_SIZE, SSD_WIDGET_SPACE | SSD_CONTAINER_FLAGS | SSD_POINTER_NONE
                     | SSD_CONTAINER_BORDER | SSD_ALIGN_CENTER);
   ssd_widget_add (driving, box);
   box = ssd_container_new ("Driving Heading group", NULL, SSD_MIN_SIZE, SSD_MIN_SIZE,
            SSD_WIDGET_SPACE | SSD_END_ROW);

   text = ssd_text_new ("driving_heading_label",
         roadmap_lang_get ("When driving"), SSD_HEADER_TEXT_SIZE, SSD_TEXT_NORMAL_FONT|SSD_TEXT_LABEL
                  | SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_text_set_color(text, SSD_CONTAINER_TEXT_COLOR);
   ssd_widget_add (box, text);

   ssd_widget_add (box, ssd_separator_new ("separator", SSD_ALIGN_BOTTOM));
   ssd_widget_set_color (box, NULL, NULL);
   ssd_widget_add (driving, box);

   //////////////////////////////////////////////////
   // * Nickname
   //////////////////////////////////////////////////
   box = ssd_container_new ("Nickname group", NULL, SSD_MAX_SIZE,
                  container_height, SSD_WIDGET_SPACE | SSD_END_ROW | tab_flag);

   if (gState == VisGrp_NickName)
      checked = TRUE;
   else
      checked = FALSE;

   CheckboxDriving[i] = ssd_checkbox_new (RT_CFG_PRM_VISGRP_Nickname, checked,
            SSD_ALIGN_VCENTER | SSD_ALIGN_RIGHT, checkbox_callback, NULL, NULL,
            CHECKBOX_STYLE_V);
   ssd_widget_add (box, CheckboxDriving[i]);
   i++;

   icon[0] = "privacy_nickname";
   icon[1] = NULL;

   ssd_widget_add (box, ssd_button_new ("privacy_nickname", "privacy_nickname",
            (const char **) &icon[0], 1, SSD_ALIGN_VCENTER, NULL));
   ssd_widget_set_color (box, NULL, NULL);

   text = ssd_text_new ("Nickname", roadmap_lang_get (
         "Nickname"), SSD_MAIN_TEXT_SIZE, SSD_TEXT_NORMAL_FONT | SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE);
   ssd_text_set_color(text, SSD_CONTAINER_TEXT_COLOR);
   ssd_widget_add (box, text);

   ssd_widget_add (box, ssd_bitmap_new ("On_map_nickname", "On_map_nickname",
            SSD_ALIGN_VCENTER));

   ssd_widget_add (driving, box);
   ssd_widget_add (driving, ssd_separator_new ("separator", SSD_END_ROW));

   //////////////////////////////////////////////////
   // * Anonymous
   //////////////////////////////////////////////////
   box = ssd_container_new ("Anonymous group", NULL, SSD_MAX_SIZE,
                  container_height, SSD_WIDGET_SPACE | SSD_END_ROW | tab_flag);

   if (gState == VisGrp_Anonymous)
      checked = TRUE;
   else
      checked = FALSE;

   CheckboxDriving[i] = ssd_checkbox_new (RT_CFG_PRM_VISGRP_Anonymous, checked,
            SSD_ALIGN_VCENTER | SSD_ALIGN_RIGHT, checkbox_callback, NULL, NULL,
            CHECKBOX_STYLE_V);
   ssd_widget_add (box, CheckboxDriving[i]);
   i++;
   icon[0] = "privacy_anonymous";
   icon[1] = NULL;

   ssd_widget_add (box, ssd_button_new ("privacy_anonymous",
            "privacy_anonymous", (const char **) &icon[0], 1,
            SSD_ALIGN_VCENTER, NULL));

   text = ssd_text_new ("Anonymous text", roadmap_lang_get (
         "Anonymous"), SSD_MAIN_TEXT_SIZE, SSD_TEXT_NORMAL_FONT | SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE);
   ssd_text_set_color(text, SSD_CONTAINER_TEXT_COLOR);
   ssd_widget_add (box, text);
   ssd_widget_add (box, ssd_bitmap_new ("On_map_anonymous", "On_map_anonymous",
            SSD_ALIGN_VCENTER));

   ssd_widget_set_color (box, NULL, NULL);
   ssd_widget_add (driving, box);
   /*
   //////////////////////////////////////////////////
   // * Invisible
   //////////////////////////////////////////////////

   box = ssd_container_new ("Invisible Group", NULL, SSD_MAX_SIZE,
                  container_height, SSD_WIDGET_SPACE | SSD_END_ROW | tab_flag);
   if (gState == VisGrp_Invisible)
      checked = TRUE;
   else
      checked = FALSE;

   CheckboxDriving[i] = ssd_checkbox_new (RT_CFG_PRM_VISGRP_Invisible, checked,
            SSD_ALIGN_VCENTER, checkbox_callback, NULL, NULL,
            CHECKBOX_STYLE_ROUNDED);
   ssd_widget_add (box, CheckboxDriving[i]);
   i++;
   icon[0] = "privacy_invisible";
   icon[1] = NULL;

   ssd_widget_add (box, ssd_button_new ("privacy_invisible",
            "privacy_invisible", (const char **) &icon[0], 1,
            SSD_ALIGN_VCENTER, NULL));
   ssd_widget_add (box, ssd_text_new ("Invisible Text", roadmap_lang_get (
            "Don't show me"), 14, SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE
            | SSD_END_ROW));

   ssd_widget_set_color (box, NULL, NULL);
   ssd_widget_add (driving, box);
*/
   ssd_widget_add (dialog, driving);
/*
   //////////////////////////////////////////////////
   // * Report
   //////////////////////////////////////////////////

   report = ssd_container_new ("Report privacy", NULL, SSD_MIN_SIZE,
            SSD_MIN_SIZE, SSD_START_NEW_ROW | SSD_WIDGET_SPACE | SSD_END_ROW
                     | SSD_ROUNDED_CORNERS | SSD_ROUNDED_WHITE
                     | SSD_POINTER_NONE | SSD_CONTAINER_BORDER);

   box = ssd_container_new ("Reporting Heading group", NULL, SSD_MIN_SIZE,
                  container_height, SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_add (box, ssd_text_new ("reporting_heading_label",
            roadmap_lang_get ("When reporting"), 14, SSD_TEXT_LABEL
                     | SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE | SSD_END_ROW));

   ssd_widget_add (box, ssd_separator_new ("separator", SSD_ALIGN_BOTTOM));
   ssd_widget_set_color (box, NULL, NULL);
   ssd_widget_add (report, box);

   i = 0;
   //////////////////////////////////////////////////
   // * Report Nickname
   //////////////////////////////////////////////////
   box = ssd_container_new ("Report Nickname Group", NULL, SSD_MIN_SIZE,
                  container_height, SSD_WIDGET_SPACE | SSD_END_ROW | tab_flag);
   if (gReportState == VisRep_NickName)
      checked = TRUE;
   else
      checked = FALSE;

   CheckboxReporting[i] = ssd_checkbox_new (RT_CFG_PRM_VISREP_Nickname,
            checked, SSD_ALIGN_VCENTER, rep_checkbox_callback, NULL, NULL,
            CHECKBOX_STYLE_ROUNDED);
   ssd_widget_add (box, CheckboxReporting[i]);
   i++;

   space = ssd_container_new ("spacer1", NULL, 10, 14, 0);
   ssd_widget_set_color (space, NULL, NULL);
   ssd_widget_add (box, space);

   ssd_widget_add (box, ssd_text_new ("Report Nickname", roadmap_lang_get (
            "Nickname"), 14, SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE
            | SSD_END_ROW));

   ssd_widget_add (box, ssd_separator_new ("separator", SSD_ALIGN_BOTTOM));
   ssd_widget_set_color (box, NULL, NULL);
   ssd_widget_add (report, box);

   //////////////////////////////////////////////////
   // * Report Anonymous
   //////////////////////////////////////////////////
   box = ssd_container_new ("Report Anonymous Group", NULL, SSD_MAX_SIZE,
                  container_height, SSD_WIDGET_SPACE | SSD_END_ROW | tab_flag);
   if (gReportState == VisRep_Anonymous)
      checked = TRUE;
   else
      checked = FALSE;

   CheckboxReporting[i] = ssd_checkbox_new (RT_CFG_PRM_VISREP_Anonymous,
            checked, SSD_ALIGN_VCENTER, rep_checkbox_callback, NULL, NULL,
            CHECKBOX_STYLE_ROUNDED);
   ssd_widget_add (box, CheckboxReporting[i]);
   i++;

   space = ssd_container_new ("spacer1", NULL, 10, 14, 0);
   ssd_widget_set_color (space, NULL, NULL);
   ssd_widget_add (box, space);

   ssd_widget_add (box, ssd_text_new ("Report Anonymous", roadmap_lang_get (
            "Anonymous"), 14, SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE));

   ssd_widget_set_color (box, NULL, NULL);
   ssd_widget_add (report, box);

   ssd_widget_add (dialog, report);
   */
#ifndef TOUCH_SCREEN
   set_softkeys(dialog);
#endif
}
Пример #3
0
SsdWidget ssd_dialog_activate (const char *name, void *context) {

   SsdDialog   prev     = NULL;
   SsdDialog   current  = RoadMapDialogCurrent;
   SsdDialog   dialog   = ssd_dialog_get (name);

   if (!dialog) {
      return NULL; /* Tell the caller this is a new, undefined, dialog. */
   }

   while (current && strcmp(current->name, name)) {
      prev = current;
      current = current->activated_prev;
   }

   if (current) {
      if (prev) {
         prev->activated_prev = current->activated_prev;
         current->activated_prev = RoadMapDialogCurrent;
         RoadMapDialogCurrent = current;
      }
      return current->container;
   }

   dialog->context = context;

   dialog->activated_prev = RoadMapDialogCurrent;

   if (!RoadMapDialogCurrent) {
      roadmap_keyboard_register_to_event__key_pressed( OnKeyPressed);
      /* Grab pointer hooks */
      roadmap_pointer_register_pressed
         (ssd_dialog_pressed, POINTER_HIGHEST);
      roadmap_pointer_register_released
         (ssd_dialog_released, POINTER_HIGHEST);
      roadmap_pointer_register_short_click
         (ssd_dialog_short_click, POINTER_HIGHEST);
      roadmap_pointer_register_long_click
         (ssd_dialog_long_click, POINTER_HIGHEST);

      roadmap_pointer_register_drag_start
                (&ssd_dialog_drag_start,POINTER_HIGHEST );

       roadmap_pointer_register_drag_end
                (&ssd_dialog_drag_end,POINTER_HIGHEST);

       roadmap_pointer_register_drag_motion
                (&ssd_dialog_drag_motion,POINTER_HIGHEST);
   }

   RoadMapDialogCurrent = dialog;
   set_softkeys(dialog);


   if( SSD_TAB_CONTROL & RoadMapDialogCurrent->container->flags)
      ssd_dialog_invalidate_tab_order();

   // Sort tab-order:
   ssd_dialog_sort_tab_order( dialog);
   dialog->stop_offset = 0;
   if (dialog->scroll_container != NULL)
      ssd_widget_set_offset(dialog->scroll_container,0,0);
   // Reset focus
#ifdef TOUCH_SCREEN
   ssd_dialog_set_dialog_focus(dialog, NULL);
#else
   ssd_dialog_set_dialog_focus(dialog, dialog->in_focus_default);
#endif

   if (!RoadMapScreenFrozen &&
   !(dialog->container->flags & (SSD_DIALOG_FLOAT|  SSD_DIALOG_TRANSPARENT))) {
      roadmap_start_screen_refresh (0);
      RoadMapScreenFrozen = 1;
   }

   ssd_dialog_disable_key ();

   ssd_dialog_handle_native_kb( dialog );

   return dialog->container; /* Tell the caller the dialog already exists. */
}