Bwidget Source Code
Check-in [672bf13068]
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:* listbox.tcl(ListBox::_configureSelectmode) Drag modifies multiple selection [Bug 2995969] reported by Robert Karen. Bound events on ButtonRelease-1 instead Button-1 for multiple selections to avoid bug. * listbox.tcl(ListBox::_drag_and_drop) The default drag and drop routine only handled single drag and drop. It was extended to handle also drag and drop of multiple entries.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 672bf13068b9945db7b76524f5e2b53b9e75426c
User & Date: oehhar 2010-05-12 08:22:19
Context
2010-05-12
08:24
* listbox.tcl(ListBox::see) Method see shifts image out of view. Showed up, by a selection click on a long item with icon [Bug 2999764] reported by Robert Karen. check-in: 17f103959e user: oehhar tags: trunk
08:22
* listbox.tcl(ListBox::_configureSelectmode) Drag modifies multiple selection [Bug 2995969] reported by Robert Karen. Bound events on ButtonRelease-1 instead Button-1 for multiple selections to avoid bug. * listbox.tcl(ListBox::_drag_and_drop) The default drag and drop routine only handled single drag and drop. It was extended to handle also drag and drop of multiple entries. check-in: 672bf13068 user: oehhar tags: trunk
2009-11-01
20:46
*** bug fixed - related to ttk behaviour # without this function, an error occures # when operating under tile control proc Button::instate { path args } { return [expr { [$path cget -state] == "normal" ? 1 : 0}] } check-in: f64f8938dc user: oberdorfer tags: trunk, tcllib-1-12
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1
2
3
4
5
6










7
8
9
10
11
12
13
# ------------------------------------------------------------------------------
#  ChangeLog
#  This file is part of Unifix BWidget Toolkit
#  $Id: ChangeLog,v 1.214 2009/09/11 16:04:49 oberdorfer Exp $
# ------------------------------------------------------------------------------











2009-09-11 Johann Oberdorfer  <[email protected]>

        * button.tcl, "BWSlim.Toolbutton" style related change to ensure that
	  a button created with "-style BWSlim.Toolbutton" keeps it's layout	  

2009-09-10 Johann Oberdorfer  <[email protected]>



|


>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# ------------------------------------------------------------------------------
#  ChangeLog
#  This file is part of Unifix BWidget Toolkit
#  $Id: ChangeLog,v 1.215 2010/05/12 08:22:19 oehhar Exp $
# ------------------------------------------------------------------------------

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

	* listbox.tcl(ListBox::_configureSelectmode) Drag modifies
	multiple selection [Bug 2995969] reported by Robert Karen.
	Bound events on ButtonRelease-1 instead Button-1 for multiple
	selections to avoid bug.
	* listbox.tcl(ListBox::_drag_and_drop) The default drag and drop
	routine only handled single drag and drop.
	It was extended to handle also drag and drop of multiple entries.

2009-09-11 Johann Oberdorfer  <[email protected]>

        * button.tcl, "BWSlim.Toolbutton" style related change to ensure that
	  a button created with "-style BWSlim.Toolbutton" keeps it's layout	  

2009-09-10 Johann Oberdorfer  <[email protected]>

Changes to listbox.tcl.

1
2
3
4
5
6
7
8
9
10
11
...
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
....
1672
1673
1674
1675
1676
1677
1678
1679






1680









1681
1682
1683

1684
1685



1686
1687
1688
1689
1690
1691
1692
# ----------------------------------------------------------------------------
#  listbox.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: listbox.tcl,v 1.30 2009/09/06 21:21:35 oberdorfer Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - ListBox::create
#     - ListBox::configure
#     - ListBox::cget
#     - ListBox::insert
#     - ListBox::itemconfigure
................................................................................
    # clear current binding
    switch -exact -- $previous {
        single {
            $path bindText  <Button-1> ""
            $path bindImage <Button-1> ""
        }
        multiple {
            $path bindText <Button-1>          ""
            $path bindText <Shift-Button-1>    ""
            $path bindText <Control-Button-1>  ""

            $path bindImage <Button-1>         ""
            $path bindImage <Shift-Button-1>   ""
            $path bindImage <Control-Button-1> ""
        }
    }
    # set new bindings
    switch -exact -- $selectmode {
        single {
            $path bindText  <Button-1> [list ListBox::_mouse_select $path set]
            $path bindImage <Button-1> [list ListBox::_mouse_select $path set]
            if {1 < [llength [ListBox::selection $path get]]} {
                ListBox::selection $path clear
            }
        }
        multiple {
            set cmd ListBox::_multiple_select
            $path bindText <Button-1>          [list $cmd $path n %x %y]
            $path bindText <Shift-Button-1>    [list $cmd $path s %x %y]
            $path bindText <Control-Button-1>  [list $cmd $path c %x %y]

            $path bindImage <Button-1>         [list $cmd $path n %x %y]
            $path bindImage <Shift-Button-1>   [list $cmd $path s %x %y]
            $path bindImage <Control-Button-1> [list $cmd $path c %x %y]
        }
        default {
            if {0 < [llength [ListBox::selection $path get]]} {
                ListBox::selection $path clear
            }
        }
    }
