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

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

Overview
Comment:* mainframe.tcl, MainFrame.html (MainFrame::getmenustate) Added method getmenustate to return menu tag state [Bug 948063] reported by Rolf Ade

* combobox.tcl (ComboBox::configure) Bug fixed: Widget did not take focus, when -editable false and "configure -state normal" called. [Bug 756334] reported by Rolf Ade

* widget.tcl (Widget::configure) Bug: ProgressDlg option -bg not setable. The special handling of subwidgets with special class or path ":cmd" was improved. [Bug 611477]

* notebook.tcl (NoteBook::_itemconfigure) Not honored option: itemconfigure ... -helptext [Patch 2814050] by Koen Danckaert

Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f39181862b05987191cbecb5867262d092b84dd3
User & Date: oehhar 2009-07-01 14:41:30.000
Context
2009-07-02
16:22
* widget.tcl (Widget::configure) Bug: ProgressDlg option -geometry not setable. The former patch was improved. Koen Danckaert and myself argued, that we modify symptoms without basic understandings. Anyway, better now than before. check-in: 3764a95a26 user: oehhar tags: trunk
2009-07-01
14:41
* mainframe.tcl, MainFrame.html (MainFrame::getmenustate) Added method getmenustate to return menu tag state [Bug 948063] reported by Rolf Ade

* combobox.tcl (ComboBox::configure) Bug fixed: Widget did not take focus, when -editable false and "configure -state normal" called. [Bug 756334] reported by Rolf Ade

* widget.tcl (Widget::configure) Bug: ProgressDlg option -bg not setable. The special handling of subwidgets with special class or path ":cmd" was improved. [Bug 611477]

* notebook.tcl (NoteBook::_itemconfigure) Not honored option: itemconfigure ... -helptext [Patch 2814050] by Koen Danckaert check-in: f39181862b user: oehhar tags: trunk

2009-06-30
16:17
* buttonbox.tcl (ButtonBox::_redraw) Bug corrected: -uniform gridding option is used if tcl version >= 8.4 (not 8.3). [Patch 2807147] by Koen Danckaert

* tree.tcl (Tree::_drop_cmd) If there is no node, drop didn't work. [Bug 1042613] reported by Rolf Ade

* Tree.html Bind commands: removed promise that %W would work in future. The underlying widgets should only be manipulated using the node id. [Bug 1224203] by Jasper Taylor, remarks by J. Tang

* Tree.html Bind commands: with -selectfill, the given command is overwritten for the background box. [Bug 1003962] by Torsten Berg

* dropsite.tcl (DropSite::register) Bug fixed: fails on multiple drop targets [Bug 1213123] by T.Neil

* combobox.tcl (ComboBox::_create_popup) Bug fixed: Return key in drop down list when -bwlistbox true [Bug 1205536] patch by Steve Landers

* combobox.tcl (ComboBox::_create_popup, ComboBox::_unmapliste) Mac aqua and x11 fixes, multi screen issue still open. [Bug 1451784] report by Jasper Taylor, fix by Kevin Walzer

* listbox.tcl (ListBox::_multiple_select) Selected item not deselected on control-click [Bug 1029144] reported by Konrad Rosenbaum check-in: d4234674be user: oehhar tags: trunk

Changes
Unified Diff Ignore Whitespace Patch
Changes to BWman/MainFrame.html.
242
243
244
245
246
247
248







249
250
251
252
253
254
255
256
257
258
259
260
261
262

263
264
265
266
267
268
269
Returns the pathname of the <I>index</I>th added indicator.
</DD></DL>
<DL><DT><A NAME="getmenu"><I>pathName</I> <B>getmenu</B></A>
 <I>menuid</I>
</DT><DD>

Returns the pathname of the menu whose id is <I>menuid</I>.







</DD></DL>
<DL><DT><A NAME="gettoolbar"><I>pathName</I> <B>gettoolbar</B></A>
 <I>index</I>
</DT><DD>

Returns the pathname of the <I>index</I>th added toolbar.
</DD></DL>
<DL><DT><A NAME="setmenustate"><I>pathName</I> <B>setmenustate</B></A>
 <I>tag</I>
 <I>state</I>
</DT><DD>

Set the <B>-state</B> option value of all the menu entries that have the tag <I>tag</I>
to <I>state</I>.


</DD></DL>
<DL><DT><A NAME="showstatusbar"><I>pathName</I> <B>showstatusbar</B></A>
 <I>name</I>
</DT><DD>

<I>name</I> is one of <B>none</B>, <B>status</B> or <B>progression</B>.







