Пример #1
0
static SsdWidget create_close_button(){
   char *icons[3];
   SsdWidget button;
   icons[0] = "GeoReminderButtonUp";
   icons[1] = "GeoReminderButtonDown";
   icons[2] = NULL;
   button = ssd_button_label_custom("Close_button", roadmap_lang_get("Close"), SSD_WS_DEFWIDGET|SSD_WS_TABSTOP|SSD_ALIGN_CENTER|SSD_ALIGN_BOTTOM, on_close, (const char**) &icons[0], "#ab5939", "#fff88d");
   ssd_widget_set_offset(button, 0, -20);
   return button;
}
Пример #2
0
/////////////////////////////////////////////////////////////////////
// Twitter
/////////////////////////////////////////////////////////////////////
void welcome_wizard_twitter_dialog(void){
   SsdWidget dialog;
   SsdWidget group, box, label, label_cnt;
   SsdWidget group_title, text;
   SsdWidget bitmap, button;
   const char* icons[3];

   dialog = ssd_dialog_new( WELCOME_WIZ_DLG_TWITTER_NAME, roadmap_lang_get( WELCOME_WIZ_DLG_TWITTER_TITLE ), NULL, SSD_CONTAINER_TITLE|SSD_DIALOG_NO_SCROLL );

   // Space before white container
   ssd_dialog_add_vspace( dialog, ADJ_SCALE( 3 ), 0 );

   box = ssd_container_new ( "Sign Up Box", NULL, SSD_MAX_SIZE,
         SSD_MIN_SIZE, SSD_END_ROW | SSD_ALIGN_CENTER | SSD_CONTAINER_BORDER | SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE|SSD_WIDGET_SPACE );

   // Space inside white container
   ssd_dialog_add_vspace( box, ADJ_SCALE( 1 ), 0 );

   // Twitter title
   group = ssd_container_new ( "Twitter title group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE, SSD_END_ROW );
   ssd_dialog_add_hspace( group, ADJ_SCALE( WELCOME_WIZ_DLG_HOFFSET ), SSD_ALIGN_VCENTER );
   bitmap = ssd_bitmap_new( "Twitter logo","welcome_twitter", SSD_ALIGN_VCENTER);
   ssd_widget_add( group, bitmap );
   ssd_dialog_add_hspace( group, ADJ_SCALE( 15 ), SSD_ALIGN_VCENTER );
   group_title = ssd_text_new( "Twitter", roadmap_lang_get( "Twitter" ), 15, SSD_TEXT_LABEL );
   ssd_text_set_color( group_title, "#202020" );
   ssd_widget_add( group, group_title );

   ssd_widget_add( box, group );

   // Tweeter explanation text
   ssd_dialog_add_vspace( box, ADJ_SCALE( 16 ), 0 );
   group = ssd_container_new ( "Twitter text", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE, SSD_END_ROW );
   ssd_dialog_add_hspace( group, ADJ_SCALE( 5 ), SSD_ALIGN_VCENTER );
   label = ssd_text_new( "Label", roadmap_lang_get ( "Tweet your road reports" ), WELCOME_WIZ_DLG_LBL_FONT,
                                                            SSD_TEXT_LABEL | SSD_ALIGN_VCENTER | SSD_TEXT_NORMAL_FONT );
   ssd_text_set_color( label, WELCOME_WIZ_DLG_LBL_COLOR );
   ssd_widget_add( group, label );

   ssd_widget_add( box, group );

   // Username
   ssd_dialog_add_vspace( box, ADJ_SCALE( 14 ), 0 );
   group = get_welcome_wiz_entry_group( "Username", "TwitterUserName", "Username" );
   ssd_widget_add( box, group );

   // Password
   ssd_dialog_add_vspace( box, ADJ_SCALE( 10 ), 0 );
   group = get_welcome_wiz_entry_group( "Password", "TwitterPassword", "Password" );
   ssd_widget_add( box, group );

   // Tweet checkout waze
   ssd_dialog_add_vspace( box, ADJ_SCALE( 4 ), 0 );
   group = ssd_container_new ("Tweet checkout group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE, SSD_END_ROW | SSD_WS_TABSTOP );
   ssd_widget_set_color ( group, NULL, NULL );
   ssd_dialog_add_hspace( group, ADJ_SCALE( WELCOME_WIZ_DLG_HOFFSET ), 0 );
   ssd_widget_add( group, ssd_checkbox_new ( WELCOME_WIZ_DLG_TWITTER_SET_SIGNUP, TRUE,  0, NULL, NULL, NULL, CHECKBOX_STYLE_DEFAULT ) );
   label_cnt = ssd_container_new ( "Label container", NULL, SSD_MIN_SIZE, SSD_MIN_SIZE, SSD_ALIGN_VCENTER );
   ssd_widget_set_color ( label_cnt, NULL, NULL );
   ssd_dialog_add_hspace( label_cnt, ADJ_SCALE( 10 ), 0 );
   label = ssd_text_new ("Label", roadmap_lang_get ( "Tweet that I'm checking-out waze"), WELCOME_WIZ_DLG_LBL_FONT,
                                                               SSD_TEXT_NORMAL_FONT|SSD_TEXT_LABEL|SSD_ALIGN_VCENTER );
   ssd_text_set_color( label, WELCOME_WIZ_DLG_LBL_COLOR );
   ssd_widget_add ( label_cnt, label );
   ssd_widget_add ( group, label_cnt );
   ssd_widget_add ( box, group);

   ssd_dialog_add_vspace( box, ADJ_SCALE( 10 ), 0 );

#ifdef TOUCH_SCREEN

    icons[0] = "welcome_btn";
    icons[1] = "welcome_btn_h";
    icons[2] = NULL;
    // Preload image to get dimensions
    group = ssd_container_new ( "Buttons group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE, SSD_ALIGN_CENTER | SSD_END_ROW );
    button = ssd_button_label_custom( "Skip", roadmap_lang_get ("Skip"), SSD_ALIGN_CENTER | SSD_ALIGN_VCENTER, twitter_button_callback,
          icons, 2, "#FFFFFF", "#FFFFFF",14 );
    text = ssd_widget_get( button, "label" );
    text->flags |= SSD_TEXT_NORMAL_FONT;
    ssd_text_set_font_size( text, 15 );
    ssd_widget_add ( group, button );
    ssd_dialog_add_hspace( group, ADJ_SCALE( 10 ), SSD_ALIGN_CENTER | SSD_ALIGN_VCENTER );

    // Skip button

    button = ssd_button_label_custom( "Next", roadmap_lang_get ("Next"), SSD_ALIGN_CENTER | SSD_ALIGN_VCENTER, twitter_button_callback,
          icons, 2, "#FFFFFF", "#FFFFFF",14 );
    text = ssd_widget_get( button, "label" );
    text->flags |= SSD_TEXT_NORMAL_FONT;
    ssd_text_set_font_size( text, 15 );
    ssd_widget_add ( group, button );

    ssd_widget_add ( box, group );

    ssd_dialog_add_vspace( box, ADJ_SCALE( 6 ), 0 );
#else
    ssd_widget_set_left_softkey_text       ( dialog, roadmap_lang_get("Next"));
    ssd_widget_set_left_softkey_callback   ( dialog, on_softkey_next_twitter);
#endif

   ssd_widget_add ( dialog, box );

   ssd_dialog_activate( WELCOME_WIZ_DLG_TWITTER_NAME, NULL );
   ssd_dialog_draw();

}
Пример #3
0
/////////////////////////////////////////////////////////////////////
// Ping
/////////////////////////////////////////////////////////////////////
void welcome_wizard_ping_dialog(void){
   SsdWidget dialog;
   SsdWidget group, box, label, label_cnt;
   SsdWidget group_title, text;
   SsdWidget button;
   const char* icons[3];
   char str[512];

   dialog = ssd_dialog_new( WELCOME_WIZ_DLG_PING_NAME, roadmap_lang_get( WELCOME_WIZ_DLG_PING_TITLE ), NULL,
                                                            SSD_CONTAINER_TITLE|SSD_DIALOG_NO_SCROLL );

   box = ssd_container_new ( "Ping Box", NULL, SSD_MAX_SIZE,
         SSD_MIN_SIZE, SSD_END_ROW | SSD_ALIGN_CENTER | SSD_CONTAINER_BORDER | SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE|SSD_WIDGET_SPACE );

   // Space inside white container
   ssd_dialog_add_vspace( box, ADJ_SCALE( 1 ), 0 );

   // Ping title
   group = ssd_container_new ( "Ping title group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE, SSD_END_ROW );
   ssd_dialog_add_hspace( group, ADJ_SCALE( WELCOME_WIZ_DLG_PING_HOFFSET ), SSD_ALIGN_VCENTER );

   group_title = ssd_text_new( "Ping", roadmap_lang_get( "Ping" ), 15, SSD_TEXT_LABEL );
   ssd_text_set_color( group_title, "#202020" );
   ssd_widget_add( group, group_title );
   ssd_widget_add( box, group );

   // Ping explanation text
   ssd_dialog_add_vspace( box, ADJ_SCALE( 16 ), 0 );

   snprintf( str, sizeof(str), "%s\n%s",
             roadmap_lang_get("Allow wazers to ping you."),
             roadmap_lang_get("It's useful, fun and you can always turn it off."));

   group = ssd_container_new ( "Ping text", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE, SSD_END_ROW );

   ssd_dialog_add_hspace( group, ADJ_SCALE( WELCOME_WIZ_DLG_PING_HOFFSET ), SSD_ALIGN_VCENTER );

   label_cnt = ssd_container_new ( "Label container", NULL, WELCOME_WIZ_DLG_PING_TEXT_WIDTH, SSD_MIN_SIZE, SSD_END_ROW );

   label = ssd_text_new( "Label", str, WELCOME_WIZ_DLG_LBL_FONT,
                                                            SSD_TEXT_LABEL | SSD_TEXT_NORMAL_FONT );
   ssd_text_set_color( label, WELCOME_WIZ_DLG_LBL_COLOR );

   ssd_widget_add( label_cnt, label );
   ssd_widget_add( group, label_cnt );

   ssd_widget_add( box, group );

   ssd_dialog_add_vspace( box, ADJ_SCALE( 34 ), 0 );

   // Ping checkbox
   group = ssd_container_new ("Ping agree group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE, SSD_END_ROW | SSD_WS_TABSTOP );
   ssd_widget_set_color ( group, NULL, NULL );
   ssd_dialog_add_hspace( group, ADJ_SCALE( WELCOME_WIZ_DLG_PING_HOFFSET ), 0 );
   ssd_widget_add( group, ssd_checkbox_new ( WELCOME_WIZ_DLG_PING_AGREE, TRUE,  0, NULL, NULL, NULL, CHECKBOX_STYLE_DEFAULT ) );
   label_cnt = ssd_container_new ( "Label container", NULL, SSD_MIN_SIZE, SSD_MIN_SIZE, SSD_ALIGN_VCENTER );
   ssd_widget_set_color ( label_cnt, NULL, NULL );
   ssd_dialog_add_hspace( label_cnt, ADJ_SCALE( 10 ), 0 );
   label = ssd_text_new ("Label", roadmap_lang_get( "I agree to be pinged" ), WELCOME_WIZ_DLG_LBL_FONT,
                                                               SSD_TEXT_NORMAL_FONT|SSD_TEXT_LABEL|SSD_ALIGN_VCENTER );
   ssd_text_set_color( label, WELCOME_WIZ_DLG_LBL_COLOR );
   ssd_widget_add ( label_cnt, label );
   ssd_widget_add ( group, label_cnt );
   ssd_widget_add ( box, group);


#ifdef TOUCH_SCREEN

    // Next button
    ssd_dialog_add_vspace( box, ADJ_SCALE( 8 ), 0 );

    icons[0] = "welcome_btn";
    icons[1] = "welcome_btn_h";
    icons[2] = NULL;
    group = ssd_container_new ( "Buttons group", NULL, ssd_container_get_width()*0.9, SSD_MIN_SIZE, SSD_ALIGN_CENTER | SSD_END_ROW );

    button = ssd_button_label_custom( "Next", roadmap_lang_get ("Next"), SSD_ALIGN_RIGHT | SSD_ALIGN_VCENTER, ping_button_callback,
          icons, 2, "#FFFFFF", "#FFFFFF",14 );
    text = ssd_widget_get( button, "label" );
    text->flags |= SSD_TEXT_NORMAL_FONT;
    ssd_text_set_font_size( text, 15 );
    ssd_widget_add ( group, button );

    ssd_widget_add ( box, group );

#else
    ssd_widget_set_left_softkey_text       ( dialog, roadmap_lang_get("Next"));
    ssd_widget_set_left_softkey_callback   ( dialog, on_softkey_next_ping );
#endif

    ssd_dialog_add_vspace( box, ADJ_SCALE( 12 ), 0 );

    ssd_widget_add ( dialog, box );

    ssd_dialog_activate( WELCOME_WIZ_DLG_PING_NAME, NULL );
    ssd_dialog_draw();
}
Пример #4
0
/////////////////////////////////////////////////////////////////////
// Way to go dialog
/////////////////////////////////////////////////////////////////////
void welcome_wizard_way_to_go( void )
{
   SsdWidget dialog;
   SsdWidget group, box;
   SsdWidget group_title, text;
   SsdWidget button, separator, way_to_go_bmp;
   const char* explanation_text;
   const char* icons[3];
#define WAY_TO_GO_TEXT_1_WIDTH   225
#define WAY_TO_GO_TEXT_2_WIDTH   290
   dialog = ssd_dialog_new( WELCOME_WIZ_DLG_WAY_TO_GO_NAME, roadmap_lang_get( WELCOME_WIZ_DLG_WAY_TO_GO_TITLE ), NULL,
                                                            SSD_CONTAINER_TITLE );

   ssd_dialog_add_vspace( dialog, ADJ_SCALE( 5 ), 0 );

   box = ssd_container_new ( "Way to go box", NULL, ssd_container_get_width(),
         SSD_MIN_SIZE, SSD_END_ROW | SSD_ALIGN_CENTER | SSD_CONTAINER_BORDER | SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE|SSD_WIDGET_SPACE );

   // Space inside white container
   ssd_dialog_add_vspace( box, ADJ_SCALE( 12 ), 0 );

   // Title
   group = ssd_container_new ( "Way to go title group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE, SSD_END_ROW );
   ssd_dialog_add_hspace( group, ADJ_SCALE( WELCOME_WIZ_DLG_WAY_TO_GO_HOFFSET ), SSD_ALIGN_VCENTER );

   group_title = ssd_text_new( "Way to go title text", roadmap_lang_get( "Way to go!" ), 25, SSD_TEXT_LABEL );
   ssd_text_set_color( group_title, WELCOME_WIZ_DLG_WAY_TO_GO_TITLE_COLOR );
   ssd_widget_add( group, group_title );
   ssd_widget_add( box, group );

   ssd_dialog_add_vspace( box, ADJ_SCALE( 7 ), 0 );
   group = ssd_container_new ( "Way to go separator group", NULL, ssd_container_get_width()*0.9, SSD_MIN_SIZE, SSD_ALIGN_CENTER|SSD_END_ROW );
   separator = ssd_separator_new( "Separator", SSD_ALIGN_CENTER|SSD_WIDGET_SPACE );
   ssd_widget_add( group, separator );
   ssd_widget_add( box, group );

   /*
    * Logo bitmap
    */
   ssd_dialog_add_vspace( box, ADJ_SCALE( 10 ), 0 );
   way_to_go_bmp = ssd_bitmap_new( "Way to go bitmap", "way_to_go_wazer", SSD_ALIGN_CENTER|SSD_END_ROW );
   ssd_widget_add( box, way_to_go_bmp );

   // Explanation text - I
   ssd_dialog_add_vspace( box, ADJ_SCALE( 12 ), 0 );
   group = ssd_container_new ( "Explanation text I", NULL, ADJ_SCALE( WAY_TO_GO_TEXT_1_WIDTH ), SSD_MIN_SIZE, SSD_END_ROW|SSD_ALIGN_CENTER );
   ssd_widget_set_color( group, NULL, NULL );
   if ( Realtime_is_random_user() )
      explanation_text = "Your temporary account has been created!";
   else
      explanation_text = "Your account has been created!";
   text = ssd_text_new( "Way to go explanation text", roadmap_lang_get( explanation_text ), 16, SSD_TEXT_LABEL|SSD_ALIGN_CENTER );
   ssd_text_set_color( text, WELCOME_WIZ_DLG_WAY_TO_GO_EXPL_COLOR );
   ssd_widget_add( group, text );
   ssd_widget_add( box, group );

   // Explanation text - II
   ssd_dialog_add_vspace( box, ADJ_SCALE( 20 ), 0 );
   group = ssd_container_new ( "Explanation text II", NULL, ADJ_SCALE( WAY_TO_GO_TEXT_2_WIDTH ), SSD_MIN_SIZE, SSD_END_ROW|SSD_ALIGN_CENTER );
   ssd_widget_set_color( group, NULL, NULL );
   explanation_text = "Take a moment to click through the following screens to familiarize yourself with waze...";
   text = ssd_text_new( "Way to go explanation text", roadmap_lang_get( explanation_text ), 15, SSD_TEXT_LABEL|SSD_ALIGN_CENTER );
   ssd_text_set_color( text, WELCOME_WIZ_DLG_WAY_TO_GO_EXPL_COLOR );
   ssd_widget_add( group, text );
   ssd_widget_add( box, group );
   ssd_dialog_add_vspace( box, ADJ_SCALE( 12 ), 0 );

#ifdef TOUCH_SCREEN

    icons[0] = "welcome_btn";
    icons[1] = "welcome_btn_h";
    icons[2] = NULL;
    button = ssd_button_label_custom( "Go", roadmap_lang_get ( "Go" ), SSD_ALIGN_CENTER, way_to_go_button_callback, icons, 2, "#FFFFFF", "#FFFFFF", 14 );
//    text = ssd_widget_get( button, "label" );
//    text->flags |= SSD_TEXT_NORMAL_FONT;
//    ssd_text_set_font_size( text, 15 );
    ssd_widget_add ( box, button );

#else
    ssd_widget_set_left_softkey_text       ( dialog, roadmap_lang_get("Go"));
    ssd_widget_set_left_softkey_callback   ( dialog, on_softkey_left_way_to_go );
#endif

    ssd_dialog_add_vspace( box, ADJ_SCALE( 16 ), 0 );

    ssd_widget_add ( dialog, box );

    ssd_dialog_activate( WELCOME_WIZ_DLG_WAY_TO_GO_NAME, NULL );
    ssd_dialog_draw();
}