Changeset e259ad9 in tol for tolbase/lib/wtree/wtree.tcl


Ignore:
Timestamp:
Feb 29, 2012, 8:38:47 AM (15 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
7d4ba03
Parents:
73cf07b
Message:

refs #1382, edition is triggered when clicked over the whole column no only when clicked over the text

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

File:
1 edited

Legend:

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

    r73cf07b re259ad9  
    915915    foreach { item I column C elem E } $treeInfo { }
    916916   
    917     #puts "OnButtonPress1: $treeInfo"
    918917    if { $item == "item" && \
    919918             $column == "column" && \
    … …  
    925924      set idx_info $column_info(MAPIDX,$C)
    926925
    927       if { $column_info($idx_info,-editable) && $E eq "eTXT"} {
     926      if { $column_info($idx_info,-editable) &&
     927           ( $E eq "eTXT" || $E eq "eRECT" ) } {
    928928        set exists [winfo exists $tree.entry]
    929         ::TreeCtrl::EntryOpen $tree $I $C $E
     929        ::TreeCtrl::EntryOpen $tree $I $C eTXT
    930930        if {!$exists} {
    931           $tree.entry configure -borderwidth 1 -justify center  \
     931          $tree.entry configure -borderwidth 1 -justify left  \
    932932              -background white -relief sunken
    933933          update idletask
    934934        }
    935935        $tree.entry selection clear
    936         scan [$tree item bbox $I $C $E] "%d %d %d %d" x1 y1 x2 y2
     936        scan [ $tree item bbox $I $C eRECT ] "%d %d %d %d" x1 y1 x2 y2
    937937        set left $x1
    938938        set right $x2
    939         place $tree.entry -y $y1 -x $left -width [expr {$right - $left + 4}]
    940         $tree.entry icursor [$tree.entry index @[expr {$x - ($x1 + 1)}]]
     939        place $tree.entry -y $y1 -x $left -width [expr {$right - $left + 1}]
     940        $tree.entry icursor [$tree.entry index @[expr {$x - $x1}]]
    941941        return -code break
    942942
    … …  
    994994                -columns [ list \
    995995                               { {image text} -tags ID   -label Identifier } \
    996                                { text -tags DESC -label Description } ] ]
     996                               { text -tags DESC -label Description -editable yes } ] ]
    997997   
    998998    $T notify bind $T <Expand-before> {
    … …  
    10031003    }
    10041004    $T notify bind $T <ActiveItem> {
    1005       #puts "now active item is %c the previous was %p"
     1005      puts "now active item is %c the previous was %p"
    10061006    }
    10071007    grid $T -row 1 -column 0 -sticky "snew"
Note: See TracChangeset for help on using the changeset viewer.