Changeset 17 for trunk/gui/scripts/textentry.tcl
- Timestamp:
- Jun 11, 2005, 9:56:37 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/textentry.tcl
r11 r17 109 109 if {$_mode == "entry"} { 110 110 $itk_component(entry) configure -state normal 111 $itk_component(emenu) entryconfigure "Cut" -state normal 112 $itk_component(emenu) entryconfigure "Copy" -state normal 113 $itk_component(emenu) entryconfigure "Paste" -state normal 111 114 $itk_component(entry) delete 0 end 112 115 $itk_component(entry) insert 0 $newval 113 116 if {!$itk_option(-editable)} { 114 117 $itk_component(entry) configure -state disabled 118 $itk_component(emenu) entryconfigure "Cut" -state disabled 119 $itk_component(emenu) entryconfigure "Copy" -state disabled 120 $itk_component(emenu) entryconfigure "Paste" -state disabled 115 121 } 116 122 } elseif {$_mode == "text"} { 117 123 $itk_component(text) configure -state normal 124 $itk_component(tmenu) entryconfigure "Cut" -state normal 125 $itk_component(tmenu) entryconfigure "Copy" -state normal 126 $itk_component(tmenu) entryconfigure "Paste" -state normal 118 127 $itk_component(text) delete 1.0 end 119 128 $itk_component(text) insert end $newval 120 129 if {!$itk_option(-editable)} { 121 130 $itk_component(text) configure -state disabled 131 $itk_component(tmenu) entryconfigure "Cut" -state disabled 132 $itk_component(tmenu) entryconfigure "Copy" -state disabled 133 $itk_component(tmenu) entryconfigure "Paste" -state disabled 122 134 } 123 135 } … … 231 243 -foreground $itk_option(-textforeground) 232 244 245 itk_component add emenu { 246 menu $itk_component(entry).menu -tearoff 0 247 } 248 $itk_component(emenu) add command -label "Cut" -accelerator "^X" \ 249 -command [list event generate $itk_component(entry) <<Cut>>] 250 $itk_component(emenu) add command -label "Copy" -accelerator "^C" \ 251 -command [list event generate $itk_component(entry) <<Copy>>] 252 $itk_component(emenu) add command -label "Paste" -accelerator "^V" \ 253 -command [list event generate $itk_component(entry) <<Paste>>] 254 bind $itk_component(entry) <<PopupMenu>> { 255 tk_popup %W.menu %X %Y 256 } 257 233 258 $itk_component(entry) insert end $val 234 259 if {!$itk_option(-editable)} { … … 270 295 $itk_component(scrollbars) contents $itk_component(text) 271 296 297 itk_component add tmenu { 298 menu $itk_component(text).menu -tearoff 0 299 } 300 $itk_component(tmenu) add command -label "Cut" -accelerator "^X" \ 301 -command [list event generate $itk_component(text) <<Cut>>] 302 $itk_component(tmenu) add command -label "Copy" -accelerator "^C" \ 303 -command [list event generate $itk_component(text) <<Copy>>] 304 $itk_component(tmenu) add command -label "Paste" -accelerator "^V" \ 305 -command [list event generate $itk_component(text) <<Paste>>] 306 bind $itk_component(text) <<PopupMenu>> { 307 tk_popup %W.menu %X %Y 308 } 309 272 310 $itk_component(text) insert end $val 273 311 if {!$itk_option(-editable)} { 274 312 $itk_component(text) configure -state disabled 313 $itk_component(menu) entryconfigure "Cut" -state disabled 314 $itk_component(menu) entryconfigure "Copy" -state disabled 315 $itk_component(menu) entryconfigure "Paste" -state disabled 275 316 } 276 317 set _mode "text" … … 306 347 if {$_mode == "entry"} { 307 348 $itk_component(editor) configure -state $state 349 $itk_component(emenu) entryconfigure "Cut" -state $state 350 $itk_component(emenu) entryconfigure "Copy" -state $state 351 $itk_component(emenu) entryconfigure "Paste" -state $state 308 352 } elseif {$_mode == "text"} { 309 353 $itk_component(text) configure -state $state 354 $itk_component(tmenu) entryconfigure "Cut" -state $state 355 $itk_component(tmenu) entryconfigure "Copy" -state $state 356 $itk_component(tmenu) entryconfigure "Paste" -state $state 310 357 } 311 358 }
Note: See TracChangeset
for help on using the changeset viewer.