summaryrefslogtreecommitdiffstats
path: root/generic/tkTextTag.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2005-10-10 10:36:34 (GMT)
committervincentdarley <vincentdarley>2005-10-10 10:36:34 (GMT)
commit465cf308ea2f63fa388ed9e0e055c82e8e9e3ca3 (patch)
treece21d5eee20f7e5c9a628e238ad0a87a0aaeebad /generic/tkTextTag.c
parentebaf2538558086d8a3749809e5863e1b134f19ab (diff)
downloadtk-465cf308ea2f63fa388ed9e0e055c82e8e9e3ca3.zip
tk-465cf308ea2f63fa388ed9e0e055c82e8e9e3ca3.tar.gz
tk-465cf308ea2f63fa388ed9e0e055c82e8e9e3ca3.tar.bz2
tip256 implementation
Diffstat (limited to 'generic/tkTextTag.c')
-rw-r--r--generic/tkTextTag.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 00d350a..540c0af 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextTag.c,v 1.20 2005/08/10 22:02:22 dkf Exp $
+ * RCS: @(#) $Id: tkTextTag.c,v 1.21 2005/10/10 10:36:35 vincentdarley Exp $
*/
#include "default.h"
@@ -30,6 +30,17 @@ static char *wrapStrings[] = {
"char", "none", "word", "", (char *) NULL
};
+/*
+ * The 'TkTextTabStyle' enum in tkText.h is used to define a type for
+ * the -tabstyle option of the Text widget. These values are used as
+ * indices into the string table below. Tags are allowed an empty wrap
+ * value, but the widget as a whole is not.
+ */
+
+static char *tabStyleStrings[] = {
+ "tabular", "wordprocessor", "", (char *) NULL
+};
+
static Tk_OptionSpec tagOptionSpecs[] = {
{TK_OPTION_BORDER, "-background", (char *) NULL, (char *) NULL,
NULL, -1, Tk_Offset(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0},
@@ -70,6 +81,9 @@ static Tk_OptionSpec tagOptionSpecs[] = {
NULL, -1, Tk_Offset(TkTextTag, spacing3String), TK_OPTION_NULL_OK,0,0},
{TK_OPTION_STRING, "-tabs", (char *) NULL, (char *) NULL,
NULL, Tk_Offset(TkTextTag, tabStringPtr), -1, TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-tabstyle", (char *) NULL, (char *) NULL,
+ (char *) NULL, -1, Tk_Offset(TkTextTag, tabStyle),
+ TK_OPTION_NULL_OK, (ClientData) tabStyleStrings, 0},
{TK_OPTION_STRING, "-underline", (char *) NULL, (char *) NULL,
(char *) NULL, -1, Tk_Offset(TkTextTag, underlineString),
TK_OPTION_NULL_OK, 0, 0},
@@ -483,6 +497,7 @@ TkTextTagCmd(textPtr, interp, objc, objv)
|| (tagPtr->spacing2String != NULL)
|| (tagPtr->spacing3String != NULL)
|| (tagPtr->tabStringPtr != NULL)
+ || (tagPtr->tabStyle != TK_TEXT_TABSTYLE_NONE)
|| (tagPtr->wrapMode != TEXT_WRAPMODE_NULL)) {
tagPtr->affectsDisplay = 1;
tagPtr->affectsDisplayGeometry = 1;
@@ -996,6 +1011,7 @@ TkTextCreateTag(textPtr, tagName, newTag)
tagPtr->spacing3 = 0;
tagPtr->tabStringPtr = NULL;
tagPtr->tabArrayPtr = NULL;
+ tagPtr->tabStyle = TK_TEXT_TABSTYLE_NONE;
tagPtr->underlineString = NULL;
tagPtr->underline = 0;
tagPtr->elideString = NULL;
@@ -1723,11 +1739,3 @@ TagBindEvent(textPtr, eventPtr, numTags, tagArrayPtr)
ckfree((char*)nameArrPtr);
}
}
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */