// 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 ();
}
Exemple #2
0
void
group_layouter(struct dialog_data *dlg_data)
{
	struct terminal *term = dlg_data->win->term;
	int w = dialog_max_width(term);
	int rw;
	int y = 0;
	int n = dlg_data->number_of_widgets - 2;

#ifdef CONFIG_UTF8
	if (term->utf8_cp)
		rw = int_min(w, utf8_ptr2cells(dlg_data->dlg->title, NULL));
	else
#endif /* CONFIG_UTF8 */
		rw = int_min(w, strlen(dlg_data->dlg->title));

	dlg_format_group(dlg_data, dlg_data->widgets_data, n,
			 0, &y, w, &rw, 1);

	y++;
	dlg_format_buttons(dlg_data, dlg_data->widgets_data + n, 2, 0, &y, w,
			   &rw, ALIGN_CENTER, 1);

	w = rw;

	draw_dialog(dlg_data, w, y);

	y = dlg_data->box.y + DIALOG_TB + 1;
	dlg_format_group(dlg_data, dlg_data->widgets_data, n,
			 dlg_data->box.x + DIALOG_LB, &y, w, NULL, 0);

	y++;
	dlg_format_buttons(dlg_data, dlg_data->widgets_data + n, 2,
			   dlg_data->box.x + DIALOG_LB, &y, w, &rw, ALIGN_CENTER, 0);
}
Exemple #3
0
void
group_layouter(struct dialog_data *dlg_data)
{
	struct terminal *term = dlg_data->win->term;
	int w = dialog_max_width(term);
	int rw = int_min(w, strlen(dlg_data->dlg->title));
	int y = 0;
	int n = dlg_data->number_of_widgets - 2;

	dlg_format_group(NULL, dlg_data->widgets_data, n,
			 0, &y, w, &rw);

	y++;
	dlg_format_buttons(NULL, dlg_data->widgets_data + n, 2, 0, &y, w,
			   &rw, ALIGN_CENTER);

	w = rw;

	draw_dialog(dlg_data, w, y);

	y = dlg_data->box.y + DIALOG_TB + 1;
	dlg_format_group(term, dlg_data->widgets_data, n,
			 dlg_data->box.x + DIALOG_LB, &y, w, NULL);

	y++;
	dlg_format_buttons(term, dlg_data->widgets_data + n, 2,
			   dlg_data->box.x + DIALOG_LB, &y, w, &rw, ALIGN_CENTER);
}
Exemple #4
0
static HRESULT draw_background(uxgtk_theme_t *theme, cairo_t *cr, int part_id, int state_id,
                               int width, int height)
{
    switch (part_id)
    {
        case WP_DIALOG:
            return draw_dialog(theme, cr, state_id, width, height);
    }

    FIXME("Unsupported window part %d.\n", part_id);
    return E_NOTIMPL;
}
Exemple #5
0
Fichier : ui.c Projet : AMSMM/NJEMU
int draw_battery_status(int draw)
{
	static UINT32 counter = 0;
	static int prev_bat = 0, prev_charging = 0;
	int width, icon, update = 0;
	int bat = scePowerGetBatteryLifePercent();
	int charging = scePowerIsBatteryCharging();
	char bat_left[4];

	counter++;

	if (draw)
	{
		if (bat > 66)		icon = ICON_BATTERY1;
		else if (bat > 33)	icon = ICON_BATTERY2;
		else if (bat >= 10) icon = ICON_BATTERY3;
		else				icon = ICON_BATTERY4;

		if ((charging && (counter % 60 < 40)) || !charging)
			small_icon_shadow(407, 3, UI_COLOR(UI_PAL_TITLE), icon);

		uifont_print_shadow(432, 5, UI_COLOR(UI_PAL_TITLE), "[");
		uifont_print_shadow(462, 5, UI_COLOR(UI_PAL_TITLE), "%]");

		if (bat >= 0 && bat <= 100)
			sprintf(bat_left, "%3d", bat);
		else
			strcpy(bat_left, "---");

		width = uifont_get_string_width(bat_left);
		uifont_print_shadow(462 - width, 5, UI_COLOR(UI_PAL_TITLE), bat_left);

		if (!charging && (bat < 10) && (counter % 120 < 40))
		{
			int sx, sy, ex, ey;
			char message[128];

			sprintf(message, TEXT(WARNING_BATTERY_IS_LOW_PLEASE_CHARGE_BATTERY), bat);
			width = uifont_get_string_width(message);

			sx = (SCR_WIDTH - width) >> 1;
			sy = (SCR_HEIGHT - FONTSIZE) >> 1;
			ex = sx + width;
			ey = sy + FONTSIZE;

			draw_dialog(sx - FONTSIZE/2, sy - FONTSIZE/2, ex + FONTSIZE/2, ey + FONTSIZE/2);

			uifont_print_shadow_center(sy, UI_COLOR(UI_PAL_WARNING), message);
		}
	}
// Redraw everything on the screen.  Does not flip pages.
// Should only be called with updateMutex locked.
void ScreenRecoveryUI::draw_screen_locked()
{
    draw_background_locked(currentIcon);

    if (DialogShowing()) {
        draw_dialog();
        return;
    }

    SetColor(MENU);

    if (show_text) {

        if (currentIcon != ERASING && currentIcon != INSTALLING_UPDATE)
            draw_header_icon();

        if (currentIcon == ERASING || currentIcon == INSTALLING_UPDATE || currentIcon == VIEWING_LOG) {
            int y = currentIcon == INSTALLING_UPDATE ? gr_fb_height() / 4 : header_height + 4;

            SetColor(LOG);
            int cx, cy;
            gr_set_font("log");
            gr_font_size(&cx, &cy);
            // display from the bottom up, until we hit the top of the
            // screen or we've displayed the entire text buffer.
            int row = (text_first_row+log_text_rows-1) % log_text_rows;
            for (int ty = gr_fb_height() - cy, count = 0;
                 ty > y+2 && count < log_text_rows;
                 ty -= (cy+2), ++count) {
                gr_text(4, ty, text[row], 0);
                --row;
                if (row < 0) row = log_text_rows-1;
            }
            return;
        }

        if (show_menu) {
            gr_set_font("menu");

            int nr_items = menu_items - menu_show_start;
            if (nr_items > max_menu_rows)
                nr_items = max_menu_rows;
            for (int i = 0; i < nr_items; ++i) {
                draw_menu_item(text_first_row + 3*i, menu[menu_show_start+i],
                        ((menu_show_start+i) == menu_sel));
            }
        }
    }
}
Exemple #7
0
void show_fatal_error(void)
{
	if (fatal_error)
	{
		int sx, sy, ex, ey;
		int width = uifont_get_string_width(fatal_error_message);
		int update = 1;

		sx = (SCR_WIDTH - width) >> 1;
		sy = (SCR_HEIGHT - FONTSIZE) >> 1;
		ex = sx + width;
		ey = sy + (FONTSIZE - 1);

		video_set_mode(32);

		load_background(WP_LOGO);

		while (Loop != LOOP_EXIT)
		{
			if (update)
			{
				show_background();
				small_icon_shadow(6, 3, UI_COLOR(UI_PAL_TITLE), ICON_SYSTEM);
				uifont_print_shadow(32, 5, UI_COLOR(UI_PAL_TITLE), TEXT(FATAL_ERROR));
				draw_dialog(sx - FONTSIZE/2, sy - FONTSIZE/2, ex + FONTSIZE/2, ey + FONTSIZE/2);
				uifont_print_shadow_center(sy, UI_COLOR(UI_PAL_SELECT), fatal_error_message);

				update = draw_battery_status(1);
				update |= draw_volume_status(1);
				video_flip_screen(1);
			}
			else
			{
				update = draw_battery_status(0);
				update |= draw_volume_status(0);
				video_wait_vsync();
			}

			pad_update();

			if (pad_pressed(PSP_CTRL_ANY))
				break;
		}

		pad_wait_clear();

		fatal_error = 0;
	}
}
void draw_menu_full(void)
{
	draw_edge();
	draw_logo();
	draw_color_list();
	draw_init_size();
	draw_direction();
	draw_speed();
	draw_function();
	draw_control_buttons();
	draw_io_buttons();
	draw_size();
	draw_steps();
	draw_labels();
	wnoutrefresh(menuw);

	if (dialogw) {
		draw_dialog();
	}
}
Exemple #9
0
void
TipButton::feel( int mouse )
	{
	init_dialog( Tip, NULL, NULL );
	ready_dialog( Tip, NULL, NULL, tip_feel, NULL, NULL, NULL );
	center_dialog( Tip );
	save_under_dialog( Tip );
	draw_dialog( Tip );

	//CRASH//debug( "Render icon" );
	gfx_blit( kyle_icon_data, Tip[ICON].sx, Tip[ICON].sy,
		Tip[ICON].width, Tip[ICON].height, 15 );

	_nTipOfTheDay = rand() % _nTips;
	drawTipText();

	do_dialog( Tip, -1 );
	restore_under_dialog();

	dialog_done = 0;			// override inside dialog box's setting
	}
Exemple #10
0
//ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ¿
// do_user_interaction                                                      ³
//                                                                          ³
// Entry point from client module called on startup operation.              ³
//ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ�
void do_user_interaction()
{
    int         cursor;
    float       t1, t2;
    Editable    *e;
    static int  inited = 0;

    char        file[16];
    char        path[128];
    char        buff[32];

    gfx_get_mform(cursor);
    gfx_set_mform(C_ARROW,0);

    gfx_report("");
    gfx_prompt("");
    gfx_prompt("");

    // Force mtl_pathname to point to process directory with ESPORT.VGP
    // as the filename.

    gfx_get_paths(GFX_PROCESS_PATH,0,path,file);

    strcpy(mtl_palpath,path);
    strcpy(mtl_palname,"ESPORT.VGP");

    strcpy(log_fname,path);
    strcat(log_fname,"\\ESPORT.LOG");

    if (! inited)
    {
        char buff[256];
        strcpy(buff,path);
        strcat(buff,"\\");
        strcat(buff,"ESPORT.INI");

        load_from_ini(buff);

        init_dialog(Escher, Escher_edit, NULL);
        inited = 1;
    }
    do_export=loop_done=0;

    gfx_get_paths(GFX_3DS_PATH,0,path,file);
    if (strstr(file,".3DS"))
    {
        *strstr(file,".3DS")=0;
        strcpy(scene_name,file);
        strcat(file,".IFF");
        strcpy(output_name,file);
        strcpy(output_path,path);
    }

    Escher[TARGET].text=output_name;

    ready_dialog(Escher, Escher_edit, NULL, Escher_feel, Escher_rad,
                NULL, NULL);

        init_editable(&Escher[SCN_NAME], scene_name);

    sprintf(buff,"%f",scale_3ds);
        init_editable(&Escher[SCAL_3DS], buff);

    sprintf(buff,"%f",scale_esh);
        init_editable(&Escher[SCAL_ESH], buff);

    Escher[INC_CAMS].radio = (cameras_flag) ? 1 : 0;
    Escher[INC_LGTS].radio = (lights_flag) ? 1 : 0;
    Escher[KEYFRAME].radio = (keys_flag) ? 1 : 0;

    Escher[FLAGS_0].radio = (object_flags & ESCH_MSH_APP0) ? 1 : 0;
    Escher[FLAGS_1].radio = (object_flags & ESCH_MSH_APP1) ? 1 : 0;
    Escher[FLAGS_2].radio = (object_flags & ESCH_MSH_APP2) ? 1 : 0;
    Escher[FLAGS_3].radio = (object_flags & ESCH_MSH_APP3) ? 1 : 0;
    Escher[FLAGS_4].radio = (object_flags & ESCH_MSH_APP4) ? 1 : 0;
    Escher[FLAGS_5].radio = (object_flags & ESCH_MSH_APP5) ? 1 : 0;
    Escher[FLAGS_6].radio = (object_flags & ESCH_MSH_APP6) ? 1 : 0;
    Escher[FLAGS_7].radio = (object_flags & ESCH_MSH_APP7) ? 1 : 0;
    Escher[FLAGS_8].radio = (object_flags & ESCH_MSH_APP8) ? 1 : 0;
    Escher[FLAGS_9].radio = (object_flags & ESCH_MSH_APP9) ? 1 : 0;
    Escher[FLAGS_A].radio = (object_flags & ESCH_MSH_APPA) ? 1 : 0;
    Escher[FLAGS_B].radio = (object_flags & ESCH_MSH_APPB) ? 1 : 0;
    Escher[FLAGS_C].radio = (object_flags & ESCH_MSH_APPC) ? 1 : 0;
    Escher[FLAGS_D].radio = (object_flags & ESCH_MSH_APPD) ? 1 : 0;
    Escher[FLAGS_E].radio = (object_flags & ESCH_MSH_APPE) ? 1 : 0;
    Escher[FLAGS_F].radio = (object_flags & ESCH_MSH_APPF) ? 1 : 0;

startover: ;

    while (!loop_done)
    {
        center_dialog(Escher);
        save_under_dialog(Escher);
        draw_dialog(Escher);
        do_dialog(Escher, -1);
    }

    if (do_export)
    {

        e=(Editable*)Escher[SCAL_3DS].text;
        t1=atof(e->string);
        if (t1 <= 0.0)
        {
            gfx_continu_line("Scale values must be positive and non-zero");
            loop_done=0;
            goto startover;
        }

        e=(Editable*)Escher[SCAL_ESH].text;
        t2=atof(e->string);
        if (t2 <= 0.0)
        {
            gfx_continu_line("Scale values must be positive and non-zero");
            loop_done=0;
            goto startover;
        }
        scale_3ds = t1;
        scale_esh = t2;
        scale_3ds2esch = t2 / t1;

        e=(Editable*)Escher[SCN_NAME].text;
        strncpy(scene_name,e->string,16);

        object_flags=0;
        if (Escher[FLAGS_0].radio)
            object_flags |= ESCH_MSH_APP0;
        if (Escher[FLAGS_1].radio)
            object_flags |= ESCH_MSH_APP1;
        if (Escher[FLAGS_2].radio)
            object_flags |= ESCH_MSH_APP2;
        if (Escher[FLAGS_3].radio)
            object_flags |= ESCH_MSH_APP3;
        if (Escher[FLAGS_4].radio)
            object_flags |= ESCH_MSH_APP4;
        if (Escher[FLAGS_5].radio)
            object_flags |= ESCH_MSH_APP5;
        if (Escher[FLAGS_6].radio)
            object_flags |= ESCH_MSH_APP6;
        if (Escher[FLAGS_7].radio)
            object_flags |= ESCH_MSH_APP7;
        if (Escher[FLAGS_8].radio)
            object_flags |= ESCH_MSH_APP8;
        if (Escher[FLAGS_9].radio)
            object_flags |= ESCH_MSH_APP9;
        if (Escher[FLAGS_A].radio)
            object_flags |= ESCH_MSH_APPA;
        if (Escher[FLAGS_B].radio)
            object_flags |= ESCH_MSH_APPB;
        if (Escher[FLAGS_C].radio)
            object_flags |= ESCH_MSH_APPC;
        if (Escher[FLAGS_D].radio)
            object_flags |= ESCH_MSH_APPD;
        if (Escher[FLAGS_E].radio)
            object_flags |= ESCH_MSH_APPE;
        if (Escher[FLAGS_F].radio)
            object_flags |= ESCH_MSH_APPF;

        cameras_flag = (Escher[INC_CAMS].radio) ? 1 : 0;
        lights_flag = (Escher[INC_LGTS].radio) ? 1 : 0;
        keys_flag = (Escher[KEYFRAME].radio) ? 1 : 0;

        export();
    }
Exemple #11
0
static void
download_dialog_layouter(struct dialog_data *dlg_data)
{
	struct file_download *file_download = dlg_data->dlg->udata;
	struct terminal *term = dlg_data->win->term;
	int w = dialog_max_width(term);
	int rw = w;
	int x, y = 0;
	int url_len;
	unsigned char *url;
	struct download *download = &file_download->download;
	struct color_pair *dialog_text_color = get_bfu_color(term, "dialog.text");
	unsigned char *msg = get_download_msg(download, term, 1, 1, "\n");
	int show_meter = (download_is_progressing(download)
			  && download->progress->size >= 0);
#if CONFIG_BITTORRENT
	int bittorrent = (file_download->uri->protocol == PROTOCOL_BITTORRENT
			  && (show_meter || is_in_state(download->state, S_RESUME)));
#endif

	redraw_windows(REDRAW_BEHIND_WINDOW, dlg_data->win);
	file_download->dlg_data = dlg_data;

	if (!msg) return;

	url = get_uri_string(file_download->uri, URI_PUBLIC);
	if (!url) {
		mem_free(msg);
		return;
	}
#ifdef CONFIG_UTF8
	if (term->utf8_cp)
		decode_uri(url);
	else
#endif /* CONFIG_UTF8 */
		decode_uri_for_display(url);
	url_len = strlen(url);

	if (show_meter) {
		int_lower_bound(&w, DOWN_DLG_MIN);
	}

	dlg_format_text_do(dlg_data, url, 0, &y, w, &rw,
			dialog_text_color, ALIGN_LEFT, 1);

	y++;
	if (show_meter) y += 2;

#if CONFIG_BITTORRENT
	if (bittorrent) y += 2;
#endif
	dlg_format_text_do(dlg_data, msg, 0, &y, w, &rw,
			dialog_text_color, ALIGN_LEFT, 1);

	y++;
	dlg_format_buttons(dlg_data, dlg_data->widgets_data,
			   dlg_data->number_of_widgets, 0, &y, w,
			   &rw, ALIGN_CENTER, 1);

	draw_dialog(dlg_data, w, y);

	w = rw;
	if (url_len > w) {
		/* Truncate too long urls */
		url_len = w;
		url[url_len] = '\0';
		if (url_len > 4) {
			url[--url_len] = '.';
			url[--url_len] = '.';
			url[--url_len] = '.';
		}
	}

	y = dlg_data->box.y + DIALOG_TB + 1;
	x = dlg_data->box.x + DIALOG_LB;
	dlg_format_text_do(dlg_data, url, x, &y, w, NULL,
			dialog_text_color, ALIGN_LEFT, 0);

	if (show_meter) {
		y++;
		draw_progress_bar(download->progress, term, x, y, w, NULL, NULL);
		y++;
	}

#if CONFIG_BITTORRENT
	if (bittorrent) {
		y++;
		draw_bittorrent_piece_progress(download, term, x, y, w, NULL, NULL);
		y++;
	}
#endif
	y++;
	dlg_format_text_do(dlg_data, msg, x, &y, w, NULL,
			dialog_text_color, ALIGN_LEFT, 0);

	y++;
	dlg_format_buttons(dlg_data, dlg_data->widgets_data,
			   dlg_data->number_of_widgets, x, &y, w,
			   NULL, ALIGN_CENTER, 0);

	mem_free(url);
	mem_free(msg);
}
Exemple #12
0
//ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ¿
// do_mtl                                                                   ³
//                                                                          ³
// Do material's dialog.                                                    ³
//ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ�
void do_mtl()
{
    int         sizex, sizey;
    Editable    *e;
    static int  inited = 0;
    char        buff[32];

    if (! inited)
    {
        init_dialog(EschMtl, EschMtl_edit, NULL);
        inited = 1;
    }

    loop_done=0;

    EschMtl[PALETTE].text=mtl_palname;
    EschMtl[PALETTE].radio=0;
    EschMtl[COMPRESS].radio = (mtl_compress) ? 1 : 0;

    ready_dialog(EschMtl, EschMtl_edit, NULL, EschMtl_feel, EschMtl_rad,
                 NULL, NULL);

    sprintf(buff,"%d",mtl_sizex);
    init_editable(&EschMtl[SIZEX], buff);

    sprintf(buff,"%d",mtl_sizey);
    init_editable(&EschMtl[SIZEY], buff);

startover:
    ;

    while (!loop_done)
    {
        center_dialog(EschMtl);
        save_under_dialog(EschMtl);
        draw_dialog(EschMtl);
        do_dialog(EschMtl, -1);
    }

    e=(Editable*)EschMtl[SIZEX].text;
    sizex=atoi(e->string);

    switch(sizex) {
    case 16:
    case 32:
    case 64:
    case 128:
    case 256:
        break;
    default:
        gfx_continu_line("X Size must be 16, 32, 64, 128, or 256");
        loop_done=0;
        goto startover;
    }

    e=(Editable*)EschMtl[SIZEY].text;
    sizey=atoi(e->string);

    switch(sizey) {
    case 16:
    case 32:
    case 64:
    case 128:
    case 256:
        break;
    default:
        gfx_continu_line("Y Size must be 16, 32, 64, 128, or 256");
        loop_done=0;
        goto startover;
    }

    mtl_sizex=sizex;
    mtl_sizey=sizey;

    mtl_compress = (EschMtl[COMPRESS].radio) ? 1 : 0;
}
void ssd_dialog_draw_prev (void) {

	if ( RoadMapDialogCurrent && ( RoadMapDialogCurrent->container->flags & SSD_DIALOG_FLOAT ) )
		draw_dialog(RoadMapDialogCurrent->activated_prev);

}
void ssd_dialog_draw (void) {

   draw_dialog(RoadMapDialogCurrent);
   roadmap_canvas_refresh ();
}