head	1.19;
access;
symbols
	core-8-5-9:1.16.2.1
	core-8-5-8:1.16
	macosx-cocoa-merge:1.16
	macosx-cocoa-premerge:1.16
	macosx-carbon-freeze:1.16
	core-8-5-7:1.16
	core-8-5-6:1.16
	core-8-6-b1:1.16
	core-8-6-a3:1.16
	core-8-5-5:1.16
	core-8-6-a2:1.16
	core-8-5-4:1.16
	core-8-5-3:1.16
	core-8-6-a1:1.16
	core-8-4-19:1.9.2.1
	core-8-5-branch:1.16.0.2
	core-8-5-2:1.16
	core-8-4-18:1.9.2.1
	core-8-5-1:1.16
	core-8-4-17:1.9.2.1
	core-8-5-0:1.16
	core-8-5-b3:1.15
	core-8-5-b2:1.15
	core-8-4-16:1.9.2.1
	core-8-5-b1:1.15
	core-stablilizer-merge:1.15
	core-stabilizer-branch:1.13.0.2
	core-stabilizer-merge:1.16
	core-8-4-15:1.9.2.1
	core-8-5-a6:1.13
	core-8-5-a5:1.13
	core-8-4-14:1.9.2.1
	core-8-5-a4:1.13
	core-8-4-13:1.9.2.1
	core-8-4-12:1.9.2.1
	core-8-4-11:1.9.2.1
	core-8-5-a3:1.11
	core-8-4-10:1.9.2.1
	core-8-4-9-branch:1.9.2.1.0.2
	core-8-5-a2:1.11
	core-8-4-9:1.9.2.1
	core-8-4-8:1.9.2.1
	core-8-4-7:1.9.2.1
	core-8-5-a1:1.11
	core-8-4-6:1.9.2.1
	core-8-4-5:1.9.2.1
	mistachkin-dev-branch:1.10.0.2
	core-8-4-4:1.9.2.1
	core-8-4-3:1.9.2.1
	core-8-4-branch:1.9.0.2
	core-8-4-2:1.9
	core-8-4-1:1.9
	core-8-3-5:1.5
	core-8-4-0:1.9
	macosx-8-4-merge-2002-08-31-trunk:1.9
	macosx-8-4-premerge-2002-08-31-branch:1.8.4.1
	macosx-8-4-premerge-2002-08-31-trunk:1.9
	macosx-8-4-merge-2002-08-30-branch:1.8.4.1
	macosx-8-4-merge-2002-08-30-trunk:1.9
	macosx-8-4-merge-2002-08-20-branch:1.8.4.1
	macosx-8-4-merge-2002-08-20-trunk:1.9
	core-8-4-b2:1.9
	core-8-4-b1:1.9
	macosx-premerge-6-9-02:1.8
	core-8-4-a4:1.8
	core-8-3-4:1.5
	macosx-8-4-branch:1.8.0.4
	macosx-8-4-branchpoint:1.8
	core-8-4-a3:1.8
	core-8-3-3:1.5
	dgp-privates-into-namespace:1.8.0.2
	tclpro-1-5-0:1.5
	core-8-4-win-speedup:1.7.0.2
	core-8-4-a2:1.7
	tclpro-1-4-1:1.5
	tclpro-1-4-0:1.5
	core-8-3-2:1.5
	ajuba-ajuba2-2-1-base:1.5
	ajuba-ajuba2-2-0:1.5
	core-8-4-a1:1.7
	core-8-3-1-branch:1.5.0.12
	core-8-3-1:1.5
	scriptics-sc-2-0-b5:1.5
	scriptics-sc-2-0-fixed:1.5
	scriptics-sc-2-0-b2:1.5
	scriptics-sc-2-0-b1:1.5
	core-8-3-0:1.5
	core-8-3-b2:1.5
	core-8-3-b1:1.5
	scriptics-sc-1-1:1.5
	scriptics-sc-1-1-b1:1.5
	core-8-2-3:1.5
	scriptics-sc-1-1-branch:1.5.0.10
	scriptics-sc-1-1-base:1.5
	scriptics-sc-1-0:1.5
	scriptics-sc-1-0-branch:1.5.0.8
	scriptics-sc-1-0-base:1.5
	core-8-2-2:1.5
	core-8-2-1:1.5
	scriptics-bc-1-0-b1:1.5
	core-8-2-1-branch:1.5.0.6
	scriptics-tclpro-1-3-0:1.5
	core-8-2-0:1.5
	core-8-2-b3-branch:1.5.0.4
	core-8-2-b3-base:1.5
	scriptics-tclpro-1-3-b4:1.5
	core-8-2-b2:1.5
	scriptics-tclpro-1-3-b3:1.5
	core-8-2-b1:1.5
	scriptics-tclpro-1-3-b2:1.5
	merge-to-mainline-5/21/99:1.5
	scriptics-tclpro-1-3-b2-branch:1.5.0.2
	core-8-1-1:1.5
	scriptics-tclpro-1-3-b1:1.5
	core-8-1-1-base:1.5
	core-8-1-0:1.5
	merge-to-mainline-4-29-99:1.5
	merge-to-mainline-4-23-99:1.5
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.4.0.6
	core-8-0-6-base:1.4
	core-8-0-5:1.4
	core-8-1-b3:1.1.4.2
	core-8-1-b2:1.1.4.2
	dev-8-1-stubs-branch:1.1.4.2.0.2
	dev-stubs-branch:1.4.0.4
	scriptics-tclpro-1-2:1.4
	scriptics-tclpro-1-2-b2:1.4
	core-8-1-merge-2/10/99:1.4
	core-8-0-5-branch:1.4.0.2
	core-8-0-5-base:1.4
	scriptics-tclpro-1-2-b1:1.4
	scriptics-tclpro-1-2-a1:1.4
	core-8-1-b1:1.1.4.2
	core-8-0-4:1.4
	core-8-1-a2:1.1.4.1
	core-8-0-2:1.1
	core-8-0-3:1.4;
locks; strict;
comment	@ * @;


1.19
date	2010.04.23.08.32.56;	author nijtmans;	state Exp;
branches;
next	1.18;

1.18
date	2010.02.18.22.31.31;	author nijtmans;	state Exp;
branches;
next	1.17;

1.17
date	2010.01.13.23.08.07;	author nijtmans;	state Exp;
branches;
next	1.16;

1.16
date	2007.12.13.15.24.13;	author dgp;	state Exp;
branches
	1.16.2.1;
next	1.15;

1.15
date	2007.06.25.19.09.44;	author dgp;	state Exp;
branches;
next	1.14;

1.14
date	2007.06.24.16.07.34;	author dkf;	state Exp;
branches;
next	1.13;

1.13
date	2005.11.27.02.36.13;	author das;	state Exp;
branches
	1.13.2.1;
next	1.12;

1.12
date	2005.11.04.15.23.05;	author dkf;	state Exp;
branches;
next	1.11;

1.11
date	2004.02.18.00.40.24;	author hobbs;	state Exp;
branches;
next	1.10;

1.10
date	2003.04.26.02.59.20;	author hobbs;	state Exp;
branches;
next	1.9;

1.9
date	2002.06.17.10.54.29;	author drh;	state Exp;
branches
	1.9.2.1;
next	1.8;

1.8
date	2000.11.22.01.49.37;	author ericm;	state Exp;
branches
	1.8.4.1;
next	1.7;

1.7
date	2000.05.17.21.17.20;	author ericm;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2000.05.13.00.39.07;	author ericm;	state Exp;
branches;
next	1.5;

1.5
date	99.04.16.01.51.11;	author stanton;	state Exp;
branches;
next	1.4;

1.4
date	98.09.14.18.23.04;	author stanton;	state Exp;
branches;
next	1.3;

1.3
date	98.08.04.12.18.56;	author escoffon;	state Exp;
branches;
next	1.2;

1.2
date	98.07.29.12.38.27;	author escoffon;	state Exp;
branches;
next	1.1;

1.1
date	98.04.01.09.51.46;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.29.00.25.13;	author stanton;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	98.09.30.02.16.41;	author stanton;	state Exp;
branches;
next	;

1.7.2.1
date	2002.04.02.21.00.46;	author hobbs;	state Exp;
branches;
next	;

1.8.4.1
date	2002.08.20.20.27.01;	author das;	state Exp;
branches;
next	;

1.9.2.1
date	2003.04.26.02.53.46;	author hobbs;	state Exp;
branches;
next	1.9.2.2;

1.9.2.2
date	2010.03.12.13.12.35;	author nijtmans;	state Exp;
branches;
next	;

1.13.2.1
date	2007.06.25.19.12.12;	author dgp;	state Exp;
branches;
next	;

1.16.2.1
date	2010.03.12.13.02.37;	author nijtmans;	state Exp;
branches;
next	;


desc
@@


1.19
log
@Formatting
typo fixes
remove not existing tkDisplayList;
Useless re-definitions of TCL_STORAGE_CLASS
@
text
@/*
 * tkButton.h --
 *
 *	Declarations of types and functions used to implement button-like
 *	widgets.
 *
 * Copyright (c) 1996-1998 by Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @@(#) $Id: tkButton.h,v 1.18 2010/02/18 22:31:31 nijtmans Exp $
 */

#ifndef _TKBUTTON
#define _TKBUTTON

#ifndef _TKINT
#include "tkInt.h"
#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 "state" field of TkButton records.
 */

enum state {
    STATE_ACTIVE, STATE_DISABLED, STATE_NORMAL
};

/*
 * Legal values for the "defaultState" field of TkButton records.
 */

enum defaultState {
    DEFAULT_ACTIVE, DEFAULT_DISABLED, DEFAULT_NORMAL
};

/*
 * A data structure of the following type is kept for each widget managed by
 * this file:
 */

