head	1.11;
access;
symbols
	core-8-5-9:1.11
	core-8-5-8:1.11
	macosx-cocoa-merge:1.11
	macosx-cocoa-premerge:1.11
	macosx-carbon-freeze:1.11
	core-8-5-7:1.11
	core-8-5-6:1.11
	core-8-6-b1:1.11
	core-8-6-a3:1.11
	core-8-5-5:1.11
	core-8-6-a2:1.11
	core-8-5-4:1.11
	core-8-5-3:1.11
	core-8-6-a1:1.11
	core-8-4-19:1.9.4.1
	core-8-5-branch:1.11.0.4
	core-8-5-2:1.11
	core-8-4-18:1.9.4.1
	core-8-5-1:1.11
	core-8-4-17:1.9.4.1
	core-8-5-0:1.11
	core-8-5-b3:1.11
	core-8-5-b2:1.11
	core-8-4-16:1.9.4.1
	core-8-5-b1:1.11
	core-stablilizer-merge:1.11
	core-stabilizer-branch:1.11.0.2
	core-stabilizer-merge:1.11
	core-8-4-15:1.9.4.1
	core-8-5-a6:1.11
	core-8-5-a5:1.11
	core-8-4-14:1.9.4.1
	core-8-5-a4:1.11
	core-8-4-13:1.9.4.1
	core-8-4-12:1.9
	core-8-4-11:1.9
	core-8-5-a3:1.9
	core-8-4-10:1.9
	core-8-4-9-branch:1.9.0.8
	core-8-5-a2:1.9
	core-8-4-9:1.9
	core-8-4-8:1.9
	core-8-4-7:1.9
	core-8-5-a1:1.9
	core-8-4-6:1.9
	core-8-4-5:1.9
	mistachkin-dev-branch:1.9.0.6
	core-8-4-4:1.9
	core-8-4-3:1.9
	core-8-4-branch:1.9.0.4
	core-8-4-2:1.9
	core-8-4-1:1.9
	core-8-3-5:1.7.2.1
	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.9
	macosx-8-4-premerge-2002-08-31-trunk:1.9
	macosx-8-4-merge-2002-08-30-branch:1.9
	macosx-8-4-merge-2002-08-30-trunk:1.9
	macosx-8-4-merge-2002-08-20-branch:1.9
	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.9
	core-8-4-a4:1.9
	core-8-3-4:1.7.2.1
	macosx-8-4-branch:1.9.0.2
	macosx-8-4-branchpoint:1.9
	core-8-4-a3:1.9
	core-8-3-3:1.7.2.1
	dgp-privates-into-namespace:1.8.0.4
	tclpro-1-5-0:1.7.2.1
	core-8-4-win-speedup:1.8.0.2
	core-8-4-a2:1.8
	tclpro-1-4-1:1.7.2.1
	tclpro-1-4-0:1.7.2.1
	core-8-3-2:1.7.2.1
	ajuba-ajuba2-2-1-base:1.7
	ajuba-ajuba2-2-0:1.7
	core-8-4-a1:1.8
	core-8-3-1-branch:1.7.0.2
	core-8-3-1:1.7
	scriptics-sc-2-0-b5:1.6
	scriptics-sc-2-0-fixed:1.6
	scriptics-sc-2-0-b2:1.6
	scriptics-sc-2-0-b1:1.6
	core-8-3-0:1.5
	core-8-3-b2:1.5
	core-8-3-b1:1.5
	scriptics-sc-1-1:1.4
	scriptics-sc-1-1-b1:1.4
	core-8-2-3:1.4
	scriptics-sc-1-1-branch:1.4.0.10
	scriptics-sc-1-1-base:1.4
	scriptics-sc-1-0:1.4
	scriptics-sc-1-0-branch:1.4.0.8
	scriptics-sc-1-0-base:1.4
	core-8-2-2:1.4
	core-8-2-1:1.4
	scriptics-bc-1-0-b1:1.4
	core-8-2-1-branch:1.4.0.6
	scriptics-tclpro-1-3-0:1.4
	core-8-2-0:1.4
	core-8-2-b3-branch:1.4.0.4
	core-8-2-b3-base:1.4
	scriptics-tclpro-1-3-b4:1.4
	core-8-2-b2:1.4
	scriptics-tclpro-1-3-b3:1.4
	core-8-2-b1:1.4
	scriptics-tclpro-1-3-b2:1.4
	merge-to-mainline-5/21/99:1.4
	scriptics-tclpro-1-3-b2-branch:1.4.0.2
	core-8-1-1:1.4
	scriptics-tclpro-1-3-b1:1.4
	core-8-1-1-base:1.4
	core-8-1-0:1.4
	merge-to-mainline-4-29-99:1.4
	merge-to-mainline-4-23-99:1.4
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.3.0.6
	core-8-0-6-base:1.3
	core-8-0-5:1.3
	core-8-1-b3:1.1.4.3
	core-8-1-b2:1.1.4.2
	dev-8-1-stubs-branch:1.1.4.2.0.2
	dev-stubs-branch:1.3.0.4
	scriptics-tclpro-1-2:1.3
	scriptics-tclpro-1-2-b2:1.3
	core-8-1-merge-2/10/99:1.3
	core-8-0-5-branch:1.3.0.2
	core-8-0-5-base:1.3
	scriptics-tclpro-1-2-b1:1.3
	scriptics-tclpro-1-2-a1:1.3
	core-8-1-b1:1.1.4.2
	core-8-0-4:1.3
	core-8-1-a2:1.1.4.1
	core-8-0-2:1.1
	core-8-0-3:1.3;
