Changeset f738c05 in tol for tolbase


Ignore:
Timestamp:
Nov 24, 2016, 12:09:24 PM (10 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
0f71b65
Parents:
cc64b09
Message:

Refs #1933
Se revisa el widget blistboxplus.
Se eliminan las barras propias (ya están las de wtree).
Se elimina código antiguo comentado.

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7356 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/byswidget/blistboxplus/blistboxplus.tcl

    rcc64b09 rf738c05  
    5252# listbox -> el treeview que hace de listbox propiamente
    5353# menu -> el menu contextual del listbox
    54 # xbar -> horizontal scrollbar
    55 # ybar -> vertical scrollbar
    5654# afterTime -> tiempo desde que se pulso la ultima tecla
    5755# listKey -> lista de teclas pulsadas
    … …  
    7775  option -iniconfig ""
    7876 
    79   #@O treeview options
    80   option -exportselection false
     77  #@O! (treeview options) Se introducen para evitar errores
     78  option -exportselection false ;# unused
    8179  option -linewidth 1 ;# unused
    8280  option -selectbackground "unused"
    … …  
    8482  variable _listbox
    8583  variable menu
    86   variable xbar
    87   variable ybar
    8884 
    8985  variable afterTime 0
    … …  
    106102
    107103    if {1} {
    108       #@T install _listbox using ::blt::treeview $win.lb -hideroot yes \
    109           -activeicons "" -icons {} -selectmode multiple \
    110           -selectbackground grey -selectforeground white \
    111           -highlightthickness 0 -borderwidth 1 -selectborderwidth 1 \
    112           -nofocusselectbackground grey -font {Arial 9} -flat yes
    113104      install _listbox using ::wtree $win.lb -table 0 -filter no \
    114105        -background white -showroot 0 -selectmode extended -showheader 1 \
    … …  
    120111        -highlightbackground gray75 -highlightcolor black \
    121112        -highlightthickness 0 -font {Arial 9}]
    122       #@T set _listbox [::blt::treeview $win.lb -hideroot yes \
    123                         -activeicons "" -icons {} -selectmode multiple \
    124                         -selectbackground grey -selectforeground white \
    125                         -highlightthickness 0 -borderwidth 1 \
    126                         -selectborderwidth 1 \
    127                         -nofocusselectbackground grey -font {Arial 9} -flat yes]
    128113    }
    129114
    … …  
    131116
    132117    install menu using menu $win.m -tearoff 0
    133     #@!scroll install xbar using scrollbar $win.sbh -orient horizontal \
    134                                            -command "$win xview"
    135     #@!scroll install ybar using scrollbar $win.sbv -orient vertical \
    136                                            -command "$win yview"
    137118
    138119    #bindtags is modified to make possible to associate binds to self
    139     $_listbox configure -bindtags [list $self Blistboxplus]
    140 
    141     #@T! $_listbox style  configure text     -bg white
    142     #@T! to do
    143 
    144     #@T! $_listbox column configure treeView -bg white
    145     #@T! to do   
     120    $_listbox configure -bindtags [list $self Blistboxplus]
    146121
    147122    $self configure -readonly [from args -readonly]
    … …  
    150125    # Apply all arguments given:
    151126    $self configurelist $args
    152 
    153     #@T! $_listbox configure -xscrollcommand "$xbar set"
    154     #@T! $_listbox configure -yscrollcommand "$ybar set"
    155     #@T! to do   
     127   
    156128    if { $options(-parent) eq "" } {
    157129      $self configure -parent [winfo parent $win]
    158130    }
    159131   
    160     # bind
    161     #@!bind
    162     #@T! $_listbox bind all <KeyPress> +[list $self _OnKeyPress %A]
    163     #@T! to do   
     132    # bind 
    164133    bind $_listbox <KeyPress> +[list $self _OnKeyPress %A]
    165134   
    … …  
    169138    #pack
    170139    grid $_listbox -row 0 -column 0 -sticky news
    171     #@!scroll grid $ybar -row 0 -column 1 -sticky ns
    172     #@!scroll grid $xbar -row 1 -column 0 -sticky ew
    173140    grid columnconfigure $self 0 -weight 1
    174141    grid rowconfigure    $self 0 -weight 1
    175142
    176     #@!scroll ::autoscroll::autoscroll $ybar
    177     #@!scroll ::autoscroll::autoscroll $xbar
    178143    debug_msg "voy a pillarte: antes de _ReadIni"
    179144    $self _ReadIni
    … …  
    203168  onconfigure -cols { lst } {
    204169    set options(-cols) $lst
    205     #@T! foreach col [$self column names] {
    206     #@T!   $_listbox column delete $col
    207     #@T! }
     170
    208171    $_listbox column delete all
    209     #@T! foreach col $options(-cols) {
    210     #@T!   $_listbox column insert end $col -justify left
    211     #@T!   $_listbox column configure $col -command "$self _SortByColumn [list $col]" -titleborderwidth 1
    212     #@T! }
    213172   
    214173    set lstx [list [list image -label Icon -tags Icon] ]
    … …  
    218177      lappend lstx $colx
    219178    }
    220     #@! Tolcon_Trace "lstx $lstx"
    221179    $_listbox configure -columns $lstx
    222180   
    223181    if { $options(-icon) == "" } {
    224       #@T! $_listbox column configure "BLT TreeView $_listbox" -hide 1
    225182      $_listbox column configure Icon -visible 0
    226183    } else {
    227       #@T! $_listbox column configure "BLT TreeView $_listbox" -hide 0
    228184      $_listbox column configure Icon -visible 1
    229185    }
    230186   
    231     #@T adds
    232187    $_listbox column configure first -expand yes -weight 1
    233188    $_listbox column configure all -itembackground ""   
    … …  
    238193    foreach col [$self column names] {
    239194      if { "-1" eq [lsearch $options(-hiddencols) $col] } {
    240         #@T! $_listbox column configure $col -hide 0
    241195        $_listbox column configure $col -visible 1
    242196      } else {
    243         #@T! $_listbox column configure $col -hide 1
    244197        $_listbox column configure $col -visible 0
    245198      }
    … …  
    249202  onconfigure -showtitles { bool } {
    250203    set options(-showtitles) $bool
    251     #@O $_listbox configure -showtitles $bool
    252     $_listbox configure -showheader $bool   
    253     #@O! $_listbox show
     204    $_listbox configure -showheader $bool
    254205  }
    255206
    … …  
    257208    set options(-icon) $icon
    258209    if { $icon != "" } {
    259       #@T! $_listbox column configure "BLT TreeView $_listbox" -min 16 -max 16 \
    260       #@T!   -hide 0 -titleborderwidth 1
    261       #@T! $_listbox configure -icons [list [Bitmap::get $icon] [Bitmap::get $icon]]
    262210      $_listbox column configure Icon -minwidth 16 -maxwidth 16 -visible 1 ;# -titleborderwidth 1
    263211     
    264212    } else {
    265       #@T! $_listbox column configure "BLT TreeView $_listbox" -hide 1
    266213      $_listbox column configure Icon -visible 0
    267214    }
    … …  
    273220    set cols [$self column names]
    274221    foreach col $cols {
    275      #@O $self column configure $col -title [mc [lindex $titles $c] ]
    276222     $_listbox column configure $col -text [mc [lindex $titles $c] ]
    277223     incr c 1     
    … …  
    359305      }
    360306    } elseif { [lindex $args 1] eq "auto" } {
    361       #@O! Nothing to do ??
     307      #@O! Llamado desde barima. Hace falta hacer algo?
    362308      return
    363309    } else {
    … …  
    668614  #
    669615  #///////////////////////////////////////////////////////////////////////////
    670 
    671     #@O!
    672616    return [$_listbox SortbyColumn $_listbox $col]
    673  
    674     set numofel [$self size]
    675     set lst [list]
    676     set fulllst [$self get]
    677 
    678     foreach i $fulllst {
    679       lappend lst [$self get $i ]
    680     }
    681 # lst:    contains a list of values
    682     set coln 0
    683     set cols [$self cget -cols]
    684     set hidcols [$self cget -hiddencols]
    685     for { set j 0 } { $j < [llength $cols] } { incr j } {
    686       if {[lindex $cols $j] eq $col} {
    687         set coln $j
    688       }
    689     }
    690 # coln:   contains the index of the column to be ordered
    691     set lst [lsort -index $coln $lst]
    692     $self clear
    693     for { set i 0 } { $i < $numofel } { incr i } {
    694       set el [lindex $lst $i ]
    695       $self insert end $el
    696     }
    697 
    698617  }
    699618
Note: See TracChangeset for help on using the changeset viewer.