Changeset 642ac37 in tol for tolbase/lib


Ignore:
Timestamp:
Nov 6, 2008, 5:26:48 PM (18 years ago)
Author:
Christian Paz <cpaz@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
3e755e5
Parents:
0295b9a
Message:

added the option togglehier to avoid toggle hierarchically the marked checkboxes.

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

File:
1 edited

Legend:

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

    r0295b9a r642ac37  
    3535  # bonselcmd    -> comando a ejecutar cuando se selecciona un nodo
    3636  # bhelptext    -> columna que se muestra como helptext
     37  # btogglehier  -> cambiar jerárquicamente si un item está o no seleccionado
    3738#/////////////////////////////////////////////////////////////////////////////
    3839  variable items_selected
    … …  
    4546  option -bhelptext
    4647  option -bmenu
     48  option -btogglehier true
    4749  #///////////////////////////////////////////////////////////////////////////
    4850  constructor {args} {
    … …  
    6668    $self configure -hideroot yes -linewidth 0 -activeicons "" \
    6769      -selectbackground gray90 -selectforeground black \
    68       -highlightthickness 1 -borderwidth 0 -selectborderwidth 0 \
     70      -highlightthickness 1 -borderwidth 1 -selectborderwidth 1 \
    6971      -font $toltk_options(fonts,Label) -icons {}
    7072
    … …  
    295297    array set aryData [$self entry cget $index -data]
    296298    set state $aryData(state)
     299       
     300        set ctogglehier [$self cget -btogglehier]
    297301
    298302    if { [string equal $state NSE] } return
    … …  
    301305    if { [string equal $state ON] } {
    302306      $self _SetNodeState $index OFF
    303       $self ToggleUp $parent_idx OFF ON
    304       $self entry configure $index -data [list childsON 0 childsMED 0]
    305       foreach it [$self entry children $index] {
    306         $self ToggleDown $it OFF
    307       }
     307          if $ctogglehier {
     308        $self ToggleUp $parent_idx OFF ON
     309        $self entry configure $index -data [list childsON 0 childsMED 0]
     310        foreach it [$self entry children $index] {
     311          $self ToggleDown $it OFF
     312        }
     313          }
    308314    } else {
    309315      $self _SetNodeState $index ON
    310       $self ToggleUp $parent_idx ON $state
    311       $self entry configure $index\
    312            -data [list childsON [$self entry size $index] childsMED 0]
    313       foreach it [$self entry children $index] {
    314         $self ToggleDown $it ON
    315       }
     316          if $ctogglehier {
     317        $self ToggleUp $parent_idx ON $state
     318        $self entry configure $index\
     319             -data [list childsON [$self entry size $index] childsMED 0]
     320        foreach it [$self entry children $index] {
     321          $self ToggleDown $it ON
     322        }
     323          }
    316324    }
    317325  }
    … …  
    500508    .top.tf1.f.btv bColumnInsert end Type
    501509    #RellenaBTreeView root [file join [info dir script] testdir]
    502     RellenaBTreeView root "./byswidget/btreeview/testdir"
     510    #RellenaBTreeView root "./byswidget/btreeview/testdir" [jym: se cambia para que no falle]
     511    RellenaBTreeView root "c:/UnxUtils"
    503512    grid .top.tf1.f.btv -row 0 -column 0 -sticky new
    504513    grid columnconfigure .top.tf1.f 0 -weight 1
Note: See TracChangeset for help on using the changeset viewer.