typedef struct {
    Tk_Window tkwin;		/* Window that embodies the button. NULL means
				 * that the window has been destroyed. */
    Display *display;		/* Display containing widget. Needed to free
				 * up resources after tkwin is gone. */
    Tcl_Interp *interp;		/* Interpreter associated with button. */
    Tcl_Command widgetCmd;	/* Token for button's widget command. */
    int type;			/* Type of widget, such as TYPE_LABEL:
				 * restricts operations that may be performed
				 * on widget. See below for legal values. */
    Tk_OptionTable optionTable;	/* Table that defines configuration options
				 * available for this widget. */

    /*
     * Information about what's in the button.
     */

    Tcl_Obj *textPtr;		/* Value of -text option: specifies text to
				 * display in button. */
    int underline;		/* Value of -underline option: specifies index
				 * of character to underline. < 0 means don't
				 * underline anything. */
    Tcl_Obj *textVarNamePtr;	/* Value of -textvariable option: specifies
				 * name of variable or NULL. If non-NULL,
				 * button displays the contents of this
				 * variable. */
    Pixmap bitmap;		/* Value of -bitmap option. If not None,
				 * specifies bitmap to display and text and
				 * textVar are ignored. */
    Tcl_Obj *imagePtr;		/* Value of -image option: specifies image to
				 * display in window, or NULL if none. If
				 * non-NULL, bitmap, text, and textVarName are
				 * ignored.*/
    Tk_Image image;		/* Derived from imagePtr by calling
				 * Tk_GetImage, or NULL if imagePtr is
				 * NULL. */
    Tcl_Obj *selectImagePtr;	/* Value of -selectimage option: specifies
				 * image to display in window when selected,
				 * or NULL if none. Ignored if imagePtr is
				 * NULL. */
    Tk_Image selectImage;	/* Derived from selectImagePtr by calling
				 * Tk_GetImage, or NULL if selectImagePtr is
				 * NULL. */
    Tcl_Obj *tristateImagePtr;	/* Value of -tristateimage option: specifies
				 * image to display in window when selected,
				 * or NULL if none. Ignored if imagePtr is
				 * NULL. */
    Tk_Image tristateImage;	/* Derived from tristateImagePtr by calling
				 * Tk_GetImage, or NULL if tristateImagePtr is
				 * NULL. */

    /*
     * Information used when displaying widget:
     */

    enum state state;		/* Value of -state option: specifies state of
				 * button for display purposes.*/
    Tk_3DBorder normalBorder;	/* Value of -background option: specifies
				 * color for background (and border) when
				 * window isn't active. */
    Tk_3DBorder activeBorder;	/* Value of -activebackground option: this is
				 * the color used to draw 3-D border and
				 * background when widget is active. */
    Tcl_Obj *borderWidthPtr;	/* Value of -borderWidth option: specifies
				 * width of border in pixels. */
    int borderWidth;		/* Integer value corresponding to
				 * borderWidthPtr. Always >= 0. */
    int relief;			/* Value of -relief option: specifies 3-d
				 * effect for border, such as
				 * TK_RELIEF_RAISED. */
    int overRelief;		/* Value of -overrelief option: specifies a
				 * 3-d effect for the border, such as
				 * TK_RELIEF_RAISED, to be used when the mouse
				 * is over the button. */
    int offRelief;		/* Value of -offrelief option: specifies a 3-d
				 * effect for the border, such as
				 * TK_RELIEF_RAISED, to be used when a
				 * checkbutton or radiobutton without
				 * indicator is off. */
    Tcl_Obj *highlightWidthPtr;	/* Value of -highlightthickness option:
				 * specifies width in pixels of highlight to
				 * draw around widget when it has the focus.
				 * <= 0 means don't draw a highlight. */
    int highlightWidth;		/* Integer value corresponding to
				 * highlightWidthPtr. Always >= 0. */
    Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
				 * specifies background with which to draw 3-D
				 * default ring and focus highlight area when
				 * highlight is off. */
    XColor *highlightColorPtr;	/* Value of -highlightcolor option: specifies
				 * color for drawing traversal highlight. */
    int inset;			/* Total width of all borders, including
				 * traversal highlight and 3-D border.
				 * Indicates how much interior stuff must be
				 * offset from outside edges to leave room for
				 * borders. */
    Tk_Font tkfont;		/* Value of -font option: specifies font to
				 * use for display text. */
    XColor *normalFg;		/* Value of -font option: specifies foreground
				 * color in normal mode. */
    XColor *activeFg;		/* Value of -activeforeground option:
				 * foreground color in active mode. NULL means
				 * use -foreground instead. */
    XColor *disabledFg;		/* Value of -disabledforeground option:
				 * foreground color when disabled. NULL means
				 * use normalFg with a 50% stipple instead. */
    GC normalTextGC;		/* GC for drawing text in normal mode. Also
				 * used to copy from off-screen pixmap onto
				 * screen. */
    GC activeTextGC;		/* GC for drawing text in active mode (NULL
				 * means use normalTextGC). */
    GC disabledGC;		/* Used to produce disabled effect for text
				 * and check/radio marks. */
    GC stippleGC;		/* Used to produce disabled stipple effect for
				 * images when disabled. */
    Pixmap gray;		/* Pixmap for displaying disabled text if
				 * disabledFg is NULL. */
    GC copyGC;			/* Used for copying information from an
				 * off-screen pixmap to the screen. */
    Tcl_Obj *widthPtr;		/* Value of -width option. */
    int width;			/* Integer value corresponding to widthPtr. */
    Tcl_Obj *heightPtr;		/* Value of -height option. */
    int height;			/* Integer value corresponding to heightPtr. */
    Tcl_Obj *wrapLengthPtr;	/* Value of -wraplength option: specifies line
				 * length (in pixels) at which to wrap onto
				 * next line. <= 0 means don't wrap except at
				 * newlines. */
    int wrapLength;		/* Integer value corresponding to
				 * wrapLengthPtr. */
    Tcl_Obj *padXPtr;		/* Value of -padx option: specifies how many
				 * pixels of extra space to leave on left and
				 * right of text. Ignored for bitmaps and
				 * images. */
    int padX;			/* Integer value corresponding to padXPtr. */
    Tcl_Obj *padYPtr;		/* Value of -padx option: specifies how many
				 * pixels of extra space to leave above and
				 * below text. Ignored for bitmaps and
				 * images. */
    int padY;			/* Integer value corresponding to padYPtr. */
    Tk_Anchor anchor;		/* Value of -anchor option: specifies where
				 * text/bitmap should be displayed inside
				 * button region. */
    Tk_Justify justify;		/* Value of -justify option: specifies how to
				 * align lines of multi-line text. */
    int indicatorOn;		/* Value of -indicatoron option: 1 means draw
				 * indicator in checkbuttons and radiobuttons,
				 * 0 means don't draw it. */
    Tk_3DBorder selectBorder;	/* Value of -selectcolor option: specifies
				 * color for drawing indicator background, or
				 * perhaps widget background, when
				 * selected. */
    int textWidth;		/* Width needed to display text as requested,
				 * in pixels. */
    int textHeight;		/* Height needed to display text as requested,
				 * in pixels. */
    Tk_TextLayout textLayout;	/* Saved text layout information. */
    int indicatorSpace;		/* Horizontal space (in pixels) allocated for
				 * display of indicator. */
    int indicatorDiameter;	/* Diameter of indicator, in pixels. */
    enum defaultState defaultState;
				/* Value of -default option, such as
				 * DEFAULT_NORMAL: specifies state of default
				 * ring for buttons (normal, active, or
				 * disabled). NULL for other classes. */

    /*
     * For check and radio buttons, the fields below are used to manage the
     * variable indicating the button's state.
     */

    Tcl_Obj *selVarNamePtr;	/* Value of -variable option: specifies name
				 * of variable used to control selected state
				 * of button. */
    Tcl_Obj *onValuePtr;	/* Value of -offvalue option: specifies value
				 * to store in variable when this button is
				 * selected. */
    Tcl_Obj *offValuePtr;	/* Value of -offvalue option: specifies value
				 * to store in variable when this button isn't
				 * selected. Used only by checkbuttons. */
    Tcl_Obj *tristateValuePtr;	/* Value of -tristatevalue option: specifies
				 * value to display Tristate or Multivalue
				 * mode when variable matches this value.
				 * Used by check- buttons. */

    /*
     * Miscellaneous information:
     */

    Tk_Cursor cursor;		/* Value of -cursor option: if not None,
				 * specifies current cursor for window. */
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option; not used in the
				 * C code, but used by keyboard traversal
				 * scripts. */
    Tcl_Obj *commandPtr;	/* Value of -command option: specifies script
				 * to execute when button is invoked. If
				 * widget is label or has no command, this is
				 * NULL. */
    int compound;		/* Value of -compound option; specifies
				 * whether the button should show both an
				 * image and text, and, if so, how. */
    int repeatDelay;		/* Value of -repeatdelay option; specifies the
				 * number of ms after which the button will
				 * start to auto-repeat its command. */
    int repeatInterval;		/* Value of -repeatinterval option; specifies
				 * the number of ms between auto-repeat
				 * invocataions of the button command. */
    int flags;			/* Various flags; see below for
				 * definitions. */
} TkButton;

/*
 * Possible "type" values for buttons. These are the kinds of widgets
 * supported by this file. The ordering of the type numbers is significant:
 * greater means more features and is used in the code.
 */

#define TYPE_LABEL		0
#define TYPE_BUTTON		1
#define TYPE_CHECK_BUTTON	2
#define TYPE_RADIO_BUTTON	3

/*
 * Flag bits for buttons:
 *
 * REDRAW_PENDING:		Non-zero means a DoWhenIdle handler has
 *				already been queued to redraw this window.
 * SELECTED:			Non-zero means this button is selected, so
 *				special highlight should be drawn.
 * GOT_FOCUS:			Non-zero means this button currently has the
 *				input focus.
 * BUTTON_DELETED:		Non-zero needs that this button has been
 *				deleted, or is in the process of being deleted
 */

#define REDRAW_PENDING		(1 << 0)
#define SELECTED		(1 << 1)
#define GOT_FOCUS		(1 << 2)
#define BUTTON_DELETED		(1 << 3)
#define TRISTATED		(1 << 4)

/*
 * Declaration of button class functions structure
 * and button/label defaults, for use in optionSpecs.
 */

MODULE_SCOPE const Tk_ClassProcs tkpButtonProcs;
MODULE_SCOPE char tkDefButtonHighlightWidth[TCL_INTEGER_SPACE];
MODULE_SCOPE char tkDefButtonPadx[TCL_INTEGER_SPACE];
MODULE_SCOPE char tkDefButtonPady[TCL_INTEGER_SPACE];
MODULE_SCOPE char tkDefButtonBorderWidth[TCL_INTEGER_SPACE];
MODULE_SCOPE char tkDefLabelHighlightWidth[TCL_INTEGER_SPACE];
MODULE_SCOPE char tkDefLabelPadx[TCL_INTEGER_SPACE];
MODULE_SCOPE char tkDefLabelPady[TCL_INTEGER_SPACE];