>
>
>
>
>
>
>














>







242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
Returns the pathname of the <I>index</I>th added indicator.
</DD></DL>
<DL><DT><A NAME="getmenu"><I>pathName</I> <B>getmenu</B></A>
 <I>menuid</I>
</DT><DD>

Returns the pathname of the menu whose id is <I>menuid</I>.
</DD></DL>
<DL><DT><A NAME="getmenustate"><I>pathName</I> <B>getmenustate</B></A>
 <I>tag</I>
 <I>state</I>
</DT><DD>

Returns the state of the given menu <I>tag</I>.
</DD></DL>
<DL><DT><A NAME="gettoolbar"><I>pathName</I> <B>gettoolbar</B></A>
 <I>index</I>
</DT><DD>

Returns the pathname of the <I>index</I>th added toolbar.
</DD></DL>
<DL><DT><A NAME="setmenustate"><I>pathName</I> <B>setmenustate</B></A>
 <I>tag</I>
 <I>state</I>
</DT><DD>

Set the <B>-state</B> option value of all the menu entries that have the tag <I>tag</I>
to <I>state</I>.
A menu entry is disabled, if one of its associated tags have state <B>disabled</B>.

</DD></DL>
<DL><DT><A NAME="showstatusbar"><I>pathName</I> <B>showstatusbar</B></A>
 <I>name</I>
</DT><DD>

<I>name</I> is one of <B>none</B>, <B>status</B> or <B>progression</B>.
Changes to ChangeLog.

















1
2
3
4
5
6
7

















2009-06-30 Harald Oehlmann  <[email protected]>

	* buttonbox.tcl (ButtonBox::_redraw) Bug corrected:
	-uniform gridding option is used if tcl version >= 8.4 (not 8.3).
	[Patch 2807147] by Koen Danckaert

	* tree.tcl (Tree::_drop_cmd) If there is no node, drop didn't work.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2009-07-01 Harald Oehlmann  <[email protected]>

	* mainframe.tcl, MainFrame.html (MainFrame::getmenustate)
	Added method getmenustate to return menu tag state
	[Bug 948063] reported by Rolf Ade

	* combobox.tcl (ComboBox::configure) Bug fixed: Widget did not take
	focus, when -editable false and "configure -state normal" called.
	[Bug 756334] reported by Rolf Ade
	
	* widget.tcl (Widget::configure) Bug: ProgressDlg option -bg not
	setable. The special handling of subwidgets with special class or
	path ":cmd" was improved. [Bug 611477]
	
	* notebook.tcl (NoteBook::_itemconfigure) Not honored option:
	itemconfigure ... -helptext [Patch 2814050] by Koen Danckaert
	
2009-06-30 Harald Oehlmann  <[email protected]>

	* buttonbox.tcl (ButtonBox::_redraw) Bug corrected:
	-uniform gridding option is used if tcl version >= 8.4 (not 8.3).
	[Patch 2807147] by Koen Danckaert

	* tree.tcl (Tree::_drop_cmd) If there is no node, drop didn't work.
Changes to combobox.tcl.
1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  combobox.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: combobox.tcl,v 1.40 2009/06/30 16:17:37 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - ComboBox::create
#     - ComboBox::configure
#     - ComboBox::cget
#     - ComboBox::setvalue
#     - ComboBox::getvalue



|







1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  combobox.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: combobox.tcl,v 1.41 2009/07/01 14:41:30 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - ComboBox::create
#     - ComboBox::configure
#     - ComboBox::cget
#     - ComboBox::setvalue
#     - ComboBox::getvalue
267
268
269
270
271
272
273







