Commit 69ef52fc authored by claes's avatar claes

GrowTable select color changeable

parent 4ba58a5e
...@@ -12,4 +12,5 @@ ...@@ -12,4 +12,5 @@
060516 cs ge Possibility to use local database in DigLowColor, ToggleDig, Slider 060516 cs ge Possibility to use local database in DigLowColor, ToggleDig, Slider
insensitiv, and Invisible. insensitiv, and Invisible.
060516 cs ge Bit type added in Invisible to check visibility on bits in a bitmap. 060516 cs ge Bit type added in Invisible to check visibility on bits in a bitmap.
060522 cs ge Bugfix for $user attributes. Scan function for dynamics wasn't called. 060522 cs ge Bugfix for $user attributes. Scan function for dynamics wasn't called.
\ No newline at end of file 060524 cs ge Property for selected cell color in GrowTable.
\ No newline at end of file
/* /*
* Proview $Id: ge_graph.cpp,v 1.31 2006-05-16 11:51:01 claes Exp $ * Proview $Id: ge_graph.cpp,v 1.32 2006-05-24 08:01:51 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -1259,7 +1259,8 @@ int Graph::get_attr_items( grow_tObject object, attr_sItem **itemlist, ...@@ -1259,7 +1259,8 @@ int Graph::get_attr_items( grow_tObject object, attr_sItem **itemlist,
"HeaderRowHeight", "Table.HeaderRowHeight", "HeaderRowHeight", "Table.HeaderRowHeight",
"HeaderTextSize", "Table.HeaderTextSize", "HeaderTextSize", "Table.HeaderTextSize",
"HeaderTextBold", "Table.HeaderTextBold", "HeaderTextBold", "Table.HeaderTextBold",
"HeaderTextColor", "Table.HeaderTextColor", "HeaderTextBold", "Table.HeaderTextBold",
"SelectColor", "Table.SelectColor",
"Options", "Table.Options", "Options", "Table.Options",
"VerticalScrollbar", "Table.VerticalScrollbar", "VerticalScrollbar", "Table.VerticalScrollbar",
"HorizontalScrollbar", "Table.HorizontalScrollbar", "HorizontalScrollbar", "Table.HorizontalScrollbar",
......
/* /*
* Proview $Id: glow.h,v 1.13 2006-05-16 11:50:27 claes Exp $ * Proview $Id: glow.h,v 1.14 2006-05-24 08:01:51 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -1580,7 +1580,8 @@ typedef enum { ...@@ -1580,7 +1580,8 @@ typedef enum {
glow_eSave_GrowTable_column_width11 = 4260, glow_eSave_GrowTable_column_width11 = 4260,
glow_eSave_GrowTable_header_text11 = 4261, glow_eSave_GrowTable_header_text11 = 4261,
glow_eSave_GrowTable_column_width12 = 4262, glow_eSave_GrowTable_column_width12 = 4262,
glow_eSave_GrowTable_header_text12 = 4263 glow_eSave_GrowTable_header_text12 = 4263,
glow_eSave_GrowTable_select_drawtype = 4264
} glow_eSave; } glow_eSave;
//! Relative or absolute position for an annotation //! Relative or absolute position for an annotation
......
/* /*
* Proview $Id: glow_growapi.cpp,v 1.21 2006-05-16 11:50:27 claes Exp $ * Proview $Id: glow_growapi.cpp,v 1.22 2006-05-24 08:01:51 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -1890,6 +1890,12 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab, ...@@ -1890,6 +1890,12 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab,
attrinfo[i].type = glow_eType_Color; attrinfo[i].type = glow_eType_Color;
attrinfo[i++].size = sizeof( op->header_text_color); attrinfo[i++].size = sizeof( op->header_text_color);
} }
if ( (name = growapi_translate( transtab, "SelectColor"))) {
strcpy( attrinfo[i].name, name);
attrinfo[i].value_p = &op->select_drawtype;
attrinfo[i].type = glow_eType_Color;
attrinfo[i++].size = sizeof( op->select_drawtype);
}
if ( (name = growapi_translate( transtab, "Options"))) { if ( (name = growapi_translate( transtab, "Options"))) {
strcpy( attrinfo[i].name, name); strcpy( attrinfo[i].name, name);
attrinfo[i].value_p = &op->options; attrinfo[i].value_p = &op->options;
......
/* /*
* Proview $Id: glow_growtable.cpp,v 1.9 2005-12-06 09:13:08 claes Exp $ * Proview $Id: glow_growtable.cpp,v 1.10 2006-05-24 08:01:51 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -47,7 +47,8 @@ GrowTable::GrowTable( GlowCtx *glow_ctx, char *name, double x, double y, ...@@ -47,7 +47,8 @@ GrowTable::GrowTable( GlowCtx *glow_ctx, char *name, double x, double y,
header_text_size(1), header_text_size(1),
header_text_drawtype(glow_eDrawType_TextHelvetica), header_text_color(glow_eDrawType_Line), header_text_drawtype(glow_eDrawType_TextHelvetica), header_text_color(glow_eDrawType_Line),
header_row_height(0.8), row_height(0.6), value_size(0), cell_value(0), selected_cell_row(-1), header_row_height(0.8), row_height(0.6), value_size(0), cell_value(0), selected_cell_row(-1),
selected_cell_column(-1), input_focus(0), options(glow_mTableOptions_No) selected_cell_column(-1), select_drawtype( glow_eDrawType_Inherit),
input_focus(0), options(glow_mTableOptions_No)
{ {
for ( int i = 0; i < TABLE_MAX_COL; i++) { for ( int i = 0; i < TABLE_MAX_COL; i++) {
strcpy( header_text[i], ""); strcpy( header_text[i], "");
...@@ -100,6 +101,7 @@ void GrowTable::save( ofstream& fp, glow_eSaveMode mode) ...@@ -100,6 +101,7 @@ void GrowTable::save( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_GrowTable_header_row_height) << FSPACE << header_row_height << endl; fp << int(glow_eSave_GrowTable_header_row_height) << FSPACE << header_row_height << endl;
fp << int(glow_eSave_GrowTable_row_height) << FSPACE << row_height << endl; fp << int(glow_eSave_GrowTable_row_height) << FSPACE << row_height << endl;
fp << int(glow_eSave_GrowTable_options) << FSPACE << options << endl; fp << int(glow_eSave_GrowTable_options) << FSPACE << options << endl;
fp << int(glow_eSave_GrowTable_select_drawtype) << FSPACE << select_drawtype << endl;
for ( int i = 0; i < TABLE_MAX_COL; i++) { for ( int i = 0; i < TABLE_MAX_COL; i++) {
fp << int(glow_eSave_GrowTable_column_width1)+2*i << FSPACE << column_width[i] << endl; fp << int(glow_eSave_GrowTable_column_width1)+2*i << FSPACE << column_width[i] << endl;
fp << int(glow_eSave_GrowTable_header_text1)+2*i << FSPACE << header_text[i] << endl; fp << int(glow_eSave_GrowTable_header_text1)+2*i << FSPACE << header_text[i] << endl;
...@@ -146,6 +148,7 @@ void GrowTable::open( ifstream& fp) ...@@ -146,6 +148,7 @@ void GrowTable::open( ifstream& fp)
case glow_eSave_GrowTable_header_row_height: fp >> header_row_height; break; case glow_eSave_GrowTable_header_row_height: fp >> header_row_height; break;
case glow_eSave_GrowTable_row_height: fp >> row_height; break; case glow_eSave_GrowTable_row_height: fp >> row_height; break;
case glow_eSave_GrowTable_options: fp >> tmp; options = (glow_mTableOptions)tmp; break; case glow_eSave_GrowTable_options: fp >> tmp; options = (glow_mTableOptions)tmp; break;
case glow_eSave_GrowTable_select_drawtype: fp >> tmp; select_drawtype = (glow_eDrawType)tmp; break;
case glow_eSave_GrowTable_column_width1: fp >> column_width[0]; break; case glow_eSave_GrowTable_column_width1: fp >> column_width[0]; break;
case glow_eSave_GrowTable_header_text1: fp.get(); fp.getline( header_text[0], sizeof(header_text[0])); break; case glow_eSave_GrowTable_header_text1: fp.get(); fp.getline( header_text[0], sizeof(header_text[0])); break;
case glow_eSave_GrowTable_column_width2: fp >> column_width[1]; break; case glow_eSave_GrowTable_column_width2: fp >> column_width[1]; break;
...@@ -342,8 +345,14 @@ void GrowTable::draw( GlowTransform *t, int highlight, int hot, void *node, void ...@@ -342,8 +345,14 @@ void GrowTable::draw( GlowTransform *t, int highlight, int hot, void *node, void
glow_eDrawType light_drawtype; glow_eDrawType light_drawtype;
glow_eDrawType dark_drawtype; glow_eDrawType dark_drawtype;
glow_eDrawType sel_drawtype;
dark_drawtype = ((GrowCtx *)ctx)->shift_drawtype( fill_drawtype, 2, 0); dark_drawtype = ((GrowCtx *)ctx)->shift_drawtype( fill_drawtype, 2, 0);
light_drawtype = ((GrowCtx *)ctx)->shift_drawtype( fill_drawtype, -2, 0); light_drawtype = ((GrowCtx *)ctx)->shift_drawtype( fill_drawtype, -2, 0);
if ( select_drawtype == glow_eDrawType_Inherit)
sel_drawtype = dark_drawtype;
else
sel_drawtype = select_drawtype;
ll_x = int( dx1 * ctx->zoom_factor_x) - ctx->offset_x; ll_x = int( dx1 * ctx->zoom_factor_x) - ctx->offset_x;
ll_y = int( dy1 * ctx->zoom_factor_y) - ctx->offset_y; ll_y = int( dy1 * ctx->zoom_factor_y) - ctx->offset_y;
...@@ -451,7 +460,7 @@ void GrowTable::draw( GlowTransform *t, int highlight, int hot, void *node, void ...@@ -451,7 +460,7 @@ void GrowTable::draw( GlowTransform *t, int highlight, int hot, void *node, void
if ( selected_cell_row >= 0 && selected_cell_column == 0) { if ( selected_cell_row >= 0 && selected_cell_column == 0) {
x = ll_x; x = ll_x;
y = t_ll_y + row_height * ctx->zoom_factor_y * selected_cell_row; y = t_ll_y + row_height * ctx->zoom_factor_y * selected_cell_row;
glow_draw_fill_rect( ctx, int(x), int(y), header_w, int(row_height * ctx->zoom_factor_y), dark_drawtype); glow_draw_fill_rect( ctx, int(x), int(y), header_w, int(row_height * ctx->zoom_factor_y), sel_drawtype);
} }
if ( shadow) { if ( shadow) {
...@@ -505,7 +514,7 @@ void GrowTable::draw( GlowTransform *t, int highlight, int hot, void *node, void ...@@ -505,7 +514,7 @@ void GrowTable::draw( GlowTransform *t, int highlight, int hot, void *node, void
x += column_width[i] * ctx->zoom_factor_x; x += column_width[i] * ctx->zoom_factor_x;
y = t_ll_y + row_height * ctx->zoom_factor_y * selected_cell_row; y = t_ll_y + row_height * ctx->zoom_factor_y * selected_cell_row;
glow_draw_fill_rect( ctx, int(x), int(y), int(column_width[selected_cell_column] * ctx->zoom_factor_x), glow_draw_fill_rect( ctx, int(x), int(y), int(column_width[selected_cell_column] * ctx->zoom_factor_x),
int(row_height * ctx->zoom_factor_y), dark_drawtype); int(row_height * ctx->zoom_factor_y), sel_drawtype);
} }
if ( shadow) { if ( shadow) {
......
/* /*
* Proview $Id: glow_growtable.h,v 1.5 2005-09-01 14:57:54 claes Exp $ * Proview $Id: glow_growtable.h,v 1.6 2006-05-24 08:01:51 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -169,6 +169,7 @@ class GrowTable : public GrowRect { ...@@ -169,6 +169,7 @@ class GrowTable : public GrowRect {
char *cell_value; //!< Contains the cell values. char *cell_value; //!< Contains the cell values.
int selected_cell_row; //!< Row of the currently selected cell. -1 of no row is selected. int selected_cell_row; //!< Row of the currently selected cell. -1 of no row is selected.
int selected_cell_column; //!< Column of the currently selected cell. -1 of no row is selected. int selected_cell_column; //!< Column of the currently selected cell. -1 of no row is selected.
glow_eDrawType select_drawtype; //!< Drawtype for selected cell.
int input_focus; //!< This object has input focus. int input_focus; //!< This object has input focus.
int header_text_bold; //!< Header text is bold. int header_text_bold; //!< Header text is bold.
glow_mTableOptions options; //!< Options bitmask. glow_mTableOptions options; //!< Options bitmask.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment