head	1.11;
access;
symbols
	core-8-5-9:1.10
	core-8-5-8:1.10
	macosx-cocoa-merge:1.10
	macosx-cocoa-premerge:1.10
	macosx-carbon-freeze:1.10
	core-8-5-7:1.10
	core-8-5-6:1.10
	core-8-6-b1:1.10
	core-8-6-a3:1.10
	core-8-5-5:1.10
	core-8-6-a2:1.10
	core-8-5-4:1.10
	core-8-5-3:1.10
	core-8-6-a1:1.10
	core-8-4-19:1.8
	core-8-5-branch:1.10.0.4
	core-8-5-2:1.10
	core-8-4-18:1.8
	core-8-5-1:1.10
	core-8-4-17:1.8
	core-8-5-0:1.10
	core-8-5-b3:1.10
	core-8-5-b2:1.10
	core-8-4-16:1.8
	core-8-5-b1:1.10
	core-stablilizer-merge:1.10
	core-stabilizer-branch:1.10.0.2
	core-stabilizer-merge:1.10
	core-8-4-15:1.8
	core-8-5-a6:1.10
	core-8-5-a5:1.10
	core-8-4-14:1.8
	core-8-5-a4:1.10
	core-8-4-13:1.8
	core-8-4-12:1.8
	core-8-4-11:1.8
	core-8-5-a3:1.8
	core-8-4-10:1.8
	core-8-4-9-branch:1.8.0.14
	core-8-5-a2:1.8
	core-8-4-9:1.8
	core-8-4-8:1.8
	core-8-4-7:1.8
	core-8-5-a1:1.8
	core-8-4-6:1.8
	core-8-4-5:1.8
	mistachkin-dev-branch:1.8.0.12
	core-8-4-4:1.8
	core-8-4-3:1.8
	core-8-4-branch:1.8.0.10
	core-8-4-2:1.8
	core-8-4-1:1.8
	core-8-3-5:1.8
	core-8-4-0:1.8
	macosx-8-4-merge-2002-08-31-trunk:1.8
	macosx-8-4-premerge-2002-08-31-branch:1.8
	macosx-8-4-premerge-2002-08-31-trunk:1.8
	macosx-8-4-merge-2002-08-30-branch:1.8
	macosx-8-4-merge-2002-08-30-trunk:1.8
	macosx-8-4-merge-2002-08-20-branch:1.8
	macosx-8-4-merge-2002-08-20-trunk:1.8
	core-8-4-b2:1.8
	core-8-4-b1:1.8
	macosx-premerge-6-9-02:1.8
	core-8-4-a4:1.8
	core-8-3-4:1.8
	macosx-8-4-branch:1.8.0.8
	macosx-8-4-branchpoint:1.8
	core-8-4-a3:1.8
	core-8-3-3:1.8
	dgp-privates-into-namespace:1.8.0.6
	tclpro-1-5-0:1.8
	core-8-4-win-speedup:1.8.0.4
	core-8-4-a2:1.8
	tclpro-1-4-1:1.8
	tclpro-1-4-0:1.8
	core-8-3-2:1.8
	ajuba-ajuba2-2-1-base:1.8
	ajuba-ajuba2-2-0:1.8
	core-8-4-a1:1.8
	core-8-3-1-branch:1.8.0.2
	core-8-3-1:1.8
	scriptics-sc-2-0-b5:1.7
	scriptics-sc-2-0-fixed:1.7
	scriptics-sc-2-0-b2:1.7
	scriptics-sc-2-0-b1:1.7
	core-8-3-0:1.7
	core-8-3-b2:1.7
	core-8-3-b1:1.7
	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.3
	core-8-1-b2:1.1.4.3
	dev-8-1-stubs-branch:1.1.4.3.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.1
	core-8-0-4:1.4
	core-8-1-a2:1.1
	core-8-0-2:1.1
	core-8-0-3:1.4;
