- Timestamp:
- Nov 24, 2016, 12:09:24 PM (10 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 0f71b65
- Parents:
- cc64b09
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/byswidget/blistboxplus/blistboxplus.tcl
rcc64b09 rf738c05 52 52 # listbox -> el treeview que hace de listbox propiamente 53 53 # menu -> el menu contextual del listbox 54 # xbar -> horizontal scrollbar55 # ybar -> vertical scrollbar56 54 # afterTime -> tiempo desde que se pulso la ultima tecla 57 55 # listKey -> lista de teclas pulsadas … … 77 75 option -iniconfig "" 78 76 79 #@O treeview options80 option -exportselection false 77 #@O! (treeview options) Se introducen para evitar errores 78 option -exportselection false ;# unused 81 79 option -linewidth 1 ;# unused 82 80 option -selectbackground "unused" … … 84 82 variable _listbox 85 83 variable menu 86 variable xbar87 variable ybar88 84 89 85 variable afterTime 0 … … 106 102 107 103 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 yes113 104 install _listbox using ::wtree $win.lb -table 0 -filter no \ 114 105 -background white -showroot 0 -selectmode extended -showheader 1 \ … … 120 111 -highlightbackground gray75 -highlightcolor black \ 121 112 -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]128 113 } 129 114 … … 131 116 132 117 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"137 118 138 119 #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] 146 121 147 122 $self configure -readonly [from args -readonly] … … 150 125 # Apply all arguments given: 151 126 $self configurelist $args 152 153 #@T! $_listbox configure -xscrollcommand "$xbar set" 154 #@T! $_listbox configure -yscrollcommand "$ybar set" 155 #@T! to do 127 156 128 if { $options(-parent) eq "" } { 157 129 $self configure -parent [winfo parent $win] 158 130 } 159 131 160 # bind 161 #@!bind 162 #@T! $_listbox bind all <KeyPress> +[list $self _OnKeyPress %A] 163 #@T! to do 132 # bind 164 133 bind $_listbox <KeyPress> +[list $self _OnKeyPress %A] 165 134 … … 169 138 #pack 170 139 grid $_listbox -row 0 -column 0 -sticky news 171 #@!scroll grid $ybar -row 0 -column 1 -sticky ns172 #@!scroll grid $xbar -row 1 -column 0 -sticky ew173 140 grid columnconfigure $self 0 -weight 1 174 141 grid rowconfigure $self 0 -weight 1 175 142 176 #@!scroll ::autoscroll::autoscroll $ybar177 #@!scroll ::autoscroll::autoscroll $xbar178 143 debug_msg "voy a pillarte: antes de _ReadIni" 179 144 $self _ReadIni … … 203 168 onconfigure -cols { lst } { 204 169 set options(-cols) $lst 205 #@T! foreach col [$self column names] { 206 #@T! $_listbox column delete $col 207 #@T! } 170 208 171 $_listbox column delete all 209 #@T! foreach col $options(-cols) {210 #@T! $_listbox column insert end $col -justify left211 #@T! $_listbox column configure $col -command "$self _SortByColumn [list $col]" -titleborderwidth 1212 #@T! }213 172 214 173 set lstx [list [list image -label Icon -tags Icon] ] … … 218 177 lappend lstx $colx 219 178 } 220 #@! Tolcon_Trace "lstx $lstx"221 179 $_listbox configure -columns $lstx 222 180 223 181 if { $options(-icon) == "" } { 224 #@T! $_listbox column configure "BLT TreeView $_listbox" -hide 1225 182 $_listbox column configure Icon -visible 0 226 183 } else { 227 #@T! $_listbox column configure "BLT TreeView $_listbox" -hide 0228 184 $_listbox column configure Icon -visible 1 229 185 } 230 186 231 #@T adds232 187 $_listbox column configure first -expand yes -weight 1 233 188 $_listbox column configure all -itembackground "" … … 238 193 foreach col [$self column names] { 239 194 if { "-1" eq [lsearch $options(-hiddencols) $col] } { 240 #@T! $_listbox column configure $col -hide 0241 195 $_listbox column configure $col -visible 1 242 196 } else { 243 #@T! $_listbox column configure $col -hide 1244 197 $_listbox column configure $col -visible 0 245 198 } … … 249 202 onconfigure -showtitles { bool } { 250 203 set options(-showtitles) $bool 251 #@O $_listbox configure -showtitles $bool 252 $_listbox configure -showheader $bool 253 #@O! $_listbox show 204 $_listbox configure -showheader $bool 254 205 } 255 206 … … 257 208 set options(-icon) $icon 258 209 if { $icon != "" } { 259 #@T! $_listbox column configure "BLT TreeView $_listbox" -min 16 -max 16 \260 #@T! -hide 0 -titleborderwidth 1261 #@T! $_listbox configure -icons [list [Bitmap::get $icon] [Bitmap::get $icon]]262 210 $_listbox column configure Icon -minwidth 16 -maxwidth 16 -visible 1 ;# -titleborderwidth 1 263 211 264 212 } else { 265 #@T! $_listbox column configure "BLT TreeView $_listbox" -hide 1266 213 $_listbox column configure Icon -visible 0 267 214 } … … 273 220 set cols [$self column names] 274 221 foreach col $cols { 275 #@O $self column configure $col -title [mc [lindex $titles $c] ]276 222 $_listbox column configure $col -text [mc [lindex $titles $c] ] 277 223 incr c 1 … … 359 305 } 360 306 } elseif { [lindex $args 1] eq "auto" } { 361 #@O! Nothing to do ??307 #@O! Llamado desde barima. Hace falta hacer algo? 362 308 return 363 309 } else { … … 668 614 # 669 615 #/////////////////////////////////////////////////////////////////////////// 670 671 #@O!672 616 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 values682 set coln 0683 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 $j688 }689 }690 # coln: contains the index of the column to be ordered691 set lst [lsort -index $coln $lst]692 $self clear693 for { set i 0 } { $i < $numofel } { incr i } {694 set el [lindex $lst $i ]695 $self insert end $el696 }697 698 617 } 699 618
Note: See TracChangeset
for help on using the changeset viewer.