................................................................................
            set idx [$path index $i]
        }
        "widget" {
            set idx [llength $items]
        }
    }

    if {$idx > [$path index $startItem]} { incr idx -1 }
















    if {[string equal $operation "copy"]} {
        set options [Widget::options $path.$startItem]
        eval [linsert $options 0 $path insert $idx $startItem\#auto]

    } else {
        $path move $startItem $idx



    }
}


proc ListBox::_keyboard_navigation { path dir } {
    variable $path
    upvar 0  $path data


|







 







|
|
|

|
|
|













|
|
|

|
|
|







 







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







1
2
3
4
5
6
7
8
9
10
11
...
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
....
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
# ----------------------------------------------------------------------------
#  listbox.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: listbox.tcl,v 1.31 2010/05/12 08:22:19 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - ListBox::create
#     - ListBox::configure
#     - ListBox::cget
#     - ListBox::insert
#     - ListBox::itemconfigure
................................................................................
    # clear current binding
    switch -exact -- $previous {
        single {
            $path bindText  <Button-1> ""
            $path bindImage <Button-1> ""
        }
        multiple {
            $path bindText <ButtonRelease-1>          ""
            $path bindText <Shift-ButtonRelease-1>    ""
            $path bindText <Control-ButtonRelease-1>  ""

            $path bindImage <ButtonRelease-1>         ""
            $path bindImage <Shift-ButtonRelease-1>   ""
            $path bindImage <Control-ButtonRelease-1> ""
        }
    }
    # set new bindings
    switch -exact -- $selectmode {
        single {
            $path bindText  <Button-1> [list ListBox::_mouse_select $path set]
            $path bindImage <Button-1> [list ListBox::_mouse_select $path set]
            if {1 < [llength [ListBox::selection $path get]]} {
                ListBox::selection $path clear
            }
        }
        multiple {
            set cmd ListBox::_multiple_select
            $path bindText <ButtonRelease-1>          [list $cmd $path n %x %y]
            $path bindText <Shift-ButtonRelease-1>    [list $cmd $path s %x %y]
            $path bindText <Control-ButtonRelease-1>  [list $cmd $path c %x %y]

            $path bindImage <ButtonRelease-1>         [list $cmd $path n %x %y]
            $path bindImage <Shift-ButtonRelease-1>   [list $cmd $path s %x %y]
            $path bindImage <Control-ButtonRelease-1> [list $cmd $path c %x %y]
        }
        default {
            if {0 < [llength [ListBox::selection $path get]]} {
                ListBox::selection $path clear
            }
        }
    }
................................................................................
            set idx [$path index $i]
        }
        "widget" {
            set idx [llength $items]
        }
    }

    # Check if startItem is part of the current selection and process the
    # whole selection if so
    set selItems [selection $path get]
    if {-1 != [lsearch -exact $selItems $startItem]} {
        set dragItems $selItems
    } else {
        set dragItems [list $startItem]
    }

    # get drag indexes (to sort them)
	foreach dragItem $dragItems {
        lappend dragIdx [$path index $dragItem]
    }
    foreach pos [lsort -integer -indices $dragIdx] {
        set dragItem [lindex $dragItems $pos]
        set dragIdx [$path index $dragItem]
        if {$idx > $dragIdx} { incr idx -1 }
        if {[string equal $operation "copy"]} {
            set options [Widget::options $path.$dragItem]
            eval [linsert $options 0 $path insert $idx $dragItem\#auto]
            incr idx
        } else {
            $path move $dragItem $idx
            set idx [$path index $dragItem]
            incr idx
        }
    }
}


proc ListBox::_keyboard_navigation { path dir } {
    variable $path
    upvar 0  $path data