summaryrefslogtreecommitdiffstats
path: root/mac/tkMacDraw.c
diff options
context:
space:
mode:
authorjingham <jingham@noemail.net>1999-08-10 05:04:44 (GMT)
committerjingham <jingham@noemail.net>1999-08-10 05:04:44 (GMT)
commitc582bf35bf20084065646debe5530181755dd44e (patch)
tree7316e518597bb3d84ce7a7a7cabcf5b05832add8 /mac/tkMacDraw.c
parent961a6ba6f98f8f6bbb1f1654697976bd4771cc6d (diff)
downloadtk-c582bf35bf20084065646debe5530181755dd44e.zip
tk-c582bf35bf20084065646debe5530181755dd44e.tar.gz
tk-c582bf35bf20084065646debe5530181755dd44e.tar.bz2
New Function: TkpDrawHighlightBorder. Use this in place of Tk_DrawFocusHighlight. The latter did not work on the Mac, since you need to know both foreground & background color when you draw the active focus ring.
FossilOrigin-Name: 9bb078186f93162afcdcd453066e44b705aa8186
Diffstat (limited to 'mac/tkMacDraw.c')
-rw-r--r--mac/tkMacDraw.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/mac/tkMacDraw.c b/mac/tkMacDraw.c
index a346a3c..bb04f05 100644
--- a/mac/tkMacDraw.c
+++ b/mac/tkMacDraw.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacDraw.c,v 1.5 1999/05/22 06:32:50 jingham Exp $
+ * RCS: @(#) $Id: tkMacDraw.c,v 1.6 1999/08/10 05:04:53 jingham Exp $
*/
#include "tkInt.h"
@@ -1129,3 +1129,46 @@ InvertByte(
}
return result;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDrawpHighlightBorder --
+ *
+ * This procedure draws a rectangular ring around the outside of
+ * a widget to indicate that it has received the input focus.
+ *
+ * On the Macintosh, this puts a 1 pixel border in the bgGC color
+ * between the widget and the focus ring, except in the case where
+ * highlightWidth is 1, in which case the border is left out.
+ *
+ * For proper Mac L&F, use highlightWidth of 3.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A rectangle "width" pixels wide is drawn in "drawable",
+ * corresponding to the outer area of "tkwin".
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDrawHighlightBorder (
+ Tk_Window tkwin,
+ GC fgGC,
+ GC bgGC,
+ int highlightWidth,
+ Drawable drawable)
+{
+ if (highlightWidth == 1) {
+ TkDrawInsetFocusHighlight (tkwin, fgGC, highlightWidth, drawable, 0);
+ } else {
+ TkDrawInsetFocusHighlight (tkwin, bgGC, highlightWidth, drawable, 0);
+ if (fgGC != bgGC) {
+ TkDrawInsetFocusHighlight (tkwin, fgGC, highlightWidth - 1, drawable, 0);
+ }
+ }
+}
+ \ No newline at end of file