コード例 #1
0
ファイル: main.c プロジェクト: iPodLinux-Community/ZacZilla
/* Banner drawing */
static void tuxchess_do_draw()
{
	if (!is_mini) {
		pz_draw_header("Tuxchess");
		ttk_draw_window (historic_wid);
	} else {
		ttk_draw_window (message_wid);
	}
}
コード例 #2
0
/* set text to NULL for updating, to a value for new window stuff */
static void updateprogress( TWindow * sliderwin, TWidget * slider,
			    int newVal, char * displayText,
			    char * lineTwo )
{
	ttk_color menu_bg_color = 0;
	ttk_color menu_fg_color = 0;
	int textw;

	if( newVal < 0 ) newVal = 0; /* jsut in case */

	/* if displayText is non-NULL, rerender the whole thing */
	if( displayText || lineTwo ) {
		if( ttk_ap_getx( "menu.bg" ))
			menu_bg_color = ttk_ap_getx("menu.bg")->color;
		if( ttk_ap_getx( "menu.fg" ))
			menu_fg_color = ttk_ap_getx("menu.fg")->color;

		if( menu_fg_color == menu_bg_color ) {
		    if( menu_fg_color == 0 || menu_fg_color == 3 ) { /*why 3?*/
			menu_fg_color = ttk_makecol( BLACK );
			menu_bg_color = ttk_makecol( WHITE );
		    }
		}

		ttk_fillrect(sliderwin->srf,0,0,
				sliderwin->w,sliderwin->h,
				menu_bg_color );

		if( displayText ) {
			textw = ttk_text_width(ttk_textfont,displayText);
			ttk_text(sliderwin->srf,ttk_textfont,
				ttk_screen->w/ 2 - textw/2, ttk_screen->h/2,
				menu_fg_color, displayText);
		}

		if( lineTwo ) {
			textw = ttk_text_width(ttk_textfont, lineTwo);
			ttk_text(sliderwin->srf,ttk_textfont,
				ttk_screen->w/ 2 - textw/2, 
				ttk_screen->h/2 + ttk_textfont->height + 5,
				menu_fg_color, lineTwo);
		}
	}

	ttk_slider_set_val(slider,newVal);
	ttk_slider_draw(slider,sliderwin->srf);
	ttk_draw_window(sliderwin);
	ttk_gfx_update(ttk_screen->srf);
//	ttk_delay(10);  //useful for testing
}