Bwidget Source Code
Check-in [55b962c054]
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 (Tree::_set_help), Tree.html DynamicHelp -helpcmd added to tree node help * tree.tcl (Tree::_draw_subnodes) a vertical line to a virtual root node above the widget is only drawn when there are multiple child nodes. This reverts the modification dated 2004-04-21 for this case. [Patch 2825354] by Koen Danckaert
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 55b962c054340dafffb67e66f5048f231585f1e1
User & Date: oehhar 2009-07-24 16:01:55
Context
2009-07-24
17:44
Changed page version from 1.8 to 1.9 check-in: 94ff035b54 user: oehhar tags: trunk
16:01
* tree.tcl (Tree::_set_help), Tree.html DynamicHelp -helpcmd added to tree node help * tree.tcl (Tree::_draw_subnodes) a vertical line to a virtual root node above the widget is only drawn when there are multiple child nodes. This reverts the modification dated 2004-04-21 for this case. [Patch 2825354] by Koen Danckaert check-in: 55b962c054 user: oehhar tags: trunk
2009-07-17
15:29
* scrollframe.tcl (ScrollableFrame::create et al) ScrollableFrame.html Background color of canvas takes the color of the scrolled frame. If themed, canvas takes the themed color of the scrolled themed frame. If themed, parameters -background and -bg are not available(doc + code). [Patch 2822970] by Koen Danckaert check-in: 0a9de4a94f user: oehhar tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to BWman/Tree.html.

690
691
692
693
694
695
696









697
698
699
700
701
702
703
704
705
706
707
708
</DL>
<DL><DT><A NAME="Node-font"><B>-font</B></A></DT>
<DD>

Specifies a font for the label of the node.

</DD>









</DL>
<DL><DT><A NAME="-helptext"><B>-helptext</B></A></DT>
<DD>

Text for dynamic help. If empty, no help is available for this widget.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="-helptype"><B>-helptype</B></A></DT>
<DD>
Type of dynamic help. Use <I>balloon</I> or <I>variable</I>.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.






>
>
>
>
>
>
>
>
>




|







690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
</DL>
<DL><DT><A NAME="Node-font"><B>-font</B></A></DT>
<DD>

Specifies a font for the label of the node.

</DD>
</DL>
<DL><DT><A NAME="-helpcmd"><B>-helpcmd</B></A></DT>
<DD>

If specified, refers to a command to execute to get the help text to display.
The command must return a string to display.
If the command returns an empty string, no help is displayed. 
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="-helptext"><B>-helptext</B></A></DT>
<DD>

Text for dynamic help.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="-helptype"><B>-helptype</B></A></DT>
<DD>
Type of dynamic help. Use <I>balloon</I> or <I>variable</I>.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.

Changes to ChangeLog.










1
2
3
4
5
6
7








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

	* scrollframe.tcl (ScrollableFrame::create et al) ScrollableFrame.html
	Background color of canvas takes the color of the scrolled frame.
	If themed, canvas takes the themed color of the scrolled themed frame.
	If themed, parameters -background and -bg are not available(doc + code).
	[Patch 2822970] by Koen Danckaert
>
>
>
>
>
>
>
>
>







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

	* tree.tcl (Tree::_set_help), Tree.html DynamicHelp -helpcmd added to
	tree node help
	* tree.tcl (Tree::_draw_subnodes) a vertical line to a virtual root node
	above the widget is only drawn when there are multiple child nodes.
	This reverts the modification dated 2004-04-21 for this case.
	[Patch 2825354] by Koen Danckaert

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

	* scrollframe.tcl (ScrollableFrame::create et al) ScrollableFrame.html
	Background color of canvas takes the color of the scrolled frame.
	If themed, canvas takes the themed color of the scrolled themed frame.
	If themed, parameters -background and -bg are not available(doc + code).
	[Patch 2822970] by Koen Danckaert

Changes to tree.tcl.

1
2
3
4
5
6
7
8
9
10
11
....
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
....
2147
2148
2149
2150
2151
2152
2153
2154

2155
2156
2157
2158
2159
2160
2161
....
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184

2185
2186
2187
2188
2189

2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204



2205
2206
2207
2208
2209
2210
2211
# ----------------------------------------------------------------------------
#  tree.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: tree.tcl,v 1.59 2009/06/30 16:17:37 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - Tree::create
#     - Tree::configure
#     - Tree::cget
#     - Tree::insert
#     - Tree::itemconfigure
................................................................................
    set y1 $y0
    foreach node $nodes {
	set padx   [_get_node_padx $path $node]
	set deltax [_get_node_deltax $path $node]
        set yp $y1
        set y1 [_draw_node $path $node $x0 [expr {$y1+$deltay}] $deltax $deltay $padx $showlines]
    }
    if { $showlines && [llength $nodes] } {
	if {$y0 < 0} {
	    # Adjust the drawing of the line to the first root node
	    # to start at the vertical point (not go up).
	    incr y0 $deltay
	}
        set id [$path.c create line $x0 $y0 $x0 [expr {$yp+$deltay}] \
                    -fill    [Widget::getoption $path -linesfill]   \
                    -stipple [Widget::getoption $path -linestipple] \
                    -tags    line]

        $path.c lower $id
    }