/*
 * Declaration of functions used in the implementation of the button widget.
 */

#ifndef TkpButtonSetDefaults
MODULE_SCOPE void	TkpButtonSetDefaults();
#endif
MODULE_SCOPE void	TkButtonWorldChanged(ClientData instanceData);
MODULE_SCOPE void	TkpComputeButtonGeometry(TkButton *butPtr);
MODULE_SCOPE TkButton	*TkpCreateButton(Tk_Window tkwin);
#ifndef TkpDestroyButton
MODULE_SCOPE void 	TkpDestroyButton(TkButton *butPtr);
#endif
#ifndef TkpDisplayButton
MODULE_SCOPE void	TkpDisplayButton(ClientData clientData);
#endif
MODULE_SCOPE int	TkInvokeButton(TkButton *butPtr);

#endif /* _TKBUTTON */
@


1.18
log
@Put all Tk_OptionSpec for buttons and labels
in const memory. With some changes to win32
and macosx, preventing direct writes to
read-only memory.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.17 2010/01/13 23:08:07 nijtmans Exp $
a21 5
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif

a323 3
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT

@


1.17
log
@Eliminate tkpMenubuttonClass
make tkpButtonProcs CONST
fix gcc warnings: missing initializer
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.16 2007/12/13 15:24:13 dgp Exp $
d298 2
a299 1
 * Declaration of variables shared between the files in the button module.
d303 7
d316 1
a316 1
MODULE_SCOPE void	TkpButtonSetDefaults(Tk_OptionSpec *specPtr);
@


1.16
log
@merge stable branch onto HEAD
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.13.2.1 2007/06/25 19:12:12 dgp Exp $
d301 1
a301 1
MODULE_SCOPE Tk_ClassProcs tkpButtonProcs;
@


1.16.2.1
log
@[Bug 2956548] TkpButtonSetDefaults only initializes one button type
Fix various gcc warnings, all backported from Tk 8.6
VC6++ does not have SPI_SETKEYBOARDCUES
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.16 2007/12/13 15:24:13 dgp Exp $
a301 1
MODULE_SCOPE char tkDefButtonBorderWidth[TCL_INTEGER_SPACE];
@


1.15
log
@restore unix line endings
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.14 2007/06/24 16:07:34 dkf Exp $
@


1.14
log
@Cleaning up whitespace, comments, declarations. No functional changes.
@
text
@d1 324
a324 324
/*
 * tkButton.h --
 *
 *	Declarations of types and functions used to implement button-like
 *	widgets.
 *
 * Copyright (c) 1996-1998 by Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @@(#) $Id: tkButton.h,v 1.13 2005/11/27 02:36:13 das Exp $
 */

#ifndef _TKBUTTON
#define _TKBUTTON

#ifndef _TKINT
#include "tkInt.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 "state" field of TkButton records.
 */

enum state {
    STATE_ACTIVE, STATE_DISABLED, STATE_NORMAL
};

/*
 * Legal values for the "defaultState" field of TkButton records.
 */

enum defaultState {
    DEFAULT_ACTIVE, DEFAULT_DISABLED, DEFAULT_NORMAL
};

/*
 * A data structure of the following type is kept for each widget managed by
 * this file:
 */

typedef struct {
    Tk_Window tkwin;		/* Window that embodies the button. NULL means
				 * that the window has been destroyed. */
    Display *display;		/* Display containing widget. Needed to free
				 * up resources after tkwin is gone. */
    Tcl_Interp *interp;		/* Interpreter associated with button. */
    Tcl_Command widgetCmd;	/* Token for button's widget command. */
    int type;			/* Type of widget, such as TYPE_LABEL:
				 * restricts operations that may be performed
				 * on widget. See below for legal values. */
    Tk_OptionTable optionTable;	/* Table that defines configuration options
				 * available for this widget. */

    /*
     * Information about what's in the button.
     */

    Tcl_Obj *textPtr;		/* Value of -text option: specifies text to
				 * display in button. */
    int underline;		/* Value of -underline option: specifies index
				 * of character to underline. < 0 means don't
				 * underline anything. */
    Tcl_Obj *textVarNamePtr;	/* Value of -textvariable option: specifies
				 * name of variable or NULL. If non-NULL,
				 * button displays the contents of this
				 * variable. */
    Pixmap bitmap;		/* Value of -bitmap option. If not None,
				 * specifies bitmap to display and text and
				 * textVar are ignored. */
    Tcl_Obj *imagePtr;		/* Value of -image option: specifies image to
				 * display in window, or NULL if none. If
				 * non-NULL, bitmap, text, and textVarName are
				 * ignored.*/
    Tk_Image image;		/* Derived from imagePtr by calling
				 * Tk_GetImage, or NULL if imagePtr is
				 * NULL. */
    Tcl_Obj *selectImagePtr;	/* Value of -selectimage option: specifies
				 * image to display in window when selected,
				 * or NULL if none. Ignored if imagePtr is
				 * NULL. */
    Tk_Image selectImage;	/* Derived from selectImagePtr by calling
				 * Tk_GetImage, or NULL if selectImagePtr is
				 * NULL. */
    Tcl_Obj *tristateImagePtr;	/* Value of -tristateimage option: specifies
				 * image to display in window when selected,
				 * or NULL if none. Ignored if imagePtr is
				 * NULL. */
    Tk_Image tristateImage;	/* Derived from tristateImagePtr by calling
				 * Tk_GetImage, or NULL if tristateImagePtr is
				 * NULL. */

    /*
     * Information used when displaying widget:
     */

    enum state state;		/* Value of -state option: specifies state of
				 * button for display purposes.*/
    Tk_3DBorder normalBorder;	/* Value of -background option: specifies
				 * color for background (and border) when
				 * window isn't active. */
    Tk_3DBorder activeBorder;	/* Value of -activebackground option: this is
				 * the color used to draw 3-D border and
				 * background when widget is active. */
    Tcl_Obj *borderWidthPtr;	/* Value of -borderWidth option: specifies
				 * width of border in pixels. */
    int borderWidth;		/* Integer value corresponding to
				 * borderWidthPtr. Always >= 0. */
    int relief;			/* Value of -relief option: specifies 3-d
				 * effect for border, such as
				 * TK_RELIEF_RAISED. */
    int overRelief;		/* Value of -overrelief option: specifies a
				 * 3-d effect for the border, such as
				 * TK_RELIEF_RAISED, to be used when the mouse
				 * is over the button. */
    int offRelief;		/* Value of -offrelief option: specifies a 3-d
				 * effect for the border, such as
				 * TK_RELIEF_RAISED, to be used when a
				 * checkbutton or radiobutton without
				 * indicator is off. */
    Tcl_Obj *highlightWidthPtr;	/* Value of -highlightthickness option:
				 * specifies width in pixels of highlight to
				 * draw around widget when it has the focus.
				 * <= 0 means don't draw a highlight. */
    int highlightWidth;		/* Integer value corresponding to
				 * highlightWidthPtr. Always >= 0. */
    Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
				 * specifies background with which to draw 3-D
				 * default ring and focus highlight area when
				 * highlight is off. */
    XColor *highlightColorPtr;	/* Value of -highlightcolor option: specifies
				 * color for drawing traversal highlight. */
    int inset;			/* Total width of all borders, including
				 * traversal highlight and 3-D border.
				 * Indicates how much interior stuff must be
				 * offset from outside edges to leave room for
				 * borders. */
    Tk_Font tkfont;		/* Value of -font option: specifies font to
				 * use for display text. */
    XColor *normalFg;		/* Value of -font option: specifies foreground
				 * color in normal mode. */
    XColor *activeFg;		/* Value of -activeforeground option:
				 * foreground color in active mode. NULL means
				 * use -foreground instead. */
    XColor *disabledFg;		/* Value of -disabledforeground option:
				 * foreground color when disabled. NULL means
				 * use normalFg with a 50% stipple instead. */
    GC normalTextGC;		/* GC for drawing text in normal mode. Also
				 * used to copy from off-screen pixmap onto
				 * screen. */
    GC activeTextGC;		/* GC for drawing text in active mode (NULL
				 * means use normalTextGC). */
    GC disabledGC;		/* Used to produce disabled effect for text
				 * and check/radio marks. */
    GC stippleGC;		/* Used to produce disabled stipple effect for
				 * images when disabled. */
    Pixmap gray;		/* Pixmap for displaying disabled text if
				 * disabledFg is NULL. */
    GC copyGC;			/* Used for copying information from an
				 * off-screen pixmap to the screen. */
    Tcl_Obj *widthPtr;		/* Value of -width option. */
    int width;			/* Integer value corresponding to widthPtr. */
    Tcl_Obj *heightPtr;		/* Value of -height option. */
    int height;			/* Integer value corresponding to heightPtr. */
    Tcl_Obj *wrapLengthPtr;	/* Value of -wraplength option: specifies line
				 * length (in pixels) at which to wrap onto
				 * next line. <= 0 means don't wrap except at
				 * newlines. */
    int wrapLength;		/* Integer value corresponding to
				 * wrapLengthPtr. */
    Tcl_Obj *padXPtr;		/* Value of -padx option: specifies how many
				 * pixels of extra space to leave on left and
				 * right of text. Ignored for bitmaps and
				 * images. */
    int padX;			/* Integer value corresponding to padXPtr. */
    Tcl_Obj *padYPtr;		/* Value of -padx option: specifies how many
				 * pixels of extra space to leave above and
				 * below text. Ignored for bitmaps and
				 * images. */
    int padY;			/* Integer value corresponding to padYPtr. */
    Tk_Anchor anchor;		/* Value of -anchor option: specifies where
				 * text/bitmap should be displayed inside
				 * button region. */
    Tk_Justify justify;		/* Value of -justify option: specifies how to
				 * align lines of multi-line text. */
    int indicatorOn;		/* Value of -indicatoron option: 1 means draw
				 * indicator in checkbuttons and radiobuttons,
				 * 0 means don't draw it. */
    Tk_3DBorder selectBorder;	/* Value of -selectcolor option: specifies
				 * color for drawing indicator background, or
				 * perhaps widget background, when
				 * selected. */
    int textWidth;		/* Width needed to display text as requested,
				 * in pixels. */
    int textHeight;		/* Height needed to display text as requested,
				 * in pixels. */
    Tk_TextLayout textLayout;	/* Saved text layout information. */
    int indicatorSpace;		/* Horizontal space (in pixels) allocated for
				 * display of indicator. */
    int indicatorDiameter;	/* Diameter of indicator, in pixels. */
    enum defaultState defaultState;
				/* Value of -default option, such as
				 * DEFAULT_NORMAL: specifies state of default
				 * ring for buttons (normal, active, or
				 * disabled). NULL for other classes. */

    /*
     * For check and radio buttons, the fields below are used to manage the
     * variable indicating the button's state.
     */

    Tcl_Obj *selVarNamePtr;	/* Value of -variable option: specifies name
				 * of variable used to control selected state
				 * of button. */
    Tcl_Obj *onValuePtr;	/* Value of -offvalue option: specifies value
				 * to store in variable when this button is
				 * selected. */
    Tcl_Obj *offValuePtr;	/* Value of -offvalue option: specifies value
				 * to store in variable when this button isn't
				 * selected. Used only by checkbuttons. */
    Tcl_Obj *tristateValuePtr;	/* Value of -tristatevalue option: specifies
				 * value to display Tristate or Multivalue
				 * mode when variable matches this value.
				 * Used by check- buttons. */

    /*
     * Miscellaneous information:
     */

    Tk_Cursor cursor;		/* Value of -cursor option: if not None,
				 * specifies current cursor for window. */
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option; not used in the
				 * C code, but used by keyboard traversal
				 * scripts. */
    Tcl_Obj *commandPtr;	/* Value of -command option: specifies script
				 * to execute when button is invoked. If
				 * widget is label or has no command, this is
				 * NULL. */
    int compound;		/* Value of -compound option; specifies
				 * whether the button should show both an
				 * image and text, and, if so, how. */
    int repeatDelay;		/* Value of -repeatdelay option; specifies the
				 * number of ms after which the button will
				 * start to auto-repeat its command. */
    int repeatInterval;		/* Value of -repeatinterval option; specifies
				 * the number of ms between auto-repeat
				 * invocataions of the button command. */
    int flags;			/* Various flags; see below for
				 * definitions. */
} TkButton;

