Bwidget Source Code
Check-in [66f7bd69b2]
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:* notebook.tcl (NoteBook::delete) Method delete destroyframe=1 and reinsertion -> raise failed - state variables were deleted [Bug 2831785] by kjnash * tree.tcl (Tree::_keynav) Fire virtual event <<TreeSelect>> also on keyboard navigation [Patch 2828086] by Kevin Walzer * combobox.tcl Replaced aqua conditional code check by $Widget::_aqua
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 66f7bd69b21fa244706370683241f8011a2c870c
User & Date: oehhar 2009-08-04 16:39:05
Context
2009-08-12
07:22
* dynhelp.tcl Use balloon help font TkTooltipFont [Patch 2835180] * dynhelp.tcl(DynamicHelp::_show_help)Replaced aqua conditional code check by $Widget::_aqua check-in: c17d1f3e1b user: oehhar tags: trunk
2009-08-04
16:39
* notebook.tcl (NoteBook::delete) Method delete destroyframe=1 and reinsertion -> raise failed - state variables were deleted [Bug 2831785] by kjnash * tree.tcl (Tree::_keynav) Fire virtual event <<TreeSelect>> also on keyboard navigation [Patch 2828086] by Kevin Walzer * combobox.tcl Replaced aqua conditional code check by $Widget::_aqua check-in: 66f7bd69b2 user: oehhar tags: trunk
2009-07-24
17:44
Changed page version from 1.8 to 1.9 check-in: 94ff035b54 user: oehhar tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.










1
2
3
4
5
6
7








2009-07-24 Harald Oehlmann  <[email protected]>

	**** BWidget 1.9.0 tagged ****

	* pkgIndex.tcl, README.txt: updated to BWidget 1.9

2009-07-23 Harald Oehlmann  <[email protected]>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2009-08-04 Harald Oehlmann  <[email protected]>

	* notebook.tcl (NoteBook::delete) Method delete destroyframe=1 and
	reinsertion -> raise failed - state variables were deleted.
	[Bug 2831785] by kjnash
	* tree.tcl (Tree::_keynav) Fire virtual event <<TreeSelect>> also on
	keyboard navigation [Patch 2828086] by Kevin Walzer
	* combobox.tcl Replaced aqua conditional code check by $Widget::_aqua

2009-07-24 Harald Oehlmann  <[email protected]>

	**** BWidget 1.9.0 tagged ****

	* pkgIndex.tcl, README.txt: updated to BWidget 1.9

2009-07-23 Harald Oehlmann  <[email protected]>

Changes to combobox.tcl.

1
2
3
4
5
6
7
8
9
10
11
...
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
...
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
# ----------------------------------------------------------------------------
#  combobox.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: combobox.tcl,v 1.42 2009/07/07 17:28:14 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - ComboBox::create
#     - ComboBox::configure
#     - ComboBox::cget
#     - ComboBox::setvalue
#     - ComboBox::getvalue
................................................................................
	set sbwidth 15
    }

    toplevel            $shell -relief solid -bd 1
    wm withdraw         $shell
    wm overrideredirect $shell 1
    # these commands cause the combobox to behave strangely on OS X
    if {![string equal [tk windowingsystem] "aqua"]} {
        update idle
        wm transient    $shell [winfo toplevel $path]
        catch { wm attributes $shell -topmost 1 }
    }

    set sw [ScrolledWindow $shell.sw -managed 1 -size $sbwidth -ipad 0]

................................................................................

    set width [Widget::cget $path -listboxwidth]
    if {!$width} { set width [winfo width $path] }
    BWidget::place $path.shell $width 0 below $path
    wm deiconify $path.shell
    raise $path.shell
    BWidget::focus set $listb
    if { ! [string equal [tk windowingsystem] "aqua"] } {
        BWidget::grab global $path
    }
}


