Bwidget Source Code
Check-in [aa5dc5c579]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:* tree.tcl: Changed the <KeyPress-space> binding to use "+", so it will not overwrite existing bindings (if there are any). Also added some extra protection in the keynav procedure against the user typing <Left> on a root node (this used to cause a stack trace).
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: aa5dc5c5799522122244a96b2967c89b508f3d3b
User & Date: sven 2000-02-16 16:43:22
Context
2000-02-16
16:43
*** empty log message *** check-in: 83391d43ae user: sven tags: trunk
16:43
* tree.tcl: Changed the <KeyPress-space> binding to use "+", so it will not overwrite existing bindings (if there are any). Also added some extra protection in the keynav procedure against the user typing <Left> on a root node (this used to cause a stack trace). check-in: aa5dc5c579 user: sven tags: trunk
2000-02-11
22:54
* tree.tcl: Integrated changes from Eric Boudaillier: [itemconfigure -open ...] optimized to only call redraw_idle 3 if node has subnodes. _cross_event: itemconfigure -open called before -opencmd/closecmd; no more call to _redraw_idle (handled by other procedures) _over_cmd: allow position {root 0} when tree is empty new [find] command: [find @x,y ?confine?] if confine is "confine" returns the node at window coordinate x,y (x,y must be inside the bbox of the node) else returns the node found on the line (in pixel) pixel y [find line] returns the node on the line $line (in -deltay coords) new [line] command: [line node] returns the line where node is drawn -selectfill option added: if true, selection is draw on full width of tree (instead of just highlighting the bbox of the selected nodes)

* combobox.tcl: Integrated changes from Eric Boudaillier: internal widget restructuring.

* tree.tcl: Added "range" subcommand to selection. Given two nodes, node1 and node2, it will set the selection to the visible nodes between (and including) node1 and node2. If node1 or node2 is not visible, it will find the first visible ancestor of the node and use that as the start/end point instead.

* listbox.tcl: Integrated changes from Eric Boudaillier: _over_cmd: allow position 0 when listbox is empty find command, similar to tree find command.

* spinbox.tcl: Integrated changes from Eric Boudaillier: cosmetic changes.

* color.tcl: Integrated changes from Eric Boudaillier: split widget into two commands: SelectColor::menu and SelectColor::dialog.

* progressbar.tcl: Integrated changes from Eric Boudaillier: added -idle option to prevent call to update in case where task is done in idle (ie, fileevents)

* scrollview.tcl: Integrated changes from Eric Boudaillier: bindings changed.

* scrollw.tcl: Integrated changes from Eric Boudaillier: -managed option: if true, scrollbar are managed during creation, so their size are included in the requested size of the ScrolledWindow. If false, they are not. -sides option: specifies the side of the scrollbar. -size option: specifies size of scrollbar. -ipad option: specifies pad between scrollbar and scrolled widget.

* mainframe.tcl: Integrated changes from Eric Boudaillier: support for function keys in accelerators, support for no modifier in accelerators.

* notebook.tcl: Integrated changes from Eric Boudaillier: -internalborderwidth (-ibd) option specifies pad around pages; -foreground, -background, -activeforeground, -activebackground, -disabledforeground options for each tab. Code cleanup. check-in: 651774cb09 user: ericm tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tree.tcl.

1
2
3
4
5
6
7
8
9
10
11
...
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
....
1668
1669
1670
1671
1672
1673
1674



1675
1676
1677
1678
1679

1680
1681
1682
1683
1684
1685
1686
# ------------------------------------------------------------------------------
#  tree.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: tree.tcl,v 1.8 2000/02/11 22:54:29 ericm Exp $
# ------------------------------------------------------------------------------
#  Index of commands:
#     - Tree::create
#     - Tree::configure
#     - Tree::cget
#     - Tree::insert
#     - Tree::itemconfigure
................................................................................

    # Added by [email protected]
    # These allow keyboard traversal of the tree
    bind $path <KeyPress-Up>    "Tree::_keynav up %W"
    bind $path <KeyPress-Down>  "Tree::_keynav down %W"
    bind $path <KeyPress-Right> "Tree::_keynav right %W"
    bind $path <KeyPress-Left>  "Tree::_keynav left %W"
    bind $path <KeyPress-space> "Tree::_keynav space %W"

    # These allow keyboard control of the scrolling
    bind $path <Control-KeyPress-Up>    "$path yview scroll -1 units"
    bind $path <Control-KeyPress-Down>  "$path yview scroll  1 units"
    bind $path <Control-KeyPress-Left>  "$path xview scroll -1 units"
    bind $path <Control-KeyPress-Right> "$path xview scroll  1 units"
    # [email protected]
................................................................................
	    }
	    set open [$win itemcget $node -open]
	    if { $open } {
		$win itemconfigure $node -open 0
		return
	    } else {
		set parent [$win parent $node]



		while { ![$win itemcget $parent -selectable] } {
		    set parent [$win parent $parent]
		    if { [string equal $parent "root"] } {
			set parent $node
			break

		    }
		}
		$win selection set $parent
		$win see $parent
		return
	    }
	}


|







 







|







 







>
>
>
|
|
|
|
|
>







1
2
3
4
5
6
7
8
9
10
11
...
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
....
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
# ------------------------------------------------------------------------------
#  tree.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: tree.tcl,v 1.9 2000/02/16 16:43:22 sven Exp $
# ------------------------------------------------------------------------------
#  Index of commands:
#     - Tree::create
#     - Tree::configure
#     - Tree::cget
#     - Tree::insert
#     - Tree::itemconfigure
................................................................................

    # Added by [email protected]
    # These allow keyboard traversal of the tree
    bind $path <KeyPress-Up>    "Tree::_keynav up %W"
    bind $path <KeyPress-Down>  "Tree::_keynav down %W"
    bind $path <KeyPress-Right> "Tree::_keynav right %W"
    bind $path <KeyPress-Left>  "Tree::_keynav left %W"
    bind $path <KeyPress-space> "+Tree::_keynav space %W"

    # These allow keyboard control of the scrolling
    bind $path <Control-KeyPress-Up>    "$path yview scroll -1 units"
    bind $path <Control-KeyPress-Down>  "$path yview scroll  1 units"
    bind $path <Control-KeyPress-Left>  "$path xview scroll -1 units"
    bind $path <Control-KeyPress-Right> "$path xview scroll  1 units"
    # [email protected]
................................................................................
	    }
	    set open [$win itemcget $node -open]
	    if { $open } {
		$win itemconfigure $node -open 0
		return
	    } else {
		set parent [$win parent $node]
                if { [string equal $parent "root"] } {
                    set parent $node
                } else {
		    while { ![$win itemcget $parent -selectable] } {
		        set parent [$win parent $parent]
		        if { [string equal $parent "root"] } {
			    set parent $node
			    break
                        }
		    }
		}
		$win selection set $parent
		$win see $parent
		return
	    }
	}