[Cgui-develop] cgui/src list.c,1.1.2.6.2.26,1.1.2.6.2.27
Brought to you by:
chrisan,
rasmusmyklebust
|
From: Christer S. <ch...@us...> - 2009-08-02 08:55:34
|
Update of /cvsroot/cgui/cgui/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21024/src Modified Files: Tag: Branch_CGUI_1-6-7 list.c Log Message: fixes due to feature 2830892 Index: list.c =================================================================== RCS file: /cvsroot/cgui/cgui/src/list.c,v retrieving revision 1.1.2.6.2.26 retrieving revision 1.1.2.6.2.27 diff -C2 -d -r1.1.2.6.2.26 -r1.1.2.6.2.27 *** list.c 8 Feb 2009 10:43:55 -0000 1.1.2.6.2.26 --- list.c 2 Aug 2009 08:55:25 -0000 1.1.2.6.2.27 *************** *** 110,113 **** --- 110,118 ---- #endif + /* To hold values for a bar diagram bar of a specific row (to be set by the application). */ + static int CGUI_list_row_bar_diagram_color; + static double CGUI_list_row_bar_diagram_percentage; + static int CGUI_list_row_bar_diagram_used; + typedef struct t_listchain t_listchain; typedef struct t_tree_node t_tree_node; *************** *** 922,926 **** t_list *l; int colnr, x1, x2, imy, bgx, y1, y2, cx2, alx, strike = 0, uline = 0, ret = 0, strike_x, col_x, text_x, fcolor, bcolor, len, ral; ! int is_clipped, tot_text_length, available_text_width, x_end, fixw, j, prev_parse_label_state; char *s, *p, buf[50000], tttext[50000]; BITMAP *bmp; --- 927,931 ---- t_list *l; int colnr, x1, x2, imy, bgx, y1, y2, cx2, alx, strike = 0, uline = 0, ret = 0, strike_x, col_x, text_x, fcolor, bcolor, len, ral; ! int is_clipped, tot_text_length, available_text_width, x_end, fixw, j, prev_parse_label_state, bar_end_x; char *s, *p, buf[50000], tttext[50000]; BITMAP *bmp; *************** *** 954,957 **** --- 959,963 ---- } is_clipped = 0; + CGUI_list_row_bar_diagram_used = 0; if (l->nrcols) { appdata = GetApplicationData(i, l, b); *************** *** 980,984 **** if (bgx > x1) rectfill(bmp, x1, y1, bgx-1, y2 - 1, cgui_colors[CGUI_COLOR_TREE_VIEW_BACKGROUND]); ! rectfill(bmp, bgx, y1, x2, y2 - 1, CGUI_list_row_b_color); } if (l->treeview && colnr == 0) { --- 986,1004 ---- if (bgx > x1) rectfill(bmp, x1, y1, bgx-1, y2 - 1, cgui_colors[CGUI_COLOR_TREE_VIEW_BACKGROUND]); ! if (CGUI_list_row_bar_diagram_used) { ! /* Application wants to use this row to display the bar of a bar diagram. */ ! bar_end_x = (x2 - bgx + 1) * CGUI_list_row_bar_diagram_percentage + 0.5; ! if (b->hasfocus == 1) { ! red = getr(CGUI_list_row_b_color) / 2 + getr(CGUI_list_row_bar_diagram_color) / 2; ! green = getg(CGUI_list_row_b_color) / 2 + getg(CGUI_list_row_bar_diagram_color) / 2; ! blue = getb(CGUI_list_row_b_color) / 2 + getb(CGUI_list_row_bar_diagram_color) / 2; ! CGUI_list_row_bar_diagram_color = makecol(red, green, blue); ! } ! rectfill(bmp, bgx, y1, bar_end_x-1, y2 - 1, CGUI_list_row_bar_diagram_color); ! rectfill(bmp, bar_end_x, y1, x2, y2 - 1, CGUI_list_row_b_color); ! } else { ! /* Normal case */ ! rectfill(bmp, bgx, y1, x2, y2 - 1, CGUI_list_row_b_color); ! } } if (l->treeview && colnr == 0) { *************** *** 3104,3107 **** --- 3124,3134 ---- } + extern void CguiListBoxRowSetBar(int color, double percentage) + { + CGUI_list_row_bar_diagram_color = color; + CGUI_list_row_bar_diagram_percentage = percentage; + CGUI_list_row_bar_diagram_used = 1; + } + /*void _PrintListTree(int listid) { |