From 77dfd6d02a7bb85275282510c308d0d906ee6f53 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 23 Sep 2005 15:56:28 +0000 Subject: [PATCH] Patch level : 2.2 Files correlati : Ricompilazione Demo : [ ] Commento : Corretto disegno dei check buttons e centrature icona nei bottoni in genere git-svn-id: svn://10.65.10.50/trunk@13368 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xi/xi.c | 8 +++++--- xi/xilm3.c | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/xi/xi.c b/xi/xi.c index 040ff1bc3..b3ef84d4d 100755 --- a/xi/xi.c +++ b/xi/xi.c @@ -1216,8 +1216,10 @@ xi_draw_field_button( XI_OBJ * xi_obj ) XinWindowPenSet( win, &hollow_cpen ); xi_draw_rect( win, &r ); } - x = r.left + 3; - y = r.top + 2; +// Guy was here + x = (r.left+r.right)/2-16; // x = r.left + 3; + y = (r.top+r.bottom)/2-16; // y = r.top + 2; + cr = r; cr.top += 2; cr.left += 2; @@ -3462,7 +3464,7 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct, r2 = r; xi_inflate_rect( &r2, -2 ); xi_set_clip( win, &r2 ); - if ( down ) + if ( down || bd->checked) // Guy added bd->checked xi_draw_icon( win, x, y + 1, bd->down_icon_rid, XI_COLOR_BLACK, color_ctrl ); else diff --git a/xi/xilm3.c b/xi/xilm3.c index 4796e0cee..f178bae1b 100755 --- a/xi/xilm3.c +++ b/xi/xilm3.c @@ -1059,8 +1059,13 @@ redraw_cell_button( LM_DATA * lmp, int row, int col, XinRect * clip_rct, xi_inflate_rect( &r, -1 ); lm_draw_3d_rect( lmp, &r, down, 2, TRUE ); xi_inflate_rect( &r, -2 ); - cell_btn_icon_x = ( int ) xi_get_pref( XI_PREF_CELL_BTN_ICON_X ); - cell_btn_icon_y = ( int ) xi_get_pref( XI_PREF_CELL_BTN_ICON_Y ); + + // Guy was here: le icone vanno centrate nel bottone + // cell_btn_icon_x = ( int ) xi_get_pref( XI_PREF_CELL_BTN_ICON_X ); + // cell_btn_icon_y = ( int ) xi_get_pref( XI_PREF_CELL_BTN_ICON_Y ); + cell_btn_icon_x = (r.right-r.left)/2 - 16; + cell_btn_icon_y = (r.bottom-r.top)/2 - 16; + r.left = max( r.left, col_rct.left ); r.right = min( r.right, col_rct.right ); XinWindowDrawToolsGet( lmp->win, &ct );