diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkMenu.c | 14 | ||||
-rw-r--r-- | generic/tkMenu.h | 14 | ||||
-rw-r--r-- | generic/tkMenubutton.c | 4 | ||||
-rw-r--r-- | generic/tkMenubutton.h | 17 |
4 files changed, 34 insertions, 15 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 84e338d..ff50130 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.c,v 1.12 2001/09/14 20:35:58 andreas_kupries Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.13 2001/10/12 13:30:31 tmh Exp $ */ /* @@ -108,6 +108,15 @@ char *tkMenuStateStrings[] = {"active", "normal", "disabled", (char *) NULL}; static char *menuEntryTypeStrings[] = {"cascade", "checkbutton", "command", "radiobutton", "separator", (char *) NULL}; +/* + * The following table defines the legal values for the -compound option. + * It is used with the "enum compound" declaration in tkMenu.h + */ + +static char *compoundStrings[] = { + "bottom", "center", "left", "none", "right", "top", (char *) NULL +}; + Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = { {TK_OPTION_BORDER, "-activebackground", (char *) NULL, (char *) NULL, DEF_MENU_ENTRY_ACTIVE_BG, Tk_Offset(TkMenuEntry, activeBorderPtr), -1, @@ -130,6 +139,9 @@ Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = { {TK_OPTION_STRING, "-command", (char *) NULL, (char *) NULL, DEF_MENU_ENTRY_COMMAND, Tk_Offset(TkMenuEntry, commandPtr), -1, TK_OPTION_NULL_OK}, + {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", + DEF_MENU_ENTRY_COMPOUND, -1, Tk_Offset(TkMenuEntry, compound), 0, + (ClientData) compoundStrings, 0}, {TK_OPTION_FONT, "-font", (char *) NULL, (char *) NULL, DEF_MENU_ENTRY_FONT, Tk_Offset(TkMenuEntry, fontPtr), -1, TK_OPTION_NULL_OK}, diff --git a/generic/tkMenu.h b/generic/tkMenu.h index 9ec63f4..9553bc0 100644 --- a/generic/tkMenu.h +++ b/generic/tkMenu.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.h,v 1.5 1999/04/16 01:51:19 stanton Exp $ + * RCS: @(#) $Id: tkMenu.h,v 1.6 2001/10/12 13:30:31 tmh Exp $ */ #ifndef _TKMENU @@ -39,6 +39,15 @@ typedef struct TkMenuPlatformData_ *TkMenuPlatformData; typedef struct TkMenuPlatformEntryData_ *TkMenuPlatformEntryData; /* + * Legal values for the "compound" field of TkMenuEntry and TkMenuButton records. + */ + +enum compound { + COMPOUND_BOTTOM, COMPOUND_CENTER, COMPOUND_LEFT, COMPOUND_NONE, + COMPOUND_RIGHT, COMPOUND_TOP +}; + +/* * One of the following data structures is kept for each entry of each * menu managed by this file: */ @@ -115,6 +124,9 @@ typedef struct TkMenuEntry { * entry. */ int labelWidth; /* Number of pixels to allow for displaying * labels in menu entries. */ + int compound; /* Value of -compound option; specifies whether + * the entry should show both an image and + * text, and, if so, how. */ /* * Information used to implement this entry's action: diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 815837f..28d82a9 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.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: tkMenubutton.c,v 1.7 2001/08/29 23:22:24 hobbs Exp $ + * RCS: @(#) $Id: tkMenubutton.c,v 1.8 2001/10/12 13:30:31 tmh Exp $ */ #include "tkMenubutton.h" @@ -38,7 +38,7 @@ static char *stateStrings[] = { /* * The following table defines the legal values for the -compound option. - * It is used with the "enum compound" declaration in tkButton.h + * It is used with the "enum compound" declaration in tkMenuButton.h */ static char *compoundStrings[] = { diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h index a4a8a05..332d770 100644 --- a/generic/tkMenubutton.h +++ b/generic/tkMenubutton.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenubutton.h,v 1.7 2001/05/21 14:07:33 tmh Exp $ + * RCS: @(#) $Id: tkMenubutton.h,v 1.8 2001/10/12 13:30:31 tmh Exp $ */ #ifndef _TKMENUBUTTON @@ -19,21 +19,16 @@ #include "tkInt.h" #endif +#ifndef _TKMENU +#include "tkMenu.h" +#endif + #ifdef BUILD_tk # undef TCL_STORAGE_CLASS # define TCL_STORAGE_CLASS DLLEXPORT #endif /* - * Legal values for the "compound" field of TkButton records. - */ - -enum compound { - COMPOUND_BOTTOM, COMPOUND_CENTER, COMPOUND_LEFT, COMPOUND_NONE, - COMPOUND_RIGHT, COMPOUND_TOP -}; - -/* * Legal values for the "orient" field of TkMenubutton records. */ @@ -172,7 +167,7 @@ typedef struct { */ int compound; /* Value of -compound option; specifies whether - * the button should show both an image and + * the menubutton should show both an image and * text, and, if so, how. */ enum direction direction; /* Direction for where to pop the menu. |