locks; strict;
comment	@# @;


1.11
date	2006.01.25.18.22.04;	author dgp;	state Exp;
branches;
next	1.10;

1.10
date	2005.07.25.09.06.00;	author dkf;	state Exp;
branches;
next	1.9;

1.9
date	2001.08.01.16.21.11;	author dgp;	state Exp;
branches
	1.9.4.1;
next	1.8;

1.8
date	2000.05.09.17.28.31;	author hobbs;	state Exp;
branches
	1.8.2.1
	1.8.4.1;
next	1.7;

1.7
date	2000.03.31.09.24.11;	author hobbs;	state Exp;
branches
	1.7.2.1;
next	1.6;

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

1.5
date	99.09.02.17.02.52;	author hobbs;	state Exp;
branches;
next	1.4;

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

1.3
date	98.09.14.18.23.23;	author stanton;	state Exp;
branches;
next	1.2;

1.2
date	98.06.27.18.06.39;	author welch;	state Exp;
branches;
next	1.1;

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

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

1.1.4.2
date	98.09.30.02.17.33;	author stanton;	state Exp;
branches;
next	1.1.4.3;

1.1.4.3
date	99.04.06.03.52.54;	author stanton;	state Exp;
branches;
next	;

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

1.8.2.1
date	2002.04.06.01.02.01;	author hobbs;	state Exp;
branches;
next	;

1.8.4.1
date	2001.02.28.23.29.56;	author dgp;	state Exp;
branches;
next	;

1.9.4.1
date	2006.01.25.18.21.41;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.11
log
@        * library/bgerror.tcl:  Updates to use Tcl 8.4 features. [Patch 1237759]        * library/choosedir.tcl:
        * library/comdlg.tcl:
        * library/console.tcl:
        * library/dialog.tcl:
        * library/focus.tcl:
        * library/msgbox.tcl:
        * library/palette.tcl:
        * library/tk.tcl:
        * library/tkfbox.tcl:
        * library/xmfbox.tcl:
@
text
@# focus.tcl --
#
# This file defines several procedures for managing the input
# focus.
#
# RCS: @@(#) $Id: focus.tcl,v 1.10 2005/07/25 09:06:00 dkf Exp $
#
# Copyright (c) 1994-1995 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

# ::tk_focusNext --
# This procedure returns the name of the next window after "w" in
# "focus order" (the window that should receive the focus next if
# Tab is typed in w).  "Next" is defined by a pre-order search
# of a top-level and its non-top-level descendants, with the stacking
# order determining the order of siblings.  The "-takefocus" options
# on windows determine whether or not they should be skipped.
#
# Arguments:
# w -		Name of a window.

proc ::tk_focusNext w {
    set cur $w
    while {1} {

	# Descend to just before the first child of the current widget.

	set parent $cur
	set children [winfo children $cur]
	set i -1

	# Look for the next sibling that isn't a top-level.

	while {1} {
	    incr i
	    if {$i < [llength $children]} {
		set cur [lindex $children $i]
		if {[winfo toplevel $cur] eq $cur} {
		    continue
		} else {
		    break
		}
	    }

	    # No more siblings, so go to the current widget's parent.
	    # If it's a top-level, break out of the loop, otherwise
	    # look for its next sibling.

	    set cur $parent
	    if {[winfo toplevel $cur] eq $cur} {
		break
	    }
	    set parent [winfo parent $parent]
	    set children [winfo children $parent]
	    set i [lsearch -exact $children $cur]
	}
	if {$w eq $cur || [tk::FocusOK $cur]} {
	    return $cur
	}
    }
}

