Bwidget Source Code
Check-in [c3b144fc1f]
Not logged in

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

Overview
Comment: * tree.tcl [Bug 3106208]: Followup. Moved the fixed code of the last entry I did (2010-11-09) into a new command Tree::MergeFlag and call this from both Tree::itemconfigure and Tree::insert. Missing the place in Tree::insert caused another problem, found by Dustin Littau.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk | tcllib-1-13 | tcllib-1-14
Files: files | file ages | folders
SHA1: c3b144fc1f7c6f1fb20283aefa230f5eaca99dde
User & Date: andreas_kupries 2010-12-14 17:01:34.000
Context
2018-02-07
16:58
add support to msgcat -- closed because become invalid Closed-Leaf check-in: b19b621e2a user: pd tags: msgcat
2010-12-14
17:01
* tree.tcl [Bug 3106208]: Followup. Moved the fixed code of the last entry I did (2010-11-09) into a new command Tree::MergeFlag and call this from both Tree::itemconfigure and Tree::insert. Missing the place in Tree::insert caused another problem, found by Dustin Littau. Leaf check-in: c3b144fc1f user: andreas_kupries tags: trunk, tcllib-1-13, tcllib-1-14
2010-11-21
17:29
Dialog.html Removed documentation of unavailable option -buttonwidth. check-in: 7eee767759 user: oehhar tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to ChangeLog.
1
2
3
4
5
6






















7
8






9
10
11
12
13
14
15
# ------------------------------------------------------------------------------
#  ChangeLog
#  This file is part of Unifix BWidget Toolkit
#  $Id: ChangeLog,v 1.221 2010/11/21 17:29:07 oehhar Exp $
# ------------------------------------------------------------------------------























2010-11-16 Harald Oehlmann <[email protected]>







	* Dialog.html Removed documentation of unavailable option -buttonwidth.

2010-11-09  Andreas Kupries  <[email protected]>

	* tree.tcl (Tree::itemconfigure): Fix intermingling of node names
	and flag values which can cause an lsearch to fail, by mistaking a
	flag value as the node searched for, and then treating a node name



|


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# ------------------------------------------------------------------------------
#  ChangeLog
#  This file is part of Unifix BWidget Toolkit
#  $Id: ChangeLog,v 1.222 2010/12/14 17:01:34 andreas_kupries Exp $
# ------------------------------------------------------------------------------

2010-12-14  Andreas Kupries  <[email protected]>

	* tree.tcl [Bug 3106208]: Followup. Moved the fixed code of the
	last entry I did (2010-11-09) into a new command Tree::MergeFlag
	and call this from both Tree::itemconfigure and Tree::insert.
	Missing the place in Tree::insert caused another problem, found by
	Dustin Littau.

2010-11-05 Harald Oehlmann <[email protected]>

	**** BWidget 1.9.3 tagged ****

2010-11-23 Harald Oehlmann <[email protected]>

	* scrollw.tcl Add theming support for ScrolledWindow widget.
	* ScrolledWindow.html Themed mode documented.

2010-11-21 Harald Oehlmann <[email protected]>

	* label.tcl Add theming support for Label widget.
	* label.html Themed mode documented.

2010-11-16 Harald Oehlmann <[email protected]>

	* button.tcl Add theming support for Button widget.
	Option "-relief link" is mapped to "Toolbutton style.
	Option -height is not available when themed.
	Thanks to Kevin Walzer for the test on MacOS.
	* buttonbox.tcl When themed, only set themed button options.
	The widget itself is not jet themed.
	* Dialog.html Removed documentation of unavailable option -buttonwidth.

2010-11-09  Andreas Kupries  <[email protected]>

	* tree.tcl (Tree::itemconfigure): Fix intermingling of node names
	and flag values which can cause an lsearch to fail, by mistaking a
	flag value as the node searched for, and then treating a node name
Changes to tree.tcl.
1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  tree.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: tree.tcl,v 1.63 2010/11/10 07:57:58 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - Tree::create
#     - Tree::configure
#     - Tree::cget
#     - Tree::insert
#     - Tree::itemconfigure



|







1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  tree.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: tree.tcl,v 1.64 2010/12/14 17:01:34 andreas_kupries Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - Tree::create
#     - Tree::configure
#     - Tree::cget
#     - Tree::insert
#     - Tree::itemconfigure
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
    } elseif { [visible $path $parent] } {
        # parent is visible...
        if { [Widget::getMegawidgetOption $path.$parent -open] } {
            # ...and opened -> redraw whole
            _redraw_idle $path 3
        } else {
            # ...and closed -> redraw cross
            lappend data(upd,nodes) $parent 8
            _redraw_idle $path 2
        }
    }

    return $node
}








|







355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
    } elseif { [visible $path $parent] } {
        # parent is visible...
        if { [Widget::getMegawidgetOption $path.$parent -open] } {
            # ...and opened -> redraw whole
            _redraw_idle $path 3
        } else {
            # ...and closed -> redraw cross
	    MergeFlag $path $parent 8
            _redraw_idle $path 2
        }
    }

    return $node
}

405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425














426
427
428
429
430
431
432
        }

	if {$data(upd,level) < 3 && [Widget::hasChanged $path.$node -padx x]} {
	    _redraw_idle $path 3
	}

	if { $data(upd,level) < 3 && $flag } {
            # data(upd,nodes) is a key-val list: emulate a dict by an array
            array set n $data(upd,nodes)
            if {![info exists n($node)]} {
                lappend data(upd,nodes) $node $flag
            } else {
                set n($node) [expr {$n($node) | $flag}]
                set data(upd,nodes) [array get n]
            }
            _redraw_idle $path 2
        }
    }
    return $result
}
















# ----------------------------------------------------------------------------
#  Command Tree::itemcget
# ----------------------------------------------------------------------------
proc Tree::itemcget { path node option } {
    # Instead of upvar'ing $path as data for this test, just directly refer to
    # it, as that is faster.







<
<
<
|
<
<
<
<






>
>
>
>
>
>
>
>
>
>
>
>
>
>







405
406
407
408
409
410
411



412




413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
        }

	if {$data(upd,level) < 3 && [Widget::hasChanged $path.$node -padx x]} {
	    _redraw_idle $path 3
	}

	if { $data(upd,level) < 3 && $flag } {



	    MergeFlag $path $node $flag




            _redraw_idle $path 2
        }
    }
    return $result
}

proc Tree::MergeFlag { path node flag } {
    variable $path
    upvar 0  $path data

    # data(upd,nodes) is a key-val list: emulate a dict by an array
    array set n $data(upd,nodes)
    if {![info exists n($node)]} {
	lappend data(upd,nodes) $node $flag
    } else {
	set n($node) [expr {$n($node) | $flag}]
	set data(upd,nodes) [array get n]
    }
    return
}

# ----------------------------------------------------------------------------
#  Command Tree::itemcget
# ----------------------------------------------------------------------------
proc Tree::itemcget { path node option } {
    # Instead of upvar'ing $path as data for this test, just directly refer to
    # it, as that is faster.