From 88cfa4d4cb648e4a17dfb4d43e8878b5de1fcc1c Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 28 Jan 2009 08:55:42 +0000 Subject: [PATCH] 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 --- xi/xi.c | 25 +++++++++++++++++-------- xi/xi.h | 2 ++ xi/xiport.c | 17 +++++++++++++++++ xi/xiport.h | 2 ++ xi/xiutils.c | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 8 deletions(-) diff --git a/xi/xi.c b/xi/xi.c index 7df67c4c6..857ea582a 100755 --- a/xi/xi.c +++ b/xi/xi.c @@ -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 ) { diff --git a/xi/xi.h b/xi/xi.h index 994588f18..e4e978aa9 100755 --- a/xi/xi.h +++ b/xi/xi.h @@ -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 ); diff --git a/xi/xiport.c b/xi/xiport.c index d3768778b..6f5b491cc 100755 --- a/xi/xiport.c +++ b/xi/xiport.c @@ -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). */ diff --git a/xi/xiport.h b/xi/xiport.h index c60878c47..3af0ca05c 100755 --- a/xi/xiport.h +++ b/xi/xiport.h @@ -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 ); diff --git a/xi/xiutils.c b/xi/xiutils.c index e7a81a927..c8b0ac0cb 100755 --- a/xi/xiutils.c +++ b/xi/xiutils.c @@ -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 ) {