locks; strict;
comment	@ * @;


1.11
date	2010.04.23.08.32.56;	author nijtmans;	state Exp;
branches;
next	1.10;

1.10
date	2005.11.27.02.36.14;	author das;	state Exp;
branches;
next	1.9;

1.9
date	2005.11.15.15.18.22;	author dkf;	state Exp;
branches;
next	1.8;

1.8
date	2000.04.14.08.33.16;	author hobbs;	state Exp;
branches;
next	1.7;

1.7
date	99.12.22.20.01.08;	author hobbs;	state Exp;
branches;
next	1.6;

1.6
date	99.12.21.23.55.11;	author hobbs;	state Exp;
branches;
next	1.5;

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

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

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

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

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

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

1.1.4.2
date	99.01.07.02.42.51;	author lfb;	state Exp;
branches;
next	1.1.4.3;

1.1.4.3
date	99.02.13.05.09.35;	author lfb;	state Exp;
branches;
next	;


desc
@@


1.11
log
@Formatting
typo fixes
remove not existing tkDisplayList;
Useless re-definitions of TCL_STORAGE_CLASS
@
text
@/*
 * tkScale.h --
 *
 *	Declarations of types and functions used to implement the scale
 *	widget.
 *
 * Copyright (c) 1996 by Sun Microsystems, Inc.
 * Copyright (c) 1999-2000 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @@(#) $Id: tkScale.h,v 1.10 2005/11/27 02:36:14 das Exp $
 */

#ifndef _TKSCALE
#define _TKSCALE

#ifndef _TKINT
#include "tkInt.h"
#endif

/*
 * Legal values for the "orient" field of TkScale records.
 */

enum orient {
    ORIENT_HORIZONTAL, ORIENT_VERTICAL
};

/*
 * Legal values for the "state" field of TkScale records.
 */

enum state {
    STATE_ACTIVE, STATE_DISABLED, STATE_NORMAL
};

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