/*
 * Possible "type" values for buttons. These are the kinds of widgets
 * supported by this file. The ordering of the type numbers is significant:
 * greater means more features and is used in the code.
 */

#define TYPE_LABEL		0
#define TYPE_BUTTON		1
#define TYPE_CHECK_BUTTON	2
#define TYPE_RADIO_BUTTON	3

/*
 * Flag bits for buttons:
 *
 * REDRAW_PENDING:		Non-zero means a DoWhenIdle handler has
 *				already been queued to redraw this window.
 * SELECTED:			Non-zero means this button is selected, so
 *				special highlight should be drawn.
 * GOT_FOCUS:			Non-zero means this button currently has the
 *				input focus.
 * BUTTON_DELETED:		Non-zero needs that this button has been
 *				deleted, or is in the process of being deleted
 */

#define REDRAW_PENDING		(1 << 0)
#define SELECTED		(1 << 1)
#define GOT_FOCUS		(1 << 2)
#define BUTTON_DELETED		(1 << 3)
#define TRISTATED		(1 << 4)

/*
 * Declaration of variables shared between the files in the button module.
 */

MODULE_SCOPE Tk_ClassProcs tkpButtonProcs;

/*
 * Declaration of functions used in the implementation of the button widget.
 */

#ifndef TkpButtonSetDefaults
MODULE_SCOPE void	TkpButtonSetDefaults(Tk_OptionSpec *specPtr);
#endif
MODULE_SCOPE void	TkButtonWorldChanged(ClientData instanceData);
MODULE_SCOPE void	TkpComputeButtonGeometry(TkButton *butPtr);
MODULE_SCOPE TkButton	*TkpCreateButton(Tk_Window tkwin);
#ifndef TkpDestroyButton
MODULE_SCOPE void 	TkpDestroyButton(TkButton *butPtr);
#endif
#ifndef TkpDisplayButton
MODULE_SCOPE void	TkpDisplayButton(ClientData clientData);
#endif
MODULE_SCOPE int	TkInvokeButton(TkButton *butPtr);

# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT

#endif /* _TKBUTTON */
@


