Bwidget Source Code
Check-in [ae5fed8a0f]
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:* ScrolledWindow.html ScrolledWindow documentation changed: Documented options: -ipad, -sides, -size, -managed [Patch 2807160] Text by Koen Danckaert Removed (read only) remark of option -scrollbar.

* scrollframe.tcl (ScrollableFrame::create) changed bindings [Patch 2807227] by Koen Danckaert (comment)

* scrollw.tcl (ScrolledWindow::_set_hscroll, ScrolledWindow::_set_vscroll) Bug corrected: enless loop when both scrollbars where automatically mapped and the window size was changed by this action (on linux). Scrollbar unmapping and mapping secured by a locked update [Bug 2783019]

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ae5fed8a0f475d83be367961785d56d9be19e7b9
User & Date: oehhar 2009-06-29 13:28:24
Context
2009-06-29
15:53
* widget.tcl (Widget::tkinclude) : option data base entry name keeps the original name and not the renamed name. The only resulting modification is to rename the option key for "MessageDlg -text" from "*MessageDlg.frame.msg.message" to "*MessageDlg.frame.msg.text". [Bug 1266792] check-in: 23042e15ee user: oehhar tags: trunk
13:28
* ScrolledWindow.html ScrolledWindow documentation changed: Documented options: -ipad, -sides, -size, -managed [Patch 2807160] Text by Koen Danckaert Removed (read only) remark of option -scrollbar.

* scrollframe.tcl (ScrollableFrame::create) changed bindings [Patch 2807227] by Koen Danckaert (comment)

* scrollw.tcl (ScrolledWindow::_set_hscroll, ScrolledWindow::_set_vscroll) Bug corrected: enless loop when both scrollbars where automatically mapped and the window size was changed by this action (on linux). Scrollbar unmapping and mapping secured by a locked update [Bug 2783019] check-in: ae5fed8a0f user: oehhar tags: trunk

2009-06-26
15:22
* notebook.tcl (NoteBook::delete) Deleted also state variables [Bug 1445219] reported by Eric Kemp-Benedict check-in: 886bbcdfee user: oehhar tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to BWman/ScrolledWindow.html.

21
22
23
24
25
26
27


28


29
30
31
32
33
34
35
..
56
57
58
59
60
61
62
63
64






65
66








67
68
69
70
71














72
73
74
75
76
77
78
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wso">WIDGET-SPECIFIC OPTIONS</A></I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-auto">-auto</A></TR>


<TD>&nbsp;&nbsp;<A HREF="#-scrollbar">-scrollbar</A></TR>


</TR>
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wc">WIDGET COMMAND</A></I></DT>
<DD><I>pathName</I> <A HREF="#cget"><B>cget</B></A>
 <I>option</I>
................................................................................
<DL><DT><A NAME="-auto"><B>-auto</B></A></DT>
<DD>

Specifies the desired auto managed scrollbar:
<LI><B>none</B> means scrollbar are always drawn
<LI><B>horizontal</B> means horizontal scrollbar is drawn as needed
<LI><B>vertical</B> means vertical scrollbar is drawn as needed
<LI><B>both</B> means horizontal and vertical scrollbars are drawn as needed
<LI><B>horizontal</B> means horizontal scrollbar is drawn as needed






</DD>
</DL>








<DL><DT><A NAME="-scrollbar"><B>-scrollbar (read-only)</B></A></DT>
<DD>

Specifies the desired scrollbar: <B>none</B>, <B>horizontal</B>, <B>vertical</B>
or <B>both</B>. This option is not modifiable with <B>ScrolledWindow::configure</B>.














</DD>
</DL>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">WIDGET COMMAND</A></B><BR>
<DL><DT><A NAME="cget"><I>pathName</I> <B>cget</B></A>
 <I>option</I>
</DT><DD>






>
>

>
>







 







|
|
>
>
>
>
>
>


>
>
>
>
>
>
>
>
|



|
>
>
>
>
>
>
>
>
>
>
>
>
>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wso">WIDGET-SPECIFIC OPTIONS</A></I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-auto">-auto</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-ipad">-ipad</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-managed">-managed</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-scrollbar">-scrollbar</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-sides">-sides</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-size">-size</A></TR>
</TR>
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wc">WIDGET COMMAND</A></I></DT>
<DD><I>pathName</I> <A HREF="#cget"><B>cget</B></A>
 <I>option</I>