typedef struct TkScale {
    Tk_Window tkwin;		/* Window that embodies the scale. NULL means
				 * that the window has been destroyed but the
				 * data structures haven't yet been cleaned
				 * up.*/
    Display *display;		/* Display containing widget. Used, among
				 * other things, so that resources can be
				 * freed even after tkwin has gone away. */
    Tcl_Interp *interp;		/* Interpreter associated with scale. */
    Tcl_Command widgetCmd;	/* Token for scale's widget command. */
    Tk_OptionTable optionTable;	/* Table that defines configuration options
				 * available for this widget. */
    enum orient orient;		/* Orientation for window (vertical or
				 * horizontal). */
    int width;			/* Desired narrow dimension of scale, in
				 * pixels. */
    int length;			/* Desired long dimension of scale, in
				 * pixels. */
    double value;		/* Current value of scale. */
    Tcl_Obj *varNamePtr;	/* Name of variable or NULL. If non-NULL,
				 * scale's value tracks the contents of this
				 * variable and vice versa. */
    double fromValue;		/* Value corresponding to left or top of
				 * scale. */
    double toValue;		/* Value corresponding to right or bottom of
				 * scale. */
    double tickInterval;	/* Distance between tick marks; 0 means don't
				 * display any tick marks. */
    double resolution;		/* If > 0, all values are rounded to an even
				 * multiple of this value. */
    int digits;			/* Number of significant digits to print in
				 * values. 0 means we get to choose the number
				 * based on resolution and/or the range of the
				 * scale. */
    char format[10];		/* Sprintf conversion specifier computed from
				 * digits and other information. */
    double bigIncrement;	/* Amount to use for large increments to scale
				 * value. (0 means we pick a value). */
    char *command;		/* Command prefix to use when invoking Tcl
				 * commands because the scale value changed.
				 * NULL means don't invoke commands. */
    int repeatDelay;		/* How long to wait before auto-repeating on
				 * scrolling actions (in ms). */
    int repeatInterval;		/* Interval between autorepeats (in ms). */
    char *label;		/* Label to display above or to right of
				 * scale; NULL means don't display a label. */
    int labelLength;		/* Number of non-NULL chars. in label. */
    enum state state;		/* Values are active, normal, or disabled.
				 * Value of scale cannot be changed when
				 * disabled. */

    /*
     * Information used when displaying widget:
     */

    int borderWidth;		/* Width of 3-D border around window. */
    Tk_3DBorder bgBorder;	/* Used for drawing slider and other
				 * background areas. */
    Tk_3DBorder activeBorder;	/* For drawing the slider when active. */
    int sliderRelief;		/* Is slider to be drawn raised, sunken,
				 * etc. */
    XColor *troughColorPtr;	/* Color for drawing trough. */
    GC troughGC;		/* For drawing trough. */
    GC copyGC;			/* Used for copying from pixmap onto screen */
    Tk_Font tkfont;		/* Information about text font, or NULL. */
    XColor *textColorPtr;	/* Color for drawing text. */
    GC textGC;			/* GC for drawing text in normal mode. */
    int relief;			/* Indicates whether window as a whole is
				 * raised, sunken, or flat. */
    int highlightWidth;		/* Width in pixels of highlight to draw around
				 * widget when it has the focus. <= 0 means
				 * don't draw a highlight. */
    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;	/* 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. */
    int sliderLength;		/* Length of slider, measured in pixels along
				 * long dimension of scale. */
    int showValue;		/* Non-zero means to display the scale value
				 * below or to the left of the slider; zero
				 * means don't display the value. */

    /*
     * Layout information for horizontal scales, assuming that window gets the
     * size it requested:
     */

    int horizLabelY;		/* Y-coord at which to draw label. */
    int horizValueY;		/* Y-coord at which to draw value text. */
    int horizTroughY;		/* Y-coord of top of slider trough. */
    int horizTickY;		/* Y-coord at which to draw tick text. */
    /*
     * Layout information for vertical scales, assuming that window gets the
     * size it requested:
     */

    int vertTickRightX;		/* X-location of right side of tick-marks. */
    int vertValueRightX;	/* X-location of right side of value string. */
    int vertTroughX;		/* X-location of scale's slider trough. */
    int vertLabelX;		/* X-location of origin of label. */

    /*
     * Miscellaneous information:
     */

    int fontHeight;		/* Height of scale font. */
    Tk_Cursor cursor;		/* Current cursor for window, or None. */
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option; not used in the
				 * C code, but used by keyboard traversal
				 * scripts. May be NULL. */
    int flags;			/* Various flags; see below for
				 * definitions. */
} TkScale;

/*
 * Flag bits for scales:
 *
 * REDRAW_SLIDER -		1 means slider (and numerical readout) need to
 *				be redrawn.
 * REDRAW_OTHER -		1 means other stuff besides slider and value
 *				need to be redrawn.
 * REDRAW_ALL -			1 means the entire widget needs to be redrawn.
 * REDRAW_PENDING -		1 means any sort of redraw is pending
 * ACTIVE -			1 means the widget is active (the mouse is in
 *				its window).
 * INVOKE_COMMAND -		1 means the scale's command needs to be
 *				invoked during the next redisplay (the value
 *				of the scale has changed since the last time
 *				the command was invoked).
 * SETTING_VAR -		1 means that the associated variable is being
 *				set by us, so there's no need for ScaleVarProc
 *				to do anything.
 * NEVER_SET -			1 means that the scale's value has never been
 *				set before (so must invoke -command and set
 *				associated variable even if the value doesn't
 *				appear to have changed).
 * GOT_FOCUS -			1 means that the focus is currently in this
 *				widget.
 * SCALE_DELETED -		1 means the scale widget is being deleted
 */

