head	1.8;
access;
symbols
	core-8-5-9:1.4.2.2
	core-8-5-8:1.4.2.1
	macosx-cocoa-merge:1.7
	macosx-cocoa-premerge:1.7
	macosx-carbon-freeze:1.7
	core-8-5-7:1.4.2.1
	core-8-5-6:1.4.2.1
	core-8-6-b1:1.7
	core-8-6-a3:1.6
	core-8-5-5:1.4.2.1
	core-8-6-a2:1.6
	core-8-5-4:1.4.2.1
	core-8-5-3:1.4.2.1
	core-8-6-a1:1.6
	core-8-5-branch:1.4.0.2
	core-8-5-2:1.4
	core-8-5-1:1.4
	core-8-5-0:1.2
	core-8-5-b3:1.2
	core-8-5-b2:1.2
	core-8-5-b1:1.2
	core-stablilizer-merge:1.2
	core-stabilizer-branch:1.2.0.2
	core-stabilizer-merge:1.4.2.1
	core-8-5-a6:1.2;
locks; strict;
comment	@# @;


1.8
date	2009.11.12.18.17.14;	author jenglish;	state Exp;
branches;
next	1.7;

1.7
date	2008.10.28.20.02.03;	author jenglish;	state Exp;
branches;
next	1.6;

1.6
date	2008.05.23.20.20.06;	author jenglish;	state Exp;
branches;
next	1.5;

1.5
date	2008.04.25.19.08.32;	author jenglish;	state Exp;
branches;
next	1.4;

1.4
date	2008.01.30.05.33.19;	author jenglish;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2008.01.06.19.16.12;	author jenglish;	state Exp;
branches;
next	1.2;

1.2
date	2006.12.18.19.33.14;	author jenglish;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2006.10.31.01.42.27;	author hobbs;	state Exp;
branches;
next	;

1.2.2.1
date	2008.01.23.16.39.12;	author dgp;	state Exp;
branches;
next	1.2.2.2;

1.2.2.2
date	2008.01.31.02.59.18;	author dgp;	state Exp;
branches;
next	1.2.2.3;

1.2.2.3
date	2008.06.25.16.46.05;	author dgp;	state Exp;
branches;
next	;

1.4.2.1
date	2008.06.20.14.14.20;	author jenglish;	state Exp;
branches;
next	1.4.2.2;

1.4.2.2
date	2010.08.26.02.06.10;	author hobbs;	state Exp;
branches;
next	;


desc
@@


1.8
log
@[update] hygiene.

+ Where possible, replace [a; update; b] with [a ; after 0 b].
+ Where not possible, use [update idletasks] instead of full [update].
+ Use [after 0] in favor of [after idle] for delayed work,
  to reduce likelihood of reentrancy issues in [update idletasks].
@
text
@# $Id: treeview.tcl,v 1.7 2008/10/28 20:02:03 jenglish Exp $
#
# ttk::treeview widget bindings and utilities.
#

namespace eval ttk::treeview {
    variable State

    # Enter/Leave/Motion
    #
    set State(activeWidget) 	{}
    set State(activeHeading) 	{}

    # Press/drag/release:
    #
    set State(pressMode) 	none
    set State(pressX)		0

    # For pressMode == "resize"
    set State(resizeColumn)	#0

    # For pressmode == "heading"
    set State(heading)  	{}
}

### Widget bindings.
#