................................................................................
#	node		Node in the tree
#	tags		A list of tags to add to the final list
#
# Results:
#	list		The list of tags to apply to the canvas item
proc Tree::_get_node_tags {path node {tags ""}} {
    eval [linsert $tags 0 lappend list TreeItemSentinal]
    if {[Widget::getoption $path.$node -helptext] == ""} { return $list }


    switch -- [Widget::getoption $path.$node -helptype] {
	balloon {
	    lappend list BwHelpBalloon
	}
	variable {
	    lappend list BwHelpVariable
................................................................................
#
# Results:
#	none
proc Tree::_set_help { path node } {
    Widget::getVariable $path help

    set item $path.$node
    set opts [list -helptype -helptext -helpvar]
    foreach {cty ctx cv} [eval [linsert $opts 0 Widget::hasChangedX $item]] break
    set text [Widget::getoption $item -helptext]


    ## If we've never set help for this item before, and text is not blank,
    ## we need to setup help.  We also need to reset help if any of the
    ## options have changed.
    if { (![info exists help($node)] && $text != "") || $cty || $ctx || $cv } {

	set help($node) 1
	set type [Widget::getoption $item -helptype]
        switch $type {
            balloon {
		DynamicHelp::register $path.c balloon n:$node $text
		DynamicHelp::register $path.c balloon i:$node $text
		DynamicHelp::register $path.c balloon b:$node $text
            }
            variable {
		set var [Widget::getoption $item -helpvar]
		DynamicHelp::register $path.c variable n:$node $var $text
		DynamicHelp::register $path.c variable i:$node $var $text
		DynamicHelp::register $path.c variable b:$node $var $text
            }
        }



    }
}

proc Tree::_mouse_select { path cmd args } {
    eval [linsert $args 0 selection $path $cmd]
    switch -- $cmd {
        "add" - "clear" - "remove" - "set" - "toggle" {


|







 







|
|
|
|
<
<







 







|
>







 







|
|

>

|
|

|
>


<
<
<
<
<
<
<
|
<
<
<
<
<
>
>
>







1
2
3
4
5
6
7
8
9
10
11
....
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375


1376
1377
1378
1379
1380
1381
1382
....
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
....
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192







2193





2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
# ----------------------------------------------------------------------------
#  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 y1 $y0
    foreach node $nodes {
	set padx   [_get_node_padx $path $node]
	set deltax [_get_node_deltax $path $node]
        set yp $y1
        set y1 [_draw_node $path $node $x0 [expr {$y1+$deltay}] $deltax $deltay $padx $showlines]
    }
    # Only draw a line to the invisible root node above the tree widget when
    # there are multiple top nodes.
    set len [llength $nodes]
    if { $showlines && $len && !($y0 < 0 && $len < 2) } {


        set id [$path.c create line $x0 $y0 $x0 [expr {$yp+$deltay}] \
                    -fill    [Widget::getoption $path -linesfill]   \
                    -stipple [Widget::getoption $path -linestipple] \
                    -tags    line]

        $path.c lower $id
    }
................................................................................
#	node		Node in the tree
#	tags		A list of tags to add to the final list
#
# Results:
#	list		The list of tags to apply to the canvas item
proc Tree::_get_node_tags {path node {tags ""}} {
    eval [linsert $tags 0 lappend list TreeItemSentinal]
    if {[Widget::getoption $path.$node -helptext] == "" &&
        [Widget::getoption $path.$node -helpcmd]  == ""} { return $list }

    switch -- [Widget::getoption $path.$node -helptype] {
	balloon {
	    lappend list BwHelpBalloon
	}
	variable {
	    lappend list BwHelpVariable
................................................................................
#
# Results:
#	none
proc Tree::_set_help { path node } {
    Widget::getVariable $path help

    set item $path.$node
    set opts [list -helptype -helptext -helpvar -helpcmd]
    foreach {cty ctx cv cc} [eval [linsert $opts 0 Widget::hasChangedX $item]] break
    set text [Widget::getoption $item -helptext]
    set cmd  [Widget::getoption $item -helpcmd]

    ## If we've never set help for this item before, and text or cmd is not
    ## blank, we need to setup help. We also need to reset help if any of the
    ## options have changed.
    if { (![info exists help($node)] && ($text != "" || $cmd != ""))
         || $cty || $ctx || $cv } {
	set help($node) 1
	set type [Widget::getoption $item -helptype]







        set var [Widget::getoption $item -helpvar]





        DynamicHelp::add $path.c -item n:$node -type $type -text $text -variable $var -command $cmd
        DynamicHelp::add $path.c -item i:$node -type $type -text $text -variable $var -command $cmd
        DynamicHelp::add $path.c -item b:$node -type $type -text $text -variable $var -command $cmd
    }
}

proc Tree::_mouse_select { path cmd args } {
    eval [linsert $args 0 selection $path $cmd]
    switch -- $cmd {
        "add" - "clear" - "remove" - "set" - "toggle" {