Migliorata grafica botton e testate sheet

git-svn-id: svn://10.65.10.50/branches/R_10_00@22661 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-05-23 14:39:41 +00:00
parent 5abc07f468
commit 5d8a5b2a73
6 changed files with 6078 additions and 5870 deletions

37
xi/xi.c
View File

@ -1227,7 +1227,7 @@ xi_draw_field_button( XI_OBJ * xi_obj )
xi_inflate_rect( &r, -1 );
if ( ( BOOLEAN ) xi_get_pref( XI_PREF_3D_LOOK ) )
xi_draw_3d_rect(win, &r, fd->down, button_depth, color_light, color_ctrl, color_dark);
xi_draw_shaded_rect(win, &r, fd->down, button_depth, color_light, color_ctrl, color_dark);
else
{
XinWindowBrushSet( win, &white_cbrush );
@ -1668,17 +1668,14 @@ draw_list_button( XinWindow win, XinRect * rct, BOOLEAN down )
XinWindowPenSet( win, &black_cpen );
XinWindowBrushSet( win, &hollow_cbrush );
xi_draw_rect( win, &r );
r.top++;
r.left++;
r.bottom--;
r.right--;
xi_inflate_rect(&r, -1);
if ( ( BOOLEAN ) xi_get_pref( XI_PREF_3D_LOOK ) )
{
const XinColor color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT);
const XinColor color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
const XinColor color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK);
xi_draw_3d_rect(win, &r, down, 2, color_light, color_ctrl, color_dark);
xi_draw_shaded_rect(win, &r, down, 2, color_light, color_ctrl, color_dark);
}
else
{
@ -3430,7 +3427,6 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct,
case XIBT_BUTTON_CHECKBOX:
case XIBT_BUTTON_RADIOBTN:
{
int grid_width;
int bline = -1;
XinRect r;
XinPen back_pen;
@ -3453,7 +3449,7 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct,
r = *rct;
if ( xi_obj->v.btn->packed == TRUE )
{
grid_width = ( int ) xi_get_pref( XI_PREF_CONTAINER_GRID_WIDTH );
int grid_width = ( int ) xi_get_pref( XI_PREF_CONTAINER_GRID_WIDTH );
xi_inflate_rect( &r, -grid_width );
}
else
@ -3463,10 +3459,15 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct,
bt = xi_obj->v.btn->type;
if ( bt == XIBT_BUTTON || bt == XIBT_BUTTON_CHECKBOX ||
bt == XIBT_BUTTON_RADIOBTN )
xi_inflate_rect( &r, -3 );
xi_inflate_rect( &r, -1 ); // Was -3
}
XinWindowDrawModeSet( win, XinDrawModeCopy );
xi_draw_3d_rect( win, &r, ( BOOLEAN ) ( down || bd->checked ), 2, color_light, color_ctrl, color_dark );
if ( ( BOOLEAN ) xi_get_pref( XI_PREF_3D_LOOK ) )
xi_draw_shaded_rect( win, &r, ( BOOLEAN ) ( down || bd->checked ), 2, color_light, color_ctrl, color_dark );
else
xi_draw_3d_rect( win, &r, ( BOOLEAN ) ( down || bd->checked ), 2, color_light, color_ctrl, color_dark );
if ( bd->up_icon_rid )
{
int x,
@ -3521,7 +3522,10 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct,
( XinColor ) xi_get_pref( XI_PREF_COLOR_DISABLED ) );
text_rect = r;
if ( down )
{
text_rect.top += 2;
text_rect.left += 2;
}
fontp = xi_obj->v.btn->font;
if ( fontp == NULL )
fontp = xi_obj->itf->v.itf->font;
@ -3919,7 +3923,12 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct,
xi_draw_thick_rect( win, &rct2, 2 );
}
else
xi_draw_3d_rect( win, &rct2, down, 1, 0L, 0L, 0L );
{
if ( ( BOOLEAN ) xi_get_pref( XI_PREF_3D_LOOK ) )
xi_draw_shaded_rect( win, &rct2, down, 1, 0L, 0L, 0L );
else
xi_draw_3d_rect( win, &rct2, down, 1, 0L, 0L, 0L );
}
if ( !enabled )
fore_cp.fore_color = xi_get_pref( XI_PREF_COLOR_DISABLED );
if ( checked )
@ -3958,6 +3967,12 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct,
pnt1.v++;
xi_move_to( win, pnt1 );
xi_draw_line( win, pnt2 );
/* Sarebbe bello ma ... non è trasparente
XinRect rct3 = rct2;
xi_inflate_rect(&rct3, -2);
xi_draw_checkmark(win, &rct3);
*/
}
if ( !box_only )
{

View File

@ -224,6 +224,7 @@ typedef enum
AGA_PREF_BTN_COLOR_LIGHT,
AGA_PREF_BTN_COLOR_CTRL,
AGA_PREF_BTN_COLOR_DARK,
AGA_PREF_BTN_COLOR_TEXT,
AGA_PREF_LASTPREF /* should always be last */
}
AGA_PREF_TYPE;
@ -1443,9 +1444,11 @@ XIDLL void xi_draw_3d_diamond XVT_CC_ARGS( ( XinWindow win, XinRect * rctp, BO
XIDLL void xi_draw_3d_line XVT_CC_ARGS( ( XinWindow win, XinPoint pnt1, XinPoint pnt2, BOOLEAN well ) );
XIDLL void xi_draw_3d_rect XVT_CC_ARGS( ( XinWindow win, XinRect * rctp, BOOLEAN well, int height, XinColor
color_light, XinColor color_ctrl, XinColor color_dark ) );
XIDLL void xi_draw_diamond XVT_CC_ARGS( ( XinWindow win, XinRect * rctp, BOOLEAN well, BOOLEAN black, BOOLEAN
fill,
XinColor color ) );
XIDLL void xi_draw_shaded_rect XVT_CC_ARGS( ( XinWindow win, XinRect * rctp, BOOLEAN well, int height, XinColor
color_light, XinColor color_ctrl, XinColor color_dark ) );
XIDLL void xi_draw_diamond XVT_CC_ARGS( ( XinWindow win, XinRect * rctp, BOOLEAN well, BOOLEAN black, BOOLEAN fill, XinColor color ) );
XIDLL void xi_draw_checkmark XVT_CC_ARGS( ( XinWindow win, XinRect * rctp ) );
XIDLL void xi_draw_text_attrib XVT_CC_ARGS( ( XinWindow win, XinFont * font, int x, int y, char *s, int len, unsigned
long attrib ) );
XIDLL void xi_draw_thick_rect XVT_CC_ARGS( ( XinWindow win, XinRect * rctp, int width ) );

View File

@ -173,8 +173,7 @@ static void
lm_draw_3d_rect( LM_DATA * lmp, XinRect * rctp, BOOLEAN well, int depth, BOOLEAN adj_v )
{
XinRect r;
BOOLEAN left,
right;
BOOLEAN left, right;
const XinColor color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT);
const XinColor color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
const XinColor color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK);
@ -194,7 +193,11 @@ lm_draw_3d_rect( LM_DATA * lmp, XinRect * rctp, BOOLEAN well, int depth, BOOLEAN
right = lm_adj_h( lmp, &r.right );
if ( !left && !right )
return;
xi_draw_3d_rect( lmp->win, &r, well, depth, color_light, color_ctrl, color_dark);
if ( xi_get_pref( XI_PREF_3D_LOOK ) )
xi_draw_shaded_rect( lmp->win, &r, well, depth, color_light, color_ctrl, color_dark);
else
xi_draw_3d_rect( lmp->win, &r, well, depth, color_light, color_ctrl, color_dark);
}
/*********** draw column headings ***********/
@ -279,6 +282,7 @@ draw_column_headings( LM_DATA * lmp, XinRect * actual_rct )
cell_rct.right--;
cell_rct.top++;
cell_rct.bottom = heading_rct.bottom - 2 + BORDER_WIDTH;
/* Reimplemented below 10/05/2012
if ( COLUMN_IS_ENABLED( lm, col ) )
{
if ( LIST_IS_ENABLED( lmp ) )
@ -292,8 +296,12 @@ draw_column_headings( LM_DATA * lmp, XinRect * actual_rct )
fore_color = lmp->disabled_color;
back_color = lmp->disabled_back_color;
}
if ( col_data->heading_well || col_data->heading_platform )
*/
if ( col_data->heading_well || col_data->heading_platform ) // Alway true ???
{
fore_color = aga_get_pref(AGA_PREF_BTN_COLOR_TEXT);
back_color = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
}
XinWindowColorTextForeSet( win, fore_color );
XinWindowColorTextBackSet( win, back_color );
}
@ -413,7 +421,7 @@ draw_column_headings( LM_DATA * lmp, XinRect * actual_rct )
ascent,
descent;
s = XinMemoryAlloc( strlen( col_data->heading_text ) + 1 );
s = (char*)XinMemoryAlloc( strlen( col_data->heading_text ) + 1 );
strcpy( s, col_data->heading_text );
ch = s;
first_char = ch;
@ -1620,8 +1628,12 @@ TO OPTIMIZE BACKGROUND DRAWING, USE NEXT TWO LINES
const XinColor color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
const XinColor color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK);
xi_draw_3d_rect( win, &rct, ( BOOLEAN ) ( CELL_IS_SELECTED( lmp, row, col ) ? !column_data->column_well :
column_data->column_well ), 2, color_light, color_ctrl, color_dark );
if ( xi_get_pref( XI_PREF_3D_LOOK ) )
xi_draw_shaded_rect( win, &rct, ( BOOLEAN ) ( CELL_IS_SELECTED( lmp, row, col ) ? !column_data->column_well :
column_data->column_well ), 2, color_light, color_ctrl, color_dark );
else
xi_draw_3d_rect( win, &rct, ( BOOLEAN ) ( CELL_IS_SELECTED( lmp, row, col ) ? !column_data->column_well :
column_data->column_well ), 2, color_light, color_ctrl, color_dark );
}
}
}

