Tk Source Code

Changes On Branch tip-591
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch tip-591 Excluding Merge-Ins

This is equivalent to a diff from e3fe3bec to 28d98c6c

2020-12-11
08:56
TIP #591: Rotate ttk::notebook window with mousewheel on tab check-in: 16da36d6 user: jan.nijtmans tags: trunk, main
2020-11-18
20:47
Fix upstream issue 'Regression from commit e7f5981 breaks many hitherto valid SVG icons #188', see https://github.com/memononen/nanosvg/issues/188 check-in: 2b07cb2b user: fvogel tags: trunk, main
16:52
Fix [f9bd73629e]: Bug in the ttk::notebook::CycleTab proc in the tip-591 branch Closed-Leaf check-in: 28d98c6c user: jan.nijtmans tags: tip-591
16:23
Fix cb458261c3: Strip comme il faut. Actually: don't strip-install on MacOS, because it cannot handle zipped content check-in: e3fe3bec user: jan.nijtmans tags: trunk, main
07:56
Divide keysyms.n in more logical blocks of about 200 lines. Use 2-character escapes where possible check-in: e88189d2 user: jan.nijtmans tags: trunk, main
2020-11-16
15:27
TIP #591 (experimental) implementation check-in: 97646c0a user: jan.nijtmans tags: tip-591

Changes to library/ttk/notebook.tcl.

12
13
14
15
16
17
18


19
20
21
22
23
24
25
bind TNotebook <Control-Tab>		{ ttk::notebook::CycleTab %W  1; break }
bind TNotebook <Control-Shift-Tab>	{ ttk::notebook::CycleTab %W -1; break }
catch {
bind TNotebook <Control-ISO_Left_Tab>	{ ttk::notebook::CycleTab %W -1; break }
}
bind TNotebook <Destroy>		{ ttk::notebook::Cleanup %W }



# ActivateTab $nb $tab --
#	Select the specified tab and set focus.
#
#  Desired behavior:
#	+ take focus when reselecting the currently-selected tab;
#	+ keep focus if the notebook already has it;
#	+ otherwise set focus to the first traversable widget







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
bind TNotebook <Control-Tab>		{ ttk::notebook::CycleTab %W  1; break }
bind TNotebook <Control-Shift-Tab>	{ ttk::notebook::CycleTab %W -1; break }
catch {
bind TNotebook <Control-ISO_Left_Tab>	{ ttk::notebook::CycleTab %W -1; break }
}
bind TNotebook <Destroy>		{ ttk::notebook::Cleanup %W }

ttk::bindMouseWheel TNotebook		[list ttk::notebook::CycleTab %W]

# ActivateTab $nb $tab --
#	Select the specified tab and set focus.
#
#  Desired behavior:
#	+ take focus when reselecting the currently-selected tab;
#	+ keep focus if the notebook already has it;
#	+ otherwise set focus to the first traversable widget
52
53
54
55
56
57
58
59
60
61



62

63
64
65
66
67
68
69
70
71
	ActivateTab $w $index
    }
}

# CycleTab --
#	Select the next/previous tab in the list.
#
proc ttk::notebook::CycleTab {w dir} {
    if {[$w index end] != 0} {
	set current [$w index current]



	set select [expr {($current + $dir) % [$w index end]}]

	while {[$w tab $select -state] != "normal" && ($select != $current)} {
	    set select [expr {($select + $dir) % [$w index end]}]
	}
	if {$select != $current} {
	    ActivateTab $w $select
	}
    }
}








|


>
>
>
|
>
|
|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
	ActivateTab $w $index
    }
}

# CycleTab --
#	Select the next/previous tab in the list.
#
proc ttk::notebook::CycleTab {w dir {factor 1.0}} {
    if {[$w index end] != 0} {
	set current [$w index current]
	set d [expr {$dir/$factor}]
	set d [expr {int($d > 0 ? ceil($d) : floor($d))}]
	set tabCount [$w index end]
	set select [expr {($current + $d) % $tabCount}]
	set step [expr {$dir > 0 ? 1 : -1}]
	while {[$w tab $select -state] ne "normal" && ($select != $current)} {
	    set select [expr {($select + $step) % $tabCount}]
	}
	if {$select != $current} {
	    ActivateTab $w $select
	}
    }
}