Changeset 606ed76 in tol for tolbase/lib/wtree/wtree.tcl


Ignore:
Timestamp:
Nov 17, 2016, 12:40:36 PM (10 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
ceea866
Parents:
6d788c2
Message:

Se eliminan espacios en blanco al final de línea.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/wtree/wtree.tcl

    r6d788c2 r606ed76  
    88package require snit
    99
    10 # 
     10#
    1111# TODO:
    1212#
    … …  
    5858 # pares indicando para cada tipo el valor de la propiedad
    5959}
    60  
     60
    6161snit::widget wtree {
    6262  typevariable SystemButtonFace
    … …  
    7979  option -columnfilter \
    8080      -default "" -configuremethod "_conf-columnfilter"
    81  
     81
    8282  variable tree
    8383  variable vscrollbar
    … …  
    109109  delegate option -bd to hull
    110110  delegate option -relief to hull
    111  
     111
    112112  typeconstructor {
    113    
     113
    114114    set thisPlatform $::tcl_platform(platform)
    115115    set w [ listbox .___lb___ ]
    … …  
    156156      }
    157157    }
    158    
     158
    159159    if { [ lsearch -exact [ image names ] folder-closed ] == -1 } {
    160160      image create photo folder-closed -data {
    … …  
    191191      #lassign $id where item arg1 arg2
    192192      foreach  {where item arg1 arg2} $id break
    193      
     193
    194194      if {[llength [$w item descendants $item]] == 0} {
    195195        $self notify generate <<ItemSelected>> [list T $w c $item]
    … …  
    197197        $w item toggle $item
    198198      }
    199      
     199
    200200    } else {
    201201      TreeCtrl::DoubleButton1 $w $x $y
    … …  
    211211    }
    212212  }
    213  
     213
    214214  method Button3 {w x y rootX rootY} {
    215215
    … …  
    225225    if {[lindex $id 0] == "item"} {
    226226      foreach {where item arg1 arg2} $id break
    227      
     227
    228228      if {[$w selection includes $item]==0} {
    229229        $w selection clear
    … …  
    234234    tk_popup $cmenu $rootX $rootY
    235235  }
    236  
     236
    237237  method KeyPressEscape {} {
    238238
    239239    $self notify generate <<Escape>>
    240240  }
    241  
     241
    242242  method SortbyColumn {t column} {
    243243
    … …  
    291291    grid columnconfigure $win.frameFilter.fentry 0 -weight 1
    292292    grid remove $widgets(filter,bcancel)
    293    
     293
    294294    bind $widgets(filter,entry) <Key-Return> [ mymethod _applyFilter ]
    295295    grid $win.frameFilter.l -row 0 -column 1 -sticky "e"
    … …  
    307307    grid rowconfigure $win.frameTree 0 -weight 1
    308308    grid columnconfigure $win.frameTree 0 -weight 1
    309    
     309
    310310    install tree as treectrl $win.frameTree.t \
    311311        -highlightthickness 0 -borderwidth 0 \
    … …  
    323323    $tree notify install <Edit-end>
    324324    $tree notify install <Edit-accept>
    325    
     325
    326326    $tree notify bind $tree <Edit-begin> \
    327327        [ mymethod EditCallback begin %I %C %E %t ]
    … …  
    330330    $tree notify bind $tree <Edit-accept>  \
    331331        [ mymethod EditCallback accept %I %C %E %t ]
    332    
     332
    333333    bind $tree <ButtonPress-1> [ mymethod OnButtonPress1 %x %y ]
    334     bind $tree <Control-ButtonPress-1> { } 
    335     bind $tree <Shift-ButtonPress-1> { } 
     334    bind $tree <Control-ButtonPress-1> { }
     335    bind $tree <Shift-ButtonPress-1> { }
    336336
    337337    set height [font metrics [$tree cget -font] -linespace]
    … …  
    348348                                      {selected focus}] ]
    349349    set elements(check) [ $tree element create eCHK window ]
    350    
     350
    351351    set elements(rect) [ $tree element create eRECT rect \
    352352                             -showfocus yes -open ew \
    … …  
    377377
    378378    focus $tree
    379    
     379
    380380    $self _configure_bindings
    381381    $self _conf-columns -columns $options(-columns)
    … …  
    387387    #return $win
    388388  }
    389  
     389
    390390  method AcceptEdit { } {
    391391    ::TreeCtrl::EditClose $tree entry 1 0
    … …  
    509509    $self _setNormalCursor
    510510  }
    511  
     511
    512512  method _filterNodesMatching { } {
    513513    if { [ llength $listFilterOff ] } {
    … …  
    532532    foreach n $nodes {
    533533      # filtro el nodo
    534      
     534
    535535      #esto es para el filtrado automatico incremental
    536536      if { $breakFilter } {
    … …  
    542542      $self _filterNodeSet [ $tree item children $n ] \
    543543          $positiveWords $negativeRegExp
    544      
     544
    545545      if { 0 } {
    546546      if { [ $self _filterNode $n $positiveWords $negativeRegExp ] } {
    … …  
    569569    # hago match, luego hago algo mas sofisticado con regexp
    570570    # set visible [ string match "*${text}*" $itemText ]
    571     if { [ string length $negativeRegExp ] && 
     571    if { [ string length $negativeRegExp ] &&
    572572         ![ regexp -nocase $negativeRegExp $itemText ] } {
    573573      # itemText contiene alguna de las palabra prohibidas
    … …  
    625625    }
    626626  }
    627  
     627
    628628  method _scheduleFilter { } {
    629629    after cancel $idIdleFilter
    … …  
    632632
    633633  method _configure_bindings { } {
    634    
     634
    635635    bind $tree <Double-ButtonPress-1> "[mymethod DoubleButton1 %W %x %y] ; break"
    636636    bind $tree <Return> "[mymethod KeyPressReturn %W] ; break"
    … …  
    639639
    640640    bind $tree <Escape> "[mymethod KeyPressEscape] ; break"
    641    
     641
    642642    $tree notify bind $tree <Header-invoke> [mymethod SortbyColumn %W %C]
    643643
    644644    $tree notify bind $vscrollbar <Scroll-y> { %W set %l %u }
    645645    bind $vscrollbar <ButtonPress-1> [list focus $tree]
    646    
     646
    647647    $tree notify bind $hscrollbar <Scroll-x> { %W set %l %u }
    648648    bind $hscrollbar <ButtonPress-1> [list focus $tree]
    649    
     649
    650650    ::autoscroll::autoscroll $vscrollbar
    651651    ::autoscroll::autoscroll $hscrollbar
    … …  
    664664  method _conf-buttonstyle { _ bs } {
    665665    set valid_bstyles [ array names wtree::ButtonImageConf ]
    666     if { [ lsearch $valid_bstyles $bs ] == -1 } { 
     666    if { [ lsearch $valid_bstyles $bs ] == -1 } {
    667667      error "invalid button style $bs should be one of $valid_bstyles"
    668668    } else {
    … …  
    673673
    674674  method _conf-contextmenu { _ cmenu } {
    675     set options(-contextmenu) $cmenu 
     675    set options(-contextmenu) $cmenu
    676676  }
    677677
    678678  method _conf-filter { _ value } {
    679679    if { [ string is boolean $value ] } {
    680       if { ( $options(-filter)  && $value ) || 
     680      if { ( $options(-filter)  && $value ) ||
    681681           ( !$options(-filter) && !$value ) } {
    682682        return
    … …  
    705705  #
    706706  # columnsSpec es una lista de "columnas" y una columna puede ser
    707   # 
     707  #
    708708  #  - un unico elemento con valor: image, text o check
    709709  #
    … …  
    744744                      -image $opts(-image) \
    745745                      -itembackground "\#e0e8f0 {}" \
    746                       -tags $opts(-tags) ]                     
     746                      -tags $opts(-tags) ]
    747747      # "
    748748      set column_info($idx,ID) $colID
    … …  
    902902    } else {
    903903      return [ list $elements($etype) $def_prop($etype) "" ]
    904     } 
     904    }
    905905  }
    906906
    … …  
    912912
    913913  method OnButtonPress1 { x y } {
    914    
     914
    915915    set treeInfo [ $tree identify $x $y ]
    916916    if { $treeInfo eq "" } {
    … …  
    918918      return
    919919    }
    920    
     920
    921921    if { [ llength $treeInfo ] != 6 } {
    922922      return
    923923    }
    924    
     924
    925925    foreach { item I column C elem E } $treeInfo { }
    926    
     926
    927927    if { $item == "item" && \
    928928             $column == "column" && \
    … …  
    934934      set idx_info $column_info(MAPIDX,$C)
    935935
    936       if { $column_info($idx_info,-editable) && 
     936      if { $column_info($idx_info,-editable) &&
    937937           ( $E eq "eTXT" || $E eq "eRECT" ) } {
    938938        set exists [winfo exists $tree.entry]
    … …  
    958958    }
    959959  }
    960  
     960
    961961  proc test_GetTextContents { T item } {
    962962    set textDump ""
    … …  
    10001000      grid $w.fsearch -row 0 -column 0 -sticky "snew"
    10011001    }
    1002    
     1002
    10031003    set T [ wtree $w.t -table $istable -filter yes -buttonstyle mac \
    10041004                -columns [ list \
    10051005                               { {image text} -tags ID   -label Identifier } \
    10061006                               { text -tags DESC -label Description -editable yes } ] ]
    1007    
     1007
    10081008    $T notify bind $T <Expand-before> {
    10091009      #puts "before openning %I"
    … …  
    10231023      trace add    variable ::wtreeSearch write "::wtree::test_ListenSearch $T"
    10241024    }
    1025    
     1025
    10261026    set bugValue {
    10271027Serie AlgGetData(
    … …  
    10531053          %T CancelEdit
    10541054        } ]
    1055     grid $w.btn1 -row 1 -column 0 
    1056     grid $w.btn2 -row 1 -column 1 
     1055    grid $w.btn1 -row 1 -column 0
     1056    grid $w.btn2 -row 1 -column 1
    10571057    grid rowconfigure $w 1 -weight 1
    1058     grid columnconfigure $w 0 -weight 1 
    1059    
     1058    grid columnconfigure $w 0 -weight 1
     1059
    10601060    for { set r 0 } { $r < 100 } { incr r } {
    10611061      $T insert [list  [list folder-open "node $r"] [ list "Description for node $r" ] ]
Note: See TracChangeset for help on using the changeset viewer.