summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoye <joye>2014-06-26 20:24:42 (GMT)
committerjoye <joye>2014-06-26 20:24:42 (GMT)
commit8b87cbe046ec9f5be7ea6e32e9b2ea16635ee61d (patch)
treec32f048901a3c0f63e20a8e0fd8b100899616f8b
parent2a40ac98b233129440f823ca1a50b90d779a64a7 (diff)
downloadblt-8b87cbe046ec9f5be7ea6e32e9b2ea16635ee61d.zip
blt-8b87cbe046ec9f5be7ea6e32e9b2ea16635ee61d.tar.gz
blt-8b87cbe046ec9f5be7ea6e32e9b2ea16635ee61d.tar.bz2
*** empty log message ***
-rw-r--r--src/bltGrAxis.C2
-rw-r--r--src/bltGrLegd.C3
-rw-r--r--src/bltGrPSOutput.C51
-rw-r--r--tests/ps.tcl7
4 files changed, 34 insertions, 29 deletions
diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C
index 63231c1..f52ceed 100644
--- a/src/bltGrAxis.C
+++ b/src/bltGrAxis.C
@@ -1224,8 +1224,6 @@ void Axis::offsets(int margin, int offset, AxisInfo *infoPtr)
}
int axisPad =0;
- // if (graphPtr_->plotRelief != TK_RELIEF_SOLID)
- // axisPad = 0;
// Adjust offset for the interior border width and the line width */
// fixme
diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C
index 4e5ac3c..92e64c7 100644
--- a/src/bltGrLegd.C
+++ b/src/bltGrLegd.C
@@ -591,10 +591,9 @@ void Legend::print(PostScript* psPtr)
}
else {
ops->style.color = ops->fgColor;
- if (elemOps->legendRelief != TK_RELIEF_FLAT) {
+ if (elemOps->legendRelief != TK_RELIEF_FLAT)
psPtr->print3DRectangle(gops->normalBg, x, y, entryWidth_, entryHeight_,
ops->entryBW, elemOps->legendRelief);
- }
}
elemPtr->printSymbol(psPtr, x + xSymbol, y + ySymbol, symbolSize);
ts.printText(psPtr, elemOps->label, x + xLabel,
diff --git a/src/bltGrPSOutput.C b/src/bltGrPSOutput.C
index e698be4..be34021 100644
--- a/src/bltGrPSOutput.C
+++ b/src/bltGrPSOutput.C
@@ -339,32 +339,11 @@ void PostScript::print3DRectangle(Tk_3DBorder border, double x, double y,
int width, int height, int borderWidth,
int relief)
{
- TkBorder* borderPtr = (TkBorder*)border;
- XColor* lightPtr, *darkPtr;
- XColor* topPtr, *bottomPtr;
- XColor light, dark;
int twiceWidth = (borderWidth * 2);
-
if ((width < twiceWidth) || (height < twiceWidth))
return;
- if ((relief == TK_RELIEF_SOLID) ||
- (borderPtr->lightColorPtr == NULL) || (borderPtr->darkColorPtr == NULL)) {
- if (relief == TK_RELIEF_SOLID) {
- dark.red = dark.blue = dark.green = 0x00;
- light.red = light.blue = light.green = 0x00;
- relief = TK_RELIEF_SUNKEN;
- } else {
- light = *borderPtr->bgColorPtr;
- dark.red = dark.blue = dark.green = 0xFF;
- }
- lightPtr = &light;
- darkPtr = &dark;
- }
- else {
- lightPtr = borderPtr->lightColorPtr;
- darkPtr = borderPtr->darkColorPtr;
- }
+ TkBorder* borderPtr = (TkBorder*)border;
// Handle grooves and ridges with recursive calls
if ((relief == TK_RELIEF_GROOVE) || (relief == TK_RELIEF_RIDGE)) {
@@ -381,6 +360,24 @@ void PostScript::print3DRectangle(Tk_3DBorder border, double x, double y,
return;
}
+ XColor* lightPtr = borderPtr->lightColorPtr;
+ XColor* darkPtr = borderPtr->darkColorPtr;
+ XColor light;
+ if (!lightPtr) {
+ light.red = 0x00;
+ light.blue = 0x00;
+ light.green = 0x00;
+ lightPtr = &light;
+ }
+ XColor dark;
+ if (!darkPtr) {
+ dark.red = 0x00;
+ dark.blue = 0x00;
+ dark.green = 0x00;
+ darkPtr = &dark;
+ }
+
+ XColor* topPtr, *bottomPtr;
if (relief == TK_RELIEF_RAISED) {
topPtr = lightPtr;
bottomPtr = darkPtr;
@@ -389,8 +386,14 @@ void PostScript::print3DRectangle(Tk_3DBorder border, double x, double y,
topPtr = darkPtr;
bottomPtr = lightPtr;
}
- else
- topPtr = bottomPtr = borderPtr->bgColorPtr;
+ else if (relief == TK_RELIEF_SOLID) {
+ topPtr = lightPtr;
+ bottomPtr = lightPtr;
+ }
+ else {
+ topPtr = borderPtr->bgColorPtr;
+ bottomPtr = borderPtr->bgColorPtr;
+ }
setBackground(bottomPtr);
fillRectangle(x, y + height - borderWidth, width, borderWidth);
diff --git a/tests/ps.tcl b/tests/ps.tcl
index 0896069..859ceca 100644
--- a/tests/ps.tcl
+++ b/tests/ps.tcl
@@ -13,9 +13,14 @@ $graph xaxis configure -bg cyan -relief raised
$graph configure -relief raised
$graph configure -plotrelief raised
-$graph postscript output foo.ps
+$graph legend selection set data2
+$graph legend focus data1
+$graph legend configure -selectrelief groove
+
$graph postscript configure -decorations no
$graph postscript output bar.ps
+$graph postscript configure -decorations yes
+$graph postscript output foo.ps
#set graph [bltBarGraph $w]