Patch level : 10.0

Files correlati     : xi.dll
Ricompilazione Demo : [ ]
Commento            :
Aggiunto supporto per group box con spigoli smussati


git-svn-id: svn://10.65.10.50/trunk@18129 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-01-28 08:55:42 +00:00
parent 2194155ee1
commit 88cfa4d4cb
5 changed files with 72 additions and 8 deletions

25
xi/xi.c
View File

@ -1158,19 +1158,28 @@ xi_draw_obj( XI_OBJ * xi_obj )
}
else
{
XinPen cpen;
XinBrush cbrush;
XinPen cpen = black_cpen;
XinBrush cbrush = white_cbrush;
cpen = black_cpen;
if ( rect->fore_color )
cpen.fore_color = rect->fore_color;
XinWindowPenSet( win, &cpen );
cbrush.pattern = XinBrushSolid;
cbrush.fore_color = XI_COLOR_WHITE;
if ( rect->back_color )
cbrush.fore_color = rect->back_color;
cbrush.fore_color = rect->back_color;
XinWindowBrushSet( win, &cbrush );
xi_draw_rect( win, &rct );
if ( rect->ridge )
{
XinWindowPenSet( win, &hollow_cpen );
xi_draw_rect( win, &rct );
XinWindowPenSet( win, &cpen );
xi_draw_roundrect( win, &rct, 4, 4 );
}
else
{
XinWindowPenSet( win, &cpen );
xi_draw_rect( win, &rct );
}
}
if ( rect->bitmap != NULL )
{

View File

@ -1453,6 +1453,8 @@ XIDLL BOOLEAN xi_rect_intersect XVT_CC_ARGS( ( XinRect * rctp, XinRect * rctp1
XIDLL void xi_offset_rect( XinRect * rct, int delta_h, int delta_v );
XIDLL void xi_invalidate_rect( XinWindow win, XinRect * rctp );
XIDLL void xi_draw_rect( XinWindow win, XinRect * rctp );
XIDLL void xi_draw_roundrect( XinWindow win, XinRect * rctp, int rh, int rv );
XIDLL void xi_draw_line( XinWindow win, XinPoint p );
XIDLL void xi_move_to( XinWindow win, XinPoint p );

View File

@ -3577,6 +3577,23 @@ XinWindowRectDraw( XinWindow Win, XinRect * rctp )
/*START*/
}
/*
this function draws a dotted rectangle in the specified window (added by Guy).
*/
void
XinWindowRoundRectDraw( XinWindow Win, XinRect * rctp, int rh, int rv )
{
/*END*/
RCT r;
r.left = rctp->left;
r.top = rctp->top;
r.right = rctp->right;
r.bottom = rctp->bottom;
xvt_dwin_draw_roundrect(( WINDOW ) Win, &r, rh, rv );
/*START*/
}
/*
this function draws a dotted rectangle in the specified window (added by Guy).
*/

View File

@ -692,6 +692,8 @@ extern "C"
void XinWindowPolygonDraw( XinWindow win, XinPoint* points, int nbr_points );
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 */
XinRect *XinWindowRectGet( XinWindow win, XinRect * p_rect );
void XinWindowRectInvalidate( XinWindow win, XinRect * rect );
XinRect *XinWindowRectOuterGet( XinWindow win, XinRect * p_rect );

View File

@ -2212,6 +2212,40 @@ xi_draw_rect( XinWindow win, XinRect * rctp )
}
}
void
xi_draw_roundrect( XinWindow win, XinRect * rctp, int rh, int rv )
{
if ( rctp->top >= rctp->bottom || rctp->left >= rctp->right )
return;
{
XinRect r;
#if XIWS == XIWS_WM
XinDrawTools ct;
r = *rctp;
adjust_point( &r.top );
adjust_point( &r.left );
adjust_point( &r.bottom );
adjust_point( &r.right );
xi_set_cur_window( win );
vrct_to_prct( win, &r );
XinWindowDrawToolsGet( win, &ct );
if ( ct.mode == XinDrawModeXor && !xi_is_rect_empty( &r ) )
ct.brush.color = XI_COLOR_BLACK;
if ( ct.brush.pat == XinPatternHollow )
ct.brush.color = ct.back_color;
XinWindowDrawToolsSet( win, &ct );
XinWindowRoundRectDraw( win, &r, radius, radius );
#else
r = *rctp;
xi_set_cur_window( win );
vrct_to_prct( win, &r );
XinWindowRoundRectDraw( win, &r, rh, rv );
#endif
}
}
void
xi_move_to( XinWindow win, XinPoint pnt )
{