# ----------------------------------------------------------------------------
#  Command ComboBox::_unmapliste
# ----------------------------------------------------------------------------
proc ComboBox::_unmapliste { path {refocus 1} } {
    # On aqua, state is zoomed, otherwise normal
    if {[winfo exists $path.shell] && \
      ( [string equal [wm state $path.shell] "normal"] ||
	[string equal [wm state $path.shell] "zoomed"] ) } {
        if {![string equal [tk windowingsystem] "aqua"]} {
            BWidget::grab release $path
            BWidget::focus release $path.shell.listb $refocus
            # Update now because otherwise [focus -force...] makes the app hang!
            if {$refocus} {
                update
                focus -force $path.e
            }


|







 







|







 







|













|







1
2
3
4
5
6
7
8
9
10
11
...
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
...
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
# ----------------------------------------------------------------------------
#  combobox.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: combobox.tcl,v 1.43 2009/08/04 16:39:06 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - ComboBox::create
#     - ComboBox::configure
#     - ComboBox::cget
#     - ComboBox::setvalue
#     - ComboBox::getvalue
................................................................................
	set sbwidth 15
    }

    toplevel            $shell -relief solid -bd 1
    wm withdraw         $shell
    wm overrideredirect $shell 1
    # these commands cause the combobox to behave strangely on OS X
    if {! $Widget::_aqua } {
        update idle
        wm transient    $shell [winfo toplevel $path]
        catch { wm attributes $shell -topmost 1 }
    }

    set sw [ScrolledWindow $shell.sw -managed 1 -size $sbwidth -ipad 0]

................................................................................

    set width [Widget::cget $path -listboxwidth]
    if {!$width} { set width [winfo width $path] }
    BWidget::place $path.shell $width 0 below $path
    wm deiconify $path.shell
    raise $path.shell
    BWidget::focus set $listb
    if {! $Widget::_aqua } {
        BWidget::grab global $path
    }
}


# ----------------------------------------------------------------------------
#  Command ComboBox::_unmapliste
# ----------------------------------------------------------------------------
proc ComboBox::_unmapliste { path {refocus 1} } {
    # On aqua, state is zoomed, otherwise normal
    if {[winfo exists $path.shell] && \
      ( [string equal [wm state $path.shell] "normal"] ||
	[string equal [wm state $path.shell] "zoomed"] ) } {
        if {! $Widget::_aqua } {
            BWidget::grab release $path
            BWidget::focus release $path.shell.listb $refocus
            # Update now because otherwise [focus -force...] makes the app hang!
            if {$refocus} {
                update
                focus -force $path.e
            }

Changes to notebook.tcl.

1
2
3
4
5
6
7
8
9
10
11
...
298
299
300
301
302
303
304

305
306
307
308
309
310
311
312
313
314
# ---------------------------------------------------------------------------
#  notebook.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: notebook.tcl,v 1.25 2009/07/01 14:41:30 oehhar Exp $
# ---------------------------------------------------------------------------
#  Index of commands:
#     - NoteBook::create
#     - NoteBook::configure
#     - NoteBook::cget
#     - NoteBook::compute_size
#     - NoteBook::insert
................................................................................
        set data(select) ""
    }
    if { $pos < $data(base) } {
        incr data(base) -1
    }
    if { $destroyframe } {
        destroy $path.f$page

    }
    _redraw $path
    unset data($page,width) data($page,realized)
}


# ---------------------------------------------------------------------------
#  Command NoteBook::itemconfigure
# ---------------------------------------------------------------------------
proc NoteBook::itemconfigure { path page args } {


|







 







>


<







1
2
3
4
5
6
7
8
9
10
11
...
298
299
300
301
302
303
304
305
306
307

308
309
310
311
312
313
314
# ---------------------------------------------------------------------------
#  notebook.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: notebook.tcl,v 1.26 2009/08/04 16:39:06 oehhar Exp $
# ---------------------------------------------------------------------------
#  Index of commands:
#     - NoteBook::create
#     - NoteBook::configure
#     - NoteBook::cget
#     - NoteBook::compute_size
#     - NoteBook::insert
................................................................................
        set data(select) ""
    }
    if { $pos < $data(base) } {
        incr data(base) -1
    }
    if { $destroyframe } {
        destroy $path.f$page
        unset data($page,width) data($page,realized)
    }
    _redraw $path

}


# ---------------------------------------------------------------------------
#  Command NoteBook::itemconfigure
# ---------------------------------------------------------------------------
proc NoteBook::itemconfigure { path page args } {

Changes to tree.tcl.

1
2
3
4
5
6
7
8
9
10
11
....
1919
1920
1921
1922
1923
1924
1925

1926
1927
1928
1929
1930
1931
1932
1933
1934

1935
1936
1937
1938
1939
1940
1941
1942
1943

1944
1945
1946
1947
1948
1949
1950
....
1955
1956
1957
1958
1959
1960
1961

1962
1963
1964
1965
1966
1967
1968
....
1995
1996
1997
1998
1999
2000
2001

2002
2003
2004
2005
2006
2007
2008
# ----------------------------------------------------------------------------
#  tree.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: tree.tcl,v 1.60 2009/07/24 16:01:55 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - Tree::create
#     - Tree::configure
#     - Tree::cget
#     - Tree::insert
#     - Tree::itemconfigure
................................................................................
	    }
	    set index [lsearch -exact $nodes $node]
	    incr index -1
	    if { $index >= 0 } {
		$win selection set [lindex $nodes $index]
		_set_current_node $win [lindex $nodes $index]
		$win see [lindex $nodes $index]

		return
	    }
	}
	"down" {
	    # Down goes to the node that is vertically below the current node
	    if { [string equal $node ""] } {
		$win selection set [lindex $nodes 0]
		_set_current_node $win [lindex $nodes 0]
		$win see [lindex $nodes 0]

		return
	    }

	    set index [lsearch -exact $nodes $node]
	    incr index
	    if { $index < [llength $nodes] } {
		$win selection set [lindex $nodes $index]
		_set_current_node $win [lindex $nodes $index]
		$win see [lindex $nodes $index]

		return
	    }
	}
	"right" {
	    # On a right arrow, if the current node is closed, open it.
	    # If the current node is open, go to its first child
	    if { [string equal $node ""] } {
................................................................................
                if { [llength [$win nodes $node]] } {
		    set index [lsearch -exact $nodes $node]
		    incr index
		    if { $index < [llength $nodes] } {
			$win selection set [lindex $nodes $index]
			_set_current_node $win [lindex $nodes $index]
			$win see [lindex $nodes $index]

			return
		    }
                }
            } else {
                $win itemconfigure $node -open 1
                if {[llength [set cmd [Widget::getoption $win -opencmd]]]} {
                    uplevel \#0 $cmd [list $node]
................................................................................
			    break
		        }
                    }
		}
		$win selection set $parent
		_set_current_node $win $parent
		$win see $parent

		return
	    }
	}
	"space" {
	    if { [string equal $node ""] } {
		return
	    }


|







 







>









>









>







 







>







 







>







1
2
3
4
5
6
7
8
9
10
11
....
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
....
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
....
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
# ----------------------------------------------------------------------------
#  tree.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: tree.tcl,v 1.61 2009/08/04 16:39:06 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - Tree::create
#     - Tree::configure
#     - Tree::cget
#     - Tree::insert
#     - Tree::itemconfigure
................................................................................
	    }
	    set index [lsearch -exact $nodes $node]
	    incr index -1
	    if { $index >= 0 } {
		$win selection set [lindex $nodes $index]
		_set_current_node $win [lindex $nodes $index]
		$win see [lindex $nodes $index]
		event generate $win <<TreeSelect>>
		return
	    }
	}
	"down" {
	    # Down goes to the node that is vertically below the current node
	    if { [string equal $node ""] } {
		$win selection set [lindex $nodes 0]
		_set_current_node $win [lindex $nodes 0]
		$win see [lindex $nodes 0]
		event generate $win <<TreeSelect>>
		return
	    }

	    set index [lsearch -exact $nodes $node]
	    incr index
	    if { $index < [llength $nodes] } {
		$win selection set [lindex $nodes $index]
		_set_current_node $win [lindex $nodes $index]
		$win see [lindex $nodes $index]
		event generate $win <<TreeSelect>>
		return
	    }
	}
	"right" {
	    # On a right arrow, if the current node is closed, open it.
	    # If the current node is open, go to its first child
	    if { [string equal $node ""] } {
................................................................................
                if { [llength [$win nodes $node]] } {
		    set index [lsearch -exact $nodes $node]
		    incr index
		    if { $index < [llength $nodes] } {
			$win selection set [lindex $nodes $index]
			_set_current_node $win [lindex $nodes $index]
			$win see [lindex $nodes $index]
			event generate $win <<TreeSelect>>
			return
		    }
                }
            } else {
                $win itemconfigure $node -open 1
                if {[llength [set cmd [Widget::getoption $win -opencmd]]]} {
                    uplevel \#0 $cmd [list $node]
................................................................................
			    break
		        }
                    }
		}
		$win selection set $parent
		_set_current_node $win $parent
		$win see $parent
		event generate $win <<TreeSelect>>
		return
	    }
	}
	"space" {
	    if { [string equal $node ""] } {
		return
	    }