diff options
author | joye <joye> | 2014-02-20 22:06:17 (GMT) |
---|---|---|
committer | joye <joye> | 2014-02-20 22:06:17 (GMT) |
commit | 16e96b099970ec19d9db331ef56a2e5e7712e2d0 (patch) | |
tree | 2d36045ce38275391679157385fc1336fff658cd /src | |
parent | 85d33eb68078b0ac07acf782f957453c2462ab50 (diff) | |
download | blt-16e96b099970ec19d9db331ef56a2e5e7712e2d0.zip blt-16e96b099970ec19d9db331ef56a2e5e7712e2d0.tar.gz blt-16e96b099970ec19d9db331ef56a2e5e7712e2d0.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/bltGrElemBar.C | 247 | ||||
-rw-r--r-- | src/bltGrElemLine.C | 4 |
2 files changed, 187 insertions, 64 deletions
diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C index 2a8f3f6..20e2431 100644 --- a/src/bltGrElemBar.C +++ b/src/bltGrElemBar.C @@ -204,12 +204,13 @@ extern Blt_CustomOption bltBarStylesOption; #define DEF_BAR_ERRORBAR_LINE_WIDTH "1" #define DEF_BAR_ERRORBAR_CAP_WIDTH "1" #define DEF_BAR_HIDE "no" +#define DEF_BAR_LABEL NULL #define DEF_BAR_LABEL_RELIEF "flat" #define DEF_BAR_NORMAL_STIPPLE "" #define DEF_BAR_RELIEF "raised" #define DEF_BAR_SHOW_ERRORBARS "both" #define DEF_BAR_STATE "normal" -#define DEF_BAR_STACK (char *)NULL +#define DEF_BAR_STACK NULL #define DEF_BAR_STYLES "" #define DEF_BAR_TAGS "all" #define DEF_BAR_WIDTH "0.0" @@ -223,72 +224,76 @@ extern Blt_CustomOption bltBarStylesOption; #define DEF_PEN_STIPPLE "" #define DEF_PEN_TYPE "bar" #define DEF_PEN_VALUE_ANCHOR "s" +#define DEF_PEN_VALUE_ANGLE 0 #define DEF_PEN_VALUE_COLOR black #define DEF_PEN_VALUE_FONT STD_FONT_SMALL #define DEF_PEN_VALUE_FORMAT "%g" #define DEF_PEN_SHOW_VALUES "no" -static Blt_ConfigSpec barPenConfigSpecs[] = { - {BLT_CONFIG_BORDER, "-background", "background", "Background", - DEF_PEN_ACTIVE_BACKGROUND, Tk_Offset(BarPen, fill), - BLT_CONFIG_NULL_OK | ACTIVE_PEN}, - {BLT_CONFIG_BORDER, "-background", "background", "Background", - DEF_PEN_NORMAL_BACKGROUND, Tk_Offset(BarPen, fill), - BLT_CONFIG_NULL_OK | NORMAL_PEN}, - {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, - (char *)NULL, 0, ALL_PENS}, - {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, - (char *)NULL, 0, ALL_PENS}, - {BLT_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_PEN_BORDERWIDTH, Tk_Offset(BarPen, borderWidth), ALL_PENS}, - {BLT_CONFIG_CUSTOM, "-errorbarcolor", "errorBarColor", "ErrorBarColor", - DEF_BAR_ERRORBAR_COLOR, Tk_Offset(BarPen, errorBarColor), ALL_PENS, - &bltColorOption}, - {BLT_CONFIG_PIXELS, "-errorbarwidth", "errorBarWidth","ErrorBarWidth", - DEF_BAR_ERRORBAR_LINE_WIDTH, Tk_Offset(BarPen, errorBarLineWidth), - ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_PIXELS, "-errorbarcap", "errorBarCap", "ErrorBarCap", - DEF_BAR_ERRORBAR_CAP_WIDTH, Tk_Offset(BarPen, errorBarCapWidth), - ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, - (char *)NULL, 0, ALL_PENS}, - {BLT_CONFIG_SYNONYM, "-fill", "background", (char *)NULL, - (char *)NULL, 0, ALL_PENS}, - {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", - DEF_PEN_ACTIVE_FOREGROUND, Tk_Offset(BarPen, outlineColor), - ACTIVE_PEN | BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", - DEF_PEN_NORMAL_FOREGROUND, Tk_Offset(BarPen, outlineColor), - NORMAL_PEN | BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_SYNONYM, "-outline", "foreground", (char *)NULL, - (char *)NULL, 0, ALL_PENS}, - {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", - DEF_PEN_RELIEF, Tk_Offset(BarPen, relief), ALL_PENS}, - {BLT_CONFIG_CUSTOM, "-showerrorbars", "showErrorBars", "ShowErrorBars", - DEF_BAR_SHOW_ERRORBARS, Tk_Offset(BarPen, errorBarShow), - BLT_CONFIG_DONT_SET_DEFAULT, &fillOption}, - {BLT_CONFIG_CUSTOM, "-showvalues", "showValues", "ShowValues", - DEF_PEN_SHOW_VALUES, Tk_Offset(BarPen, valueShow), - ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT, &fillOption}, - {BLT_CONFIG_BITMAP, "-stipple", "stipple", "Stipple", DEF_PEN_STIPPLE, - Tk_Offset(BarPen, stipple), ALL_PENS | BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_STRING, "-type", (char *)NULL, (char *)NULL, DEF_PEN_TYPE, - Tk_Offset(BarPen, typeId), ALL_PENS | BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor", - DEF_PEN_VALUE_ANCHOR, Tk_Offset(BarPen, valueStyle.anchor), - ALL_PENS}, - {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor", - DEF_PEN_VALUE_COLOR, Tk_Offset(BarPen, valueStyle.color), - ALL_PENS}, - {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont", - DEF_PEN_VALUE_FONT, Tk_Offset(BarPen, valueStyle.font), - ALL_PENS}, - {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat", - DEF_PEN_VALUE_FORMAT, Tk_Offset(BarPen, valueFormat), - ALL_PENS | BLT_CONFIG_NULL_OK}, - {BLT_CONFIG_DOUBLE, "-valuerotate", "valueRotate", "ValueRotate", - (char *)NULL, Tk_Offset(BarPen, valueStyle.angle), ALL_PENS}, - {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0} +//*** + +static Tk_OptionSpec barElemOptionSpecs[] = { + {TK_OPTION_BORDER, "-background", "background", "Background", + DEF_BAR_BACKGROUND, + -1, Tk_Offset(BarElement, builtinPen.fill), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_DOUBLE, "-barwidth", "barWidth", "BarWidth", + DEF_BAR_WIDTH, + -1, Tk_Offset(BarElement, barWidth), 0, NULL, 0}, + {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, + -1, 0, 0, "-borderwidth", 0}, + {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, + -1, 0, 0, "-background", 0}, + {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", + DEF_BAR_BORDERWIDTH, + -1, Tk_Offset(BarElement, builtinPen.borderWidth), 0, NULL, 0}, + {TK_OPTION_SYNONYM, "-color", NULL, NULL, NULL, + -1, 0, 0, "-background", 0}, + {TK_OPTION_PIXELS,"-errorbarwidth", "errorBarWidth", "ErrorBarWidth", + DEF_BAR_ERRORBAR_LINE_WIDTH, + -1, Tk_Offset(BarElement, builtinPen.errorBarLineWidth), 0, NULL, 0}, + {TK_OPTION_PIXELS, "-errorbarcap", "errorBarCap", "ErrorBarCap", + DEF_BAR_ERRORBAR_CAP_WIDTH, + -1, Tk_Offset(BarElement, builtinPen.errorBarCapWidth), 0, NULL, 0}, + {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, + -1, 0, 0, "-foreground", 0}, + {TK_OPTION_SYNONYM, "-fill", NULL, NULL, NULL, + -1, 0, 0, "-background", 0}, + {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", + DEF_BAR_FOREGROUND, + -1, Tk_Offset(BarElement, builtinPen.outlineColor),TK_OPTION_NULL_OK,NULL,0}, + {TK_OPTION_STRING, "-label", "label", "Label", + DEF_BAR_LABEL, + -1, Tk_Offset(BarElement, label), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_RELIEF, "-legendrelief", "legendRelief", "LegendRelief", + DEF_BAR_LABEL_RELIEF, + -1, Tk_Offset(BarElement, legendRelief), 0, NULL, 0}, + {TK_OPTION_SYNONYM, "-outline", NULL, NULL, NULL, + -1, 0, 0, "-foreground", 0}, + {TK_OPTION_RELIEF, "-relief", "relief", "Relief", + DEF_BAR_RELIEF, + -1, Tk_Offset(BarElement, builtinPen.relief), 0, NULL, 0}, + {TK_OPTION_STRING, "-stack", "stack", "Stack", + DEF_BAR_STACK, + -1, Tk_Offset(BarElement, groupName), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_BITMAP, "-stipple", "stipple", "Stipple", + DEF_BAR_NORMAL_STIPPLE, + -1, Tk_Offset(BarElement, builtinPen.stipple), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor", + DEF_PEN_VALUE_ANCHOR, + -1, Tk_Offset(BarElement, builtinPen.valueStyle.anchor), 0, NULL, 0}, + {TK_OPTION_COLOR, "-valuecolor", "valueColor", "ValueColor", + DEF_PEN_VALUE_COLOR, + -1, Tk_Offset(BarElement, builtinPen.valueStyle.color), 0, NULL, 0}, + {TK_OPTION_FONT, "-valuefont", "valueFont", "ValueFont", + DEF_PEN_VALUE_FONT, + -1, Tk_Offset(BarElement, builtinPen.valueStyle.font), 0, NULL, 0}, + {TK_OPTION_STRING, "-valueformat", "valueFormat", "ValueFormat", + DEF_PEN_VALUE_FORMAT, Tk_Offset(BarElement, builtinPen.valueFormat), + -1, TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_DOUBLE, "-valuerotate", "valueRotate", "ValueRotate", + DEF_PEN_VALUE_ANGLE, + -1, Tk_Offset(BarElement, builtinPen.valueStyle.angle), 0, NULL, 0}, + {TK_OPTION_END, NULL, NULL, NULL, NULL, -1, 0, 0, NULL, 0} }; Blt_CustomOption bitmaskBarElemHideOption = @@ -409,6 +414,124 @@ static Blt_ConfigSpec barElemConfigSpecs[] = { {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0} }; +//*** + +static Tk_OptionSpec barPenOptionSpecs[] = { + {TK_OPTION_BORDER, "-background", "background", "Background", + DEF_PEN_NORMAL_BACKGROUND, + -1, Tk_Offset(BarPen, fill), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, + -1, 0, 0, "-borderwidth", 0}, + {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, + -1, 0, 0, "-background", 0}, + {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", + DEF_PEN_BORDERWIDTH, + -1, Tk_Offset(BarPen, borderWidth), 0, NULL, 0}, + {TK_OPTION_PIXELS, "-errorbarwidth", "errorBarWidth","ErrorBarWidth", + DEF_BAR_ERRORBAR_LINE_WIDTH, + -1, Tk_Offset(BarPen, errorBarLineWidth), 0, NULL, 0}, + {TK_OPTION_PIXELS, "-errorbarcap", "errorBarCap", "ErrorBarCap", + DEF_BAR_ERRORBAR_CAP_WIDTH, + -1, Tk_Offset(BarPen, errorBarCapWidth), 0, NULL, 0}, + {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, + -1, 0, 0, "-foreground", 0}, + {TK_OPTION_SYNONYM, "-fill", NULL, NULL, NULL, + -1, 0, 0, "-background", 0}, + {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", + DEF_PEN_NORMAL_FOREGROUND, + -1, Tk_Offset(BarPen, outlineColor), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_SYNONYM, "-outline", NULL, NULL, NULL, + -1, 0, 0, "-foreground", 0}, + {TK_OPTION_RELIEF, "-relief", "relief", "Relief", + DEF_PEN_RELIEF, + -1, Tk_Offset(BarPen, relief), 0, NULL, 0}, + {TK_OPTION_BITMAP, "-stipple", "stipple", "Stipple", + DEF_PEN_STIPPLE, + -1, Tk_Offset(BarPen, stipple), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_STRING, "-type", "type", "Type", + DEF_PEN_TYPE, + -1, Tk_Offset(BarPen, typeId), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor", + DEF_PEN_VALUE_ANCHOR, + -1, Tk_Offset(BarPen, valueStyle.anchor), 0, NULL, 0}, + {TK_OPTION_COLOR, "-valuecolor", "valueColor", "ValueColor", + DEF_PEN_VALUE_COLOR, + -1, Tk_Offset(BarPen, valueStyle.color), 0, NULL, 0}, + {TK_OPTION_FONT, "-valuefont", "valueFont", "ValueFont", + DEF_PEN_VALUE_FONT, + -1, Tk_Offset(BarPen, valueStyle.font), 0, NULL, 0}, + {TK_OPTION_STRING, "-valueformat", "valueFormat", "ValueFormat", + DEF_PEN_VALUE_FORMAT, + -1, Tk_Offset(BarPen, valueFormat), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_DOUBLE, "-valuerotate", "valueRotate", "ValueRotate", + DEF_PEN_VALUE_ANGLE, + -1, Tk_Offset(BarPen, valueStyle.angle), 0, NULL, 0}, + {TK_OPTION_END, NULL, NULL, NULL, NULL, -1, 0, 0, NULL, 0} +}; + +static Blt_ConfigSpec barPenConfigSpecs[] = { + {BLT_CONFIG_BORDER, "-background", "background", "Background", + DEF_PEN_ACTIVE_BACKGROUND, Tk_Offset(BarPen, fill), + BLT_CONFIG_NULL_OK | ACTIVE_PEN}, + {BLT_CONFIG_BORDER, "-background", "background", "Background", + DEF_PEN_NORMAL_BACKGROUND, Tk_Offset(BarPen, fill), + BLT_CONFIG_NULL_OK | NORMAL_PEN}, + {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, + (char *)NULL, 0, ALL_PENS}, + {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, + (char *)NULL, 0, ALL_PENS}, + {BLT_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", + DEF_PEN_BORDERWIDTH, Tk_Offset(BarPen, borderWidth), ALL_PENS}, + {BLT_CONFIG_CUSTOM, "-errorbarcolor", "errorBarColor", "ErrorBarColor", + DEF_BAR_ERRORBAR_COLOR, Tk_Offset(BarPen, errorBarColor), ALL_PENS, + &bltColorOption}, + {BLT_CONFIG_PIXELS, "-errorbarwidth", "errorBarWidth","ErrorBarWidth", + DEF_BAR_ERRORBAR_LINE_WIDTH, Tk_Offset(BarPen, errorBarLineWidth), + ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT}, + {BLT_CONFIG_PIXELS, "-errorbarcap", "errorBarCap", "ErrorBarCap", + DEF_BAR_ERRORBAR_CAP_WIDTH, Tk_Offset(BarPen, errorBarCapWidth), + ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT}, + {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, + (char *)NULL, 0, ALL_PENS}, + {BLT_CONFIG_SYNONYM, "-fill", "background", (char *)NULL, + (char *)NULL, 0, ALL_PENS}, + {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", + DEF_PEN_ACTIVE_FOREGROUND, Tk_Offset(BarPen, outlineColor), + ACTIVE_PEN | BLT_CONFIG_NULL_OK}, + {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", + DEF_PEN_NORMAL_FOREGROUND, Tk_Offset(BarPen, outlineColor), + NORMAL_PEN | BLT_CONFIG_NULL_OK}, + {BLT_CONFIG_SYNONYM, "-outline", "foreground", (char *)NULL, + (char *)NULL, 0, ALL_PENS}, + {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", + DEF_PEN_RELIEF, Tk_Offset(BarPen, relief), ALL_PENS}, + {BLT_CONFIG_CUSTOM, "-showerrorbars", "showErrorBars", "ShowErrorBars", + DEF_BAR_SHOW_ERRORBARS, Tk_Offset(BarPen, errorBarShow), + BLT_CONFIG_DONT_SET_DEFAULT, &fillOption}, + {BLT_CONFIG_CUSTOM, "-showvalues", "showValues", "ShowValues", + DEF_PEN_SHOW_VALUES, Tk_Offset(BarPen, valueShow), + ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT, &fillOption}, + {BLT_CONFIG_BITMAP, "-stipple", "stipple", "Stipple", DEF_PEN_STIPPLE, + Tk_Offset(BarPen, stipple), ALL_PENS | BLT_CONFIG_NULL_OK}, + {BLT_CONFIG_STRING, "-type", (char *)NULL, (char *)NULL, DEF_PEN_TYPE, + Tk_Offset(BarPen, typeId), ALL_PENS | BLT_CONFIG_NULL_OK}, + {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor", + DEF_PEN_VALUE_ANCHOR, Tk_Offset(BarPen, valueStyle.anchor), + ALL_PENS}, + {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor", + DEF_PEN_VALUE_COLOR, Tk_Offset(BarPen, valueStyle.color), + ALL_PENS}, + {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont", + DEF_PEN_VALUE_FONT, Tk_Offset(BarPen, valueStyle.font), + ALL_PENS}, + {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat", + DEF_PEN_VALUE_FORMAT, Tk_Offset(BarPen, valueFormat), + ALL_PENS | BLT_CONFIG_NULL_OK}, + {BLT_CONFIG_DOUBLE, "-valuerotate", "valueRotate", "ValueRotate", + (char *)NULL, Tk_Offset(BarPen, valueStyle.angle), ALL_PENS}, + {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0} +}; + /* Forward declarations */ static PenConfigureProc ConfigureBarPenProc; static PenDestroyProc DestroyBarPenProc; diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index c433bf1..a410984 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -432,10 +432,10 @@ extern Blt_CustomOption bltYAxisOption; #define DEF_PEN_SYMBOL "none" #define DEF_PEN_TYPE "line" #define DEF_PEN_VALUE_ANCHOR "s" +#define DEF_PEN_VALUE_ANGLE 0 #define DEF_PEN_VALUE_COLOR black #define DEF_PEN_VALUE_FONT STD_FONT_NUMBERS #define DEF_PEN_VALUE_FORMAT "%g" -#define DEF_PEN_VALUE_ANGLE NULL #define DEF_PEN_WIDTH "1" //*** @@ -457,7 +457,7 @@ static Tk_OptionSpec lineElemOptionSpecs[] = { DEF_LINE_ERRORBAR_CAP_WIDTH, -1, Tk_Offset(LineElement, builtinPen.errorBarCapWidth), 0, NULL, 0}, {TK_OPTION_STRING, "-label", "label", "Label", - NULL, + DEF_LINE_LABEL, -1, Tk_Offset(LineElement, label), TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_RELIEF, "-legendrelief", "legendRelief", "LegendRelief", DEF_LINE_LABEL_RELIEF, |