Changeset 2067
- Timestamp:
- Jan 25, 2011, 10:39:36 PM (14 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/videochooser.tcl
r2023 r2067 30 30 } 31 31 32 public method load {path }33 public method choose {path}32 public method load {paths} 33 public method select {id} 34 34 protected method _fixSize {} 35 35 36 36 private variable _vcnt 0 ;# counter of videos 37 37 private variable _variable "" ;# variable to pass along to each choice 38 private variable _paths "" ;# list of choice paths 38 39 private variable _objs "" ;# list of choice objects 39 40 } … … 83 84 -variable ${_variable}] 84 85 $ci load $path "" 85 pack $ci -expand yes -fill both -side right86 pack $ci -expand yes -fill both -side left 86 87 87 88 # add the object to the list of video info objs 89 lappend _paths $path 88 90 lappend _objs $ci 89 91 } 90 92 91 93 _fixSize 94 } 95 96 # ---------------------------------------------------------------------- 97 # USAGE: select 98 # ---------------------------------------------------------------------- 99 itcl::body Rappture::VideoChooser::select {id} { 100 101 set obj "" 102 103 if {[string is integer $id] == 1} { 104 # treat $id as the index 105 if {($id < 0) && ($id >= [llength ${_objs}])} { 106 error "invalid id \"$id\": must be in range 0 to [llength ${_objs}]" 107 } 108 } else { 109 # treat $id as a file path 110 set idx [lsearch -exact ${_paths} $id] 111 if {$idx == -1} { 112 error "invalid id \"$id\": not found in list of loaded objects" 113 } 114 set id $idx 115 } 116 117 # grab the object associated with the id 118 # and call it's select function. 119 set obj [lindex ${_objs} $id] 120 $obj select 92 121 } 93 122 -
trunk/gui/scripts/videochooserinfo.tcl
r2023 r2067 32 32 33 33 public method load {path about} 34 public method select {} 34 35 public method query {what} 35 36 … … 59 60 60 61 itk_component add main { 61 canvas $itk_interior.main \ 62 -background black 62 canvas $itk_interior.main 63 63 } { 64 64 usual … … 68 68 69 69 blt::table $itk_interior \ 70 0,0 $itk_component(main) -fill both -pad x270 0,0 $itk_component(main) -fill both -pady 2 71 71 72 72 blt::table configure $itk_interior c* -resize both … … 96 96 97 97 set movie [Rappture::Video file ${_path}] 98 $movie seek 5098 $movie seek 60 99 99 100 100 set _preview [image create photo] … … 115 115 116 116 $itk_component(main) bind preview <ButtonPress-1> [itcl::code $this _bindings b1press] 117 $itk_component(main) bind preview <Enter> [itcl::code $this _bindings enter] 118 $itk_component(main) bind preview <Leave> [itcl::code $this _bindings leave] 117 119 118 120 _fixSize 119 121 } 122 123 # ---------------------------------------------------------------------- 124 # USAGE: select 125 # ---------------------------------------------------------------------- 126 itcl::body Rappture::VideoChooserInfo::select {} { 127 if {"" == $_variable} { 128 return 129 } 130 # send this object's movie to the preview window 131 132 upvar #0 $_variable var 133 set var ${_path} 134 135 foreach {x0 y0 x1 y1} [$itk_component(main) bbox preview] break 136 set x0 [expr 0] 137 set y0 [expr 2] 138 set x1 [expr [$itk_component(main) cget -width]-2] 139 set y1 [expr [$itk_component(main) cget -height]-2] 140 141 # there is something wrong with the way we place the 142 # images on the canvas, or how the canvas is shapeed. 143 # the placement of the small image seems to be off 144 # by a pixel or two. for now we fudge the numbers to 145 # make the red line accesnts look decent. 146 147 $itk_component(main) create line $x0 $y0 $x1 $y0 \ 148 -fill red \ 149 -width 3 \ 150 -tags previewselected 151 152 $itk_component(main) create line $x0 $y1 $x1 $y1 \ 153 -fill red \ 154 -width 3 \ 155 -tags previewselected 156 157 # $itk_component(main) create rectangle \ 158 [$itk_component(main) bbox preview] \ 159 -outline red \ 160 -width 4 \ 161 -tags previewselected 162 # $itk_component(main) configure -background red 163 } 164 120 165 121 166 # ---------------------------------------------------------------------- … … 125 170 switch -- $sequence { 126 171 "b1press" { 127 if {"" == $_variable} { 128 return 129 } 130 # send this object's movie to the preview window 131 132 upvar #0 $_variable var 133 set var ${_path} 134 $itk_component(main) create rectangle \ 135 [$itk_component(main) bbox preview] \ 136 -outline red \ 137 -width 4 \ 138 -tags previewselected 139 172 select 173 } 174 "enter" { 175 $itk_component(main) itemconfigure previewselected -state hidden 176 } 177 "leave" { 178 $itk_component(main) itemconfigure previewselected -state normal 140 179 } 141 180 default {} … … 158 197 # unselect this object 159 198 $itk_component(main) delete previewselected 199 #$itk_component(main) configure -background black 160 200 } 161 201 } -
trunk/gui/scripts/videopreview.tcl
r2035 r2067 333 333 } 334 334 335 if {![winfo ismapped $itk_component(hull)]} { 336 return 337 } 338 335 339 set cw [winfo width $itk_component(main)] 336 340 set ch [winfo height $itk_component(main)] -
trunk/gui/scripts/videoscreen.tcl
r2035 r2067 595 595 596 596 if {[string compare "" ${_movie}] == 0} { 597 return 598 } 599 600 if {![winfo ismapped $itk_component(hull)]} { 597 601 return 598 602 }
Note: See TracChangeset
for help on using the changeset viewer.