11757
xi/xiport.c

File diff suppressed because it is too large Load Diff

View File

@ -693,7 +693,9 @@ extern "C"
void XinWindowRectDraw( XinWindow win, XinRect * rect );
void XinWindowDottedRectDraw( XinWindow win, XinRect * rect ); /* Added by Guy */
void XinWindowRoundRectDraw( XinWindow win, XinRect * rect, int rh, int rv ); /* Added by Guy */
void XinWindowShadedRectDraw( XinWindow win, XinRect * rect ); /* Added by Guy */
void XinWindowCheckMarkDraw( XinWindow win, XinRect * rect ); /* Added by Guy */
XinRect *XinWindowRectGet( XinWindow win, XinRect * p_rect );
void XinWindowRectInvalidate( XinWindow win, XinRect * rect );
XinRect *XinWindowRectOuterGet( XinWindow win, XinRect * p_rect );

View File

@ -335,7 +335,7 @@ static long xi_preferences[XI_NBR_PREFERENCES] =
#endif
};
static long aga_preferences[AGA_NBR_PREFERENCES] = { XI_COLOR_LTGRAY, XI_COLOR_GRAY, XI_COLOR_DKGRAY};
static long aga_preferences[AGA_NBR_PREFERENCES] = { XI_COLOR_LTGRAY, XI_COLOR_GRAY, XI_COLOR_DKGRAY, XI_COLOR_BLACK };
XinRect big_clip = {
@ -1100,6 +1100,119 @@ xi_draw_3d_rect( XinWindow win, XinRect * rctp, BOOLEAN well, int height,
xi_draw_rect( win, &rct );
}
void
xi_draw_shaded_rect( XinWindow win, XinRect * rctp, BOOLEAN well, int height,
XinColor color_light, XinColor color_ctrl, XinColor color_dark )
{
XinRect rct;
XinPoint pnt,
pnt2;
XinPen cpen;
XinBrush cbrush;
if ( !color_light )
{
color_light = xi_get_pref( XI_PREF_COLOR_LIGHT );
color_ctrl = xi_get_pref( XI_PREF_COLOR_CTRL );
color_dark = xi_get_pref( XI_PREF_COLOR_DARK );
}
cpen = black_cpen;
rct = *rctp;
XinWindowDrawModeSet( win, XinDrawModeCopy );
/* draw upper left lines */
cpen.fore_color = well ? color_dark : color_light;
XinWindowPenSet( win, &cpen );
pnt.h = rct.left;
pnt.v = rct.top;
xi_move_to( win, pnt );
pnt2.h = rct.left;
pnt2.v = rct.bottom - 1;
xi_draw_line( win, pnt2 );
xi_move_to( win, pnt );
pnt2.h = rct.right - 1;
pnt2.v = rct.top;
xi_draw_line( win, pnt2 );
if ( height == 2 )
{
pnt.h++;
pnt.v++;
xi_move_to( win, pnt );
pnt2.h = pnt.h;
pnt2.v = rct.bottom - 2;
xi_draw_line( win, pnt2 );
xi_move_to( win, pnt );
pnt2.h = rct.right - 2;
pnt2.v = pnt.v;
xi_draw_line( win, pnt2 );
}
/* draw lower right lines */
cpen.fore_color = well ? color_light : color_dark;
XinWindowPenSet( win, &cpen );
pnt.h = rct.left;
pnt.v = rct.bottom - 1;
xi_move_to( win, pnt );
pnt2.h = rct.right - 1;
pnt2.v = pnt.v;
xi_draw_line( win, pnt2 );
pnt.h = rct.right - 1;
pnt.v = rct.top;
xi_move_to( win, pnt );
pnt2.h = pnt.h;
pnt2.v = rct.bottom;
xi_draw_line( win, pnt2 );
if ( height == 2 )
{
pnt.h = rct.left + 1;
pnt.v = rct.bottom - 2;;
xi_move_to( win, pnt );
pnt2.h = rct.right - 1;
pnt2.v = pnt.v;
xi_draw_line( win, pnt2 );
pnt.h = rct.right - 2;
pnt.v = rct.top + 1;
xi_move_to( win, pnt );
pnt2.h = pnt.h;
pnt2.v = rct.bottom;
xi_draw_line( win, pnt2 );
}
XinWindowPenSet( win, &hollow_cpen );
cbrush = white_cbrush;
cbrush.fore_color = color_ctrl;
XinWindowBrushSet( win, &cbrush );
if ( height == 2 )
{
rct.top += 2;
rct.left += 2;
rct.bottom -= 2;
rct.right -= 2;
}
else
{
rct.top++;
rct.left++;
rct.bottom--;
rct.right--;
}
XinWindowShadedRectDraw(win, &rct);
}
void
xi_draw_checkmark( XinWindow win, XinRect * rctp )
{
XinWindowCheckMarkDraw( win, rctp );
}
void
xi_draw_3d_line( XinWindow win, XinPoint pnt1, XinPoint pnt2, BOOLEAN well )
{