diff options
author | joye <joye> | 2014-02-26 17:56:29 (GMT) |
---|---|---|
committer | joye <joye> | 2014-02-26 17:56:29 (GMT) |
commit | a3435fe9f1b9b401d7324053f87023c6c3855df1 (patch) | |
tree | e8154eb5913d494cf540a2b7a66132f66b09961b /src | |
parent | abc503d7baf8ad69d6a21fb1c00fd428cb9c94d2 (diff) | |
download | blt-a3435fe9f1b9b401d7324053f87023c6c3855df1.zip blt-a3435fe9f1b9b401d7324053f87023c6c3855df1.tar.gz blt-a3435fe9f1b9b401d7324053f87023c6c3855df1.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/bltGrLegd.C | 19 | ||||
-rw-r--r-- | src/bltGraph.C | 168 |
2 files changed, 54 insertions, 133 deletions
diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index eb283be..8a3f955 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -321,12 +321,12 @@ static Tcl_Obj* PositionGetProc(ClientData clientData, Tk_Window tkwin, static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "ActiveBackground", - "skyblue4", -1, Tk_Offset(Legend, activeBg), 0, NULL, 0}, + STD_ACTIVE_BACKGROUND, -1, Tk_Offset(Legend, activeBg), 0, NULL, 0}, {TK_OPTION_PIXELS, "-activeborderwidth", "activeBorderWidth", "ActiveBorderWidth", STD_BORDERWIDTH, -1, Tk_Offset(Legend, entryBW), 0, NULL, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "ActiveForeground", - "white", -1, Tk_Offset(Legend, activeFgColor), 0, NULL, 0}, + STD_ACTIVE_FOREGROUND, -1, Tk_Offset(Legend, activeFgColor), 0, NULL, 0}, {TK_OPTION_RELIEF, "-activerelief", "activeRelief", "ActiveRelief", "flat", -1, Tk_Offset(Legend, activeRelief), 0, NULL, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", @@ -338,9 +338,8 @@ static Tk_OptionSpec optionSpecs[] = { STD_BORDERWIDTH, -1, Tk_Offset(Legend, borderWidth), 0, NULL, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, -1, 0, 0, "-borderwidth", 0}, {TK_OPTION_INT, "-columns", "columns", "columns", - 0, -1, Tk_Offset(Legend, reqColumns), 0, NULL, 0}, - {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", - "ExportSelection", + "0", -1, Tk_Offset(Legend, reqColumns), 0, NULL, 0}, + {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", "ExportSelection", "no", -1, Tk_Offset(Legend, exportSelection), 0, NULL, 0}, {TK_OPTION_CUSTOM, "-focusdashes", "focusDashes", "FocusDashes", "dot", -1, Tk_Offset(Legend, focusDashes), @@ -360,10 +359,10 @@ static Tk_OptionSpec optionSpecs[] = { "1", -1, Tk_Offset(Legend, iyPad), 0, NULL, 0}, {TK_OPTION_BORDER, "-nofocusselectbackground", "noFocusSelectBackground", "NoFocusSelectBackground", - "skyblue4", -1, Tk_Offset(Legend, selOutFocusBg), 0, NULL, 0}, + STD_ACTIVE_BACKGROUND, -1, Tk_Offset(Legend, selOutFocusBg), 0, NULL, 0}, {TK_OPTION_COLOR, "-nofocusselectforeground", "noFocusSelectForeground", "NoFocusSelectForeground", - "white", -1, Tk_Offset(Legend, selOutFocusFgColor), 0, NULL, 0}, + STD_ACTIVE_FOREGROUND, -1, Tk_Offset(Legend, selOutFocusFgColor), 0, NULL,0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", "1", -1, Tk_Offset(Legend, xPad), 0, NULL, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", @@ -375,17 +374,17 @@ static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_RELIEF, "-relief", "relief", "Relief", "flat", -1, Tk_Offset(Legend, relief), 0, NULL, 0}, {TK_OPTION_INT, "-rows", "rows", "rows", - 0, -1, Tk_Offset(Legend, reqRows), 0, NULL, 0}, + "0", -1, Tk_Offset(Legend, reqRows), 0, NULL, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "SelectBackground", - "skyblue4", -1, Tk_Offset(Legend, selInFocusBg), 0, NULL, 0}, + STD_ACTIVE_BACKGROUND, -1, Tk_Offset(Legend, selInFocusBg), 0, NULL, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "SelectBorderWidth", "1", -1, Tk_Offset(Legend, selBW), 0, NULL, 0}, {TK_OPTION_STRING, "-selectcommand", "selectCommand", "SelectCommand", NULL, -1, Tk_Offset(Legend, selectCmd), TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "SelectForeground", - "white", -1, Tk_Offset(Legend, selInFocusFgColor), 0, NULL, 0}, + STD_ACTIVE_FOREGROUND, -1, Tk_Offset(Legend, selInFocusFgColor), 0, NULL, 0}, {TK_OPTION_STRING_TABLE, "-selectmode", "selectMode", "SelectMode", "multiple", -1, Tk_Offset(Legend, selectMode), 0, &selectmodeObjOption, 0}, {TK_OPTION_RELIEF, "-selectrelief", "selectRelief", "SelectRelief", diff --git a/src/bltGraph.C b/src/bltGraph.C index 3409c5f..9a7ed9d 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -72,41 +72,6 @@ static const char* objectClassNames[] = { "WindowMarker", }; -#define DEF_GRAPH_ASPECT_RATIO "0.0" -#define DEF_GRAPH_BAR_BASELINE "0.0" -#define DEF_GRAPH_BAR_MODE "normal" -#define DEF_GRAPH_BAR_WIDTH "0.9" -#define DEF_GRAPH_BACKGROUND STD_NORMAL_BACKGROUND -#define DEF_GRAPH_BORDERWIDTH STD_BORDERWIDTH -#define DEF_GRAPH_BUFFER_ELEMENTS "yes" -#define DEF_GRAPH_BUFFER_GRAPH "1" -#define DEF_GRAPH_CURSOR "crosshair" -#define DEF_GRAPH_FONT STD_FONT_MEDIUM -#define DEF_GRAPH_HALO "2m" -#define DEF_GRAPH_HALO_BAR "0.1i" -#define DEF_GRAPH_HEIGHT "4i" -#define DEF_GRAPH_HIGHLIGHT_BACKGROUND STD_NORMAL_BACKGROUND -#define DEF_GRAPH_HIGHLIGHT_COLOR black -#define DEF_GRAPH_HIGHLIGHT_WIDTH "2" -#define DEF_GRAPH_INVERT_XY "0" -#define DEF_GRAPH_JUSTIFY "center" -#define DEF_GRAPH_MARGIN "0" -#define DEF_GRAPH_MARGIN_VAR NULL -#define DEF_GRAPH_PLOT_BACKGROUND STD_NORMAL_BACKGROUND -#define DEF_GRAPH_PLOT_BORDERWIDTH STD_BORDERWIDTH -#define DEF_GRAPH_PLOT_HEIGHT "0" -#define DEF_GRAPH_PLOT_PADX "0" -#define DEF_GRAPH_PLOT_PADY "0" -#define DEF_GRAPH_PLOT_RELIEF "flat" -#define DEF_GRAPH_PLOT_WIDTH "0" -#define DEF_GRAPH_RELIEF "flat" -#define DEF_GRAPH_SHOW_VALUES "no" -#define DEF_GRAPH_STACK_AXES "no" -#define DEF_GRAPH_TAKE_FOCUS "" -#define DEF_GRAPH_TITLE NULL -#define DEF_GRAPH_TITLE_COLOR STD_NORMAL_FOREGROUND -#define DEF_GRAPH_WIDTH "5i" - static Tcl_IdleProc DisplayGraph; static Tcl_FreeProc DestroyGraph; static Tk_EventProc GraphEventProc; @@ -134,154 +99,111 @@ static char* barmodeObjOption[] = static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_DOUBLE, "-aspect", "aspect", "Aspect", - DEF_GRAPH_ASPECT_RATIO, - -1, Tk_Offset(Graph, aspect), 0, NULL, + "0", -1, Tk_Offset(Graph, aspect), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_GRAPH_BACKGROUND, - -1, Tk_Offset(Graph, normalBg), 0, NULL, + STD_NORMAL_BACKGROUND, -1, Tk_Offset(Graph, normalBg), 0, NULL, CACHE_DIRTY}, {TK_OPTION_STRING_TABLE, "-barmode", "barMode", "BarMode", - DEF_GRAPH_BAR_MODE, - -1, Tk_Offset(Graph, mode), 0, &barmodeObjOption, + "normal", -1, Tk_Offset(Graph, mode), 0, &barmodeObjOption, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_DOUBLE, "-barwidth", "barWidth", "BarWidth", - DEF_GRAPH_BAR_WIDTH, - -1, Tk_Offset(Graph, barWidth), 0, NULL, + ".9", -1, Tk_Offset(Graph, barWidth), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_DOUBLE, "-baseline", "baseline", "Baseline", - DEF_GRAPH_BAR_BASELINE, - -1, Tk_Offset(Graph, baseline), 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_SYNONYM, "-bm", NULL, NULL, NULL, - -1, 0, 0, "-bottommargin", 0}, + "0", -1, Tk_Offset(Graph, baseline), 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_SYNONYM, "-bm", NULL, NULL, NULL, -1, 0, 0, "-bottommargin", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_GRAPH_BORDERWIDTH, - -1, Tk_Offset(Graph, borderWidth), 0, NULL, + STD_BORDERWIDTH, -1, Tk_Offset(Graph, borderWidth), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-bottommargin", "bottomMargin", "BottomMargin", - DEF_GRAPH_MARGIN, - -1, Tk_Offset(Graph, bottomMargin.reqSize), 0, NULL, + "0", -1, Tk_Offset(Graph, bottomMargin.reqSize), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_STRING, "-bottomvariable", "bottomVariable", "BottomVariable", - DEF_GRAPH_MARGIN_VAR, - -1, Tk_Offset(Graph, bottomMargin.varName), TK_OPTION_NULL_OK, NULL, 0}, + NULL, -1, Tk_Offset(Graph, bottomMargin.varName), + TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BOOLEAN, "-bufferelements", "bufferElements", "BufferElements", - DEF_GRAPH_BUFFER_ELEMENTS, - -1, Tk_Offset(Graph, backingStore), 0, NULL, 0}, + "yes", -1, Tk_Offset(Graph, backingStore), 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-buffergraph", "bufferGraph", "BufferGraph", - DEF_GRAPH_BUFFER_GRAPH, - -1, Tk_Offset(Graph, doubleBuffer), 0, NULL, 0}, + "yes", -1, Tk_Offset(Graph, doubleBuffer), 0, NULL, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_GRAPH_CURSOR, - -1, Tk_Offset(Graph, cursor), TK_OPTION_NULL_OK, NULL, 0}, - {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, - -1, 0, 0, "-foreground", 0}, + "crosshair", -1, Tk_Offset(Graph, cursor), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, -1, 0, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_GRAPH_FONT, - -1, Tk_Offset(Graph, titleTextStyle.font), 0, NULL, + STD_FONT_MEDIUM, -1, Tk_Offset(Graph, titleTextStyle.font), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_GRAPH_TITLE_COLOR, - -1, Tk_Offset(Graph, titleTextStyle.color), 0, NULL, + STD_NORMAL_FOREGROUND, -1, Tk_Offset(Graph, titleTextStyle.color), 0, NULL, CACHE_DIRTY}, {TK_OPTION_PIXELS, "-halo", "halo", "Halo", - DEF_GRAPH_HALO, - -1, Tk_Offset(Graph, halo), 0, NULL, 0}, + "2m", -1, Tk_Offset(Graph, halo), 0, NULL, 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_GRAPH_HEIGHT, - -1, Tk_Offset(Graph, reqHeight), 0, NULL, + "4i", -1, Tk_Offset(Graph, reqHeight), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", - DEF_GRAPH_HIGHLIGHT_BACKGROUND, - -1, Tk_Offset(Graph, highlightBgColor), 0, NULL, + STD_NORMAL_BACKGROUND, -1, Tk_Offset(Graph, highlightBgColor), 0, NULL, CACHE_DIRTY}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_GRAPH_HIGHLIGHT_COLOR, - -1, Tk_Offset(Graph, highlightColor), 0, NULL, 0}, + STD_NORMAL_FOREGROUND, -1, Tk_Offset(Graph, highlightColor), 0, NULL, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", - DEF_GRAPH_HIGHLIGHT_WIDTH, - -1, Tk_Offset(Graph, highlightWidth), 0, NULL, 0}, + "2", -1, Tk_Offset(Graph, highlightWidth), 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-invertxy", "invertXY", "InvertXY", - DEF_GRAPH_INVERT_XY, - -1, Tk_Offset(Graph, inverted), 0, NULL, + "no", -1, Tk_Offset(Graph, inverted), 0, NULL, RESET_WORLD | CACHE_DIRTY | RESET_AXES}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_GRAPH_JUSTIFY, - -1, Tk_Offset(Graph, titleTextStyle.justify), 0, NULL, 0}, + "center", -1, Tk_Offset(Graph, titleTextStyle.justify), 0, NULL, 0}, {TK_OPTION_PIXELS, "-leftmargin", "leftMargin", "Margin", - DEF_GRAPH_MARGIN, - -1, Tk_Offset(Graph, leftMargin.reqSize), 0, NULL, + "0", -1, Tk_Offset(Graph, leftMargin.reqSize), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_STRING, "-leftvariable", "leftVariable", "LeftVariable", - DEF_GRAPH_MARGIN_VAR, - -1, Tk_Offset(Graph, leftMargin.varName), TK_OPTION_NULL_OK, NULL, 0}, - {TK_OPTION_SYNONYM, "-lm", NULL, NULL, NULL, - -1, 0, 0, "-leftmargin", 0}, + NULL, -1, Tk_Offset(Graph, leftMargin.varName), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_SYNONYM, "-lm", NULL, NULL, NULL, -1, 0, 0, "-leftmargin", 0}, {TK_OPTION_BORDER, "-plotbackground", "plotbackground", "PlotBackground", - DEF_GRAPH_PLOT_BACKGROUND, - -1, Tk_Offset(Graph, plotBg), 0, NULL, + STD_NORMAL_BACKGROUND, -1, Tk_Offset(Graph, plotBg), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-plotborderwidth", "plotBorderWidth", "PlotBorderWidth", - DEF_GRAPH_PLOT_BORDERWIDTH, - -1, Tk_Offset(Graph, plotBW), 0, NULL, + STD_BORDERWIDTH, -1, Tk_Offset(Graph, plotBW), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-plotpadx", "plotPadX", "PlotPad", - DEF_GRAPH_PLOT_PADX, - -1, Tk_Offset(Graph, xPad), 0, NULL, + "0", -1, Tk_Offset(Graph, xPad), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-plotpady", "plotPadY", "PlotPad", - DEF_GRAPH_PLOT_PADY, - -1, Tk_Offset(Graph, yPad), 0, NULL, + "0", -1, Tk_Offset(Graph, yPad), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_RELIEF, "-plotrelief", "plotRelief", "Relief", - DEF_GRAPH_PLOT_RELIEF, - -1, Tk_Offset(Graph, plotRelief), 0, NULL, + "flat", -1, Tk_Offset(Graph, plotRelief), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_GRAPH_RELIEF, - -1, Tk_Offset(Graph, relief), 0, NULL, 0}, + "flat", -1, Tk_Offset(Graph, relief), 0, NULL, 0}, {TK_OPTION_PIXELS, "-rightmargin", "rightMargin", "Margin", - DEF_GRAPH_MARGIN, - -1, Tk_Offset(Graph, rightMargin.reqSize), 0, NULL, + "0", -1, Tk_Offset(Graph, rightMargin.reqSize), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_STRING, "-rightvariable", "rightVariable", "RightVariable", - DEF_GRAPH_MARGIN_VAR, - -1, Tk_Offset(Graph, rightMargin.varName), TK_OPTION_NULL_OK, NULL, 0}, - {TK_OPTION_SYNONYM, "-rm", NULL, NULL, NULL, - -1, 0, 0, "-rightmargin", 0}, + NULL, -1, Tk_Offset(Graph, rightMargin.varName), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_SYNONYM, "-rm", NULL, NULL, NULL, -1, 0, 0, "-rightmargin", 0}, {TK_OPTION_BOOLEAN, "-stackaxes", "stackAxes", "StackAxes", - DEF_GRAPH_STACK_AXES, - -1, Tk_Offset(Graph, stackAxes), 0, NULL, 0}, + "no", -1, Tk_Offset(Graph, stackAxes), 0, NULL, 0}, {TK_OPTION_STRING, "-title", "title", "Title", - DEF_GRAPH_TITLE, - -1, Tk_Offset(Graph, title), TK_OPTION_NULL_OK, NULL, + NULL, -1, Tk_Offset(Graph, title), TK_OPTION_NULL_OK, NULL, RESET_WORLD | CACHE_DIRTY}, - {TK_OPTION_SYNONYM, "-tm", NULL, NULL, NULL, - -1, 0, 0, "-topmargin", 0}, + {TK_OPTION_SYNONYM, "-tm", NULL, NULL, NULL, -1, 0, 0, "-topmargin", 0}, {TK_OPTION_PIXELS, "-topmargin", "topMargin", "TopMargin", - DEF_GRAPH_MARGIN, - -1, Tk_Offset(Graph, topMargin.reqSize), 0, NULL, + "0", -1, Tk_Offset(Graph, topMargin.reqSize), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_STRING, "-topvariable", "topVariable", "TopVariable", - DEF_GRAPH_MARGIN_VAR, - -1, Tk_Offset(Graph, topMargin.varName), TK_OPTION_NULL_OK, NULL, 0}, + NULL, -1, Tk_Offset(Graph, topMargin.varName), TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_GRAPH_WIDTH, - -1, Tk_Offset(Graph, reqWidth), 0, NULL, + "5i", -1, Tk_Offset(Graph, reqWidth), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-plotwidth", "plotWidth", "PlotWidth", - DEF_GRAPH_PLOT_WIDTH, - -1, Tk_Offset(Graph, reqPlotWidth), 0, NULL, + "0", -1, Tk_Offset(Graph, reqPlotWidth), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-plotheight", "plotHeight", "PlotHeight", - DEF_GRAPH_PLOT_HEIGHT, - -1, Tk_Offset(Graph, reqPlotHeight), 0, NULL, + "0", -1, Tk_Offset(Graph, reqPlotHeight), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_END, NULL, NULL, NULL, NULL, -1, 0, 0, NULL, 0} }; |