- Timestamp:
- Feb 15, 2012, 11:55:07 PM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 878425e
- Parents:
- 1efd6f9
- Location:
- tolbase/lib/toltk
- Files:
-
- 4 edited
-
bystext.tcl (modified) (3 diffs)
-
editor.tcl (modified) (2 diffs)
-
msgs/es.msg (modified) (2 diffs)
-
tolbase.tcl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/bystext.tcl
r1efd6f9 r0e07e12 8 8 #///////////////////////////////////////////////////////////////////////////// 9 9 # Put if {1} for testing this file. 10 11 package require snit 12 10 13 if {0} { 11 14 package require Tk … … 19 22 } 20 23 24 ::snit::widgetadaptor rotext { 25 26 constructor {args} { 27 # Turn off the insert cursor 28 #installhull using text $self -insertwidth 0 29 # DDG the $self gaves an error at least with 0.97 onwards 30 installhull using text -insertwidth 0 31 32 # Apply an options passed at creation time. 33 $self configurelist $args 34 } 35 36 # Disable the insert and delete methods, to make this readonly. 37 method insert {args} {} 38 method delete {args} {} 39 40 # Enable ins and del as synonyms, so the program can insert and 41 # delete. 42 delegate method ins to hull as insert 43 delegate method del to hull as delete 44 45 # Pass all other methods and options to the real text widget, so 46 # that the remaining behavior is as expected. 47 delegate method * to hull 48 delegate option * to hull 49 } 21 50 22 51 #///////////////////////////////////////////////////////////////////////////// … … 793 822 } 794 823 824 proc ::BayesText::TolEscape { buffer } { 825 return [ string map [ list \n \\n \t \\t \" \\\" \\ \\\\ ] $buffer ] 826 } 827 828 proc ::BayesText::DlgEscapeTextApply { editor } { 829 set w .dlgescape 830 831 set idxs [ $editor tag ranges sel ] 832 if { [ llength $idxs ] } { 833 foreach {i0 i1} $idxs break 834 $editor configure -undo 0 835 $editor delete $i0 $i1 836 $editor configure -undo 1 837 set f [ $w getframe ] 838 set buffer [ $f.t get 1.0 "end -1 char" ] 839 set len [ string length $buffer ] 840 $editor insert $i0 $buffer 841 $editor tag add sel $i0 "$i0 + $len char" 842 } 843 } 844 845 proc ::BayesText::DlgEscapeText { editor } { 846 set w .dlgescape 847 if { [ winfo exists $w ] } { 848 set f [ $w getframe ] 849 raise $w 850 focus $f.o 851 } else { 852 Dialog $w -title [ mc "Escape text" ] \ 853 -default 2 -modal none -parent $editor -separator 1 854 $w add -text [ mc "Close" ] -command "destroy $w" 855 $w add -text [ mc "Apply" ] 856 set f [ $w getframe ] 857 label $f.lo -text [ mc "Original:" ] 858 text $f.o -width 40 -height 4 859 label $f.lt -text [ mc "Transformed:" ] 860 rotext $f.t -width 40 -height 4 861 bind $f.o <<Modified>> { 862 if { [ %W edit modified ] == 1 } { 863 set f [ winfo parent %W ] 864 set tt $f.t 865 set buffer [ %W get 1.0 "end -1 char" ] 866 $tt del 1.0 end 867 $tt ins end [ ::BayesText::TolEscape $buffer ] 868 %W edit modified 0 869 } 870 } 871 grid $f.lo -row 0 -column 0 -sticky w 872 grid $f.o -row 1 -column 0 -sticky snew 873 grid $f.lt -row 0 -column 1 -sticky w 874 grid $f.t -row 1 -column 1 -sticky snew 875 foreach c {0 1} { 876 grid columnconfigure $f $c -weight 1 877 } 878 grid rowconfigure $f 1 -weight 1 879 $w draw 880 } 881 $f.o delete 1.0 end 882 set idxs [ $editor tag ranges sel ] 883 if { [ llength $idxs ] } { 884 $f.o insert end [ $editor get [ lindex $idxs 0 ] [ lindex $idxs 1 ] ] 885 } 886 $w itemconfigure 1 -command [ list ::BayesText::DlgEscapeTextApply $editor ] 887 } 795 888 796 889 #///////////////////////////////////////////////////////////////////////////// -
tolbase/lib/toltk/editor.tcl
r1efd6f9 r0e07e12 463 463 "savecom" "CmdSaveCompile" "[mc [list Save and Compile]] (F9)" \ 464 464 "decom" "CmdDecompile" "[mc Decompile] (F8)" \ 465 "syntaxcheck" "CmdSyntaxCheck" "[mc [list Syntax Check]] (F7)" \465 "syntaxcheck" "CmdSyntaxCheck" "[mc [list Syntax check]] (F7)" \ 466 466 "refresh" "CmdRefresh" "[mc Refresh] (F5)"\ 467 467 "balloon" "CmdBalloon" "[mc BalloonHelp]" \ … … 549 549 -command [list ::Editor::CmdSaveAs $this] 550 550 $m add separator 551 $m add command -label [ mc "Escape text" ]... \ 552 -command [ list ::BayesText::DlgEscapeText $data(txt) ] 551 553 $m add command -label "[mc Find]..." -accelerator CTRL+F \ 552 554 -command [list ::Editor::CmdFind $this] -
tolbase/lib/toltk/msgs/es.msg
r1efd6f9 r0e07e12 151 151 mcset es "Decompile" "Decompilar" 152 152 mcset es "Show history file" "Mostrar archivo de histórico" 153 mcset es "Syntax Check" "Chequear sintaxis" 153 mcset es "Syntax check" "Chequear sintaxis" 154 mcset es "Escape text" "Escapar texto" 154 155 mcset es "Delete all" "Borrar todo" 155 156 mcset es "Delete all the messages of the window of output" \ … … 758 759 mcset es "Save and Compile" "Guardar y compilar" 759 760 mcset es "Decompile" "Decompilar" 760 mcset es "Syntax Check" "Chequear sintaxis"761 761 mcset es "Refresh" "Refrescar" 762 762 mcset es "Help on line" "Ayuda" -
tolbase/lib/toltk/tolbase.tcl
r1efd6f9 r0e07e12 304 304 $m insert 0 command -label [mc Refresh] -accelerator F5\ 305 305 -command [list ::BayesText::Refresh $w_eval] 306 $m insert 0 command -label [mc "Syntax Check"] -accelerator F7 \306 $m insert 0 command -label [mc "Syntax check"] -accelerator F7 \ 307 307 -command [list ::BayesText::TolSyntaxCheck $w_eval] 308 308 $m insert 0 command -label [mc Decompile] -accelerator F8\ … … 315 315 $m insert 0 command -label [mc "Delete all"] \ 316 316 -command [list ::BayesText::DeleteAll $w_eval] 317 $m add command -label [ mc "Escape text" ]... \ 318 -command [ list ::BayesText::DlgEscapeText $w_eval ] 319 317 320 bind $w_eval <F9> "::TolConsole::Compile ; break" 318 321 bind $w_eval <F8> "::TolConsole::ClearConsole ; break"
Note: See TracChangeset
for help on using the changeset viewer.