# ::tk_focusPrev --
# This procedure returns the name of the previous window before "w" in
# "focus order" (the window that should receive the focus next if
# Shift-Tab is typed in w).  "Next" is defined by a pre-order search
# of a top-level and its non-top-level descendants, with the stacking
# order determining the order of siblings.  The "-takefocus" options
# on windows determine whether or not they should be skipped.
#
# Arguments:
# w -		Name of a window.

proc ::tk_focusPrev w {
    set cur $w
    while {1} {

	# Collect information about the current window's position
	# among its siblings.  Also, if the window is a top-level,
	# then reposition to just after the last child of the window.

	if {[winfo toplevel $cur] eq $cur}  {
	    set parent $cur
	    set children [winfo children $cur]
	    set i [llength $children]
	} else {
	    set parent [winfo parent $cur]
	    set children [winfo children $parent]
	    set i [lsearch -exact $children $cur]
	}

	# Go to the previous sibling, then descend to its last descendant
	# (highest in stacking order.  While doing this, ignore top-levels
	# and their descendants.  When we run out of descendants, go up
	# one level to the parent.

	while {$i > 0} {
	    incr i -1
	    set cur [lindex $children $i]
	    if {[winfo toplevel $cur] eq $cur} {
		continue
	    }
	    set parent $cur
	    set children [winfo children $parent]
	    set i [llength $children]
	}
	set cur $parent
	if {$w eq $cur || [tk::FocusOK $cur]} {
	    return $cur
	}
    }
}

# ::tk::FocusOK --
#
# This procedure is invoked to decide whether or not to focus on
# a given window.  It returns 1 if it's OK to focus on the window,
# 0 if it's not OK.  The code first checks whether the window is
# viewable.  If not, then it never focuses on the window.  Then it
# checks the -takefocus option for the window and uses it if it's
# set.  If there's no -takefocus option, the procedure checks to
# see if (a) the widget isn't disabled, and (b) it has some key
# bindings.  If all of these are true, then 1 is returned.
#
# Arguments:
# w -		Name of a window.