................................................................................
<DL><DT><A NAME="-auto"><B>-auto</B></A></DT>
<DD>

Specifies the desired auto managed scrollbar:
<LI><B>none</B> means scrollbar are always drawn
<LI><B>horizontal</B> means horizontal scrollbar is drawn as needed
<LI><B>vertical</B> means vertical scrollbar is drawn as needed
<LI><B>both</B> means horizontal and vertical scrollbars are drawn as needed (default value)
</DD>
</DL>
<DL><DT><A NAME="-ipad"><B>-ipad (read-only)</B></A></DT>
<DD>

Padding in pixels between client widget and scrollbars.
Default value: <B>1</B>.
</DD>
</DL>
<DL><DT><A NAME="-managed"><B>-managed (read-only)</B></A></DT>
<DD>

If true, scrollbar are managed during creation, so their size are included in the requested size of the
ScrolledWindow. If false, they are not.
Default value: <B>true</B>.
</DD>
</DL>
<DL><DT><A NAME="-scrollbar"><B>-scrollbar</B></A></DT>
<DD>

Specifies the desired scrollbar: <B>none</B>, <B>horizontal</B>, <B>vertical</B>
or <B>both</B> (default value).
</DD>
</DL>
<DL><DT><A NAME="-sides"><B>-sides (read-only)</B></A></DT>
<DD>

Side of the scrollbars.
Possible values are: <B>ne</B>, <B>en</B>, <B>nw</B>, <B>wn</B>, <B>se</B> (default value), <B>es</B>, <B>sw</B>, <B>ws</B>.
</DD>
</DL>
<DL><DT><A NAME="-size"><B>-size (read-only)</B></A></DT>
<DD>

Size of the scrollbars in pixels.
Use </B>0</B> for standard size (default value).
</DD>
</DL>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">WIDGET COMMAND</A></B><BR>
<DL><DT><A NAME="cget"><I>pathName</I> <B>cget</B></A>
 <I>option</I>
</DT><DD>

Changes to ChangeLog.
















1
2
3
4
5
6
7














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

	* listbox.tcl (ListBox::create et al) new feature: listbox option
	-listbox now read/write [Bug 1501874] reported by Stephen Huntley
	
	* dynhelp.tcl (DynamicHelp::_show_help) fixed issue (as far as possible):
	Dynamic help baloon was on the main screen, if it touched the border on
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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

	* ScrolledWindow.html ScrolledWindow documentation changed:
	Documented options: -ipad, -sides, -size, -managed
	[Patch 2807160] Text by Koen Danckaert
	Removed (read only) remark of option -scrollbar.
	
	* scrollframe.tcl (ScrollableFrame::create) changed bindings
	[Patch 2807227] by Koen Danckaert (comment)
	
	* scrollw.tcl (ScrolledWindow::_set_hscroll, ScrolledWindow::_set_vscroll)
	Bug corrected: enless loop when both scrollbars where automatically
	mapped and the window size was changed by this action (on linux).
	Scrollbar unmapping and mapping secured by a locked update [Bug 2783019]
	
2009-06-26 Harald Oehlmann  <[email protected]>

	* listbox.tcl (ListBox::create et al) new feature: listbox option
	-listbox now read/write [Bug 1501874] reported by Stephen Huntley
	
	* dynhelp.tcl (DynamicHelp::_show_help) fixed issue (as far as possible):
	Dynamic help baloon was on the main screen, if it touched the border on

Changes to scrollframe.tcl.

