diff options
Diffstat (limited to 'tksao')
-rw-r--r-- | tksao/colorbar/cbgrid.C | 6 | ||||
-rw-r--r-- | tksao/colorbar/colorbarbase.C | 86 |
2 files changed, 35 insertions, 57 deletions
diff --git a/tksao/colorbar/cbgrid.C b/tksao/colorbar/cbgrid.C index 6e206ce..3c029d8 100644 --- a/tksao/colorbar/cbgrid.C +++ b/tksao/colorbar/cbgrid.C @@ -21,7 +21,11 @@ CBGrid::CBGrid(Widget* p, int cc, double* ll) ostringstream str; // basics - str << "Grid=0, DrawAxes=0, MinTickLen(1)=0, MinTickLen(2)=0, Colour(ticks)=0, Width(ticks)=.5, Style(ticks)=0, Border=1, Colour(border)=0, Width(border)=.5, Style(border)=0, Labelling=exterior, Colour(numlab)=0, TextLab=0, DrawTitle=0"; + str << "Grid=0, DrawAxes=0, MinTickLen(1)=0, MinTickLen(2)=0, Width(ticks)=.5, Style(ticks)=0, Border=1, Width(border)=.5, Style(border)=0, Labelling=exterior, Colour(numlab)=0, TextLab=0, DrawTitle=0"; + + str << ", Colour(ticks)=0, Colour(border)=0"; + // str << ", Colour(ticks)=" << opts->fgColor->pixel + // << ", Colour(border)=" << opts->fgColor->pixel; if (!opts->orientation) { // horizontal diff --git a/tksao/colorbar/colorbarbase.C b/tksao/colorbar/colorbarbase.C index 42d3acd..57b2e04 100644 --- a/tksao/colorbar/colorbarbase.C +++ b/tksao/colorbar/colorbarbase.C @@ -100,7 +100,7 @@ int ColorbarBase::configure(int argc, const char* argv[], int flags) if (flags != TK_CONFIG_ARGV_ONLY) return initColormap(); else { - if ((configSpecs[CONFIGORIENTATION].specFlags & TK_CONFIG_OPTION_SPECIFIED) || + if ((configSpecs[CONFIGORIENTATION].specFlags&TK_CONFIG_OPTION_SPECIFIED) || (configSpecs[CONFIGNUMERICS].specFlags & TK_CONFIG_OPTION_SPECIFIED) || (configSpecs[CONFIGSIZE].specFlags & TK_CONFIG_OPTION_SPECIFIED) || (configSpecs[CONFIGFONT].specFlags & TK_CONFIG_OPTION_SPECIFIED) || @@ -513,60 +513,37 @@ void ColorbarBase::ps() if (!opts->orientation) org += Vector(0,height-size); - { - ostringstream str; - str << org << " translate " << 1 << ' ' << 1 << " scale" << endl - << ends; - Tcl_AppendResult(interp, str.str().c_str(), NULL); - } - - if (0) { - // psColor(psColorSpace,opts->bgColor); - psColor(psColorSpace,getXColor("pink")); - - ostringstream str; - str << "newpath" << endl - << 0 << ' ' << 0 << " moveto" << endl - << 0 << ' ' << height << " lineto" << endl - << width << ' ' << height << " lineto" << endl - << width << ' ' << 0 << " lineto" << endl - << 0 << ' ' << 0 << " moveto" << endl - << " fill" << endl - << ends; - Tcl_AppendResult(interp, str.str().c_str(), NULL); - } - - { - ostringstream str; - int ww = !opts->orientation ? width : size; - int hh = !opts->orientation ? size : height; - switch (psLevel) { - case 1: - { - psHead1(str, ww, hh); - NoCompressAsciiHex filter(psLevel); - psHV(str, filter, ww, hh); - } - break; - case 2: - { - psHead2(str, ww, hh, "RunLength", "ASCII85"); - RLEAscii85 filter(psLevel); - psHV(str, filter, ww, hh); - } - break; - case 3: - { - psHead2(str, ww, hh, "Flate", "ASCII85"); - GZIPAscii85 filter(psLevel); - psHV(str, filter, ww, hh); - } - break; + ostringstream str; + str << org << " translate " << 1 << ' ' << 1 << " scale" << endl; + + int ww = !opts->orientation ? width : size; + int hh = !opts->orientation ? size : height; + switch (psLevel) { + case 1: + { + psHead1(str, ww, hh); + NoCompressAsciiHex filter(psLevel); + psHV(str, filter, ww, hh); } - - str << ends; - Tcl_AppendResult(interp, str.str().c_str(), NULL); + break; + case 2: + { + psHead2(str, ww, hh, "RunLength", "ASCII85"); + RLEAscii85 filter(psLevel); + psHV(str, filter, ww, hh); + } + break; + case 3: + { + psHead2(str, ww, hh, "Flate", "ASCII85"); + GZIPAscii85 filter(psLevel); + psHV(str, filter, ww, hh); + } + break; } + + str << ends; + Tcl_AppendResult(interp, str.str().c_str(), NULL); } void ColorbarBase::psHV(ostream& str, Filter& filter, int width, int height) @@ -752,9 +729,6 @@ void ColorbarBase::psGridAST() Vector ur = uu*mm; Vector ul = Vector(oo[0],uu[1])*mm; - // set the color - psColor(psColorSpace,opts->fgColor); - ostringstream str; str << "newpath " << endl << ll << " moveto " << endl |