void ssd_generic_icon_list_dialog_show(
                                  const char*            title,
                                  int                    count,
                                  const char**           labels,
                                  const void**           values,
                                  const char**           icons,
                                  const int*             flags,
                                  PFN_ON_ITEM_SELECTED   on_item_selected,
                                  PFN_ON_ITEM_SELECTED   on_item_deleted,
                                  void*                  context,
                                  const char*            left_softkey_text,
                                  SsdSoftKeyCallback     left_softkey_callback,
                                  int                    list_height,
                                  int                    dialog_flags,
                                  BOOL                   add_next_button)
{
   static SsdListContext list_context;

   SsdWidget list;
   int list_flags = 0;

#if defined (OPENGL)

   /*
    * Borders are fast in OPENGL
    */
   list_flags |= SSD_ALIGN_CENTER|SSD_CONTAINER_BORDER|SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE;
#endif // OPENGL

   list_context.on_item_selected= on_item_selected;
   list_context.on_item_deleted = on_item_deleted;
   list_context.context         = context;
   list_context.left_softkey_callback = left_softkey_callback;
   if ( !ssd_dialog_exists( SSD_GEN_LIST_DLG_NAME ) )
   {
      GenericList   = ssd_dialog_new ( SSD_GEN_LIST_DLG_NAME, "", on_dialog_closed, SSD_CONTAINER_TITLE|dialog_flags);
      list          = ssd_list_new ("list", SSD_MAX_SIZE, SSD_MAX_SIZE, inputtype_none, 0, NULL);
      ssd_widget_add (GenericList, list);
   }
   else{
     GenericList->flags &= ~SSD_HEADER_BLACK;
     GenericList->flags |= dialog_flags;
   }
   ssd_widget_set_offset(GenericList,0,0);
   list = ssd_widget_get (GenericList, "list");

   GenericList->set_value (GenericList->parent, title);
   ssd_widget_set_context (GenericList, &list_context);


   ssd_widget_reset_cache (list->parent);
   ssd_widget_reset_position(GenericList);
   ssd_list_resize ( list, list_height );
   ssd_list_populate (list, count, labels, values,icons,flags, list_callback, del_callback, add_next_button);
   ssd_widget_set_left_softkey_text(GenericList, left_softkey_text);
   if (left_softkey_callback != NULL)
      ssd_widget_set_left_softkey_callback(GenericList, list_left_softkey_callback);
   ssd_dialog_activate (SSD_GEN_LIST_DLG_NAME, NULL);
   ssd_dialog_draw();
}
Example #2
0
void ssd_generic_list_dialog_show(const char*            title,
                                  int                    count,
                                  const char**           labels,
                                  const void**           values,
                                  PFN_ON_ITEM_SELECTED   on_item_selected,
                                  PFN_ON_ITEM_SELECTED   on_item_deleted,
                                  void*                  context,
                                  int                     list_height )
{
   static SsdListContext list_context;

   SsdWidget list;
   int flags = 0;

#if defined (OPENGL)

   /*
    * Borders are fast in OPENGL
    */
   flags |= SSD_ALIGN_CENTER|SSD_CONTAINER_BORDER|SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE;
#endif // OPENGL

   list_context.on_item_selected= on_item_selected;
   list_context.on_item_deleted = on_item_deleted;
   list_context.context         = context;
   list_context.left_softkey_callback = NULL;

   if (!GenericList)
   {
      GenericList = ssd_dialog_new ( SSD_GEN_LIST_DLG_NAME, "", on_dialog_closed,
                                    SSD_CONTAINER_TITLE);
      ssd_dialog_add_vspace (GenericList, 5, 0);
      list = ssd_list_new ("list", ssd_container_get_width(), SSD_MAX_SIZE, inputtype_none, flags, NULL);

      ssd_widget_add (GenericList, list);
   }

   list = ssd_widget_get (GenericList, "list");
   ssd_widget_set_offset(GenericList,0,0);

   ssd_widget_set_left_softkey_text(GenericList, roadmap_lang_get("Exit_key"));
   ssd_widget_set_left_softkey_callback(GenericList, NULL);

   GenericList->set_value (GenericList->parent, title);
   ssd_widget_set_context (GenericList, &list_context);

   ssd_widget_reset_cache (list->parent);
   ssd_widget_reset_position(GenericList);
   ssd_list_resize ( list, list_height );
   ssd_list_populate (list, count, labels, values, NULL, NULL, list_callback, del_callback, FALSE);
   ssd_dialog_activate ( SSD_GEN_LIST_DLG_NAME, NULL );
   ssd_dialog_draw();
 }
Example #3
0
void ssd_dialog_reset_offset(){
   SsdDialog dialog = RoadMapDialogCurrent;
   if( !dialog)
      return;

   if (!dialog->scroll_container)
      return;

   ssd_widget_set_offset(dialog->scroll_container, 0,0);
   ssd_widget_reset_cache(dialog->scroll_container);
   ssd_widget_reset_position(dialog->scroll_container);
}
Example #4
0
void ssd_widget_reset_position (SsdWidget w) {

   SsdWidget child = w->children;

   w->position.x = -1;
   w->position.y = -1;

   while (child != NULL) {

      ssd_widget_reset_position (child);
      child = child->next;
   }
}