proc ::tk::FocusOK w {
    set code [catch {$w cget -takefocus} value]
    if {($code == 0) && ($value ne "")} {
	if {$value == 0} {
	    return 0
	} elseif {$value == 1} {
	    return [winfo viewable $w]
	} else {
	    set value [uplevel #0 $value [list $w]]
	    if {$value ne ""} {
		return $value
	    }
	}
    }
    if {![winfo viewable $w]} {
	return 0
    }
    set code [catch {$w cget -state} value]
    if {($code == 0) && $value eq "disabled"} {
	return 0
    }
    regexp Key|Focus "[bind $w] [bind [winfo class $w]]"
}

# ::tk_focusFollowsMouse --
#
# If this procedure is invoked, Tk will enter "focus-follows-mouse"
# mode, where the focus is always on whatever window contains the
# mouse.  If this procedure isn't invoked, then the user typically
# has to click on a window to give it the focus.
#
# Arguments:
# None.

proc ::tk_focusFollowsMouse {} {
    set old [bind all <Enter>]
    set script {
	if {"%d" eq "NotifyAncestor" || "%d" eq "NotifyNonlinear" \
		|| "%d" eq "NotifyInferior"} {
	    if {[tk::FocusOK %W]} {
		focus %W
	    }
	}
    }
    if {$old ne ""} {
	bind all <Enter> "$old; $script"
    } else {
	bind all <Enter> $script
    }
}
@


1.10
log
@Apply some of the changes suggested in [Patch 1237759]
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.9 2001/08/01 16:21:11 dgp Exp $
d133 1
a133 1
    if {($code == 0) && ($value != "")} {
d140 1
a140 1
	    if {$value != ""} {
@


1.9
log
@	Merged changes from feature branch dgp-privates-into-namespace,
	implementing TIP 44.  All Tk commands and variables matching
	tk[A-Z]* are now in the ::tk namespace.
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.8 2000/05/09 17:28:31 hobbs Exp $
d41 1
a41 1
              if {[string equal [winfo toplevel $cur] $cur]} {
d53 1
a53 1
	    if {[string equal [winfo toplevel $cur] $cur]} {
d60 1
a60 1
	if {[string equal $w $cur] || [tk::FocusOK $cur]} {
d85 1
a85 1
	if {[string equal [winfo toplevel $cur] $cur]}  {
d103 1
a103 1
	    if {[string equal [winfo toplevel $cur] $cur]} {
d111 1
a111 1
	if {[string equal $w $cur] || [tk::FocusOK $cur]} {
d149 1
a149 1
    if {($code == 0) && [string equal $value "disabled"]} {
d168 2
a169 3
	if {[string equal "%d" "NotifyAncestor"] \
		|| [string equal "%d" "NotifyNonlinear"] \
		|| [string equal "%d" "NotifyInferior"]} {
d175 1
a175 1
    if {[string compare $old ""]} {
@


1.9.4.1
log
@        * library/bgerror.tcl:  Updates to use Tcl 8.4 features. [Patch 1237759]        * library/button.tcl:
        * library/choosedir.tcl:
        * library/clrpick.tcl:
        * library/comdlg.tcl:
        * library/console.tcl:
        * library/dialog.tcl:
        * library/entry.tcl:
        * library/focus.tcl:
        * library/listbox.tcl:
        * library/menu.tcl:
        * library/msgbox.tcl:
        * library/palette.tcl:
        * library/panedwindow.tcl:
        * library/safetk.tcl:
        * library/scale.tcl:
        * library/scrlbar.tcl:
        * library/spinbox.tcl:
        * library/tearoff.tcl:
        * library/text.tcl:
        * library/tk.tcl:
        * library/tkfbox.tcl:
        * library/xmfbox.tcl:
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.9 2001/08/01 16:21:11 dgp Exp $
d41 1
a41 1
              if {[winfo toplevel $cur] eq $cur} {
d53 1
a53 1
	    if {[winfo toplevel $cur] eq $cur} {
d60 1
a60 1
	if {$w eq $cur || [tk::FocusOK $cur]} {
d85 1
a85 1
	if {[winfo toplevel $cur] eq $cur}  {
d103 1
a103 1
	    if {[winfo toplevel $cur] eq $cur} {
d111 1
a111 1
	if {$w eq $cur || [tk::FocusOK $cur]} {
d133 1
a133 1
    if {($code == 0) && ($value ne "")} {
d140 1
a140 1
	    if {$value ne ""} {
d149 1
a149 1
    if {($code == 0) && $value eq "disabled"} {
d168 3
a170 3
	if {"%d" eq "NotifyAncestor" \
		|| "%d" eq "NotifyNonlinear" \
		|| "%d" eq "NotifyInferior"} {
d176 1
a176 1
    if {$old ne ""} {
@


1.8
log
@	* library/focus.tcl: fixed calling of takeFocus proc [Bug: 5372]
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.7 2000/03/31 09:24:11 hobbs Exp $
d14 1
a14 1
# tk_focusNext --
d25 1
a25 1
proc tk_focusNext w {
d60 1
a60 1
	if {[string equal $w $cur] || [tkFocusOK $cur]} {
d66 1
a66 1
# tk_focusPrev --
d77 1
a77 1
proc tk_focusPrev w {
d111 1
a111 1
	if {[string equal $w $cur] || [tkFocusOK $cur]} {
d117 1
a117 1
# tkFocusOK --
d131 1
a131 1
proc tkFocusOK w {
d155 1
a155 1
# tk_focusFollowsMouse --
d165 1
a165 1
proc tk_focusFollowsMouse {} {
d171 1
a171 1
	    if {[tkFocusOK %W]} {
@


1.8.2.1
log
@update to head
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.9 2001/08/01 16:21:11 dgp Exp $
d14 1
a14 1
# ::tk_focusNext --
d25 1
a25 1
proc ::tk_focusNext w {
d60 1
a60 1
	if {[string equal $w $cur] || [tk::FocusOK $cur]} {
d66 1
a66 1
# ::tk_focusPrev --
d77 1
a77 1
proc ::tk_focusPrev w {
d111 1
a111 1
	if {[string equal $w $cur] || [tk::FocusOK $cur]} {
d117 1
a117 1
# ::tk::FocusOK --
d131 1
a131 1
proc ::tk::FocusOK w {
d155 1
a155 1
# ::tk_focusFollowsMouse --
d165 1
a165 1
proc ::tk_focusFollowsMouse {} {
d171 1
a171 1
	    if {[tk::FocusOK %W]} {
@


1.8.4.1
log
@2001-02-28  Don Porter  <dgp@@users.sourceforge.net>

        BRANCH dgp-privates-into-namespace:  Feature branch to move all
        of Tk's private commands and variable into the ::tk namespace
        and its children.

        * doc/tkvars.n:  Documented private variable tkPriv renamed tk::Priv.

        * generic/tkBind.c:
        * generic/tkMenu.c:
        * generic/tkTextDisp.c:
        * library/bgerror.tcl:
        * library/button.tcl:
        * library/choosedir.tcl:
        * library/clrpick.tcl:
        * library/comdlg.tcl:
        * library/console.tcl:
        * library/dialog.tcl:
        * library/entry.tcl:
        * library/focus.tcl:
        * library/listbox.tcl:
        * library/menu.tcl:
        * library/msgbox.tcl:
        * library/optMenu.tcl:
        * library/palette.tcl:
        * library/scale.tcl:
        * library/scrlbar.tcl:
        * library/spinbox.tcl:
        * library/tclIndex:
        * library/tearoff.tcl:
        * library/text.tcl:
        * library/tk.tcl:
        * library/tkfbox.tcl:
        * library/xmfbox.tcl:
        * mac/tkMacMenu.c:
        * tests/clrpick.test:
        * tests/filebox.test:
        * tests/macMenu.test:
        * tests/menu.test:
        * tests/menuDraw.test:
        * tests/msgbox.test:
        * tests/text.test:
        * tests/textDisp.test:
        * tests/unixMenu.test:
        * tests/winMenu.test:
        * tests/xmfbox.test:
        * unix/tkUnixDialog.c:  All Tk commands matching ::tk[A-Z]* and
        all Tk private variables in the global namespace were renamed to
        live in the namespace ::tk or one of its children.
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.8 2000/05/09 17:28:31 hobbs Exp $
d14 1
a14 1
# ::tk_focusNext --
d25 1
a25 1
proc ::tk_focusNext w {
d60 1
a60 1
	if {[string equal $w $cur] || [tk::FocusOK $cur]} {
d66 1
a66 1
# ::tk_focusPrev --
d77 1
a77 1
proc ::tk_focusPrev w {
d111 1
a111 1
	if {[string equal $w $cur] || [tk::FocusOK $cur]} {
d117 1
a117 1
# ::tk::FocusOK --
d131 1
a131 1
proc ::tk::FocusOK w {
d155 1
a155 1
# ::tk_focusFollowsMouse --
d165 1
a165 1
proc ::tk_focusFollowsMouse {} {
d171 1
a171 1
	    if {[tk::FocusOK %W]} {
@


1.7
log
@	* library/menu.tcl (tkMenuInvoke): corrected naming of tearoffs
	[Bug: 4506]

	* library/tkfbox.tcl (tkIconList_Goto): caused browsecmd to be
	called in tkIconList_Select.  This causes the entry to be set
	properly when using the type-in-name-in-listbox bindings.
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.6 2000/03/02 23:52:45 hobbs Exp $
d133 1
a133 1
    if {($code == 0) && [string compare $value ""]} {
d139 2
a140 2
	    set value [uplevel #0 [list $value $w]]
	    if {[string compare $value ""]} {
@


1.7.2.1
log
@	* BACKPORTED FROM 8.4 (HEAD) BRANCH:

	* tests/button.test:
	* generic/tkButton.c: Added -activeforeground, -activebackground
	for labels, for the -state option.

	* doc/label.n: Added -disabledforeground to list of options [Bug:
	6053].

	* tests/focus.test (focusSetupAlt): removed wm withdraw from proc
	as it would cause a hang for tkwait visibility

	* tests/menu.test:
	* generic/tk3d.c:
	* generic/tkColor.c:
	* generic/tkCursor.c: corrected handling of 3DBorder, Cursor and
	Color objects on multiple screens. [Bug: 5454]

	* generic/tkCursor.c: Added initialization for nextPtr field of
	TkCursor, patch from Nijtmans/Howlett.

	* canvas.test: added test for 5783.
	* generic/tkCanvPoly.c (DisplayPolygon): added checks for the
	polygon fillGC not being empty to prevent segfault. [Bug: 5783]

	* generic/tkImgGIF.c: Applied patch from Jan Nijtmans to fix a
	problem with the GIF writing code [Bug:	5823].
	* generic/tkImgGIF.c: Changed defines for GIF87a/GIF89a to be
	static char arrays with integer initialization, to address EBCIDIC
	vs. ASCII encoding issues and to handle compilers that don't deal
	with "\xAB" syntax for specifying hex values in strings.

	* generic/tkMenu.c (DeleteMenuCloneEntries): Applied fix from
	[Bug: 5275], which corrected a segfault-causing indexing problem
	when deleting entries from torn-off menus.

	* generic/tkPlace.c (Tk_PlaceCmd): reworked place master/slave
	table init'n to prevent seg fault when using place on multiple
	displays.

	* tests/text.test: Added tests for -regexp -nocase searches with
	backslash character classes.
	* tests/text.test: Added tests for searching when text is elided.
	* generic/tkText.c (TextSearchCmd): Text search did not work
	properly when -regexp and -nocase were used, in combination with
	backslash character classes represented by capital letters (ie,
	\W, \M); altered implementation of -regexp -nocase searches to use
	new regexp interfaces to fix this problem.  [Bug: 5988].
	* generic/tkText.c (TextSearchCmd): Text search was not returning
	the correct index when the search covered (but did not search)
	elided characters; corrected this by adjusting the match index by
	the number of elided characters preceeding the start of the match,
	just as is done with embedded windows, etc. [Bug: 5470].
	* generic/tkText.c (TextSearchCmd): Added a test for a NULL
	segment pointer when doing backwards searches for "" on an empty
	text widget. [Bug: 6007].

	* library/focus.tcl: fixed calling of takeFocus proc [Bug: 5372]

	* win/tkWinMenu.c (ReconfigureWindowsMenu): Added MF_GRAYED bit
	for disabled menu entries, to ensure that those which are drawn by
	the system are shown grayed (such as entries on menubars) [Bug: 4372].
	* win/tkWinMenu.c (ReconfigureWindowsMenu): Added code to add the
	MF_SEPARATOR bit for SEPARATOR_ENTRY menu items.  This causes
	separator entries on the system menu to be drawn correctly [Bug: 5451].
	* win/tkWinMenu.c (GetMenuSeparatorGeometry): Tweaked height
	requested for separator bars to be (linespace - (2*descent))
	instead of just (linespace); this makes the separator occupy a
	more correct amount of vertical space. [Bug: 5303].
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.8 2000/05/09 17:28:31 hobbs Exp $
d133 1
a133 1
    if {($code == 0) && ($value != "")} {
d139 2
a140 2
	    set value [uplevel #0 $value [list $w]]
	    if {$value != ""} {
@


1.6
log
@	* library/focus.tcl: fixed tkFocusOK to protect $w in
	uplevel with list. [Bug: 4208]
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.5 1999/09/02 17:02:52 hobbs Exp $
d27 1
a27 1
    while 1 {
d37 1
a37 1
	while 1 {
d79 1
a79 1
    while 1 {
@


1.5
log
@1999-09-01  Jeff Hobbs  <hobbs@@scriptics.com>

	* library/msgbox.tcl: changed the behavior of tk_messageBox on
	Unix to be more Windows like in handling of <Return> and the
	default button
	* library/button.tcl:
	* library/clrpick.tcl:
	* library/comdlg.tcl:
	* library/console.tcl:
	* library/dialog.tcl:
	* library/entry.tcl:
	* library/focus.tcl:
	* library/listbox.tcl:
	* library/menu.tcl:
	* library/msgbox.tcl:
	* library/palette.tcl:
	* library/safetk.tcl:
	* library/scale.tcl:
	* library/scrlbar.tcl:
	* library/tearoff.tcl:
	* library/text.tcl:
	* library/tk.tcl:
	* library/tkfbox.tcl:
	* library/xmfbox.tcl: updated commands to use [string] ops
	instead of expr equality operators
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.4 1999/04/16 01:51:26 stanton Exp $
d139 1
a139 1
	    set value [uplevel #0 $value $w]
@


1.4
log
@* Merged 8.1 branch into the main trunk
@
text
@d6 1
a6 1
# RCS: @@(#) $Id$
d41 1
a41 1
              if {![string compare [winfo toplevel $cur] $cur]} {
d53 1
a53 1
          if {![string compare [winfo toplevel $cur] $cur]} {
d60 1
a60 1
      if {![string compare $w $cur] || [tkFocusOK $cur]} {
d85 1
a85 1
      if {![string compare [winfo toplevel $cur] $cur]}  {
d103 1
a103 1
          if {![string compare [winfo toplevel $cur] $cur]} {
d111 1
a111 1
      if {![string compare $w $cur] || [tkFocusOK $cur]} {
d140 1
a140 1
          if {[string compare $value ""]} {
d149 1
a149 1
    if {($code == 0) && ![string compare $value "disabled"]} {
d168 6
a173 6
      if {![string compare "%d" "NotifyAncestor"]
              || ![string compare "%d" "NotifyNonlinear"]
              || ![string compare "%d" "NotifyInferior"]} {
          if {[tkFocusOK %W]} {
              focus %W
          }
@


1.3
log
@Replaced SCCS strings, fixed binary files
@
text
@d41 1
a41 1
		if {[winfo toplevel $cur] == $cur} {
d53 1
a53 1
	    if {[winfo toplevel $cur] == $cur} {
d60 1
a60 1
	if {($cur == $w) || [tkFocusOK $cur]} {
d84 2
a85 2
    
	if {[winfo toplevel $cur] == $cur}  {
d103 1
a103 1
	    if {[winfo toplevel $cur] == $cur} {
d111 1
a111 1
	if {($cur == $w) || [tkFocusOK $cur]} {
d133 1
a133 1
    if {($code == 0) && ($value != "")} {
d140 1
a140 1
	    if {$value != ""} {
d149 1
a149 1
    if {($code == 0) && ($value == "disabled")} {
d168 6
a173 5
	if {("%d" == "NotifyAncestor") || ("%d" == "NotifyNonlinear")
		|| ("%d" == "NotifyInferior")} {
		    if {[tkFocusOK %W]} {
			focus %W
		    }
d176 1
a176 1
    if {$old != ""} {
@


1.2
log
@plugin updates
@
text
@d6 1
a6 1
# SCCS: @@(#) focus.tcl 1.17 96/02/16 10:48:21
@


1.1
log
@Initial revision
@
text
@d170 3
a172 3
	    if [tkFocusOK %W] {
		focus %W
	    }
@


1.1.4.1
log
@initial tk8.1a2 version
@
text
@d6 1
a6 1
# SCCS: @@(#) focus.tcl 1.18 97/12/03 15:28:58
d170 3
a172 3
		    if {[tkFocusOK %W]} {
			focus %W
		    }
@


1.1.4.2
log
@Merged 8.0.3 changes into 8.1
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: focus.tcl,v 1.3 1998/09/14 18:23:23 stanton Exp $
@


1.1.4.3
log
@* library/bgerror.tcl:
* library/button.tcl:
* library/clrpick.tcl:
* library/console.tcl:
* library/dialog.tcl:
* library/entry.tcl:
* library/focus.tcl:
* library/listbox.tcl:
* library/menu.tcl:
* library/msgbox.tcl:
* library/palette.tcl:
* library/scale.tcl:
* library/scrlbar.tcl:
* library/tearoff.tcl:
* library/text.tcl:
* library/tk.tcl: Lots of minor performance improvements
contributed by Jeffrey Hobbs. [Bug: 1118]
@
text
@d6 1
a6 1
# RCS: @@(#) $Id$
d41 1
a41 1
              if {![string compare [winfo toplevel $cur] $cur]} {
d53 1
a53 1
          if {![string compare [winfo toplevel $cur] $cur]} {
d60 1
a60 1
      if {![string compare $w $cur] || [tkFocusOK $cur]} {
d84 2
a85 2

      if {![string compare [winfo toplevel $cur] $cur]}  {
d103 1
a103 1
          if {![string compare [winfo toplevel $cur] $cur]} {
d111 1
a111 1
      if {![string compare $w $cur] || [tkFocusOK $cur]} {
d133 1
a133 1
    if {($code == 0) && [string compare $value ""]} {
d140 1
a140 1
          if {[string compare $value ""]} {
d149 1
a149 1
    if {($code == 0) && ![string compare $value "disabled"]} {
d168 5
a172 6
      if {![string compare "%d" "NotifyAncestor"]
              || ![string compare "%d" "NotifyNonlinear"]
              || ![string compare "%d" "NotifyInferior"]} {
          if {[tkFocusOK %W]} {
              focus %W
          }
d175 1
a175 1
    if {[string compare $old ""]} {
@