bind Treeview	<Motion> 		{ ttk::treeview::Motion %W %x %y }
bind Treeview	<B1-Leave>		{ #nothing }
bind Treeview	<Leave>			{ ttk::treeview::ActivateHeading {} {}}
bind Treeview	<ButtonPress-1> 	{ ttk::treeview::Press %W %x %y }
bind Treeview	<Double-ButtonPress-1> 	{ ttk::treeview::DoubleClick %W %x %y }
bind Treeview	<ButtonRelease-1> 	{ ttk::treeview::Release %W %x %y }
bind Treeview	<B1-Motion> 		{ ttk::treeview::Drag %W %x %y }
bind Treeview 	<KeyPress-Up>    	{ ttk::treeview::Keynav %W up }
bind Treeview 	<KeyPress-Down>  	{ ttk::treeview::Keynav %W down }
bind Treeview 	<KeyPress-Right> 	{ ttk::treeview::Keynav %W right }
bind Treeview 	<KeyPress-Left>  	{ ttk::treeview::Keynav %W left }
bind Treeview	<KeyPress-Prior>	{ %W yview scroll -1 pages }
bind Treeview	<KeyPress-Next> 	{ %W yview scroll  1 pages }
bind Treeview	<KeyPress-Return>	{ ttk::treeview::ToggleFocus %W }
bind Treeview	<KeyPress-space>	{ ttk::treeview::ToggleFocus %W }

bind Treeview	<Shift-ButtonPress-1> \
		{ ttk::treeview::Select %W %x %y extend }
bind Treeview	<Control-ButtonPress-1> \
		{ ttk::treeview::Select %W %x %y toggle }

ttk::copyBindings TtkScrollable Treeview 

### Binding procedures.
#

## Keynav -- Keyboard navigation
#
# @@@@@@ TODO: verify/rewrite up and down code.
#
proc ttk::treeview::Keynav {w dir} {
    set focus [$w focus]
    if {$focus eq ""} { return }

    switch -- $dir {
	up {
	    if {[set up [$w prev $focus]] eq ""} {
	        set focus [$w parent $focus]
	    } else {
		while {[$w item $up -open] && [llength [$w children $up]]} {
		    set up [lindex [$w children $up] end]
		}
		set focus $up
	    }
	}
	down {
	    if {[$w item $focus -open] && [llength [$w children $focus]]} {
	        set focus [lindex [$w children $focus] 0]
	    } else {
		set up $focus
		while {$up ne "" && [set down [$w next $up]] eq ""} {
		    set up [$w parent $up]
		}
		set focus $down
	    }
	}
	left {
	    if {[$w item $focus -open] && [llength [$w children $focus]]} {
	    	CloseItem $w $focus
	    } else {
	    	set focus [$w parent $focus]
	    }
	}
	right {
	    OpenItem $w $focus
	}
    }

    if {$focus != {}} {
	SelectOp $w $focus choose
    }
}

## Motion -- pointer motion binding.
#	Sets cursor, active element ...
#
proc ttk::treeview::Motion {w x y} {
    set cursor {}
    set activeHeading {}

    switch -- [$w identify region $x $y] {
	separator { set cursor hresize }
	heading { set activeHeading [$w identify column $x $y] }
    }

    ttk::setCursor $w $cursor
    ActivateHeading $w $activeHeading
}

## ActivateHeading -- track active heading element
#
proc ttk::treeview::ActivateHeading {w heading} {
    variable State

    if {$w != $State(activeWidget) || $heading != $State(activeHeading)} {
	if {$State(activeHeading) != {}} {
	    $State(activeWidget) heading $State(activeHeading) state !active
	}
	if {$heading != {}} {
	    $w heading $heading state active
	}
	set State(activeHeading) $heading
	set State(activeWidget) $w
    }
}

## Select $w $x $y $selectop
#	Binding procedure for selection operations.
#	See "Selection modes", below.
#
proc ttk::treeview::Select {w x y op} {
    if {[set item [$w identify row $x $y]] ne "" } {
	SelectOp $w $item $op
    }
}

## DoubleClick -- Double-ButtonPress-1 binding.
#
proc ttk::treeview::DoubleClick {w x y} {
    if {[set row [$w identify row $x $y]] ne ""} {
	Toggle $w $row
    } else {
	Press $w $x $y ;# perform single-click action
    }
}

## Press -- ButtonPress binding.
#
proc ttk::treeview::Press {w x y} {
    focus $w
    switch -- [$w identify region $x $y] {
	nothing { }
	heading { heading.press $w $x $y }
	separator { resize.press $w $x $y }
	tree -
	cell {
	    set item [$w identify item $x $y]
	    SelectOp $w $item choose
	    switch -glob -- [$w identify element $x $y] {
		*indicator -
		*disclosure { Toggle $w $item }
	    }
	}
    }
}

## Drag -- B1-Motion binding
#
proc ttk::treeview::Drag {w x y} {
    variable State
    switch $State(pressMode) {
	resize	{ resize.drag $w $x }
	heading	{ heading.drag $w $x $y }
    }
}

proc ttk::treeview::Release {w x y} {
    variable State
    switch $State(pressMode) {
	resize	{ resize.release $w $x }
	heading	{ heading.release $w }
    }
    set State(pressMode) none
    Motion $w $x $y
}

### Interactive column resizing.
#
proc ttk::treeview::resize.press {w x y} {
    variable State
    set State(pressMode) "resize"
    set State(resizeColumn) [$w identify column $x $y]
}

proc ttk::treeview::resize.drag {w x} {
    variable State
    $w drag $State(resizeColumn) $x
}

proc ttk::treeview::resize.release {w x} {
    # no-op
}

### Heading activation.
#

proc ttk::treeview::heading.press {w x y} {
    variable State
    set column [$w identify column $x $y]
    set State(pressMode) "heading"
    set State(heading) $column
    $w heading $column state pressed
}

proc ttk::treeview::heading.drag {w x y} {
    variable State
    if {   [$w identify region $x $y] eq "heading"
        && [$w identify column $x $y] eq $State(heading)
    } {
    	$w heading $State(heading) state pressed
    } else {
    	$w heading $State(heading) state !pressed
    }
}

proc ttk::treeview::heading.release {w} {
    variable State
    if {[lsearch -exact [$w heading $State(heading) state] pressed] >= 0} {
	after 0 [$w heading $State(heading) -command]
    }
    $w heading $State(heading) state !pressed
}

### Selection modes.
#

## SelectOp $w $item [ choose | extend | toggle ] --
#	Dispatch to appropriate selection operation
#	depending on current value of -selectmode.
#
proc ttk::treeview::SelectOp {w item op} {
    select.$op.[$w cget -selectmode] $w $item
}

## -selectmode none:
#
proc ttk::treeview::select.choose.none {w item} { $w focus $item }
proc ttk::treeview::select.toggle.none {w item} { $w focus $item }
proc ttk::treeview::select.extend.none {w item} { $w focus $item }

## -selectmode browse:
#
proc ttk::treeview::select.choose.browse {w item} { BrowseTo $w $item }
proc ttk::treeview::select.toggle.browse {w item} { BrowseTo $w $item }
proc ttk::treeview::select.extend.browse {w item} { BrowseTo $w $item }

## -selectmode multiple:
#
proc ttk::treeview::select.choose.extended {w item} {
    BrowseTo $w $item
}
proc ttk::treeview::select.toggle.extended {w item} {
    $w selection toggle [list $item]
}
proc ttk::treeview::select.extend.extended {w item} {
    if {[set anchor [$w focus]] ne ""} {
	$w selection set [between $w $anchor $item]
    } else {
    	BrowseTo $w $item
    }
}

### Tree structure utilities.
#

## between $tv $item1 $item2 --
#	Returns a list of all items between $item1 and $item2,
#	in preorder traversal order.  $item1 and $item2 may be
#	in either order.
#
# NOTES:
#	This routine is O(N) in the size of the tree.
#	There's probably a way to do this that's O(N) in the number
#	of items returned, but I'm not clever enough to figure it out.
#
proc ttk::treeview::between {tv item1 item2} {
    variable between [list]
    variable selectingBetween 0
    ScanBetween $tv $item1 $item2 {}
    return $between
}

## ScanBetween --
#	Recursive worker routine for ttk::treeview::between
#
proc ttk::treeview::ScanBetween {tv item1 item2 item} {
    variable between
    variable selectingBetween

    if {$item eq $item1 || $item eq $item2} {
    	lappend between $item
	set selectingBetween [expr {!$selectingBetween}]
    } elseif {$selectingBetween} {
    	lappend between $item
    }
    foreach child [$tv children $item] {
	ScanBetween $tv $item1 $item2 $child
    }
}

### User interaction utilities.
#

## OpenItem, CloseItem -- Set the open state of an item, generate event
#

proc ttk::treeview::OpenItem {w item} {
    $w focus $item
    event generate $w <<TreeviewOpen>>
    $w item $item -open true
}

proc ttk::treeview::CloseItem {w item} {
    $w item $item -open false
    $w focus $item
    event generate $w <<TreeviewClose>>
}

## Toggle -- toggle opened/closed state of item
#
proc ttk::treeview::Toggle {w item} {
    if {[$w item $item -open]} {
	CloseItem $w $item
    } else {
	OpenItem $w $item
    }
}

## ToggleFocus -- toggle opened/closed state of focus item
#
proc ttk::treeview::ToggleFocus {w} {
    set item [$w focus]
    if {$item ne ""} {
    	Toggle $w $item
    }
}

## BrowseTo -- navigate to specified item; set focus and selection
#
proc ttk::treeview::BrowseTo {w item} {
    $w see $item
    $w focus $item
    $w selection set [list $item]
}

#*EOF*
@


1.7
log
@Expanded set of symbolic cursors.
Add correct platform-specific cursors for OSX [Bug 2054562]
Use correct cursor for ttk::entry and ttk::combobox widgets [Bug 1534835]
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.6 2008/05/23 20:20:06 jenglish Exp $
d237 1
a237 1
	after idle [$w heading $State(heading) -command]
@


1.6
log
@Batch of ttk::treeview enhancements:
+ Added [$tv identify region], [$tv identify element],
  and [$tv identify item] subcommands.
+ Simplified bindings.
+ Added [$tv tag has] subcommand.
+ Tag-related display improvements: setting a tag -background
  or -foreground no longer overrides selection feedback.
+ Don't need separate 'Item', 'Cell', and 'Row' style
  settings anymore, only the base "Treeview" style is used.
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.5 2008/04/25 19:08:32 jenglish Exp $
a105 3
    variable ::ttk::Cursors
    variable State

d110 1
a110 1
	separator { set cursor $Cursors(hresize) }
d114 1
a114 3
    if {[$w cget -cursor] ne $cursor} {
	$w configure -cursor $cursor
    }
@


1.5
log
@BUGFIX: [$tv selection] takes a list of items, not a single item [Bug 1951733].
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.4 2008/01/30 05:33:19 jenglish Exp $
a23 9

    # Provide [lassign] if not already present
    # (@@@@@@ TODO: check if this is still needed after horrible-identify purge)
    #
    if {![llength [info commands lassign]]} {
	proc lassign {vals args} {
	    uplevel 1 [list foreach $args $vals break]
	}
    }
d112 1
a112 2
    lassign [$w identify $x $y] what where detail
    switch -- $what {
d114 1
a114 1
	heading { set activeHeading $where }
d163 2
a164 4
    lassign [$w identify $x $y] what where detail
    focus $w	;# or: ClickToFocus?

    switch -- $what {
d166 11
a176 8
	heading { heading.press $w $where }
	separator { resize.press $w $x $where }
	cell -
	row  -
	item { SelectOp $w $where choose }
    }
    if {$what eq "item" && [string match *indicator $detail]} {
    	Toggle $w $where
d202 1
a202 1
proc ttk::treeview::resize.press {w x column} {
d205 1
a205 1
    set State(resizeColumn) $column
d220 1
a220 1
proc ttk::treeview::heading.press {w column} {
d222 1
d230 3
a232 2
    lassign [$w identify $x $y] what where detail
    if {$what eq "heading" && $where eq $State(heading)} {
@


1.4
log
@library/treeview.tcl: Fix bug in Shift-ButtonPress-1 binding
(error if no current focus item; reported on c.l.t.)
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.3 2008/01/06 19:16:12 jenglish Exp $
d283 1
a283 1
    $w selection toggle $item
@


1.4.2.1
log
@Backport fix for [Bug 1951733]
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.5 2008/04/25 19:08:32 jenglish Exp $
d283 1
a283 1
    $w selection toggle [list $item]
@


1.4.2.2
log
@        Major backport of 8.6 Ttk for 8.5.9.  Most changes were only being
        committed to head (8.6), although they could apply for 8.5 as well.
        This re-sync makes future work easier to maintain and adds some
        useful work for 8.5 users. Notable changes:
        - Lots of code cleanup
        - Some bug fixes never backported
        - Addition of ttk::spinbox
        - minor color changes
        - Improved Vista/7 styling
        - Move to tile version 0.8.6 (pseudo-package)
        - ABI and API compatible (even $w identify)
        - minor new features (extended $w identify)
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.8 2009/11/12 18:17:14 jenglish Exp $
d24 9
d115 3
d121 4
a124 3
    switch -- [$w identify region $x $y] {
	separator { set cursor hresize }
	heading { set activeHeading [$w identify column $x $y] }
d127 3
a129 1
    ttk::setCursor $w $cursor
d173 4
a176 2
    focus $w
    switch -- [$w identify region $x $y] {
d178 8
a185 11
	heading { heading.press $w $x $y }
	separator { resize.press $w $x $y }
	tree -
	cell {
	    set item [$w identify item $x $y]
	    SelectOp $w $item choose
	    switch -glob -- [$w identify element $x $y] {
		*indicator -
		*disclosure { Toggle $w $item }
	    }
	}
d211 1
a211 1
proc ttk::treeview::resize.press {w x y} {
d214 1
a214 1
    set State(resizeColumn) [$w identify column $x $y]
d229 1
a229 1
proc ttk::treeview::heading.press {w x y} {
a230 1
    set column [$w identify column $x $y]
d238 2
a239 3
    if {   [$w identify region $x $y] eq "heading"
        && [$w identify column $x $y] eq $State(heading)
    } {
d249 1
a249 1
	after 0 [$w heading $State(heading) -command]
@


1.3
log
@Fix MouseWheel bindings for ttk::treeview widget
(Fixes #1442006, #1821939, #1862692)
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.2 2006/12/18 19:33:14 jenglish Exp $
d289 1
a289 1
    	BrowseTo $item
@


1.2
log
@Big batch of ttk::treeview improvements:
    Added column '-stretch' and '-minwidth' options.
    Improved column drag and resize behavior.
    Added horizontal scrolling [#1518650].
    Row height and child indent specifiable on Treeview style.
    Decreased default row height, no default -padding.
    Use correct heading height [#1163349].
    Apply tag settings to tree item as well as to data columns
    [NOTE: 'tag configure' still buggy].
    Fix off-by-one condition when moving nodes forward [#1618142]
    Prevent overscroll ([#1173434])
    Treeview style settings specified separately in each theme.
    Added disclosure triangle element in aqua theme.
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $
d59 1
a59 7
# Standard mousewheel bindings:
#
bind Treeview <MouseWheel> { %W yview scroll [expr {- (%D / 120) * 4}] units }
if {[string equal "x11" [tk windowingsystem]]} {
    bind Treeview <ButtonPress-4>	{ %W yview scroll -5 units }
    bind Treeview <ButtonPress-5>	{ %W yview scroll 5 units }
}
d160 1
a160 1
## DoubleClick -- Double-ButtonPress-1 binding.  
d258 1
a258 1
#	Dispatch to appropriate selection operation 
d279 1
a279 1
proc ttk::treeview::select.choose.extended {w item} { 
d282 1
a282 1
proc ttk::treeview::select.toggle.extended {w item} { 
d301 1
a301 1
# NOTES: 
@


1.2.2.1
log
@merge updates from HEAD
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.2 2006/12/18 19:33:14 jenglish Exp $
d59 7
a65 1
ttk::copyBindings TtkScrollable Treeview 
d166 1
a166 1
## DoubleClick -- Double-ButtonPress-1 binding.
d264 1
a264 1
#	Dispatch to appropriate selection operation
d285 1
a285 1
proc ttk::treeview::select.choose.extended {w item} {
d288 1
a288 1
proc ttk::treeview::select.toggle.extended {w item} {
d307 1
a307 1
# NOTES:
@


1.2.2.2
log
@merge updates from HEAD
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.2.2.1 2008/01/23 16:39:12 dgp Exp $
d289 1
a289 1
    	BrowseTo $w $item
@


1.2.2.3
log
@merge updates from 8.5 branch
@
text
@d1 1
a1 1
# $Id: treeview.tcl,v 1.2.2.2 2008/01/31 02:59:18 dgp Exp $
d283 1
a283 1
    $w selection toggle [list $item]
@


1.1
log
@	* doc/ttk_Geometry.3, doc/ttk_Theme.3, doc/ttk_button.n:
	* doc/ttk_checkbutton.n, doc/ttk_combobox.n, doc/ttk_dialog.n:
	* doc/ttk_entry.n, doc/ttk_frame.n, doc/ttk_image.n:
	* doc/ttk_intro.n, doc/ttk_label.n, doc/ttk_labelframe.n:
	* doc/ttk_menubutton.n, doc/ttk_notebook.n, doc/ttk_panedwindow.n:
	* doc/ttk_progressbar.n, doc/ttk_radiobutton.n, doc/ttk_scrollbar.n:
	* doc/ttk_separator.n, doc/ttk_sizegrip.n, doc/ttk_style.n:
	* doc/ttk_treeview.n, doc/ttk_widget.n,:
	* generic/ttk/ttk.decls, generic/ttk/ttkBlink.c:
	* generic/ttk/ttkButton.c, generic/ttk/ttkCache.c:
	* generic/ttk/ttkClamTheme.c, generic/ttk/ttkClassicTheme.c:
	* generic/ttk/ttkDecls.h, generic/ttk/ttkDefaultTheme.c:
	* generic/ttk/ttkElements.c, generic/ttk/ttkEntry.c:
	* generic/ttk/ttkFrame.c, generic/ttk/ttkImage.c:
	* generic/ttk/ttkInit.c, generic/ttk/ttkLabel.c:
	* generic/ttk/ttkLayout.c, generic/ttk/ttkManager.c:
	* generic/ttk/ttkManager.h, generic/ttk/ttkNotebook.c:
	* generic/ttk/ttkPanedwindow.c, generic/ttk/ttkProgress.c:
	* generic/ttk/ttkScale.c, generic/ttk/ttkScroll.c:
	* generic/ttk/ttkScrollbar.c, generic/ttk/ttkSeparator.c:
	* generic/ttk/ttkSquare.c, generic/ttk/ttkState.c:
	* generic/ttk/ttkStubInit.c, generic/ttk/ttkStubLib.c:
	* generic/ttk/ttkTagSet.c, generic/ttk/ttkTheme.c:
	* generic/ttk/ttkTheme.h, generic/ttk/ttkThemeInt.h:
	* generic/ttk/ttkTrace.c, generic/ttk/ttkTrack.c:
	* generic/ttk/ttkTreeview.c, generic/ttk/ttkWidget.c:
	* generic/ttk/ttkWidget.h:
	* library/demos/ttk_demo.tcl, library/demos/ttk_iconlib.tcl:
	* library/demos/ttk_repeater.tcl:
	* library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl:
	* library/ttk/button.tcl, library/ttk/clamTheme.tcl:
	* library/ttk/classicTheme.tcl, library/ttk/combobox.tcl:
	* library/ttk/cursors.tcl, library/ttk/defaults.tcl:
	* library/ttk/dialog.tcl, library/ttk/entry.tcl:
	* library/ttk/fonts.tcl, library/ttk/icons.tcl:
	* library/ttk/keynav.tcl, library/ttk/menubutton.tcl:
	* library/ttk/notebook.tcl, library/ttk/panedwindow.tcl:
	* library/ttk/progress.tcl, library/ttk/scale.tcl:
	* library/ttk/scrollbar.tcl, library/ttk/sizegrip.tcl:
	* library/ttk/treeview.tcl, library/ttk/ttk.tcl:
	* library/ttk/utils.tcl, library/ttk/winTheme.tcl:
	* library/ttk/xpTheme.tcl:
	* macosx/ttkMacOSXTheme.c:
	* tests/ttk/all.tcl, tests/ttk/bwidget.test, tests/ttk/combobox.test:
	* tests/ttk/entry.test, tests/ttk/image.test:
	* tests/ttk/labelframe.test, tests/ttk/layout.test:
	* tests/ttk/misc.test, tests/ttk/notebook.test:
	* tests/ttk/panedwindow.test, tests/ttk/progressbar.test:
	* tests/ttk/scrollbar.test, tests/ttk/treetags.test:
	* tests/ttk/treeview.test, tests/ttk/ttk.test, tests/ttk/validate.test:
	* win/ttkWinMonitor.c, win/ttkWinTheme.c, win/ttkWinXPTheme.c:
	First import of Ttk themed Tk widgets as branched from tile 0.7.8

	* generic/tkInt.h, generic/tkWindow.c: add Ttk_Init call, copy
	tk classic widgets to ::tk namespace.
	* library/tk.tcl: add source of ttk/ttk.tcl, define $::ttk::library.
	* unix/Makefile.in, win/Makefile.in: add Ttk build bits
	* win/configure, win/configure.in: check for uxtheme.h (XP theme).
@
text
@d1 1
d3 1
a3 3
# $Id: treeview.tcl,v 1.19 2006/10/03 17:53:46 jenglish Exp $
#
# Ttk widget set -- bindings for Treeview widget.
a19 1
    set State(minWidth)		24
a20 1
    set State(resizeWidth)	0
a216 2
# @@@@@@ needs work.
#
a218 1

a219 1
    set State(pressX)	$x
a220 1
    set State(resizeWidth) [$w column $column -width]
d225 1
a225 5
    set newWidth [expr {$State(resizeWidth) + $x - $State(pressX)}]
    if {$newWidth < $State(minWidth)} {
	set newWidth $State(minWidth)
    }
    $w column $State(resizeColumn) -width $newWidth
a381 29
### Style settings for selected built-in themes.
#
#   Do this here instead of in the theme definitions since the details are
#   likely to change; it's better to keep this all in one place for now.
#
namespace eval ::ttk::treeview {
    variable theme
    namespace import -force ::ttk::style
    foreach theme [style theme names] {
	style theme settings $theme {
	    style map Item -foreground [list selected "#FFFFFF"]
	    style configure Row -background "#EEEEEE"
	    style configure Heading -relief raised -font TkHeadingFont
	    style configure Item -justify left
	    style map Heading -relief {
		pressed sunken
	    }
	    style map Row -background {
		selected	#4a6984
		focus	#ccccff
		alternate	#FFFFFF
	    }
	    style map Cell -foreground {
		selected	#FFFFFF
	    }
	}
    }
}

@