1
2
3
4
5
6
7
8
9
10
11
..
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
...
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# ----------------------------------------------------------------------------
#  scrollframe.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: scrollframe.tcl,v 1.9 2009/06/24 12:13:04 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - ScrollableFrame::create
#     - ScrollableFrame::configure
#     - ScrollableFrame::cget
#     - ScrollableFrame::getframe
#     - ScrollableFrame::see
................................................................................
		       -highlightthickness 0 -borderwidth 0 -relief flat]
    }

    $canvas create window 0 0 -anchor nw -window $frame -tags win \
        -width  [Widget::cget $path -areawidth] \
        -height [Widget::cget $path -areaheight]

    # scollregion must also be reset when canvas size changes!
    bind $canvas <Configure> \
        [list ScrollableFrame::_frameConfigure $canvas]
    bind $frame <Configure> \
        [list ScrollableFrame::_frameConfigure $canvas]
    bind $frame <Expose> \
        [list ScrollableFrame::_frameConfigure $canvas]
    # add <unmap> binding: <configure> is not called when frame
    # becomes so small that it suddenly falls outside of currently visible area.
    # but now we need to add a <map> binding too
    bind $frame <Map> \
        [list ScrollableFrame::_frameConfigure $canvas]
    bind $frame <Unmap> \
................................................................................
    # This ensures that we don't get funny scrollability in the frame
    # when it is smaller than the canvas space
    # when it is smaller than the canvas space.
    # use [winfo] to get height & width of frame

    # [winfo] doesn't work for unmapped frame
    set frameh [expr {$unmap ? 0 : [winfo height $canvas.frame]}]
    set framew [expr {$unmap ? 0 : [winfo width $canvas.frame]}]

    set height [_max $frameh [winfo height $canvas]]
    set width [_max $framew [winfo width $canvas]]

    $canvas:cmd configure -scrollregion [list 0 0 $width $height]
}


|







 







<
<
<

<
<







 







|
|
|
|



1
2
3
4
5
6
7
8
9
10
11
..
64
65
66
67
68
69
70



71


72
73
74
75
76
77
78
...
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# ----------------------------------------------------------------------------
#  scrollframe.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: scrollframe.tcl,v 1.10 2009/06/29 13:28:24 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - ScrollableFrame::create
#     - ScrollableFrame::configure
#     - ScrollableFrame::cget
#     - ScrollableFrame::getframe
#     - ScrollableFrame::see
................................................................................
		       -highlightthickness 0 -borderwidth 0 -relief flat]
    }

    $canvas create window 0 0 -anchor nw -window $frame -tags win \
        -width  [Widget::cget $path -areawidth] \
        -height [Widget::cget $path -areaheight]




    bind $frame <Configure> \


        [list ScrollableFrame::_frameConfigure $canvas]
    # add <unmap> binding: <configure> is not called when frame
    # becomes so small that it suddenly falls outside of currently visible area.
    # but now we need to add a <map> binding too
    bind $frame <Map> \
        [list ScrollableFrame::_frameConfigure $canvas]
    bind $frame <Unmap> \
................................................................................
    # This ensures that we don't get funny scrollability in the frame
    # when it is smaller than the canvas space
    # when it is smaller than the canvas space.
    # use [winfo] to get height & width of frame

    # [winfo] doesn't work for unmapped frame
    set frameh [expr {$unmap ? 0 : [winfo height $canvas.frame]}]
    set framew [expr {$unmap ? 0 : [winfo width  $canvas.frame]}]

    set height [_max $frameh [winfo height $canvas]]
    set width  [_max $framew [winfo width  $canvas]]

    $canvas:cmd configure -scrollregion [list 0 0 $width $height]
}

Changes to scrollw.tcl.

1
2
3
4
5
6
7
8
9
10
11
...
194
195
196
197
198
199
200
201
202
203
204
205
206



207
208
209
210
211
212
213
...
221
222
223
224
225
226
227
228
229
230
231
232
233