274
275
276
277
278
279
280
		::bind $entry <Tab> "[list ComboBox::_expand $path]; break"
	    } elseif {[string equal "auto" $expand]} {
		# Expand entry value anytime (from -values)
		#::bind $entry <Key> "[list ComboBox::_expand $path]; break"
	    }
	}
    }








    # if the dropdown listbox is shown, simply force the actual entry
    #  colors into it. If it is not shown, the next time the dropdown
    #  is shown it'll get the actual colors anyway
    if {[winfo exists $path.shell.listb]} {
	$path.shell.listb configure \
		-bg [Widget::cget $path -entrybg] \







>
>
>
>
>
>
>







267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
		::bind $entry <Tab> "[list ComboBox::_expand $path]; break"
	    } elseif {[string equal "auto" $expand]} {
		# Expand entry value anytime (from -values)
		#::bind $entry <Key> "[list ComboBox::_expand $path]; break"
	    }
	}
    }

    # if state changed to normal and -editable false, the edit must take focus
    if {    [Widget::hasChangedX $path -state] \
        && ![string equal [Widget::cget $path -state] "disabled"] \
        && ![Widget::cget $path -editable] } {
        Entry::configure $entry -takefocus 1
    }

    # if the dropdown listbox is shown, simply force the actual entry
    #  colors into it. If it is not shown, the next time the dropdown
    #  is shown it'll get the actual colors anyway
    if {[winfo exists $path.shell.listb]} {
	$path.shell.listb configure \
		-bg [Widget::cget $path -entrybg] \
Changes to dynhelp.tcl.
1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  dynhelp.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: dynhelp.tcl,v 1.17 2009/06/26 14:46:05 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - DynamicHelp::configure
#     - DynamicHelp::include
#     - DynamicHelp::sethelp
#     - DynamicHelp::register
#     - DynamicHelp::_motion_balloon



|







1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  dynhelp.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: dynhelp.tcl,v 1.18 2009/07/01 14:41:30 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - DynamicHelp::configure
#     - DynamicHelp::include
#     - DynamicHelp::sethelp
#     - DynamicHelp::register
#     - DynamicHelp::_motion_balloon
534
535
536
537
538
539
540


541
542
543
544
545
546
547
            set _id ""
        }
        if { $type == "motion" } {
            if { ![winfo exists $_top] } {
                set cmd [list DynamicHelp::_show_help $path $w $x $y]
                set _id [after $_delay $cmd]
            }


        } else {
            destroy $_top
            set _current_balloon ""
        }
    }
}








>
>







534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
            set _id ""
        }
        if { $type == "motion" } {
            if { ![winfo exists $_top] } {
                set cmd [list DynamicHelp::_show_help $path $w $x $y]
                set _id [after $_delay $cmd]
            }
            # Bug 923942 proposes to destroy on motion to remove dynhelp on motion.
            # this might be an optional behaviour in future versions
        } else {
            destroy $_top
            set _current_balloon ""
        }
    }
}

Changes to mainframe.tcl.
1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  mainframe.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: mainframe.tcl,v 1.23 2006/03/24 22:19:57 dev_null42a Exp $
# ------------------------------------------------------------------------------
#  Index of commands:
#     - MainFrame::create
#     - MainFrame::configure
#     - MainFrame::cget
#     - MainFrame::getframe
#     - MainFrame::addtoolbar



|







1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  mainframe.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: mainframe.tcl,v 1.24 2009/07/01 14:41:30 oehhar Exp $
# ------------------------------------------------------------------------------
#  Index of commands:
#     - MainFrame::create
#     - MainFrame::configure
#     - MainFrame::cget
#     - MainFrame::getframe
#     - MainFrame::addtoolbar
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416

# -----------------------------------------------------------------------------
#  Command MainFrame::setmenustate
# -----------------------------------------------------------------------------
proc MainFrame::setmenustate { path tag state } {
    variable _widget

    #    if { [info exists _widget($path,tags,$tag)] } {
    #        foreach {menu entry} $_widget($path,tags,$tag) {
    #            $menu entryconfigure $entry -state $state
    #        }
    #    }

    # We need a more sophisticated state system.
    # The original model was this:  each menu item has a list of tags;
    # whenever any one of those tags changed state, the menu item did too.
    # This makes it hard to have items that are enabled only when both tagA and
    # tagB are.  The new model therefore only sets the menustate to enabled
    # when ALL of its tags are enabled.

    # First see if this is a real tag
    if { [info exists _widget($path,tagstate,$tag)] } {
	if { ![string equal $state "disabled"] } {
	    set _widget($path,tagstate,$tag) 1
	} else {
	    set _widget($path,tagstate,$tag) 0







<
<
<
<
<
<
<
<
<
<
<
|







391
392
393
394
395
396
397











398
399
400
401
402
403
404
405

# -----------------------------------------------------------------------------
#  Command MainFrame::setmenustate
# -----------------------------------------------------------------------------
proc MainFrame::setmenustate { path tag state } {
    variable _widget












    # Set menustate to enabled when ALL of its tags are enabled.

    # First see if this is a real tag
    if { [info exists _widget($path,tagstate,$tag)] } {
	if { ![string equal $state "disabled"] } {
	    set _widget($path,tagstate,$tag) 1
	} else {
	    set _widget($path,tagstate,$tag) 0
427
428
429
430
431
432
433












434
435
436
437
438
439
440
	    }
	    $menu entryconfigure $entry -state $state
	}
    }
    return
}














# -----------------------------------------------------------------------------
#  Command MainFrame::menuonly
# ----------------------d------------------------------------------------------
proc MainFrame::menuonly { path } {
    variable _widget








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







416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
	    }
	    $menu entryconfigure $entry -state $state
	}
    }
    return
}

