Changeset 1024 for branches/sandbox


Ignore:
Timestamp:
Oct 12, 2010 4:40:02 PM (10 years ago)
Author:
chlake
Message:

Added Mouse Scroll Wheel Focus

Location:
branches/sandbox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/Geo_Viewer.tcl

    r1022 r1024  
    3838
    3939proc Geo_Initialize {} {
    40 #     set ::geo_entryvar(phase) "1"
    4140     set ::geo_entryvar(atomtype) "all"
    4241     catch {unset ::geo_enable}
     
    5352
    5453   if {[file exists $filename]} {
    55    #puts "$filename from [pwd] is opened"
    5654   set fh [open $filename r]
    5755   } else {
    5856     puts "$filename not found in directory [pwd]"
    5957   }
    60 
    61    # read information from DISAGL File
    6258
    6359   set bond_total -1
     
    106102            set atom2 [lindex $temp 6]
    107103            set atom3 [lindex $temp 7]
    108 #            set atype1 [atominfo $phase [lindex $temp 5] type]
    109 #            set atype2 [atominfo $phase [lindex $temp 6] type]
    110 #            set atype3 [atominfo $phase [lindex $temp 7] type]
    111 #            set atype1 [lindex [split $atype1 {+-}] 0]
    112 #            set atype2 [lindex [split $atype2 {+-}] 0]
    113 #            set atype3 [lindex [split $atype3 {+-}] 0]
    114104            set alabel1 [atominfo $phase [lindex $temp 5] label]
    115105            set alabel2 [atominfo $phase [lindex $temp 6] label]
     
    119109            set key1 [string map {" " ""} [set t2 "${symmcode1}_[lindex $atom1]"]]
    120110            set key3 [string map {" " ""} [set t3 "${symmcode3}_[lindex $atom3]"]]
    121 #            set symm2 [lindex $temp 8]
    122 #            set trans2 [lindex $temp 9]
    123 #            set symm3 [lindex $temp 10]
    124 #            set trans3 [lindex $temp 11]
    125111            lappend t1 $phase $atom1 $atom2 $atom3 $alabel1 $alabel2 $alabel3 \
    126112                         $b_angle $b_esd $key1 $key3
    127113            lappend ::geo_phase_list $phase
    128114            set ::geo_angles($phase,$key1,$atom2,$key3) $t1
    129 #            lappend ::geo_angle_keys($phase,$atom2) $key1 $key3
    130 #            set ::geo_angle_keys($phase,$atom2) [lsort -uniq [set ::geo_angle_keys($phase,$atom2)]]
    131115        }
    132116   }
     
    136120
    137121proc Geo_Viewer {args} {
    138      #destroy .maincontrolbox
    139 #            puts [trace vinfo ::geo_entryvar(phase)]
    140 #            puts [trace vinfo ::geo_entryvar(atomtype)]
    141 #   foreach item [trace vinfo ::geo_entryvar(phase)] {
    142 #       eval trace vdelete ::geo_entryvar(phase) $item
    143 #   }
    144 #   foreach item [trace vinfo ::geo_entryvar(atomtype)] {
    145 #       eval trace vdelete ::geo_entryvar(atomtype) $item
    146 #   }
    147122
    148123    # Run DISAGL
     
    205180     grid $sc.atom1 -column 0 -row 1
    206181
    207      #grid $sc.engage -column 0 -row 2 -columnspan 2
    208 
    209182     label $as.atom -text "Choose Atom(s)"
    210183
    211184     grid $as.atom -row 0 -column 1
    212 
    213 #     label $ad.label -text "Distance and Angle List"
    214 #     grid $ad.label -row 0 -column 0
    215 
    216185
    217186     foreach {top main side lbl} [MakeScrollTable $as] {}
     
    232201       $as.can config -width [lindex [$as.can cget -scrollregion] 2]
    233202
    234    #bind $as <Configure> "catch {ResizeScrollTable $as}"
    235    #bind $ad <Configure> "catch {ResizeScrollTable $ad}"
    236203   }
    237204
     
    356323                    label $::geo_main.$counter -text [lindex $::geo_angles($phase,$k,$atom,$key) 7]
    357324                    grid $::geo_main.$counter -row $rownum -column $colnum -padx 5
     325
    358326                    incr colnum
    359327                    incr counter
     
    387355}
    388356ResizeScrollTable [winfo parent [winfo parent $::geo_main]]
     357MouseWheelScrollTable [winfo parent [winfo parent $::geo_main]]
    389358}
    390359proc Geo_Print {} {
  • branches/sandbox/distrest.tcl

    r1021 r1024  
    103103
    104104    foreach {top main side lbl} [MakeScrollTable $rightfr] {}
    105 
     105    MouseWheelScrollTable $rightfr
    106106    set atom1_state  1
    107107    set atom2_state  1
     
    360360    SR_Fill_Display  $main
    361361    bind $sr_rb <Configure> "ResizeScrollTable $sr_rb"
     362    MouseWheelScrollTable $sr_rb
    362363    # see if reset of grab fixes tk bug with tk_optionMenu
    363364    grab release .mainrestraintbox
  • branches/sandbox/gsascmds.tcl

    r1021 r1024  
    23502350    $box.can create window 0 0 -anchor nw  -window [frame $box.can.f -bd 2]
    23512351    $box.side create window 0 0 -anchor nw  -window [frame $box.side.f -bd 2]
    2352 
    23532352    grid columnconfig $box 1 -weight 1
    23542353    grid rowconfig $box 1 -weight 1
     
    23832382        grid $box.yscroll -sticky ns -column 2 -row 1
    23842383    } else {
    2385         grid forget $box.yscroll 
     2384        grid forget $box.yscroll
    23862385    }
    23872386    if {[lindex $sizes 2] > [winfo width $box.can]} {
    23882387        grid $box.scroll -sticky ew -column 1 -row 2
    23892388    } else {
    2390         grid forget $box.scroll
    2391     }
    2392 }
     2389        grid forget $box.scroll
     2390    }
     2391}
     2392
     2393proc MouseWheelScrollTable {box} {
     2394     # causes mouse wheel to operate scroll for main canvas in ScrollTable
     2395     # mousewheel can be operated anywhere in parent window
     2396    bind [winfo toplevel $box] <MouseWheel> "$box.can yview scroll \[expr {-abs(%D)/%D}\] unit"
     2397}
     2398
    23932399
    23942400# this is used in cifselect -- not sure why anymore
Note: See TracChangeset for help on using the changeset viewer.