summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkWidget.h
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2011-09-22 18:10:30 (GMT)
committerjenglish <jenglish@flightlab.com>2011-09-22 18:10:30 (GMT)
commit3d7771a4c563657f852eddc6b6e5a1e5223cd568 (patch)
tree1f3d74c51d27e678018aae35bf2e4f667359e082 /generic/ttk/ttkWidget.h
parentaef5d3cf9a433ab18b10d9d5770943f1cd703bd7 (diff)
downloadtk-3d7771a4c563657f852eddc6b6e5a1e5223cd568.zip
tk-3d7771a4c563657f852eddc6b6e5a1e5223cd568.tar.gz
tk-3d7771a4c563657f852eddc6b6e5a1e5223cd568.tar.bz2
Move -takefocus option out of ttkCoreOptionSpecs,
explicitly specify it on individual widgets. [Bug 3404541], [Bug 1204186].
Diffstat (limited to 'generic/ttk/ttkWidget.h')
-rw-r--r--generic/ttk/ttkWidget.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h
index fffd82b..9e9ab69 100644
--- a/generic/ttk/ttkWidget.h
+++ b/generic/ttk/ttkWidget.h
@@ -109,14 +109,18 @@ MODULE_SCOPE int TtkWidgetConstructorObjCmd(
Tcl_CreateObjCommand(interp, name, \
TtkWidgetConstructorObjCmd, (ClientData)specPtr,NULL)
-/* WIDGET_TAKES_FOCUS --
- * Add this to the OptionSpecs table of widgets that
- * take keyboard focus during traversal to override
- * CoreOptionSpec's -takefocus default value:
+/* WIDGET_TAKEFOCUS_TRUE --
+ * WIDGET_TAKEFOCUS_FALSE --
+ * Add one or the other of these to each OptionSpecs table
+ * to indicate whether the widget should take focus
+ * during keyboard traversal.
*/
-#define WIDGET_TAKES_FOCUS \
+#define WIDGET_TAKEFOCUS_TRUE \
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \
"ttk::takefocus", Tk_Offset(WidgetCore, takeFocusPtr), -1, 0,0,0 }
+#define WIDGET_TAKEFOCUS_FALSE \
+ {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \
+ "", Tk_Offset(WidgetCore, takeFocusPtr), -1, 0,0,0 }
/* WIDGET_INHERIT_OPTIONS(baseOptionSpecs) --
* Add this at the end of an OptionSpecs table to inherit
@@ -125,6 +129,10 @@ MODULE_SCOPE int TtkWidgetConstructorObjCmd(
#define WIDGET_INHERIT_OPTIONS(baseOptionSpecs) \
{TK_OPTION_END, 0,0,0, NULL, -1,-1, 0, (ClientData)baseOptionSpecs, 0}
+/* All widgets should inherit from ttkCoreOptionSpecs[].
+ */
+MODULE_SCOPE Tk_OptionSpec ttkCoreOptionSpecs[];
+
/*
* Useful routines for use inside widget implementations:
*/
@@ -235,11 +243,6 @@ MODULE_SCOPE void Ttk_TagSetValues(Ttk_TagTable, Ttk_TagSet, void *record);
MODULE_SCOPE void Ttk_TagSetApplyStyle(Ttk_TagTable,Ttk_Style,Ttk_State,void*);
/*
- * Useful widget base classes:
- */
-MODULE_SCOPE Tk_OptionSpec ttkCoreOptionSpecs[];
-
-/*
* String tables for widget resource specifications:
*/