# -----------------------------------------------------------------------------
#  Command MainFrame::getmenustate
# -----------------------------------------------------------------------------
proc MainFrame::getmenustate { path tag } {
    variable _widget

    if {$_widget($path,tagstate,$tag)} {
        return normal
    } else {
        return disabled
    }
}

# -----------------------------------------------------------------------------
#  Command MainFrame::menuonly
# ----------------------d------------------------------------------------------
proc MainFrame::menuonly { path } {
    variable _widget

Changes to notebook.tcl.
1
2
3
4
5
6
7
8
9
10
11
# ---------------------------------------------------------------------------
#  notebook.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: notebook.tcl,v 1.24 2009/06/26 15:22:09 oehhar Exp $
# ---------------------------------------------------------------------------
#  Index of commands:
#     - NoteBook::create
#     - NoteBook::configure
#     - NoteBook::cget
#     - NoteBook::compute_size
#     - NoteBook::insert



|







1
2
3
4
5
6
7
8
9
10
11
# ---------------------------------------------------------------------------
#  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
500
501
502
503
504
505
506

507
508
509
510
511
512
513
        _compute_height $path
        _compute_width  $path
    }
    if { [Widget::hasChanged $path.f$page -state state] &&
         $state == "disabled" && $data(select) == $page } {
        set data(select) ""
    }

    return $res
}


# ---------------------------------------------------------------------------
#  Command NoteBook::_compute_width
# ---------------------------------------------------------------------------







>







500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
        _compute_height $path
        _compute_width  $path
    }
    if { [Widget::hasChanged $path.f$page -state state] &&
         $state == "disabled" && $data(select) == $page } {
        set data(select) ""
    }
    _set_help $path $page
    return $res
}


# ---------------------------------------------------------------------------
#  Command NoteBook::_compute_width
# ---------------------------------------------------------------------------
Changes to widget.tcl.
1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  widget.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: widget.tcl,v 1.33 2009/06/29 16:34:19 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - Widget::tkinclude
#     - Widget::bwinclude
#     - Widget::declare
#     - Widget::addmap
#     - Widget::init



|







1
2
3
4
5
6
7
8
9
10
11
# ----------------------------------------------------------------------------
#  widget.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: widget.tcl,v 1.34 2009/07/01 14:41:30 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - Widget::tkinclude
#     - Widget::bwinclude
#     - Widget::declare
#     - Widget::addmap
#     - Widget::init
812
813
814
815
816
817
818





819


820
821
822
823
824
825
826
827
828
829
830
            set type    [lindex $optdesc 0]
        }
        if { ![lindex $optdesc 2] } {
            set newval [$_optiontype($type) $option $value [lindex $optdesc 3]]
            if { [info exists classmap($option)] } {
		set window [_get_window $class $window]
                foreach {subpath subclass realopt} $classmap($option) {





                    if { [string length $subclass] } {


			set curval [${subclass}::cget $window$subpath $realopt]
                        ${subclass}::configure $window$subpath $realopt $newval
                    } else {
			set curval [$window$subpath cget $realopt]
                        $window$subpath configure $realopt $newval
                    }
                }
            } else {
		set curval $pathopt($option)
		set pathopt($option) $newval
	    }







>
>
>
>
>
|
>
>
|


|







812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
            set type    [lindex $optdesc 0]
        }
        if { ![lindex $optdesc 2] } {
            set newval [$_optiontype($type) $option $value [lindex $optdesc 3]]
            if { [info exists classmap($option)] } {
		set window [_get_window $class $window]
                foreach {subpath subclass realopt} $classmap($option) {
                    # Interpretation of special pointers:
                    # * subclass == ":cmd" : call window.subpath
                    # * subclass == ""     : call window.subpath
                    # * subpath  == ":cmd" : call one widget up: window:cmd
                    # * else               : call in subclass: window.subpath
                    if {         [string length $subclass] \
                            && ! [string equal  $subclass ":cmd"] \
                            && ! [string equal  $subpath  ":cmd"] } {
                        set curval [${subclass}::cget $window$subpath $realopt]
                        ${subclass}::configure $window$subpath $realopt $newval
                    } else {
                        set curval [$window$subpath cget $realopt]
                        $window$subpath configure $realopt $newval
                    }
                }
            } else {
		set curval $pathopt($option)
		set pathopt($option) $newval
	    }