home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / tcl / tkstep0.3b3 / tkstep0 / tkstep / tkScale.c.diff < prev    next >
Encoding:
Text File  |  1996-07-08  |  19.1 KB  |  461 lines

  1. --- ../tk4.1/generic/tkScale.c    Wed Mar 27 14:53:41 1996
  2. +++ tkScale.c    Mon Jul  8 19:24:13 1996
  3. @@ -14,6 +14,8 @@
  4.   * Copyright (c) 1990-1994 The Regents of the University of California.
  5.   * Copyright (c) 1994-1995 Sun Microsystems, Inc.
  6.   *
  7. + * TkStep modifications (c) 1996 Andy Lo A Foe
  8. + *
  9.   * See the file "license.terms" for information on usage and redistribution
  10.   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11.   *
  12. @@ -93,8 +95,10 @@
  13.      Tk_3DBorder activeBorder;    /* For drawing the slider when active. */
  14.      int sliderRelief;        /* Is slider to be drawn raised, sunken, etc. */
  15.      XColor *troughColorPtr;    /* Color for drawing trough. */
  16. +    XColor *darkPtr;
  17.      GC troughGC;        /* For drawing trough. */
  18.      GC copyGC;            /* Used for copying from pixmap onto screen. */
  19. +    GC troughBackGC;
  20.      XFontStruct *fontPtr;    /* Information about text font, or NULL. */
  21.      XColor *textColorPtr;    /* Color for drawing text. */
  22.      GC textGC;            /* GC for drawing text in normal mode. */
  23. @@ -103,6 +107,7 @@
  24.      int highlightWidth;        /* Width in pixels of highlight to draw
  25.                   * around widget when it has the focus.
  26.                   * <= 0 means don't draw a highlight. */
  27. +    Pixmap stipple;
  28.      XColor *highlightBgColorPtr;
  29.                  /* Color for drawing traversal highlight
  30.                   * area when highlight is off. */
  31. @@ -207,6 +212,18 @@
  32.  
  33.  #define PRINT_CHARS 150
  34.  
  35. +
  36. +/*
  37. + * If you want to make Tk ignore attribute settings that may be violating
  38. + * NEXTSTEP(tm) styles leave DISABLE_FORCE_STEP undef'ed, otherwise define it
  39. + * somewhere
  40. + */
  41. +#ifndef DISABLE_FORCE_STEP
  42. +#  define DISABLE_CHANGE    TK_CONFIG_DONT_CHANGE_DEFAULT
  43. +#else
  44. +#  define DISABLE_CHANGE    0
  45. +#endif
  46. +
  47.  /*
  48.   * Information used for argv parsing.
  49.   */
  50. @@ -214,16 +231,16 @@
  51.  static Tk_ConfigSpec configSpecs[] = {
  52.      {TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground",
  53.      DEF_SCALE_ACTIVE_BG_COLOR, Tk_Offset(Scale, activeBorder),
  54. -    TK_CONFIG_COLOR_ONLY},
  55. +    TK_CONFIG_COLOR_ONLY | DISABLE_CHANGE},
  56.      {TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground",
  57.      DEF_SCALE_ACTIVE_BG_MONO, Tk_Offset(Scale, activeBorder),
  58. -    TK_CONFIG_MONO_ONLY},
  59. +    TK_CONFIG_MONO_ONLY | DISABLE_CHANGE},
  60.      {TK_CONFIG_BORDER, "-background", "background", "Background",
  61.      DEF_SCALE_BG_COLOR, Tk_Offset(Scale, bgBorder),
  62. -    TK_CONFIG_COLOR_ONLY},
  63. +    TK_CONFIG_COLOR_ONLY | DISABLE_CHANGE},
  64.      {TK_CONFIG_BORDER, "-background", "background", "Background",
  65.      DEF_SCALE_BG_MONO, Tk_Offset(Scale, bgBorder),
  66. -    TK_CONFIG_MONO_ONLY},
  67. +    TK_CONFIG_MONO_ONLY | DISABLE_CHANGE},
  68.      {TK_CONFIG_DOUBLE, "-bigincrement", "bigIncrement", "BigIncrement",
  69.      DEF_SCALE_BIG_INCREMENT, Tk_Offset(Scale, bigIncrement), 0},
  70.      {TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *) NULL,
  71. @@ -231,7 +248,7 @@
  72.      {TK_CONFIG_SYNONYM, "-bg", "background", (char *) NULL,
  73.      (char *) NULL, 0, 0},
  74.      {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
  75. -    DEF_SCALE_BORDER_WIDTH, Tk_Offset(Scale, borderWidth), 0},
  76. +    DEF_SCALE_BORDER_WIDTH, Tk_Offset(Scale, borderWidth), DISABLE_CHANGE},
  77.      {TK_CONFIG_STRING, "-command", "command", "Command",
  78.      DEF_SCALE_COMMAND, Tk_Offset(Scale, command), TK_CONFIG_NULL_OK},
  79.      {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
  80. @@ -245,20 +262,21 @@
  81.      0},
  82.      {TK_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
  83.      DEF_SCALE_FG_COLOR, Tk_Offset(Scale, textColorPtr),
  84. -    TK_CONFIG_COLOR_ONLY},
  85. +    TK_CONFIG_COLOR_ONLY | DISABLE_CHANGE},
  86.      {TK_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
  87.      DEF_SCALE_FG_MONO, Tk_Offset(Scale, textColorPtr),
  88. -    TK_CONFIG_MONO_ONLY},
  89. +    TK_CONFIG_MONO_ONLY | DISABLE_CHANGE},
  90.      {TK_CONFIG_DOUBLE, "-from", "from", "From",
  91.      DEF_SCALE_FROM, Tk_Offset(Scale, fromValue), 0},
  92.      {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
  93.      "HighlightBackground", DEF_SCALE_HIGHLIGHT_BG,
  94. -    Tk_Offset(Scale, highlightBgColorPtr), 0},
  95. +    Tk_Offset(Scale, highlightBgColorPtr), DISABLE_CHANGE},
  96.      {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
  97.      DEF_SCALE_HIGHLIGHT, Tk_Offset(Scale, highlightColorPtr), 0},
  98.      {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness",
  99.      "HighlightThickness",
  100. -    DEF_SCALE_HIGHLIGHT_WIDTH, Tk_Offset(Scale, highlightWidth), 0},
  101. +    DEF_SCALE_HIGHLIGHT_WIDTH, Tk_Offset(Scale, highlightWidth), 
  102. +    DISABLE_CHANGE},
  103.      {TK_CONFIG_STRING, "-label", "label", "Label",
  104.      DEF_SCALE_LABEL, Tk_Offset(Scale, label), TK_CONFIG_NULL_OK},
  105.      {TK_CONFIG_PIXELS, "-length", "length", "Length",
  106. @@ -266,7 +284,7 @@
  107.      {TK_CONFIG_UID, "-orient", "orient", "Orient",
  108.      DEF_SCALE_ORIENT, Tk_Offset(Scale, orientUid), 0},
  109.      {TK_CONFIG_RELIEF, "-relief", "relief", "Relief",
  110. -    DEF_SCALE_RELIEF, Tk_Offset(Scale, relief), 0},
  111. +    DEF_SCALE_RELIEF, Tk_Offset(Scale, relief), DISABLE_CHANGE},
  112.      {TK_CONFIG_INT, "-repeatdelay", "repeatDelay", "RepeatDelay",
  113.      DEF_SCALE_REPEAT_DELAY, Tk_Offset(Scale, repeatDelay), 0},
  114.      {TK_CONFIG_INT, "-repeatinterval", "repeatInterval", "RepeatInterval",
  115. @@ -276,10 +294,11 @@
  116.      {TK_CONFIG_BOOLEAN, "-showvalue", "showValue", "ShowValue",
  117.      DEF_SCALE_SHOW_VALUE, Tk_Offset(Scale, showValue), 0},
  118.      {TK_CONFIG_PIXELS, "-sliderlength", "sliderLength", "SliderLength",
  119. -    DEF_SCALE_SLIDER_LENGTH, Tk_Offset(Scale, sliderLength), 0},
  120. +    DEF_SCALE_SLIDER_LENGTH, Tk_Offset(Scale, sliderLength), 
  121. +        DISABLE_CHANGE},
  122.      {TK_CONFIG_RELIEF, "-sliderrelief", "sliderRelief", "SliderRelief",
  123.      DEF_SCALE_SLIDER_RELIEF, Tk_Offset(Scale, sliderRelief),
  124. -    TK_CONFIG_DONT_SET_DEFAULT},
  125. +    TK_CONFIG_DONT_SET_DEFAULT| DISABLE_CHANGE},
  126.      {TK_CONFIG_UID, "-state", "state", "State",
  127.      DEF_SCALE_STATE, Tk_Offset(Scale, state), 0},
  128.      {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
  129. @@ -291,14 +310,14 @@
  130.      DEF_SCALE_TO, Tk_Offset(Scale, toValue), 0},
  131.      {TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background",
  132.      DEF_SCALE_TROUGH_COLOR, Tk_Offset(Scale, troughColorPtr),
  133. -    TK_CONFIG_COLOR_ONLY},
  134. +    TK_CONFIG_COLOR_ONLY | DISABLE_CHANGE},
  135.      {TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background",
  136.      DEF_SCALE_TROUGH_MONO, Tk_Offset(Scale, troughColorPtr),
  137. -    TK_CONFIG_MONO_ONLY},
  138. +    TK_CONFIG_MONO_ONLY | DISABLE_CHANGE},
  139.      {TK_CONFIG_STRING, "-variable", "variable", "Variable",
  140.      DEF_SCALE_VARIABLE, Tk_Offset(Scale, varName), TK_CONFIG_NULL_OK},
  141.      {TK_CONFIG_PIXELS, "-width", "width", "Width",
  142. -    DEF_SCALE_WIDTH, Tk_Offset(Scale, width), 0},
  143. +    DEF_SCALE_WIDTH, Tk_Offset(Scale, width), DISABLE_CHANGE},
  144.      {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
  145.      (char *) NULL, 0, 0}
  146.  };
  147. @@ -411,6 +430,8 @@
  148.      scalePtr->command = NULL;
  149.      scalePtr->repeatDelay = 0;
  150.      scalePtr->repeatInterval = 0;
  151. +    scalePtr->stipple = None;
  152. +    scalePtr->darkPtr = NULL;
  153.      scalePtr->label = NULL;
  154.      scalePtr->labelLength = 0;
  155.      scalePtr->state = tkNormalUid;
  156. @@ -423,6 +444,7 @@
  157.      scalePtr->copyGC = None;
  158.      scalePtr->fontPtr = NULL;
  159.      scalePtr->textColorPtr = NULL;
  160. +    scalePtr->troughBackGC = None;
  161.      scalePtr->textGC = None;
  162.      scalePtr->relief = TK_RELIEF_FLAT;
  163.      scalePtr->highlightWidth = 0;
  164. @@ -656,6 +678,15 @@
  165.      if (scalePtr->textGC != None) {
  166.      Tk_FreeGC(scalePtr->display, scalePtr->textGC);
  167.      }
  168. +    if (scalePtr->darkPtr != NULL) {
  169. +        Tk_FreeColor(scalePtr->darkPtr);
  170. +    }
  171. +    if (scalePtr->stipple != None) {
  172. +       Tk_FreeBitmap(scalePtr->display, scalePtr->stipple);
  173. +    }
  174. +    if (scalePtr->troughBackGC != None) {
  175. +        Tk_FreeGC(scalePtr->display, scalePtr->troughBackGC);
  176. +    }
  177.      Tk_FreeOptions(configSpecs, (char *) scalePtr, scalePtr->display, 0);
  178.      ckfree((char *) scalePtr);
  179.  }
  180. @@ -692,6 +723,7 @@
  181.  {
  182.      XGCValues gcValues;
  183.      GC newGC;
  184. +    XColor newcolor;
  185.      size_t length;
  186.  
  187.      /*
  188. @@ -704,6 +736,10 @@
  189.          ScaleVarProc, (ClientData) scalePtr);
  190.      }
  191.  
  192. +
  193. +    if (Tk_StrictMotif(scalePtr->tkwin)) {
  194. +    flags|=TK_CONFIG_CHECK_MY_FLAG;
  195. +    }    
  196.      if (Tk_ConfigureWidget(interp, scalePtr->tkwin, configSpecs,
  197.          argc, argv, (char *) scalePtr, flags) != TCL_OK) {
  198.      return TCL_ERROR;
  199. @@ -787,19 +823,62 @@
  200.      return TCL_ERROR;
  201.      }
  202.  
  203. -    Tk_SetBackgroundFromBorder(scalePtr->tkwin, scalePtr->bgBorder);
  204.  
  205. +    Tk_SetBackgroundFromBorder(scalePtr->tkwin, scalePtr->bgBorder);
  206. +    gcValues.background = scalePtr->troughColorPtr->pixel;
  207.      gcValues.foreground = scalePtr->troughColorPtr->pixel;
  208.      newGC = Tk_GetGC(scalePtr->tkwin, GCForeground, &gcValues);
  209.      if (scalePtr->troughGC != None) {
  210.      Tk_FreeGC(scalePtr->display, scalePtr->troughGC);
  211.      }
  212.      scalePtr->troughGC = newGC;
  213. +
  214.      if (scalePtr->copyGC == None) {
  215.      gcValues.graphics_exposures = False;
  216.      scalePtr->copyGC = Tk_GetGC(scalePtr->tkwin, GCGraphicsExposures,
  217.          &gcValues);
  218.      }
  219. +    
  220. +
  221. +/* Force a borderwidth of 1 */
  222. +    scalePtr->borderWidth = 1;
  223. +
  224. +    if (scalePtr->stipple==None) {
  225. +       scalePtr->stipple = Tk_GetBitmap((Tcl_Interp *)NULL, scalePtr->tkwin,
  226. +                                      Tk_GetUid("gray50"));
  227. +       if (scalePtr->stipple == None) {
  228. +          panic("ScrollBar couldn't allocate bitmap for trough");
  229. +       }
  230. +    }
  231. +    
  232. +    Tk_SetBackgroundFromBorder(scalePtr->tkwin, scalePtr->bgBorder);    
  233. +    /* alloc color for trough base stipple */
  234. +    newcolor.red = (60 * (int) scalePtr->troughColorPtr->red)/100;
  235. +    newcolor.green =(60 * (int) scalePtr->troughColorPtr->green)/100;
  236. +    newcolor.blue = (60 * (int) scalePtr->troughColorPtr->blue)/100;
  237. +                    
  238. +    if (scalePtr->darkPtr != NULL) {
  239. +       Tk_FreeColor(scalePtr->darkPtr);
  240. +    }    
  241. +    scalePtr->darkPtr = Tk_GetColorByValue(scalePtr->tkwin,
  242. +                             &newcolor);
  243. +                           
  244. +    gcValues.background = scalePtr->troughColorPtr->pixel;
  245. +    gcValues.foreground = scalePtr->darkPtr->pixel;   
  246. +    gcValues.stipple = scalePtr->stipple;
  247. +    gcValues.fill_style = FillOpaqueStippled;
  248. +                                                                
  249. +    newGC = Tk_GetGC(scalePtr->tkwin, GCForeground|GCBackground|GCStipple|
  250. +               GCFillStyle, &gcValues);
  251. +    if (scalePtr->troughBackGC != None) {
  252. +       Tk_FreeGC(scalePtr->display, scalePtr->troughBackGC);
  253. +    }
  254. +    scalePtr->troughBackGC = newGC;    
  255. +    
  256. +    
  257. +    
  258. +    
  259. +    
  260.      if (scalePtr->highlightWidth < 0) {
  261.      scalePtr->highlightWidth = 0;
  262.      }
  263. @@ -1086,6 +1165,13 @@
  264.      int x, y, width, height, shadowWidth;
  265.      double tickValue;
  266.      Tk_3DBorder sliderBorder;
  267. +    GC darkGC, dark2GC, lightGC, light2GC;
  268. +
  269. +
  270. +    darkGC   = Tk_3DBorderGC(tkwin,scalePtr->bgBorder, TK_3D_DARK_GC);
  271. +    dark2GC  = Tk_3DBorderGC(tkwin,scalePtr->bgBorder, TK_3D_DARK2_GC);
  272. +    lightGC  = Tk_3DBorderGC(tkwin,scalePtr->bgBorder, TK_3D_LIGHT_GC);
  273. +    light2GC = Tk_3DBorderGC(tkwin,scalePtr->bgBorder, TK_3D_DARK_GC);
  274.  
  275.      /*
  276.       * Display the information from left to right across the window.
  277. @@ -1143,17 +1229,18 @@
  278.       * Display the trough and the slider.
  279.       */
  280.  
  281. -    Tk_Draw3DRectangle(tkwin, drawable,
  282. -        scalePtr->bgBorder, scalePtr->vertTroughX, scalePtr->inset,
  283. -        scalePtr->width + 2*scalePtr->borderWidth,
  284. -        Tk_Height(tkwin) - 2*scalePtr->inset, scalePtr->borderWidth,
  285. -        TK_RELIEF_SUNKEN);
  286. -    XFillRectangle(scalePtr->display, drawable, scalePtr->troughGC,
  287. +
  288. +    XFillRectangle(scalePtr->display, drawable, scalePtr->troughBackGC,
  289.          scalePtr->vertTroughX + scalePtr->borderWidth,
  290.          scalePtr->inset + scalePtr->borderWidth,
  291.          (unsigned) scalePtr->width,
  292.          (unsigned) (Tk_Height(tkwin) - 2*scalePtr->inset
  293.          - 2*scalePtr->borderWidth));
  294. +    Tk_Draw3DRectangle(tkwin, drawable,
  295. +        scalePtr->activeBorder, scalePtr->vertTroughX, scalePtr->inset,
  296. +        scalePtr->width + 2*scalePtr->borderWidth,
  297. +        Tk_Height(tkwin) - 2*scalePtr->inset, scalePtr->borderWidth,
  298. +        TK_RELIEF_SUNKEN);
  299.      if (scalePtr->state == tkActiveUid) {
  300.      sliderBorder = scalePtr->activeBorder;
  301.      } else {
  302. @@ -1163,21 +1250,59 @@
  303.      height = scalePtr->sliderLength/2;
  304.      x = scalePtr->vertTroughX + scalePtr->borderWidth;
  305.      y = ValueToPixel(scalePtr, scalePtr->value) - height;
  306. -    shadowWidth = scalePtr->borderWidth/2;
  307. +    /* We know borderwidth is 1 */
  308. +    shadowWidth = scalePtr->borderWidth+1;
  309. +/*
  310.      if (shadowWidth == 0) {
  311.      shadowWidth = 1;
  312.      }
  313. -    Tk_Draw3DRectangle(tkwin, drawable, sliderBorder, x, y, width,
  314. -        2*height, shadowWidth, scalePtr->sliderRelief);
  315. +
  316. +    Tk_Draw3DRectangle(tkwin, drawable, scalePtr->activeBorder, x, y, width,
  317. +        2*height, shadowWidth, TK_RELIEF_RAISED);
  318. +
  319.      x += shadowWidth;
  320.      y += shadowWidth;
  321. -    width -= 2*shadowWidth;
  322. +    width -= shadowWidth;
  323.      height -= shadowWidth;
  324. -    Tk_Fill3DRectangle(tkwin, drawable, sliderBorder, x, y, width,
  325. -        height, shadowWidth, scalePtr->sliderRelief);
  326. -    Tk_Fill3DRectangle(tkwin, drawable, sliderBorder, x, y+height,
  327. -        width, height, shadowWidth, scalePtr->sliderRelief);
  328. -
  329. +*/    
  330. +/* Ugly! :-) */
  331. +    
  332. +    Tk_Fill3DRectangle(tkwin, drawable, scalePtr->bgBorder, x, y, width,
  333. +                       2*height, 2, TK_RELIEF_FLAT);
  334. +    /*
  335. +    XDrawLine(scalePtr->display, drawable, lightGC, x, y, x+width-shadowWidth, y);
  336. +    XDrawLine(scalePtr->display, drawable, lightGC, x, y, x, y+2*height-shadowWidth);
  337. +    XDrawLine(scalePtr->display, drawable, lightGC, x, y+height, x+width-shadowWidth, y+height);
  338. +
  339. +    XDrawLine(scalePtr->display, drawable, dark2GC,  x+1, y+2*height-1, x+width-1, y+2*height-1);
  340. +    XDrawLine(scalePtr->display, drawable, dark2GC,  x+width-1, y+2*height-shadowWidth, x+width-1, y+1);
  341. +    XDrawLine(scalePtr->display, drawable, darkGC, x+width-1, y+height-1, x+1, y+height-1);
  342. +
  343. +    XDrawLine(scalePtr->display, drawable, light2GC, x+1, y+height-2, x+width-shadowWidth, y+height-2);
  344. +    XDrawLine(scalePtr->display, drawable, light2GC, x+width-shadowWidth, y+height-2, x+width-shadowWidth, y+1);
  345. +    
  346. +    XDrawLine(scalePtr->display, drawable, light2GC, x+1, y+2*height-2, x+width-shadowWidth, y+2*height-2);
  347. +    XDrawLine(scalePtr->display, drawable, light2GC, x+width-shadowWidth, y+2*height-2, x+width-shadowWidth, y+height+1);
  348. +     * 
  349. +     * Re-uglyfication
  350. +    */
  351. +    XDrawLine(scalePtr->display, drawable, lightGC, x, y, x, y+2*height-shadowWidth);
  352. +    XDrawLine(scalePtr->display, drawable, lightGC, x+1, y, x+1, y+2*height-shadowWidth);
  353. +
  354. +    XDrawLine(scalePtr->display, drawable, dark2GC,  x+width-1, y+2*height-shadowWidth, x+width-1, y+1);
  355. +    XDrawLine(scalePtr->display, drawable, darkGC,  x+width-2, y+2*height-shadowWidth, x+width-2, y+1);
  356. +    
  357. +    
  358. +    XDrawLine(scalePtr->display, drawable, lightGC, x+1, y, x+width-2, y);
  359. +
  360. +    XDrawLine(scalePtr->display, drawable, darkGC, x+1, y+height-2, x+width-2, y+height-2);
  361. +    XDrawLine(scalePtr->display, drawable, lightGC, x+1, y+height-1, x+width-2, y+height-1);
  362. +    
  363. +    XDrawLine(scalePtr->display, drawable, darkGC, x, y+height*2-3, x+width-2, y+height*2-3);
  364. +    XDrawLine(scalePtr->display, drawable, dark2GC, x, y+height*2-2, x+width-1, y+height*2-2);
  365. +    XDrawLine(scalePtr->display, drawable, darkGC, x, y+height*2-1, x+width-1, y+height*2-1);
  366. +    
  367. +    
  368.      /*
  369.       * Draw the label to the right of the scale.
  370.       */
  371. @@ -1282,6 +1407,12 @@
  372.      int x, y, width, height, shadowWidth;
  373.      double tickValue;
  374.      Tk_3DBorder sliderBorder;
  375. +    GC lightGC, light2GC, darkGC, dark2GC;
  376. +    
  377. +    darkGC   = Tk_3DBorderGC(tkwin,scalePtr->bgBorder, TK_3D_DARK_GC);
  378. +    dark2GC  = Tk_3DBorderGC(tkwin,scalePtr->bgBorder, TK_3D_DARK2_GC);
  379. +    lightGC  = Tk_3DBorderGC(tkwin,scalePtr->bgBorder, TK_3D_LIGHT_GC);
  380. +    light2GC = Tk_3DBorderGC(tkwin,scalePtr->bgBorder, TK_3D_DARK_GC);
  381.  
  382.      /*
  383.       * Display the information from bottom to top across the window.
  384. @@ -1345,7 +1476,7 @@
  385.          Tk_Width(tkwin) - 2*scalePtr->inset,
  386.          scalePtr->width + 2*scalePtr->borderWidth,
  387.          scalePtr->borderWidth, TK_RELIEF_SUNKEN);
  388. -    XFillRectangle(scalePtr->display, drawable, scalePtr->troughGC,
  389. +    XFillRectangle(scalePtr->display, drawable, scalePtr->troughBackGC,
  390.          scalePtr->inset + scalePtr->borderWidth,
  391.          y + scalePtr->borderWidth,
  392.          (unsigned) (Tk_Width(tkwin) - 2*scalePtr->inset
  393. @@ -1360,21 +1491,60 @@
  394.      height = scalePtr->width;
  395.      x = ValueToPixel(scalePtr, scalePtr->value) - width;
  396.      y += scalePtr->borderWidth;
  397. -    shadowWidth = scalePtr->borderWidth/2;
  398. +    /* We know scalePtr->borderWidth is 1 */
  399. +    shadowWidth = scalePtr->borderWidth+1;
  400. +/*
  401.      if (shadowWidth == 0) {
  402.      shadowWidth = 1;
  403.      }
  404. -    Tk_Draw3DRectangle(tkwin, drawable, sliderBorder,
  405. -        x, y, 2*width, height, shadowWidth, scalePtr->sliderRelief);
  406. +    Tk_Draw3DRectangle(tkwin, drawable, scalePtr->activeBorder,
  407. +        x, y, 2*width, height, shadowWidth, TK_RELIEF_RAISED);
  408.      x += shadowWidth;
  409.      y += shadowWidth;
  410.      width -= shadowWidth;
  411.      height -= 2*shadowWidth;
  412. -    Tk_Fill3DRectangle(tkwin, drawable, sliderBorder, x, y, width, height,
  413. -        shadowWidth, scalePtr->sliderRelief);
  414. -    Tk_Fill3DRectangle(tkwin, drawable, sliderBorder, x+width, y,
  415. -        width, height, shadowWidth, scalePtr->sliderRelief);
  416. +    Tk_Fill3DRectangle(tkwin, drawable, scalePtr->bgBorder, x, y, width, height,
  417. +        shadowWidth, TK_RELIEF_RAISED);
  418. +    Tk_Fill3DRectangle(tkwin, drawable, scalePtr->bgBorder, x+width, y,
  419. +        width, height, shadowWidth, TK_RELIEF_RAISED);
  420. +    XDrawLine(scalePtr->display, drawable, lightGC, x+width, y, x+width, y+height-2);
  421. +*/
  422. +    Tk_Fill3DRectangle(tkwin, drawable, scalePtr->bgBorder, x, y, 2*width,
  423. +                       height, 2, TK_RELIEF_FLAT);
  424. +    /*
  425. +    XDrawLine(scalePtr->display, drawable, lightGC, x, y, x+2*width-2, y);
  426. +    XDrawLine(scalePtr->display, drawable, lightGC, x, y, x, y+height-2);
  427. +    XDrawLine(scalePtr->display, drawable, lightGC, x+width, y, x+width, y+height-2);
  428. +
  429. +    XDrawLine(scalePtr->display, drawable, dark2GC,  x+1, y+height-1, x+2*width-1, y+height-1);
  430. +    XDrawLine(scalePtr->display, drawable, dark2GC,  x+2*width-1, y+height-1, x+2*width-1, y+1);
  431. +    XDrawLine(scalePtr->display, drawable, darkGC, x+width-1, y+height-1, x+width-1, y+1);
  432. +
  433. +    XDrawLine(scalePtr->display, drawable, light2GC, x+1, y+height-2, x+width-shadowWidth, y+height-2);
  434. +    XDrawLine(scalePtr->display, drawable, light2GC, x+width-shadowWidth, y+height-2, x+width-2, y+1);
  435. +
  436. +    XDrawLine(scalePtr->display, drawable, light2GC, x+width+1, y+height-2, x+2*width-2, y+height-2);
  437. +    XDrawLine(scalePtr->display, drawable, light2GC, x+2*width-2, y+height-2, x+2*width-2, y+1);
  438. +
  439. +    */
  440. +    
  441. +    XDrawLine(scalePtr->display, drawable, lightGC, x, y, x+2*width-2, y);
  442. +
  443. +    XDrawLine(scalePtr->display, drawable, darkGC,  x, y+height-2, x+2*width-2, y+height-2);
  444. +    XDrawLine(scalePtr->display, drawable, dark2GC,  x, y+height-1, x+2*width-2, y+height-1);
  445. +    
  446. +    
  447. +    XDrawLine(scalePtr->display, drawable, lightGC, x, y, x, y+height-2);
  448. +    XDrawLine(scalePtr->display, drawable, lightGC, x+1, y, x+1, y+height-3);
  449. +    
  450. +    XDrawLine(scalePtr->display, drawable, darkGC, x+width-2, y+1, x+width-2, y+height-3);
  451. +    XDrawLine(scalePtr->display, drawable, lightGC, x+width-1, y, x+width-1, y+height-2);
  452. +    
  453. +    XDrawLine(scalePtr->display, drawable, darkGC, x+2*width-3, y, x+2*width-3, y+height-2);
  454. +    XDrawLine(scalePtr->display, drawable, dark2GC, x+2*width-2, y, x+2*width-2, y+height-1);
  455. +    XDrawLine(scalePtr->display, drawable, darkGC, x+2*width-1, y, x+2*width-1, y+height-1);
  456.  
  457. +    
  458.      /*
  459.       * Draw the label at the top of the scale.
  460.       */
  461.