Exemplo n.º 1
0
void roadmap_foursquare_venues_list (void) {
   static   const char* results[ROADMAP_FOURSQUARE_MAX_VENUE_COUNT];
   static   void*       indexes[ROADMAP_FOURSQUARE_MAX_VENUE_COUNT];
   static   const char* icons[ROADMAP_FOURSQUARE_MAX_VENUE_COUNT];
   int i;

   roadmap_main_remove_periodic(roadmap_foursquare_venues_list);


   for (i = 0; i < gsVenuesCount; i++) {
      results[i] = gsVenuesList[i].sDescription;
#ifdef IPHONE_NATIVE
      indexes[i] = (void*)(i+10);
#else
      indexes[i] = (void*)i;
#endif
      icons[i] = "foursquare_checkin";
   }

#ifdef IPHONE_NATIVE
   roadmap_list_menu_generic(roadmap_lang_get(FOURSQUARE_TITLE),
                             gsVenuesCount,
                             results,
                             (const void **)indexes,
                             icons,
                             NULL,
                             NULL,
                             on_venue_item_selected,
                             NULL,
                             NULL,
                             NULL,
                             60,
                             0,
                             NULL);
#else
   ssd_generic_icon_list_dialog_show(roadmap_lang_get(FOURSQUARE_VENUES_TITLE),
                                       gsVenuesCount,
                                       results,
                                       (const void **)indexes,
                                       icons,
                                       0,
                                       on_venue_item_selected,
                                       NULL,
                                       NULL,
                                       NULL,
                                       NULL,
                                       60,
                                       0,
                                       FALSE);

#endif //IPHONE_NATIVE
}
Exemplo n.º 2
0
void roadmap_car_dialog (RoadMapCallback callback) {

    char **files;
    const char *cursor;
    char **cursor2;
    char *directory;
    int count = 0; 	
    
    static roadmap_car_list_dialog context = {"roadmap_car", NULL};	
   	static char *labels[MAX_CAR_ENTRIES] ;
	static void *values[MAX_CAR_ENTRIES] ;
	static void *icons[MAX_CAR_ENTRIES];


	context.callback = callback;
    for (cursor = roadmap_path_first ("skin");
            cursor != NULL;
            cursor = roadmap_path_next ("skin", cursor)) {

	    directory = roadmap_path_join (cursor, "cars");
    	
    	files = roadmap_path_list (directory, ".png");

   		for (cursor2 = files; *cursor2 != NULL; ++cursor2) {
   	  			labels[count]  =   (char *)roadmap_lang_get(*cursor2);
   	  			values[count] =   strtok(*cursor2,".");
   	  			icons[count]   =   roadmap_path_join("cars", *cursor2);
      			count++;
   		}
   }   

    ssd_generic_icon_list_dialog_show (roadmap_lang_get ("Select your car"),
                  count,
                  (const char **)labels,
                  (const void **)values,
                  (const char **)icons,
                  NULL,
                  roadmap_car_call_back,
                  NULL,
                  &context,
                  NULL,
                  NULL,
                  70,
                  0,
                  FALSE);
                  
}