234
235
236
237
238
239
240
# -----------------------------------------------------------------------------
#  scrollw.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: scrollw.tcl,v 1.12 2006/08/21 20:54:14 dev_null42a Exp $
# -----------------------------------------------------------------------------
#  Index of commands:
#     - ScrolledWindow::create
#     - ScrolledWindow::getframe
#     - ScrolledWindow::setwidget
#     - ScrolledWindow::configure
#     - ScrolledWindow::cget
................................................................................
# -----------------------------------------------------------------------------
#  Command ScrolledWindow::_set_hscroll
# -----------------------------------------------------------------------------
proc ScrolledWindow::_set_hscroll { path vmin vmax } {
    Widget::getVariable $path data

    if {$data(realized) && $data(hsb,present)} {
	if {$data(hsb,auto)} {
	    if {$data(hsb,packed) && $vmin == 0 && $vmax == 1} {
		if {![info exists data(hlock)]} {
		    set data(hsb,packed) 0
		    grid remove $path.hscroll
		}



	    } elseif {!$data(hsb,packed) && ($vmin != 0 || $vmax != 1)} {
		set data(hsb,packed) 1
		grid $path.hscroll -column 1 -row $data(hsb,row) \
			-sticky ew -ipady $data(ipad)
		set data(hlock) 1
		update idletasks
		unset data(hlock)
................................................................................
# -----------------------------------------------------------------------------
#  Command ScrolledWindow::_set_vscroll
# -----------------------------------------------------------------------------
proc ScrolledWindow::_set_vscroll { path vmin vmax } {
    Widget::getVariable $path data

    if {$data(realized) && $data(vsb,present)} {
	if {$data(vsb,auto)} {
	    if {$data(vsb,packed) && $vmin == 0 && $vmax == 1} {
		if {![info exists data(vlock)]} {
		    set data(vsb,packed) 0
		    grid remove $path.vscroll
		}



	    } elseif {!$data(vsb,packed) && ($vmin != 0 || $vmax != 1) } {
		set data(vsb,packed) 1
		grid $path.vscroll -column $data(vsb,column) -row 1 \
			-sticky ns -ipadx $data(ipad)
		set data(vlock) 1
		update idletasks
		unset data(vlock)


|







 







|

<
|
|
<
>
>
>







 







|

<
|
|
<
>
>
>







1
2
3
4
5
6
7
8
9
10
11
...
194
195
196
197
198
199
200
201
202

203
204

205
206
207
208
209
210
211
212
213
214
...
222
223
224
225
226
227
228
229
230

231
232

233
234
235
236
237
238
239
240
241
242
# -----------------------------------------------------------------------------
#  scrollw.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: scrollw.tcl,v 1.13 2009/06/29 13:28:24 oehhar Exp $
# -----------------------------------------------------------------------------
#  Index of commands:
#     - ScrolledWindow::create
#     - ScrolledWindow::getframe
#     - ScrolledWindow::setwidget
#     - ScrolledWindow::configure
#     - ScrolledWindow::cget
................................................................................
# -----------------------------------------------------------------------------
#  Command ScrolledWindow::_set_hscroll
# -----------------------------------------------------------------------------
proc ScrolledWindow::_set_hscroll { path vmin vmax } {
    Widget::getVariable $path data

    if {$data(realized) && $data(hsb,present)} {
	if {$data(hsb,auto) && ![info exists data(hlock)]} {
	    if {$data(hsb,packed) && $vmin == 0 && $vmax == 1} {

		set data(hsb,packed) 0
		grid remove $path.hscroll

		set data(hlock) 1
		update idletasks
		unset data(hlock)
	    } elseif {!$data(hsb,packed) && ($vmin != 0 || $vmax != 1)} {
		set data(hsb,packed) 1
		grid $path.hscroll -column 1 -row $data(hsb,row) \
			-sticky ew -ipady $data(ipad)
		set data(hlock) 1
		update idletasks
		unset data(hlock)
................................................................................
# -----------------------------------------------------------------------------
#  Command ScrolledWindow::_set_vscroll
# -----------------------------------------------------------------------------
proc ScrolledWindow::_set_vscroll { path vmin vmax } {
    Widget::getVariable $path data

    if {$data(realized) && $data(vsb,present)} {
	if {$data(vsb,auto) && ![info exists data(vlock)]} {
	    if {$data(vsb,packed) && $vmin == 0 && $vmax == 1} {

		set data(vsb,packed) 0
		grid remove $path.vscroll

		set data(vlock) 1
		update idletasks
		unset data(vlock)
	    } elseif {!$data(vsb,packed) && ($vmin != 0 || $vmax != 1) } {
		set data(vsb,packed) 1
		grid $path.vscroll -column $data(vsb,column) -row 1 \
			-sticky ns -ipadx $data(ipad)
		set data(vlock) 1
		update idletasks
		unset data(vlock)