1.13
log
@	* unix/tcl.m4 (Darwin): add 64bit support, check for Tiger copyfile(),
	add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to
	configure (flag can't be present twice, so can't be in both CFLAGS and
	LDFLAGS during configure), don't use -prebind when deploying on 10.4,
	define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING (rdar://3171542).
	(SC_ENABLE_LANGINFO, SC_TIME_HANDLER): add/fix caching, fix obsolete
	autoconf macros. Sync with tcl/unix/tcl.m4.

	* unix/configure.in: fix obsolete autoconf macros, sync gratuitous
	formatting/ordering differences with tcl/unix/configure.in.

	* unix/Makefile.in: add CFLAGS to wish/tktest link to make executable
	linking the same as during configure (needed to avoid loosing any linker
	relevant flags in CFLAGS, in particular flags that can't be in LDFLAGS).
	Avoid concurrent linking of wish and compiling of tkTestInit.o during
	parallel make, fix dependencies and flags for building tkMacOSXInit.o
	(checkstubs, checkexports): dependency and Darwin fixes
	(dist): add new macosx files.

	* macosx/tkMacOSXEvent.c (TkMacOSXProcessEvent):
	* macosx/tkMacOSXEvent.h:
	* macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent):
	* macosx/tkMacOSXCarbonEvents.c: install standard application event
	handler, add & call functions to start and stop carbon even timer that
	runs the tcl event loop periodically during a nested carbon event loop
	in the toolbox (e.g. during menutracking) to ensure tcl timers etc
	continue to fire, register app event handler for menu tracking and HI
	command carbon events, move menu event handling to new handlers for
	those carbon events, no longer register for/handle appleevent carbon
	event (now dealt with by standard application event handler), event
	debugging code dynamically acquires carbon event debugging functions to
	allow use on Tiger where they are no longer exported from HIToolbox.

	* macosx/tkMacOSXFont.c (TkMacOSXUseAntialiasedText):
	* macosx/tkMacOSXKeyEvent.c (GetKeyboardLayout):
	* macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
	* macosx/tkMacOSXInit.c:
	* macosx/tkMacOSXInt.h: abstract common code to dynamically acquire
	address of a named symbol (from a loaded dynamic library) into new
	function TkMacOSXGetNamedSymbol() and macro TkMacOSXInitNamedSymbol.

	* macosx/tkMacOSXMenu.c (TkpNewMenu):
	* macosx/tkMacOSXMenubutton.c (MenuButtonInitControl):
	* macosx/tkMacOSXMenus.c (TkMacOSXHandleMenuSelect): switch to  modern
	utf8 aware menu manager API, remove obsolete code, add error handling.

	* macosx/tkMacOSXMouseEvent.c: define OSX 10.3 or later only constants
	if necessary to allow compilation on OSX 10.2

	* macosx/tkMacOSXWm.c (UpdateSizeHints): remove code that is never
	executed.

	* xlib/xgc.c (XCreateGC): sync with core-8-4-branch change.

	* generic/tk.h: add/correct location of version numbers in macosx files.

	* generic/tkInt.h: clarify fat compile comment.

	* macosx/Wish.pbproj/default.pbxuser (new file):
	* macosx/Wish.pbproj/jingham.pbxuser:
	* macosx/Wish.pbproj/project.pbxproj:
	* macosx/Wish.xcode/default.pbxuser:
	* macosx/Wish.xcode/project.pbxproj:
	* macosx/Wish.xcodeproj/default.pbxuser (new file):
	* macosx/Wish.xcodeproj/project.pbxproj (new file): new/updated projects
	for Xcode 2.2 on 10.4, Xcode 1.5 on 10.3 & ProjectBuilder on 10.2, with
	native tktest targets and support for universal (fat) compiles.

	* macosx/Tk-Info.plist (removed):
	* macosx/Wish-Info.plist (removed):
	* macosx/buildTkConfig.tcl (removed): remove obsolete build files.

	* macosx/README: clarification/cleanup, document new Xcode projects and
	universal (fat) builds via CFLAGS (i.e. ppc and i386 at the same time).

	* unix/Makefile.in:
	* unix/aclocal.m4:
	* unix/configure.in:
	* macosx/configure.ac (new file): add support for inclusion of
	unix/configure.in by macosx/configure.ac, allows generation of a config
	headers enabled configure script in macosx (required by Xcode projects).

	* macosx/GNUmakefile: rename from Makefile to avoid overwriting by
	configure run in tk/macosx, add support for reusing configure cache,
	build target fixes.

	* generic/tk3d.h:
	* generic/tkButton.h:
	* generic/tkCanvas.c:
	* generic/tkCanvas.h:
	* generic/tkColor.h:
	* generic/tkEntry.h:
	* generic/tkFileFilter.h:
	* generic/tkFont.c:
	* generic/tkFont.h:
	* generic/tkImage.c:
	* generic/tkImgPhoto.c:
	* generic/tkInt.h:
	* generic/tkMenu.c:
	* generic/tkMenu.h:
	* generic/tkMenubutton.h:
	* generic/tkScale.h:
	* generic/tkScrollbar.h:
	* generic/tkSelect.h:
	* generic/tkStubInit.c:
	* generic/tkStubLib.c:
	* generic/tkText.h:
	* generic/tkUndo.h:
	* macosx/tkMacOSXButton.c:
	* macosx/tkMacOSXDebug.c:
	* macosx/tkMacOSXDebug.h:
	* macosx/tkMacOSXDialog.c:
	* macosx/tkMacOSXDraw.c:
	* macosx/tkMacOSXEntry.c:
	* macosx/tkMacOSXFont.c:
	* macosx/tkMacOSXInt.h:
	* macosx/tkMacOSXMenu.c:
	* macosx/tkMacOSXMenubutton.c:
	* macosx/tkMacOSXMouseEvent.c:
	* macosx/tkMacOSXSend.c:
	* macosx/tkMacOSXSubwindows.c:
	* macosx/tkMacOSXWindowEvent.c:
	* macosx/tkMacOSXWm.c:
	* macosx/tkMacOSXXStubs.c:
	* unix/tkUnixButton.c:
	* unix/tkUnixMenu.c:
	* xlib/xgc.c: ensure externally visible symbols not contained in stubs
	table are declared as MODULE_SCOPE (or as static if not used outside of
	own source file), #ifdef out a few Xlib and aqua functions that are
	never called. These changes allow 'make checkstubs' to complete without
	error on Darwin with gcc 4.

	* macosx/tkMacOSXTest.c:
	* macosx/tkMacOSXPort.h:
	* win/tkWinTest.c:
	* generic/tkInt.decls: add functions needed by tktest to internal stubs
	table, correct signature of TkMacOSXHandleMenuSelect, add XSync to aqua
	Xlib stubs.

	* unix/tkUnixSend.c:
	* generic/tkText.c:
	* generic/tkTest.c: #ifdef unix only declarations.
	(TestmetricsCmd): unify win and mac implementation.
	(TestsendCmd): move to tkUnixSend.c to avoid access to global var.
	(TesttextCmd): move to tkText.c to avoid having to put all the internal
	text functions it uses into the stubs table.

	* generic/tkTextDisp.c:
	* macosx/tkMacOSXInit.c:
	* macosx/tkMacOSXKeyEvent.c:
	* macosx/tkMacOSXWindowEvent.c:
	* macosx/tkMacOSXXStubs.c: fix gcc 4 warnings.

	* macosx/tkMacOSXNotify.c:
	* macosx/tkMacOSXScrlbr.c: sync with core-8-4-branch.

	* generic/tkIntDecls.h:
	* generic/tkIntPlatDecls.h:
	* generic/tkIntXlibDecls.h:
	* generic/tkStubInit.c:
	* unix/configure:
	* unix/tkConfig.h.in: regen.
@
text
@d1 324
a324 323
/*
 * tkButton.h --
 *
 *	Declarations of types and functions used to implement button-like
 *	widgets.
 *
 * Copyright (c) 1996-1998 by Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @@(#) $Id: tkButton.h,v 1.12 2005/11/04 15:23:05 dkf Exp $
 */

#ifndef _TKBUTTON
#define _TKBUTTON

#ifndef _TKINT
#include "tkInt.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 "state" field of TkButton records.
 */

enum state {
    STATE_ACTIVE, STATE_DISABLED, STATE_NORMAL
};

/*
 * Legal values for the "defaultState" field of TkButton records.
 */

enum defaultState {
    DEFAULT_ACTIVE, DEFAULT_DISABLED, DEFAULT_NORMAL
};

/*
 * A data structure of the following type is kept for each widget managed by
 * this file:
 */

typedef struct {
    Tk_Window tkwin;		/* Window that embodies the button. NULL means
				 * that the window has been destroyed. */
    Display *display;		/* Display containing widget. Needed to free
				 * up resources after tkwin is gone. */
    Tcl_Interp *interp;		/* Interpreter associated with button. */
    Tcl_Command widgetCmd;	/* Token for button's widget command. */
    int type;			/* Type of widget, such as TYPE_LABEL:
				 * restricts operations that may be performed
				 * on widget. See below for legal values. */
    Tk_OptionTable optionTable;	/* Table that defines configuration options
				 * available for this widget. */

    /*
     * Information about what's in the button.
     */

    Tcl_Obj *textPtr;		/* Value of -text option: specifies text to
				 * display in button. */
    int underline;		/* Value of -underline option: specifies index
				 * of character to underline. < 0 means don't
				 * underline anything. */
    Tcl_Obj *textVarNamePtr;	/* Value of -textvariable option: specifies
				 * name of variable or NULL. If non-NULL,
				 * button displays the contents of this
				 * variable. */
    Pixmap bitmap;		/* Value of -bitmap option. If not None,
				 * specifies bitmap to display and text and
				 * textVar are ignored. */
    Tcl_Obj *imagePtr;		/* Value of -image option: specifies image to
				 * display in window, or NULL if none. If
				 * non-NULL, bitmap, text, and textVarName are
				 * ignored.*/
    Tk_Image image;		/* Derived from imagePtr by calling
				 * Tk_GetImage, or NULL if imagePtr is
				 * NULL. */
    Tcl_Obj *selectImagePtr;	/* Value of -selectimage option: specifies
				 * image to display in window when selected,
				 * or NULL if none. Ignored if imagePtr is
				 * NULL. */
    Tk_Image selectImage;	/* Derived from selectImagePtr by calling
				 * Tk_GetImage, or NULL if selectImagePtr is
				 * NULL. */
    Tcl_Obj *tristateImagePtr;	/* Value of -tristateimage option: specifies
				 * image to display in window when selected,
				 * or NULL if none. Ignored if imagePtr is
				 * NULL. */
    Tk_Image tristateImage;	/* Derived from tristateImagePtr by calling
				 * Tk_GetImage, or NULL if tristateImagePtr is
				 * NULL. */

    /*
     * Information used when displaying widget:
     */

    enum state state;		/* Value of -state option: specifies state of
				 * button for display purposes.*/
    Tk_3DBorder normalBorder;	/* Value of -background option: specifies
				 * color for background (and border) when
				 * window isn't active. */
    Tk_3DBorder activeBorder;	/* Value of -activebackground option: this is
				 * the color used to draw 3-D border and
				 * background when widget is active. */
    Tcl_Obj *borderWidthPtr;	/* Value of -borderWidth option: specifies
				 * width of border in pixels. */
    int borderWidth;		/* Integer value corresponding to
				 * borderWidthPtr. Always >= 0. */
    int relief;			/* Value of -relief option: specifies 3-d
				 * effect for border, such as
				 * TK_RELIEF_RAISED. */
    int overRelief;		/* Value of -overrelief option: specifies a
				 * 3-d effect for the border, such as
				 * TK_RELIEF_RAISED, to be used when the mouse
				 * is over the button. */
    int offRelief;		/* Value of -offrelief option: specifies a 3-d
				 * effect for the border, such as
				 * TK_RELIEF_RAISED, to be used when a
				 * checkbutton or radiobutton without
				 * indicator is off */
    Tcl_Obj *highlightWidthPtr;	/* Value of -highlightthickness option:
				 * specifies width in pixels of highlight to
				 * draw around widget when it has the focus.
				 * <= 0 means don't draw a highlight. */
    int highlightWidth;		/* Integer value corresponding to
				 * highlightWidthPtr.  Always >= 0. */
    Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
				 * specifies background with which to draw 3-D
				 * default ring and focus highlight area when
				 * highlight is off. */
    XColor *highlightColorPtr;	/* Value of -highlightcolor option: specifies
				 * color for drawing traversal highlight. */
    int inset;			/* Total width of all borders, including
				 * traversal highlight and 3-D border.
				 * Indicates how much interior stuff must be
				 * offset from outside edges to leave room for
				 * borders. */
    Tk_Font tkfont;		/* Value of -font option: specifies font to
				 * use for display text. */
    XColor *normalFg;		/* Value of -font option: specifies foreground
				 * color in normal mode. */
    XColor *activeFg;		/* Value of -activeforeground option:
				 * foreground color in active mode. NULL means
				 * use -foreground instead. */
    XColor *disabledFg;		/* Value of -disabledforeground option:
				 * foreground color when disabled. NULL means
				 * use normalFg with a 50% stipple instead. */
    GC normalTextGC;		/* GC for drawing text in normal mode.  Also
				 * used to copy from off-screen pixmap onto
				 * screen. */
    GC activeTextGC;		/* GC for drawing text in active mode (NULL
				 * means use normalTextGC). */
    GC disabledGC;		/* Used to produce disabled effect for text
				 * and check/radio marks. */
    GC stippleGC;		/* Used to produce disabled stipple effect for
				 * images when disabled. */
    Pixmap gray;		/* Pixmap for displaying disabled text if
				 * disabledFg is NULL. */
    GC copyGC;			/* Used for copying information from an
				 * off-screen pixmap to the screen. */
    Tcl_Obj *widthPtr;		/* Value of -width option. */
    int width;			/* Integer value corresponding to widthPtr. */
    Tcl_Obj *heightPtr;		/* Value of -height option. */
    int height;			/* Integer value corresponding to heightPtr. */
    Tcl_Obj *wrapLengthPtr;	/* Value of -wraplength option: specifies line
				 * length (in pixels) at which to wrap onto
				 * next line. <= 0 means don't wrap except at
				 * newlines. */
    int wrapLength;		/* Integer value corresponding to
				 * wrapLengthPtr. */
    Tcl_Obj *padXPtr;		/* Value of -padx option: specifies how many
				 * pixels of extra space to leave on left and
				 * right of text. Ignored for bitmaps and
				 * images. */
    int padX;			/* Integer value corresponding to padXPtr. */
    Tcl_Obj *padYPtr;		/* Value of -padx option: specifies how many
				 * pixels of extra space to leave above and
				 * below text. Ignored for bitmaps and
				 * images. */
    int padY;			/* Integer value corresponding to padYPtr. */
    Tk_Anchor anchor;		/* Value of -anchor option: specifies where
				 * text/bitmap should be displayed inside
				 * button region. */
    Tk_Justify justify;		/* Value of -justify option: specifies how to
				 * align lines of multi-line text. */
    int indicatorOn;		/* Value of -indicatoron option: 1 means draw
				 * indicator in checkbuttons and radiobuttons,
				 * 0 means don't draw it. */
    Tk_3DBorder selectBorder;	/* Value of -selectcolor option: specifies
				 * color for drawing indicator background, or
				 * perhaps widget background, when selected */
    int textWidth;		/* Width needed to display text as requested,
				 * in pixels. */
    int textHeight;		/* Height needed to display text as requested,
				 * in pixels. */
    Tk_TextLayout textLayout;	/* Saved text layout information. */
    int indicatorSpace;		/* Horizontal space (in pixels) allocated for
				 * display of indicator. */
    int indicatorDiameter;	/* Diameter of indicator, in pixels. */
    enum defaultState defaultState;
				/* Value of -default option, such as
				 * DEFAULT_NORMAL: specifies state of default
				 * ring for buttons (normal, active, or
				 * disabled). NULL for other classes. */

    /*
     * For check and radio buttons, the fields below are used to manage the
     * variable indicating the button's state.
     */

    Tcl_Obj *selVarNamePtr;	/* Value of -variable option: specifies name
				 * of variable used to control selected state
				 * of button. */
    Tcl_Obj *onValuePtr;	/* Value of -offvalue option: specifies value
				 * to store in variable when this button is
				 * selected. */
    Tcl_Obj *offValuePtr;	/* Value of -offvalue option: specifies value
				 * to store in variable when this button isn't
				 * selected. Used only by checkbuttons. */
    Tcl_Obj *tristateValuePtr;	/* Value of -tristatevalue option: specifies
                                 * value to display Tristate or Multivalue
                                 * mode when variable matches this value.
                                 * Used by check- buttons. */

    /*
     * Miscellaneous information:
     */

    Tk_Cursor cursor;		/* Value of -cursor option: if not None,
				 * specifies current cursor for window. */
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option; not used in the
				 * C code, but used by keyboard traversal
				 * scripts. */
    Tcl_Obj *commandPtr;	/* Value of -command option: specifies script
				 * to execute when button is invoked. If
				 * widget is label or has no command, this is
				 * NULL. */
    int compound;		/* Value of -compound option; specifies
				 * whether the button should show both an
				 * image and text, and, if so, how. */
    int repeatDelay;		/* Value of -repeatdelay option; specifies the
				 * number of ms after which the button will
				 * start to auto-repeat its command. */
    int repeatInterval;		/* Value of -repeatinterval option; specifies
				 * the number of ms between auto-repeat
				 * invocataions of the button command. */
    int flags;			/* Various flags; see below for
				 * definitions. */
} TkButton;

/*
 * Possible "type" values for buttons. These are the kinds of widgets
 * supported by this file. The ordering of the type numbers is significant:
 * greater means more features and is used in the code.
 */

#define TYPE_LABEL		0
#define TYPE_BUTTON		1
#define TYPE_CHECK_BUTTON	2
#define TYPE_RADIO_BUTTON	3

/*
 * Flag bits for buttons:
 *
 * REDRAW_PENDING:		Non-zero means a DoWhenIdle handler has
 *				already been queued to redraw this window.
 * SELECTED:			Non-zero means this button is selected, so
 *				special highlight should be drawn.
 * GOT_FOCUS:			Non-zero means this button currently has the
 *				input focus.
 * BUTTON_DELETED:		Non-zero needs that this button has been
 *				deleted, or is in the process of being deleted
 */

#define REDRAW_PENDING		(1 << 0)
#define SELECTED		(1 << 1)
#define GOT_FOCUS		(1 << 2)
#define BUTTON_DELETED		(1 << 3)
#define TRISTATED		(1 << 4)

/*
 * Declaration of variables shared between the files in the button module.
 */

MODULE_SCOPE Tk_ClassProcs tkpButtonProcs;

/*
 * Declaration of functions used in the implementation of the button widget.
 */

#ifndef TkpButtonSetDefaults
MODULE_SCOPE void	TkpButtonSetDefaults(Tk_OptionSpec *specPtr);
#endif
MODULE_SCOPE void	TkButtonWorldChanged(ClientData instanceData);
MODULE_SCOPE void	TkpComputeButtonGeometry(TkButton *butPtr);
MODULE_SCOPE TkButton	*TkpCreateButton(Tk_Window tkwin);
#ifndef TkpDestroyButton
MODULE_SCOPE void 	TkpDestroyButton(TkButton *butPtr);
#endif
#ifndef TkpDisplayButton
MODULE_SCOPE void	TkpDisplayButton(ClientData clientData);
#endif
MODULE_SCOPE int	TkInvokeButton(TkButton *butPtr);

# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT

#endif /* _TKBUTTON */
@


1.13.2.1
log
@merge updates from HEAD
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.13 2005/11/27 02:36:13 das Exp $
d135 1
a135 1
				 * indicator is off. */
d141 1
a141 1
				 * highlightWidthPtr. Always >= 0. */
d163 1
a163 1
    GC normalTextGC;		/* GC for drawing text in normal mode. Also
d206 1
a206 2
				 * perhaps widget background, when
				 * selected. */
d236 3
a238 3
				 * value to display Tristate or Multivalue
				 * mode when variable matches this value.
				 * Used by check- buttons. */
@


1.12
log
@ANSIfy
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.11 2004/02/18 00:40:24 hobbs Exp $
d300 1
a300 1
extern Tk_ClassProcs tkpButtonProcs;
d307 1
a307 1
EXTERN void		TkpButtonSetDefaults(Tk_OptionSpec *specPtr);
d309 3
a311 3
EXTERN void		TkButtonWorldChanged(ClientData instanceData);
EXTERN void		TkpComputeButtonGeometry(TkButton *butPtr);
EXTERN TkButton *	TkpCreateButton(Tk_Window tkwin);
d313 1
a313 1
EXTERN void 		TkpDestroyButton(TkButton *butPtr);
d316 1
a316 1
EXTERN void		TkpDisplayButton(ClientData clientData);
d318 1
a318 1
EXTERN int		TkInvokeButton(TkButton *butPtr);
@


1.11
log
@	* doc/checkbutton.n: TIP#110 implementation
	* doc/radiobutton.n: Tristate Checkbutton and Radiobuttons
	* generic/tkButton.c:
	* generic/tkButton.h:
	* library/demos/check.tcl:
	* library/demos/radio.tcl:
	* macosx/tkMacOSXButton.c:
	* macosx/tkMacOSXDefault.h:
	* tests/button.test:
	* unix/tkUnixButton.c:
	* unix/tkUnixDefault.h:
	* win/tkWinButton.c:
	* win/tkWinDefault.h:
@
text
@d4 2
a5 2
 *	Declarations of types and functions used to implement
 *	button-like widgets.
d9 2
a10 2
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.10 2003/04/26 02:59:20 hobbs Exp $
d53 2
a54 2
 * A data structure of the following type is kept for each
 * widget managed by this file:
d58 4
a61 4
    Tk_Window tkwin;		/* Window that embodies the button.  NULL
				 * means that the window has been destroyed. */
    Display *display;		/* Display containing widget.  Needed to
				 * free up resources after tkwin is gone. */
d66 1
a66 1
				 * on widget.  See below for legal values. */
d76 3
a78 3
    int underline;		/* Value of -underline option: specifies
				 * index of character to underline.  < 0 means
				 * don't underline anything. */
d80 1
a80 1
				 * name of variable or NULL.  If non-NULL,
d83 1
a83 1
    Pixmap bitmap;		/* Value of -bitmap option.  If not None,
d86 4
a89 4
    Tcl_Obj *imagePtr;		/* Value of -image option: specifies image
				 * to display in window, or NULL if none.
				 * If non-NULL, bitmap, text, and textVarName
				 * are ignored.*/
d91 2
a92 1
				 * Tk_GetImage, or NULL if imagePtr is NULL. */
d95 1
a95 1
				 * or NULL if none.  Ignored if imagePtr is
d98 2
a99 2
				 * Tk_GetImage, or NULL if selectImagePtr
				 * is NULL. */
d102 1
a102 1
				 * or NULL if none.  Ignored if imagePtr is
d105 2
a106 2
				 * Tk_GetImage, or NULL if tristateImagePtr
				 * is NULL. */
d112 2
a113 2
    enum state state;		/* Value of -state option: specifies
				 * state of button for display purposes.*/
d117 3
a119 3
    Tk_3DBorder activeBorder;	/* Value of -activebackground option:
				 * this is the color used to draw 3-D border
				 * and background when widget is active. */
d123 1
a123 1
				 * borderWidthPtr.  Always >= 0. */
d127 2
a128 2
    int overRelief;		/* Value of -overrelief option: specifies a 3-d
				 * effect for the border, such as
d134 1
a134 1
				 * checkbutton or radiobutton without 
d146 2
a147 3
    XColor *highlightColorPtr;	/* Value of -highlightcolor option:
				 * specifies color for drawing traversal
				 * highlight. */
d150 5
a154 5
				 * Indicates how much interior stuff must
				 * be offset from outside edges to leave
				 * room for borders. */
    Tk_Font tkfont;		/* Value of -font option: specifies font
				 * to use for display text. */
d158 2
a159 2
				 * foreground color in active mode.  NULL
				 * means use -foreground instead. */
d161 2
a162 3
				 * foreground color when disabled.  NULL
				 * means use normalFg with a 50% stipple
				 * instead. */
d170 2
a171 2
    GC stippleGC;		/* Used to produce disabled stipple effect
				 * for images when disabled. */
d180 4
a183 4
    Tcl_Obj *wrapLengthPtr;	/* Value of -wraplength option: specifies
				 * line length (in pixels) at which to wrap
				 * onto next line.  <= 0 means don't wrap
				 * except at newlines. */
d188 1
a188 1
				 * right of text.  Ignored for bitmaps and
d193 1
a193 1
				 * below text.  Ignored for bitmaps and
d199 5
a203 5
    Tk_Justify justify;		/* Value of -justify option: specifies how
				 * to align lines of multi-line text. */
    int indicatorOn;		/* Value of -indicatoron option:  1 means
				 * draw indicator in checkbuttons and
				 * radiobuttons, 0 means don't draw it. */
d206 1
a206 1
				 * perhaps widget background, when selected. */
d217 3
a219 4
				 * DEFAULT_NORMAL: specifies state
				 * of default ring for buttons (normal,
				 * active, or disabled).  NULL for other
				 * classes. */
d222 2
a223 2
     * For check and radio buttons, the fields below are used
     * to manage the variable indicating the button's state.
d227 2
a228 2
				 * of variable used to control selected
				 * state of button. */
d233 6
a238 7
				 * to store in variable when this button
				 * isn't selected.  Used only by
				 * checkbuttons. */
    Tcl_Obj *tristateValuePtr;	/* Value of -tristatevalue option: specifies value
                                 * to display Tristate or Multivalue mode when
                                 * variable matches this value.  Used by check-
                                 * buttons. */
d246 2
a247 2
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option;  not used in
				 * the C code, but used by keyboard traversal
d249 9
a257 9
    Tcl_Obj *commandPtr;	/* Value of -command option: specifies script 
				 * to execute when button is invoked.  If
				 * widget is label or has no command, this
				 * is NULL. */
    int compound;		/* Value of -compound option; specifies whether
				 * the button should show both an image and
				 * text, and, if so, how. */
    int repeatDelay;		/* Value of -repeatdelay option; specifies
				 * the number of ms after which the button will
d262 1
a262 1
    int flags;			/* Various flags;  see below for
d267 3
a269 4
 * Possible "type" values for buttons.  These are the kinds of
 * widgets supported by this file.  The ordering of the type
 * numbers is significant:  greater means more features and is
 * used in the code.
d280 6
a285 7
 * REDRAW_PENDING:		Non-zero means a DoWhenIdle handler
 *				has already been queued to redraw
 *				this window.
 * SELECTED:			Non-zero means this button is selected,
 *				so special highlight should be drawn.
 * GOT_FOCUS:			Non-zero means this button currently
 *				has the input focus.
d287 1
a287 2
 *				deleted, or is in the process of being
 *				deleted.
d295 1
d303 1
a303 2
 * Declaration of procedures used in the implementation of the button
 * widget. 
d307 1
a307 2
EXTERN void		TkpButtonSetDefaults _ANSI_ARGS_((
			    Tk_OptionSpec *specPtr));
d309 3
a311 5
EXTERN void		TkButtonWorldChanged _ANSI_ARGS_((
			    ClientData instanceData));
EXTERN void		TkpComputeButtonGeometry _ANSI_ARGS_((
			    TkButton *butPtr));
EXTERN TkButton *	TkpCreateButton _ANSI_ARGS_((Tk_Window tkwin));
d313 1
a313 1
EXTERN void 		TkpDestroyButton _ANSI_ARGS_((TkButton *butPtr));
d316 1
a316 1
EXTERN void		TkpDisplayButton _ANSI_ARGS_((ClientData clientData));
d318 1
a318 1
EXTERN int		TkInvokeButton  _ANSI_ARGS_((TkButton *butPtr));
@


1.10
log
@	* generic/tkButton.h:                         Rewrote the handling
	* generic/tkButton.c (TkButtonWorldChanged):  of compound *buttons
	* mac/tkMacButton.c (TkpDisplayButton):       to correctly display
	* macosx/tkMacOSXButton.c (TkpDisplayButton): mixture of disabledfg,
	* unix/tkUnixButton.c (TkpDisplayButton):     selectcolor, indicator,
	* win/tkWinButton.c (TkpDisplayButton):       etc.  *buttons will
	now only stipple the image, unless no disabledfg is given, in which
	case it will stipple the whole button.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.9.2.1 2003/04/26 02:53:46 hobbs Exp $
d99 7
d238 4
d300 1
@


1.9
log
@Initial implementation of TIP #82: added the -offrelief option to
checkbutton and radiobutton to allow those widgets to have a
MS-Office look and feel.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.8 2000/11/22 01:49:37 ericm Exp $
d162 4
a165 6
    GC disabledGC;		/* Used to produce disabled effect.  If
				 * disabledFg isn't NULL, this GC is used to
				 * draw button text or icon.  Otherwise
				 * text or icon is drawn with normalGC and
				 * this GC is used to stipple background
				 * across it.  For labels this is None. */
@


1.9.2.1
log
@	* generic/tkButton.h:                         Rewrote the handling
	* generic/tkButton.c (TkButtonWorldChanged):  of compound *buttons
	* mac/tkMacButton.c (TkpDisplayButton):       to correctly display
	* macosx/tkMacOSXButton.c (TkpDisplayButton): mixture of disabledfg,
	* unix/tkUnixButton.c (TkpDisplayButton):     selectcolor, indicator,
	* win/tkWinButton.c (TkpDisplayButton):       etc.  *buttons will
	now only stipple the image, unless no disabledfg is given, in which
	case it will stipple the whole button.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.9 2002/06/17 10:54:29 drh Exp $
d162 6
a167 4
    GC disabledGC;		/* Used to produce disabled effect for text
				 * and check/radio marks. */
    GC stippleGC;		/* Used to produce disabled stipple effect
				 * for images when disabled. */
@


1.9.2.2
log
@[Bug 2956548] TkpButtonSetDefaults only initializes one button type
Fix 2 minor gcc warnings in tkWinTest.c
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.9.2.1 2003/04/26 02:53:46 hobbs Exp $
d290 1
a290 2
 * Declaration of button class functions structure
 * and button/label defaults, for use in optionSpecs.
a293 1
extern char tkDefButtonBorderWidth[TCL_INTEGER_SPACE];
@


1.8
log
@	Overall change:  Implemented TIP 5, which exports
	TkClassProcs/TkSetClassProcs as Tk_ClassProcs/Tk_SetClassProcs,
	adding a size field to Tk_ClassProcs to allow for future
	expansion, and renaming the geometryProc to worldChangedProc,
	which is more in keeping with the actual use of the callback.

	See ChangeLog for details.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.7 2000/05/17 21:17:20 ericm Exp $
d123 5
@


1.8.4.1
log
@merged with trunk at tag macosx-8-4-merge-2002-08-20-trunk
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id$
a122 5
    int offRelief;		/* Value of -offrelief option: specifies a 3-d
				 * effect for the border, such as
				 * TK_RELIEF_RAISED, to be used when a
				 * checkbutton or radiobutton without 
				 * indicator is off */
@


1.7
log
@* doc/SetOptions.3: Added information about TK_OPTION_NULL_OK with
TK_OPTION_RELIEF.

* win/tkWinButton.c: Removed bits about TK_RELIEF_LINK.

* tests/button.test: Added tests for -overrelief; removed tests
for -relief link.

* mac/tkMacButton.c: Removed bits about TK_RELIEF_LINK.

* generic/tkOldConfig.c: Removed bits about TK_RELIEF_LINK.

* generic/tkConfig.c: Removed bits about TK_RELIEF_LINK; added
support for TK_OPTION_NULL_OK for TK_OPTION_RELIEF.

* library/button.tcl: Added binding support for -overrelief.

* generic/tk3d.c (Tk_GetRelief): Added branch for TK_RELIEF_NULL.

* generic/tkButton.c: Added -overrelief option; removed
Enter/Leave EventProc masks and handlers.

* generic/tk.h: Added TK_RELIEF_NULL definition, removed
TK_RELIEF_LINK.

* mac/tkMacDefault.h (DEF_BUTTON_OVER_RELIEF):
* win/tkWinDefault.h (DEF_BUTTON_OVER_RELIEF):
* unix/tkUnixDefault.h (DEF_BUTTON_OVER_RELIEF): Added default
value for the -overrelief option.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.6 2000/05/13 00:39:07 ericm Exp $
d290 1
a290 1
extern TkClassProcs tkpButtonProcs;
@


1.7.2.1
log
@sync with head
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.8 2000/11/22 01:49:37 ericm Exp $
d290 1
a290 1
extern Tk_ClassProcs tkpButtonProcs;
@


1.6
log
@* unix/tkUnixButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
* mac/tkMacButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
* win/tkWinButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
Added code for drawing compound buttons.

* tests/button.test: Added configuration tests for -repeatdelay,
-repeatinterval, -compound.

* library/button.tcl: Added support for -repeatedelay,
-repeatinterval options.

* generic/tkOldConfig.c: Changed handling of link relief so that
proper error messages are used.

* generic/tkButton.h: Added -compound, -repeatdelay,
-repeatinterval options.

* generic/tkButton.c: Added event watchers for enter/leave events,
for link relief support.

* generic/tk3d.c: Changed handling of link relief so that proper
error messages are used.

* generic/tk.h: Changed values of
TK_OPTION_LINK_OK/TK_CONFIG_LINK_OK for link relief support.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.5 1999/04/16 01:51:11 stanton Exp $
d119 4
a279 2
 * MOUSE_IN_BUTTON:		Non-zero means that the mouse is currently
 *				over the button.
a285 1
#define MOUSE_IN_BUTTON		(1 << 4)
@


1.5
log
@* Merged 8.1 branch into the main trunk
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id$
d28 9
d238 9
d276 2
d280 5
a284 5
#define REDRAW_PENDING		1
#define SELECTED		2
#define GOT_FOCUS		4
#define BUTTON_DELETED		0x8

@


1.4
log
@Replaced SCCS strings, fixed binary files
@
text
@d7 1
a7 1
 * Copyright (c) 1996 by Sun Microsystems, Inc.
d28 16
d55 5
a59 3
    int type;			/* Type of widget:  restricts operations
				 * that may be performed on widget.  See
				 * below for possible values. */
d65 4
a68 3
    char *text;			/* Text to display in button (malloc'ed)
				 * or NULL. */
    int underline;		/* Index of character to underline.  < 0 means
d70 16
a85 14
    char *textVarName;		/* Name of variable (malloc'ed) or NULL.
				 * If non-NULL, button displays the contents
				 * of this variable. */
    Pixmap bitmap;		/* Bitmap to display or None.  If not None
				 * then text and textVar are ignored. */
    char *imageString;		/* Name of image to display (malloc'ed), or
				 * NULL.  If non-NULL, bitmap, text, and
				 * textVarName are ignored. */
    Tk_Image image;		/* Image to display in window, or NULL if
				 * none. */
    char *selectImageString;	/* Name of image to display when selected
				 * (malloc'ed), or NULL. */
    Tk_Image selectImage;	/* Image to display in window when selected,
				 * or NULL if none.  Ignored if image is
d87 3
d95 18
a112 14
    Tk_Uid state;		/* State of button for display purposes:
				 * normal, active, or disabled. */
    Tk_3DBorder normalBorder;	/* Structure used to draw 3-D
				 * border and background when window
				 * isn't active.  NULL means no such
				 * border exists. */
    Tk_3DBorder activeBorder;	/* Structure used to draw 3-D
				 * border and background when window
				 * is active.  NULL means no such
				 * border exists. */
    int borderWidth;		/* Width of border. */
    int relief;			/* 3-d effect: TK_RELIEF_RAISED, etc. */
    int highlightWidth;		/* Width in pixels of highlight to draw
				 * around widget when it has the focus.
d114 9
a122 6
    Tk_3DBorder highlightBorder;
				/* Structure used to draw 3-D default ring
				 * and focus highlight area when highlight
				 * is off. */
    XColor *highlightColorPtr;	/* Color for drawing traversal highlight. */

d128 9
a136 5
    Tk_Font tkfont;		/* Information about text font, or NULL. */
    XColor *normalFg;		/* Foreground color in normal mode. */
    XColor *activeFg;		/* Foreground color in active mode.  NULL
				 * means use normalFg instead. */
    XColor *disabledFg;		/* Foreground color when disabled.  NULL
a143 2
    Pixmap gray;		/* Pixmap for displaying disabled text if
				 * disabledFg is NULL. */
d150 2
d154 6
a159 8
    char *widthString;		/* Value of -width option.  Malloc'ed. */
    char *heightString;		/* Value of -height option.  Malloc'ed. */
    int width, height;		/* If > 0, these specify dimensions to request
				 * for window, in characters for text and in
				 * pixels for bitmaps.  In this case the actual
				 * size of the text string or bitmap is
				 * ignored in computing desired window size. */
    int wrapLength;		/* Line length (in pixels) at which to wrap
d162 5
a166 2
    int padX, padY;		/* Extra space around text (pixels to leave
				 * on each side).  Ignored for bitmaps and
d168 17
a184 7
    Tk_Anchor anchor;		/* Where text/bitmap should be displayed
				 * inside button region. */
    Tk_Justify justify;		/* Justification to use for multi-line text. */
    int indicatorOn;		/* True means draw indicator, false means
				 * don't draw it. */
    Tk_3DBorder selectBorder;	/* For drawing indicator background, or perhaps
				 * widget background, when selected. */
d193 7
a199 3
    Tk_Uid defaultState;	/* State of default ring: normal, active, or
				 * disabled. */
        
d205 10
a214 10
    char *selVarName;		/* Name of variable used to control selected
				 * state of button.  Malloc'ed (if
				 * not NULL). */
    char *onValue;		/* Value to store in variable when
				 * this button is selected.  Malloc'ed (if
				 * not NULL). */
    char *offValue;		/* Value to store in variable when this
				 * button isn't selected.  Malloc'ed
				 * (if not NULL).  Valid only for check
				 * buttons. */
d220 3
a222 2
    Tk_Cursor cursor;		/* Current cursor for window, or None. */
    char *takeFocus;		/* Value of -takefocus option;  not used in
d224 5
a228 4
				 * scripts.  Malloc'ed, but may be NULL. */
    char *command;		/* Command to execute when button is
				 * invoked; valid for buttons only.
				 * If not NULL, it's malloc-ed. */
d255 3
d263 1
a263 12

/*
 * Mask values used to selectively enable entries in the
 * configuration specs:
 */

#define LABEL_MASK		TK_CONFIG_USER_BIT
#define BUTTON_MASK		TK_CONFIG_USER_BIT << 1
#define CHECK_BUTTON_MASK	TK_CONFIG_USER_BIT << 2
#define RADIO_BUTTON_MASK	TK_CONFIG_USER_BIT << 3
#define ALL_MASK		(LABEL_MASK | BUTTON_MASK \
	| CHECK_BUTTON_MASK | RADIO_BUTTON_MASK)
