diff options
-rw-r--r-- | src/bltGrLegd.C | 70 | ||||
-rw-r--r-- | src/bltGrLegd.h | 1 | ||||
-rw-r--r-- | src/bltGrLegdOp.C | 15 | ||||
-rw-r--r-- | src/bltGrMarkerOp.C | 6 | ||||
-rw-r--r-- | src/bltGrMisc.h | 12 | ||||
-rw-r--r-- | src/bltGraph.C | 10 | ||||
-rw-r--r-- | src/bltGraphBar.C | 10 | ||||
-rw-r--r-- | src/bltGraphLine.C | 10 | ||||
-rw-r--r-- | tests/legend.tcl | 1 |
9 files changed, 66 insertions, 69 deletions
diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index 4e6a1c9..e5b4b22 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -65,94 +65,94 @@ static const char* positionObjOption[] = { static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "ActiveBackground", - STD_ACTIVE_BACKGROUND, -1, Tk_Offset(LegendOptions, activeBg), 0, NULL, 0}, + STD_ACTIVE_BACKGROUND, -1, Tk_Offset(LegendOptions, activeBg), 0, NULL, CACHE}, {TK_OPTION_PIXELS, "-activeborderwidth", "activeBorderWidth", "ActiveBorderWidth", - STD_BORDERWIDTH, -1, Tk_Offset(LegendOptions, entryBW), 0, NULL, 0}, + STD_BORDERWIDTH, -1, Tk_Offset(LegendOptions, entryBW), 0, NULL, LAYOUT}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "ActiveForeground", STD_ACTIVE_FOREGROUND, -1, Tk_Offset(LegendOptions, activeFgColor), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_RELIEF, "-activerelief", "activeRelief", "ActiveRelief", - "flat", -1, Tk_Offset(LegendOptions, activeRelief), 0, NULL, 0}, + "flat", -1, Tk_Offset(LegendOptions, activeRelief), 0, NULL, LAYOUT}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - "n", -1, Tk_Offset(LegendOptions, anchor), 0, NULL, 0}, + "n", -1, Tk_Offset(LegendOptions, anchor), 0, NULL, LAYOUT}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, -1, 0, 0, "-background", 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - NULL, -1, Tk_Offset(LegendOptions, normalBg), TK_OPTION_NULL_OK, NULL, 0}, + NULL, -1, Tk_Offset(LegendOptions, normalBg), TK_OPTION_NULL_OK, NULL, CACHE}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - STD_BORDERWIDTH, -1, Tk_Offset(LegendOptions, borderWidth), 0, NULL, 0}, + STD_BORDERWIDTH, -1, Tk_Offset(LegendOptions, borderWidth), + 0, NULL, LAYOUT}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, -1, 0, 0, "-borderwidth", 0}, {TK_OPTION_INT, "-columns", "columns", "columns", - "0", -1, Tk_Offset(LegendOptions, reqColumns), 0, NULL, 0}, + "0", -1, Tk_Offset(LegendOptions, reqColumns), 0, NULL, LAYOUT}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", "ExportSelection", - "no", -1, Tk_Offset(LegendOptions, exportSelection), 0, NULL, 0}, + "no", -1, Tk_Offset(LegendOptions, exportSelection), 0, NULL, LAYOUT}, {TK_OPTION_CUSTOM, "-focusdashes", "focusDashes", "FocusDashes", "dot", -1, Tk_Offset(LegendOptions, focusDashes), - TK_OPTION_NULL_OK, &dashesObjOption, 0}, + TK_OPTION_NULL_OK, &dashesObjOption, CACHE}, {TK_OPTION_COLOR, "-focusforeground", "focusForeground", "FocusForeground", - STD_ACTIVE_FOREGROUND, -1, Tk_Offset(LegendOptions, focusColor), 0, NULL, 0}, + STD_ACTIVE_FOREGROUND, -1, Tk_Offset(LegendOptions, focusColor), 0, NULL, CACHE}, {TK_OPTION_FONT, "-font", "font", "Font", - STD_FONT_SMALL, -1, Tk_Offset(LegendOptions, style.font), 0, NULL, 0}, + STD_FONT_SMALL, -1, Tk_Offset(LegendOptions, style.font), 0, NULL, LAYOUT}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, -1, 0, 0, "-foreground", 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - STD_NORMAL_FOREGROUND, -1, Tk_Offset(LegendOptions, fgColor), 0, NULL, 0}, + STD_NORMAL_FOREGROUND, -1, Tk_Offset(LegendOptions, fgColor), 0, NULL, CACHE}, {TK_OPTION_BOOLEAN, "-hide", "hide", "Hide", - "no", -1, Tk_Offset(LegendOptions, hide), 0, NULL, 0}, + "no", -1, Tk_Offset(LegendOptions, hide), 0, NULL, LAYOUT}, {TK_OPTION_PIXELS, "-ipadx", "iPadX", "Pad", - "1", -1, Tk_Offset(LegendOptions, ixPad), 0, NULL, 0}, + "1", -1, Tk_Offset(LegendOptions, ixPad), 0, NULL, LAYOUT}, {TK_OPTION_PIXELS, "-ipady", "iPadY", "Pad", - "1", -1, Tk_Offset(LegendOptions, iyPad), 0, NULL, 0}, + "1", -1, Tk_Offset(LegendOptions, iyPad), 0, NULL, LAYOUT}, {TK_OPTION_BORDER, "-nofocusselectbackground", "noFocusSelectBackground", "NoFocusSelectBackground", STD_ACTIVE_BACKGROUND, -1, Tk_Offset(LegendOptions, selOutFocusBg), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_COLOR, "-nofocusselectforeground", "noFocusSelectForeground", "NoFocusSelectForeground", STD_ACTIVE_FOREGROUND, -1, Tk_Offset(LegendOptions, selOutFocusFgColor), - 0, NULL,0}, + 0, NULL, CACHE}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - "1", -1, Tk_Offset(LegendOptions, xPad), 0, NULL, 0}, + "1", -1, Tk_Offset(LegendOptions, xPad), 0, NULL, LAYOUT}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - "1", -1, Tk_Offset(LegendOptions, yPad), 0, NULL, 0}, + "1", -1, Tk_Offset(LegendOptions, yPad), 0, NULL, LAYOUT}, {TK_OPTION_STRING_TABLE, "-position", "position", "Position", "rightmargin", -1, Tk_Offset(LegendOptions, position), - 0, &positionObjOption, 0}, + 0, &positionObjOption, LAYOUT}, {TK_OPTION_BOOLEAN, "-raised", "raised", "Raised", - "no", -1, Tk_Offset(LegendOptions, raised), 0, NULL, 0}, + "no", -1, Tk_Offset(LegendOptions, raised), 0, NULL, LAYOUT}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - "flat", -1, Tk_Offset(LegendOptions, relief), 0, NULL, 0}, + "flat", -1, Tk_Offset(LegendOptions, relief), 0, NULL, LAYOUT}, {TK_OPTION_INT, "-rows", "rows", "rows", - "0", -1, Tk_Offset(LegendOptions, reqRows), 0, NULL, 0}, + "0", -1, Tk_Offset(LegendOptions, reqRows), 0, NULL, LAYOUT}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "SelectBackground", STD_ACTIVE_BACKGROUND, -1, Tk_Offset(LegendOptions, selInFocusBg), - 0, NULL, 0}, + 0, NULL, LAYOUT}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "SelectBorderWidth", - "1", -1, Tk_Offset(LegendOptions, selBW), 0, NULL, 0}, + "1", -1, Tk_Offset(LegendOptions, selBW), 0, NULL, LAYOUT}, {TK_OPTION_STRING, "-selectcommand", "selectCommand", "SelectCommand", NULL, -1, Tk_Offset(LegendOptions, selectCmd), TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "SelectForeground", STD_ACTIVE_FOREGROUND, -1, Tk_Offset(LegendOptions, selInFocusFgColor), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_STRING_TABLE, "-selectmode", "selectMode", "SelectMode", "multiple", -1, Tk_Offset(LegendOptions, selectMode), 0, &selectmodeObjOption, 0}, {TK_OPTION_RELIEF, "-selectrelief", "selectRelief", "SelectRelief", - "flat", -1, Tk_Offset(LegendOptions, selRelief), 0, NULL, 0}, - {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - NULL, -1, Tk_Offset(LegendOptions, takeFocus), TK_OPTION_NULL_OK, NULL, 0}, + "flat", -1, Tk_Offset(LegendOptions, selRelief), 0, NULL, LAYOUT}, {TK_OPTION_STRING, "-title", "title", "Title", - NULL, -1, Tk_Offset(LegendOptions, title), TK_OPTION_NULL_OK, NULL, 0}, + NULL, -1, Tk_Offset(LegendOptions, title), TK_OPTION_NULL_OK, NULL, LAYOUT}, {TK_OPTION_COLOR, "-titlecolor", "titleColor", "TitleColor", STD_NORMAL_FOREGROUND, -1, Tk_Offset(LegendOptions, titleStyle.color), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_FONT, "-titlefont", "titleFont", "TitleFont", - STD_FONT_SMALL, -1, Tk_Offset(LegendOptions, titleStyle.font), 0, NULL, 0}, + STD_FONT_SMALL, -1, Tk_Offset(LegendOptions, titleStyle.font), + 0, NULL, LAYOUT}, {TK_OPTION_PIXELS, "-x", "x", "X", - "0", -1, Tk_Offset(LegendOptions, xReq), 0, NULL, 0}, + "0", -1, Tk_Offset(LegendOptions, xReq), 0, NULL, LAYOUT}, {TK_OPTION_PIXELS, "-y", "y", "Y", - "0", -1, Tk_Offset(LegendOptions, yReq), 0, NULL, 0}, + "0", -1, Tk_Offset(LegendOptions, yReq), 0, NULL, LAYOUT}, {TK_OPTION_END, NULL, NULL, NULL, NULL, -1, 0, 0, NULL, 0} }; diff --git a/src/bltGrLegd.h b/src/bltGrLegd.h index 928404f..2e26210 100644 --- a/src/bltGrLegd.h +++ b/src/bltGrLegd.h @@ -97,7 +97,6 @@ typedef struct { XColor* selInFocusFgColor; SelectMode selectMode; int selRelief; - const char *takeFocus; const char *title; TextStyleOptions titleStyle; } LegendOptions; diff --git a/src/bltGrLegdOp.C b/src/bltGrLegdOp.C index 769656c..af5fcce 100644 --- a/src/bltGrLegdOp.C +++ b/src/bltGrLegdOp.C @@ -68,10 +68,9 @@ static int LegendObjConfigure(Graph* graphPtr, Tcl_Interp* interp, Tk_RestoreSavedOptions(&savedOptions); } + graphPtr->flags |= mask; if (legendPtr->configure() != TCL_OK) return TCL_ERROR; - - graphPtr->flags |= LAYOUT; graphPtr->eventuallyRedraw(); break; @@ -254,7 +253,7 @@ static int FocusOp(ClientData clientData, Tcl_Interp* interp, Blt_SetFocusItem(legendPtr->bindTable_,legendPtr->focusPtr_,CID_LEGEND_ENTRY); - graphPtr->flags |= LAYOUT; + graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); if (legendPtr->focusPtr_) @@ -317,7 +316,7 @@ static int SelectionAnchorOp(ClientData clientData, Tcl_Interp* interp, if (elemPtr) Tcl_SetStringObj(Tcl_GetObjResult(interp), elemPtr->name_, -1); - graphPtr->flags |= LAYOUT; + graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); return TCL_OK; @@ -330,7 +329,7 @@ static int SelectionClearallOp(ClientData clientData, Tcl_Interp* interp, Legend* legendPtr = graphPtr->legend_; legendPtr->clearSelection(); - graphPtr->flags |= LAYOUT; + graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); return TCL_OK; @@ -388,7 +387,7 @@ static int SelectionMarkOp(ClientData clientData, Tcl_Interp* interp, if (ops->selectCmd) legendPtr->eventuallyInvokeSelectCmd(); - graphPtr->flags |= LAYOUT; + graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); } return TCL_OK; @@ -465,7 +464,7 @@ static int SelectionSetOp(ClientData clientData, Tcl_Interp* interp, if (ops->selectCmd) legendPtr->eventuallyInvokeSelectCmd(); - graphPtr->flags |= LAYOUT; + graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); return TCL_OK; @@ -494,7 +493,7 @@ static void LostSelectionProc(ClientData clientData) if (ops->exportSelection) legendPtr->clearSelection(); - graphPtr->flags |= LAYOUT; + graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); } diff --git a/src/bltGrMarkerOp.C b/src/bltGrMarkerOp.C index b411b0b..32c3477 100644 --- a/src/bltGrMarkerOp.C +++ b/src/bltGrMarkerOp.C @@ -78,7 +78,7 @@ static int MarkerObjConfigure( Graph* graphPtr,Marker* markerPtr, return TCL_ERROR; MarkerOptions* ops = (MarkerOptions*)markerPtr->ops(); if (ops->drawUnder) - graphPtr->flags |= CACHE_DIRTY; + graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); break; @@ -254,7 +254,7 @@ static int DeleteOp(ClientData clientData, Tcl_Interp* interp, } delete markerPtr; } - graphPtr->flags |= CACHE_DIRTY; + graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); return TCL_OK; @@ -422,7 +422,7 @@ static int RelinkOp(ClientData clientData, Tcl_Interp* interp, Blt_Chain_LinkBefore(graphPtr->markers_.displayList, link, place); if (ops->drawUnder) - graphPtr->flags |= CACHE_DIRTY; + graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); return TCL_OK; diff --git a/src/bltGrMisc.h b/src/bltGrMisc.h index 44b3bfa..c0f52f2 100644 --- a/src/bltGrMisc.h +++ b/src/bltGrMisc.h @@ -37,16 +37,16 @@ using namespace std; #include <tk.h> -#define GRAPH_DELETED (1<<1) -#define REDRAW_PENDING (1<<2) -#define FOCUS (1<<3) +#define GRAPH_DELETED (1<<1) +#define REDRAW_PENDING (1<<2) +#define FOCUS (1<<3) -#define MAP_ITEM (1<<4) +#define MAP_ITEM (1<<4) #define RESET (1<<5) #define LAYOUT (1<<6) -#define MAP_MARKERS (1<<7) -#define CACHE_DIRTY (1<<8) +#define MAP_MARKERS (1<<7) +#define CACHE (1<<8) #define MARGIN_NONE -1 #define MARGIN_BOTTOM 0 /* x */ diff --git a/src/bltGraph.C b/src/bltGraph.C index 370a8c2..459d88f 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -232,7 +232,7 @@ void Graph::map() mapAxes(); mapElements(); flags &= ~LAYOUT; - flags |= MAP_MARKERS | CACHE_DIRTY; + flags |= MAP_MARKERS | CACHE; } mapMarkers(); @@ -268,12 +268,12 @@ void Graph::draw() Tk_Depth(tkwin_)); cacheWidth_ = width_; cacheHeight_ = height_; - flags |= CACHE_DIRTY; + flags |= CACHE; } // Update cache if needed - if (flags & CACHE_DIRTY) { - cerr << "CACHE_DIRTY" << endl; + if (flags & CACHE) { + cerr << "CACHE" << endl; drawMargins(cache_); switch (legend_->position()) { @@ -325,7 +325,7 @@ void Graph::draw() } } - flags &= ~CACHE_DIRTY; + flags &= ~CACHE; } XCopyArea(display_, cache_, drawable, drawGC_, 0, 0, Tk_Width(tkwin_), diff --git a/src/bltGraphBar.C b/src/bltGraphBar.C index 2edad31..281a5de 100644 --- a/src/bltGraphBar.C +++ b/src/bltGraphBar.C @@ -72,7 +72,7 @@ static Tk_OptionSpec optionSpecs[] = { "0", -1, Tk_Offset(BarGraphOptions, aspect), 0, NULL, RESET}, {TK_OPTION_BORDER, "-background", "background", "Background", STD_NORMAL_BACKGROUND, -1, Tk_Offset(BarGraphOptions, normalBg), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_STRING_TABLE, "-barmode", "barMode", "BarMode", "normal", -1, Tk_Offset(BarGraphOptions, barMode), 0, &barmodeObjOption, RESET}, @@ -97,17 +97,17 @@ static Tk_OptionSpec optionSpecs[] = { 0, NULL, RESET}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", STD_NORMAL_FOREGROUND, -1, Tk_Offset(BarGraphOptions, titleTextStyle.color), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_SYNONYM, "-halo", NULL, NULL, NULL, -1, 0, 0, "-searchhalo", 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", "4i", -1, Tk_Offset(BarGraphOptions, reqHeight), 0, NULL, RESET}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", STD_NORMAL_BACKGROUND, -1, Tk_Offset(BarGraphOptions, highlightBgColor), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", STD_NORMAL_FOREGROUND, -1, Tk_Offset(BarGraphOptions, highlightColor), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", "2", -1, Tk_Offset(BarGraphOptions, highlightWidth), 0, NULL, RESET}, @@ -121,7 +121,7 @@ static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_SYNONYM, "-lm", NULL, NULL, NULL, -1, 0, 0, "-leftmargin", 0}, {TK_OPTION_BORDER, "-plotbackground", "plotbackground", "PlotBackground", STD_NORMAL_BACKGROUND, -1, Tk_Offset(BarGraphOptions, plotBg), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_PIXELS, "-plotborderwidth", "plotBorderWidth", "PlotBorderWidth", STD_BORDERWIDTH, -1, Tk_Offset(BarGraphOptions, plotBW), 0, NULL, RESET}, {TK_OPTION_PIXELS, "-plotpadx", "plotPadX", "PlotPad", diff --git a/src/bltGraphLine.C b/src/bltGraphLine.C index 2fdcd1d..a864e59 100644 --- a/src/bltGraphLine.C +++ b/src/bltGraphLine.C @@ -55,7 +55,7 @@ static Tk_OptionSpec optionSpecs[] = { "0", -1, Tk_Offset(LineGraphOptions, aspect), 0, NULL, RESET}, {TK_OPTION_BORDER, "-background", "background", "Background", STD_NORMAL_BACKGROUND, -1, Tk_Offset(LineGraphOptions, normalBg), - 0, NULL, 0}, + 0, NULL, CACHE}, {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}, @@ -73,17 +73,17 @@ static Tk_OptionSpec optionSpecs[] = { 0, NULL, RESET}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", STD_NORMAL_FOREGROUND, -1, - Tk_Offset(LineGraphOptions, titleTextStyle.color), 0, NULL, 0}, + Tk_Offset(LineGraphOptions, titleTextStyle.color), 0, NULL, CACHE}, {TK_OPTION_SYNONYM, "-halo", NULL, NULL, NULL, -1, 0, 0, "-searchhalo", 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", "4i", -1, Tk_Offset(LineGraphOptions, reqHeight), 0, NULL, RESET}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", STD_NORMAL_BACKGROUND, -1, Tk_Offset(LineGraphOptions, highlightBgColor), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", STD_NORMAL_FOREGROUND, -1, Tk_Offset(LineGraphOptions, highlightColor), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", "2", -1, Tk_Offset(LineGraphOptions, highlightWidth), 0, NULL, RESET}, @@ -97,7 +97,7 @@ static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_SYNONYM, "-lm", NULL, NULL, NULL, -1, 0, 0, "-leftmargin", 0}, {TK_OPTION_BORDER, "-plotbackground", "plotbackground", "PlotBackground", STD_NORMAL_BACKGROUND, -1, Tk_Offset(LineGraphOptions, plotBg), - 0, NULL, 0}, + 0, NULL, CACHE}, {TK_OPTION_PIXELS, "-plotborderwidth", "plotBorderWidth", "PlotBorderWidth", STD_BORDERWIDTH, -1, Tk_Offset(LineGraphOptions, plotBW), 0, NULL, RESET}, {TK_OPTION_PIXELS, "-plotpadx", "plotPadX", "PlotPad", diff --git a/tests/legend.tcl b/tests/legend.tcl index 6ffa4fa..1893081 100644 --- a/tests/legend.tcl +++ b/tests/legend.tcl @@ -49,7 +49,6 @@ bltTest2 $graph legend -selectborderwidth 3 #bltTest2 $graph legend -selectforeground #bltTest2 $graph legend -selectmode bltTest2 $graph legend -selectrelief flat -bltTest2 $graph legend -takefocus yes bltTest2 $graph legend -title "Hello World" bltTest2 $graph legend -titlecolor red bltTest2 $graph legend -titlefont "times 24 bold italic" |