#define REDRAW_SLIDER		(1<<0)
#define REDRAW_OTHER		(1<<1)
#define REDRAW_ALL		(REDRAW_OTHER|REDRAW_SLIDER)
#define REDRAW_PENDING		(1<<2)
#define ACTIVE			(1<<3)
#define INVOKE_COMMAND		(1<<4)
#define SETTING_VAR		(1<<5)
#define NEVER_SET		(1<<6)
#define GOT_FOCUS		(1<<7)
#define SCALE_DELETED		(1<<8)

/*
 * Symbolic values for the active parts of a slider. These are the values that
 * may be returned by the ScaleElement procedure.
 */

#define OTHER		0
#define TROUGH1		1
#define SLIDER		2
#define TROUGH2		3

/*
 * Space to leave between scale area and text, and between text and edge of
 * window.
 */

#define SPACING 2

/*
 * How many characters of space to provide when formatting the scale's value:
 */

#define PRINT_CHARS 150

/*
 * Declaration of procedures used in the implementation of the scale widget.
 */

MODULE_SCOPE void	TkEventuallyRedrawScale(TkScale *scalePtr, int what);
MODULE_SCOPE double	TkRoundToResolution(TkScale *scalePtr, double value);
MODULE_SCOPE TkScale *	TkpCreateScale(Tk_Window tkwin);
MODULE_SCOPE void	TkpDestroyScale(TkScale *scalePtr);
MODULE_SCOPE void	TkpDisplayScale(ClientData clientData);
MODULE_SCOPE int	TkpScaleElement(TkScale *scalePtr, int x, int y);
MODULE_SCOPE void	TkScaleSetValue(TkScale *scalePtr, double value,
			    int setVar, int invokeCommand);
MODULE_SCOPE double	TkScalePixelToValue(TkScale *scalePtr, int x, int y);
MODULE_SCOPE int	TkScaleValueToPixel(TkScale *scalePtr, double value);

#endif /* _TKSCALE */
@