a269 1
extern Tk_ConfigSpec tkpButtonConfigSpecs[];
d276 4
@


1.3
log
@EXPORT is now TCL_STORAGE_CLASS
@
text
@d12 1
a12 1
 * SCCS: @@(#) tkButton.h 1.5 97/06/06 11:19:24
@


1.2
log
@added support for export/import of DLL symbols. If BUILD_tk is defined,
EXPORT is mapped to DLLEXPORT, otherwise it is DLLIMPORT.
@
text
@d23 2
a24 2
# undef EXPORT
# define EXPORT DLLEXPORT
d246 2
a247 2
#undef EXPORT
#define EXPORT DLLIMPORT
@


1.1
log
@Initial revision
@
text
@d22 5
d246 3
@


1.1.4.1
log
@initial tk8.1a2 version
@
text
@d7 1
a7 1
 * Copyright (c) 1996-1998 by Sun Microsystems, Inc.
d12 1
a12 1
 * SCCS: @@(#) tkButton.h 1.8 98/01/09 09:48:06
a22 16
 * Legal values for the "state" field of TkButton records.
 */

enum state {
    STATE_ACTIVE, STATE_DISABLED, STATE_NORMAL
};

/*
 * Legal values for the "defaultState" field of TkButton records.
 */

enum defaultState {
    DEFAULT_ACTIVE, DEFAULT_DISABLED, DEFAULT_NORMAL
};

/*
d34 3
a36 5
    int type;			/* Type of widget, such as TYPE_LABEL:
				 * restricts operations that may be performed
				 * on widget.  See below for legal values. */
    Tk_OptionTable optionTable;	/* Table that defines configuration options
				 * available for this widget. */
d42 3
a44 4
    Tcl_Obj *textPtr;		/* Value of -text option: specifies text to
				 * display in button. */
    int underline;		/* Value of -underline option: specifies
				 * index of character to underline.  < 0 means
d46 14
a59 16
    Tcl_Obj *textVarNamePtr;	/* Value of -textvariable option: specifies
				 * name of variable or NULL.  If non-NULL,
				 * button displays the contents of this
				 * variable. */
    Pixmap bitmap;		/* Value of -bitmap option.  If not None,
				 * specifies bitmap to display and text and
				 * textVar are ignored. */
    Tcl_Obj *imagePtr;		/* Value of -image option: specifies image
				 * to display in window, or NULL if none.
				 * If non-NULL, bitmap, text, and textVarName
				 * are ignored.*/
    Tk_Image image;		/* Derived from imagePtr by calling
				 * Tk_GetImage, or NULL if imagePtr is NULL. */
    Tcl_Obj *selectImagePtr;	/* Value of -selectimage option: specifies
				 * image to display in window when selected,
				 * or NULL if none.  Ignored if imagePtr is
a60 3
    Tk_Image selectImage;	/* Derived from selectImagePtr by calling
				 * Tk_GetImage, or NULL if selectImagePtr
				 * is NULL. */
d66 14
a79 18
    enum state state;		/* Value of -state option: specifies
				 * state of button for display purposes.*/
    Tk_3DBorder normalBorder;	/* Value of -background option: specifies
				 * color for background (and border) when
				 * window isn't active. */
    Tk_3DBorder activeBorder;	/* Value of -activebackground option:
				 * this is the color used to draw 3-D border
				 * and background when widget is active. */
    Tcl_Obj *borderWidthPtr;	/* Value of -borderWidth option: specifies
				 * width of border in pixels. */
    int borderWidth;		/* Integer value corresponding to
				 * borderWidthPtr.  Always >= 0. */
    int relief;			/* Value of -relief option: specifies 3-d
				 * effect for border, such as
				 * TK_RELIEF_RAISED. */
    Tcl_Obj *highlightWidthPtr;	/* Value of -highlightthickness option:
				 * specifies width in pixels of highlight to
				 * draw around widget when it has the focus.
d81 6
a86 9
    int highlightWidth;		/* Integer value corresponding to
				 * highlightWidthPtr.  Always >= 0. */
    Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
				 * specifies background with which to draw 3-D
				 * default ring and focus highlight area when
				 * highlight is off. */
    XColor *highlightColorPtr;	/* Value of -highlightcolor option:
				 * specifies color for drawing traversal
				 * highlight. */
d92 5
a96 9
    Tk_Font tkfont;		/* Value of -font option: specifies font
				 * to use for display text. */
    XColor *normalFg;		/* Value of -font option: specifies foreground
				 * color in normal mode. */
    XColor *activeFg;		/* Value of -activeforeground option:
				 * foreground color in active mode.  NULL
				 * means use -foreground instead. */
    XColor *disabledFg;		/* Value of -disabledforeground option:
				 * foreground color when disabled.  NULL
d104 2
a111 2
    Pixmap gray;		/* Pixmap for displaying disabled text if
				 * disabledFg is NULL. */
d114 8
a121 6
    Tcl_Obj *widthPtr;		/* Value of -width option. */
    int width;			/* Integer value corresponding to widthPtr. */
    Tcl_Obj *heightPtr;		/* Value of -height option. */
    int height;			/* Integer value corresponding to heightPtr. */
    Tcl_Obj *wrapLengthPtr;	/* Value of -wraplength option: specifies
				 * line length (in pixels) at which to wrap
d124 2
a125 5
    int wrapLength;		/* Integer value corresponding to
				 * wrapLengthPtr. */
    Tcl_Obj *padXPtr;		/* Value of -padx option: specifies how many
				 * pixels of extra space to leave on left and
				 * right of text.  Ignored for bitmaps and
d127 7
a133 17
    int padX;			/* Integer value corresponding to padXPtr. */
    Tcl_Obj *padYPtr;		/* Value of -padx option: specifies how many
				 * pixels of extra space to leave above and
				 * below text.  Ignored for bitmaps and
				 * images. */
    int padY;			/* Integer value corresponding to padYPtr. */
    Tk_Anchor anchor;		/* Value of -anchor option: specifies where
				 * text/bitmap should be displayed inside
				 * button region. */
    Tk_Justify justify;		/* Value of -justify option: specifies how
				 * to align lines of multi-line text. */
    int indicatorOn;		/* Value of -indicatoron option:  1 means
				 * draw indicator in checkbuttons and
				 * radiobuttons, 0 means don't draw it. */
    Tk_3DBorder selectBorder;	/* Value of -selectcolor option: specifies
				 * color for drawing indicator background, or
				 * perhaps widget background, when selected. */
d142 3
a144 7
    enum defaultState defaultState;
				/* Value of -default option, such as
				 * DEFAULT_NORMAL: specifies state
				 * of default ring for buttons (normal,
				 * active, or disabled).  NULL for other
				 * classes. */

d150 10
a159 10
    Tcl_Obj *selVarNamePtr;	/* Value of -variable option: specifies name
				 * of variable used to control selected
				 * state of button. */
    Tcl_Obj *onValuePtr;	/* Value of -offvalue option: specifies value
				 * to store in variable when this button is
				 * selected. */
    Tcl_Obj *offValuePtr;	/* Value of -offvalue option: specifies value
				 * to store in variable when this button
				 * isn't selected.  Used only by
				 * checkbuttons. */
d165 2
a166 3
    Tk_Cursor cursor;		/* Value of -cursor option: if not None,
				 * specifies current cursor for window. */
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option;  not used in
d168 4
a171 5
				 * scripts. */
    Tcl_Obj *commandPtr;	/* Value of -command option: specifies script 
				 * to execute when button is invoked.  If
				 * widget is label or has no command, this
				 * is NULL. */
a197 3
 * BUTTON_DELETED:		Non-zero needs that this button has been
 *				deleted, or is in the process of being
 *				deleted.
d203 12
a214 1
#define BUTTON_DELETED		0x8
d221 1
a227 4
#ifndef TkpButtonSetDefaults
EXTERN void		TkpButtonSetDefaults _ANSI_ARGS_((
			    Tk_OptionSpec *specPtr));
#endif
@


1.1.4.2
log
@Merged 8.0.3 changes into 8.1
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkButton.h,v 1.4 1998/09/14 18:23:04 stanton Exp $
a21 5
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif

a286 3

# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
@