1.10
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
@d13 1
a13 1
 * RCS: @@(#) $Id: tkScale.h,v 1.9 2005/11/15 15:18:22 dkf Exp $
a22 5
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif

a239 3
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT

@


1.9
log
@ANSIfy
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkScale.h,v 1.8 2000/04/14 08:33:16 hobbs Exp $
d19 2
a20 2
#ifndef _TK
#include "tk.h"
d234 7
a240 7
EXTERN void		TkEventuallyRedrawScale(TkScale *scalePtr, int what);
EXTERN double		TkRoundToResolution(TkScale *scalePtr, double value);
EXTERN TkScale *	TkpCreateScale(Tk_Window tkwin);
EXTERN void		TkpDestroyScale(TkScale *scalePtr);
EXTERN void		TkpDisplayScale(ClientData clientData);
EXTERN int		TkpScaleElement(TkScale *scalePtr, int x, int y);
EXTERN void		TkScaleSetValue(TkScale *scalePtr, double value,
d242 2
a243 2
EXTERN double		TkScalePixelToValue(TkScale *scalePtr, int x, int y);
EXTERN int		TkScaleValueToPixel(TkScale *scalePtr, double value);
@


1.8
log
@	* generic/tkCanvas.c (CanvasEventProc:2451): corrected cast

	* generic/tkEntry.c (Tk_EntryObjCmd): adjusted finishing error
	cases and changed TK_CONFIG_NULL_OK to TK_OPTION_NULL_OK

	* tests/scale.test:
	* generic/tkScale.c:
	* generic/tkScale.h:
	* unix/tkUnixScale.c:
	* mac/tkMacScale.c: moved (PixelToValue|ValueToPixel|SetScaleValue)
	to tkScale.c.  Caused an associated variable to be immediately set
	[Bug: 4833]
@
text
@d4 2
a5 2
 *	Declarations of types and functions used to implement
 *	the scale widget.
d10 2
a11 2
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
d13 1
a13 1
 * RCS: @@(#) $Id: tkScale.h,v 1.7 1999/12/22 20:01:08 hobbs Exp $
d45 2
a46 2
 * A data structure of the following type is kept for each scale
 * widget managed by this file:
d50 5
a54 5
    Tk_Window tkwin;		/* Window that embodies the scale.  NULL
				 * means that the window has been destroyed
				 * but the data structures haven't yet been
				 * cleaned up.*/
    Display *display;		/* Display containing widget.  Used, among
d63 4
a66 4
    int width;			/* Desired narrow dimension of scale,
				 * in pixels. */
    int length;			/* Desired long dimension of scale,
				 * in pixels. */
d68 3
a70 4
    Tcl_Obj *varNamePtr;	/* Name of variable or NULL.
				 * If non-NULL, scale's value tracks
				 * the contents of this variable and
				 * vice versa. */
d73 10
a82 10
    double toValue;		/* Value corresponding to right or bottom
				 * of scale. */
    double tickInterval;	/* Distance between tick marks;
				 * 0 means don't display any tick marks. */
    double resolution;		/* If > 0, all values are rounded to an
				 * even multiple of this value. */
    int digits;			/* Number of significant digits to print
				 * in values.  0 means we get to choose the
				 * number based on resolution and/or the
				 * range of the scale. */
d85 2
a86 2
    double bigIncrement;	/* Amount to use for large increments to
				 * scale value.	 (0 means we pick a value). */
d90 2
a91 2
    int repeatDelay;		/* How long to wait before auto-repeating
				 * on scrolling actions (in ms). */
d94 1
a94 1
				 * scale;  NULL means don't display a label. */
d97 1
a97 1
				 * Value of scale cannot be changed when 
d108 1
a108 1
    int sliderRelief;		/* Is slider to be drawn raised, sunken, 
d112 1
a112 1
    GC copyGC;			/* Used for copying from pixmap onto screen. */
d118 3
a120 3
    int highlightWidth;		/* Width in pixels of highlight to draw
				 * around widget when it has the focus.
				 * <= 0 means don't draw a highlight. */
d128 3
a130 3
				 * Indicates how much interior stuff must
				 * be offset from outside edges to leave
				 * room for borders. */
d134 1
a134 1
				 * below or to the left of the slider;	zero
d138 2
a139 2
     * Layout information for horizontal scales, assuming that window
     * gets the size it requested:
d147 2
a148 2
     * Layout information for vertical scales, assuming that window
     * gets the size it requested:
d162 4
a165 4
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option;	not used in
				 * the C code, but used by keyboard traversal
				 * scripts.  May be NULL. */
    int flags;			/* Various flags;  see below for
d172 2
a173 2
 * REDRAW_SLIDER -		1 means slider (and numerical readout) need
 *				to be redrawn.
d178 2
a179 2
 * ACTIVE -			1 means the widget is active (the mouse is
 *				in its window).
d181 12
a192 12
 *				invoked during the next redisplay (the
 *				value of the scale has changed since the
 *				last time the command was invoked).
 * SETTING_VAR -		1 means that the associated variable is
 *				being set by us, so there's no need for
 *				ScaleVarProc to do anything.
 * NEVER_SET -			1 means that the scale's value has never
 *				been set before (so must invoke -command and
 *				set associated variable even if the value
 *				doesn't appear to have changed).
 * GOT_FOCUS -			1 means that the focus is currently in
 *				this widget.
d208 2
a209 2
 * Symbolic values for the active parts of a slider.  These are
 * the values that may be returned by the ScaleElement procedure.
d218 2
a219 2
 * Space to leave between scale area and text, and between text and
 * edge of window.
d225 1
a225 2
 * How many characters of space to provide when formatting the
 * scale's value:
d231 1
a231 2
 * Declaration of procedures used in the implementation of the scale
 * widget. 
d234 10
a243 15
EXTERN void		TkEventuallyRedrawScale _ANSI_ARGS_((TkScale *scalePtr,
			    int what));
EXTERN double		TkRoundToResolution _ANSI_ARGS_((TkScale *scalePtr,
			    double value));
EXTERN TkScale *	TkpCreateScale _ANSI_ARGS_((Tk_Window tkwin));
EXTERN void		TkpDestroyScale _ANSI_ARGS_((TkScale *scalePtr));
EXTERN void		TkpDisplayScale _ANSI_ARGS_((ClientData clientData));
EXTERN int		TkpScaleElement _ANSI_ARGS_((TkScale *scalePtr,
			     int x, int y));
EXTERN void		TkScaleSetValue _ANSI_ARGS_((TkScale *scalePtr,
			    double value, int setVar, int invokeCommand));
EXTERN double		TkScalePixelToValue _ANSI_ARGS_((TkScale *scalePtr, 
			    int x, int y));
EXTERN int		TkScaleValueToPixel _ANSI_ARGS_((TkScale *scalePtr,
			    double value));
@


1.7
log
@	* generic/tkScale.c:
	* generic/tkScale.h:
	* mac/tkMacScale.c:
	* unix/tkUnixScale.c: fixed potential segv from patch in 3897
@
text
@d8 1
d13 1
a13 1
 * RCS: @@(#) $Id: tkScale.h,v 1.6 1999/12/21 23:55:11 hobbs Exp $
d67 1
a67 1
    double value;               /* Current value of scale. */
d76 2
a77 2
    double tickInterval;	/* Distance between tick marks;  0 means
				 * don't display any tick marks. */
d87 2
a88 2
				 * scale value.  (0 means we pick a value). */
    Tcl_Obj *commandPtr;        /* Command prefix to use when invoking Tcl
d94 2
a95 3
    Tcl_Obj *labelPtr;		/* Label to display above or to right of
				 * scale;  NULL means don't display a
				 * label.  */
d135 1
a135 1
				 * below or to the left of the slider;  zero
d161 1
d163 1
a163 1
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option;  not used in
a243 2
EXTERN double		TkpPixelToValue _ANSI_ARGS_((TkScale *scalePtr, 
			    int x, int y));
d246 1
a246 1
EXTERN void		TkpSetScaleValue _ANSI_ARGS_((TkScale *scalePtr,
d248 3
a250 1
EXTERN int		TkpValueToPixel _ANSI_ARGS_((TkScale *scalePtr,
@


1.6
log
@	* generic/tk.h:
	* README: updated for patch level 8.3b1

	* generic/tkScale.c:
	* generic/tkScale.h: fixed possible core when freeing options
	(cursor) associated with scale widget [Bug: 3897]

	* generic/tk3d.c: added extra calculations to ensure that thin
	frames get refreshed too [Bug: 3596]

	* generic/tkCanvText.c:
	* generic/tkEntry.c:
	* generic/tkFont.c:
	* generic/tkImgPPM.c: removed extranneous vars that were set but
	never used.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkScale.h,v 1.5 1999/04/16 01:51:21 stanton Exp $
d177 1
d199 7
a205 6
#define ACTIVE			(1<<2)
#define INVOKE_COMMAND		(1<<3)
#define SETTING_VAR		(1<<4)
#define NEVER_SET		(1<<5)
#define GOT_FOCUS		(1<<6)
#define SCALE_DELETED		(1<<7)
@


1.5
log
@* Merged 8.1 branch into the main trunk
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id$
d192 1
d195 9
a203 8
#define REDRAW_SLIDER		1
#define REDRAW_OTHER		2
#define REDRAW_ALL		3
#define ACTIVE			4
#define INVOKE_COMMAND		0x10
#define SETTING_VAR		0x20
#define NEVER_SET		0x40
#define GOT_FOCUS		0x80
@


1.4
log
@Replaced SCCS strings, fixed binary files
@
text
@d28 16
d58 4
a61 4
    Tk_Uid orientUid;		/* Orientation for window ("vertical" or
				 * "horizontal"). */
    int vertical;		/* Non-zero means vertical orientation,
				 * zero means horizontal. */
d66 2
a67 2
    double value;		/* Current value of scale. */
    char *varName;		/* Name of variable (malloc'ed) or NULL.
d87 1
a87 1
    char *command;		/* Command prefix to use when invoking Tcl
d89 1
a89 2
				 * NULL means don't invoke commands.
				 * Malloc'ed. */
d93 1
a93 1
    char *label;		/* Label to display above or to right of
d95 1
a95 1
				 * label.  Malloc'ed. */
d97 3
a99 2
    Tk_Uid state;		/* Normal or disabled.  Value cannot be
				 * changed when scale is disabled. */
d109 2
a110 1
    int sliderRelief;		/* Is slider to be drawn raised, sunken, etc. */
d122 4
a125 3
    XColor *highlightBgColorPtr;
				/* Color for drawing traversal highlight
				 * area when highlight is off. */
d162 1
a162 1
    char *takeFocus;		/* Value of -takefocus option;  not used in
d164 1
a164 1
				 * scripts.  Malloc'ed, but may be NULL. */
d228 1
a228 1
 * Declaration of procedures used in the implementation of the scrollbar
@


1.3
log
@EXPORT is now TCL_STORAGE_CLASS
@
text
@d12 1
a12 1
 * SCCS: @@(#) tkScale.h 1.5 96/07/08 12:56:56
@


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
d230 2
a231 2
#undef EXPORT
#define EXPORT DLLIMPORT
@


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


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

a223 3

# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
@


1.1.4.2
log
@Removed perky gloabal Tk_Uids causing concurrency problems.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkScale.h,v 1.1.4.1 1998/09/30 02:17:17 stanton Exp $
d82 2
a83 3
    int state;		        /* TK_STATE_ACTIVE, TK_STATE_NORMAL 
				 * or TK_STATE_DISABLED.  Value of scale 
				 * cannot be changed when disabled. */
@


1.1.4.3
log
@Objectified scale widget to eliminate Tk_Uids.

Fixed problem in windows process-initialization code stopping
Tk Dll from loading under Windows.
@
text
@d12 1
a12 1
 * RCS: @@(#) $Id: tkScale.h,v 1.1.4.2 1999/01/07 02:42:51 lfb Exp $
a27 16
 * Legal values for the "orient" field of TkScale records.
 */

enum orient {
    ORIENT_HORIZONTAL, ORIENT_VERTICAL
};

/*
 * Legal values for the "state" field of TkScale records.
 */

enum state {
    STATE_ACTIVE, STATE_DISABLED, STATE_NORMAL
};

/*
d42 4
a45 4
    Tk_OptionTable optionTable;	/* Table that defines configuration options
				 * available for this widget. */
    enum orient orient;		/* Orientation for window (vertical or
				 * horizontal). */
d50 2
a51 2
    double value;               /* Current value of scale. */
    Tcl_Obj *varNamePtr;	/* Name of variable or NULL.
d71 1
a71 1
    Tcl_Obj *commandPtr;        /* Command prefix to use when invoking Tcl
d73 2
a74 1
				 * NULL means don't invoke commands. */
d78 1
a78 1
    Tcl_Obj *labelPtr;		/* Label to display above or to right of
d80 1
a80 1
				 * label.  */
d82 3
a84 3
    enum state state;		/* Values are active, normal, or disabled.
				 * Value of scale cannot be changed when 
				 * disabled. */
d94 1
a94 2
    int sliderRelief;		/* Is slider to be drawn raised, sunken, 
				 * etc. */
d106 3
a108 4
    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. */
d145 1
a145 1
    Tcl_Obj *takeFocusPtr;	/* Value of -takefocus option;  not used in
d147 1
a147 1
				 * scripts.  May be NULL. */
d211 1
a211 1
 * Declaration of procedures used in the implementation of the scale
@


