Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Comment: | Logo in File menu Possibility to assign icons to speed buttons Load/Save/New/Close = new default buttons with icons Possibility to resize file list and textshell Parameters to shell script macro files Fixed window resize bug + General bug fix |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | 683c59d5743321dbc3d54e8b67ea77f911ec5cf4 |
User & Date: | dennis 2000-11-21 18:06:01 |
2000-12-25
| ||
19:25 | Prepare for release check-in: 9d8214e557 user: dennis tags: trunk, release_0_9_9 | |
2000-11-21
| ||
18:06 | Logo in File menu Possibility to assign icons to speed buttons Load/Save/New/Close = new default buttons with icons Possibility to resize file list and textshell Parameters to shell script macro files Fixed window resize bug + General bug fix check-in: 683c59d574 user: dennis tags: trunk | |
2000-11-10
| ||
00:17 | Prepared for 0_9_9 rlease check-in: ace6fff787 user: dennis tags: trunk | |
Added lib/CHANGES.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
Version 0.9.9 released 00-11- * Logo in File menu * Possibility to assign icons to speed buttons * Load/Save/New/Close = new default buttons with icons * Possibility to resize file list and textshell * Parameters to shell script macro files * Fixed window resize bug * Added macro manager and ability to exec sh macros * Added textshell + cleaned up gui.tcl * Added support for wrapping * Added some new color coding to the file list * Fixed several bugs in findreplace routines * Changed/improved internal handling of macro files Version 0.9.8 released 99-11-28 * Added file browser function (Experimental) * Some small bug fixes. Version 0.9.7 released 99-08-13 * Added RPM package !!! * Added a working Undo function ! * Added a help browser! (All help text is not written yet...) * Removed the stupid file requester (Using the tk/tcl built in) * All code is now in CVS so now i have a little better control over things (I hope ;-) * And as usual some bugs are fixxed and some new are created. Version 0.9.5 released 99-02-04 * Allmost all files are rewritten in a more structured way * Removed Undo function (Will be implemented later) * Removed experimental "markings" * Added experimental filerequest * Added speed buttons * Added ability to automatically generate configuration files * Added posibility to modify key bindings from conf. file * Added standard error handler Version 0.9.0 released 98-08-21 * Added Undo function (control-z) * Added experimental "markings" * Added open url at command line * Added ftp load/save function * Added Exec function (with preview try use %f %F %w) * Removed window buttons, added support for up to 100 windows Version 0.7.0 released 98-06-03 * Mayor restructuring of the code * Changes to the file structure * .tcltextedit now installes itself in a diffrent directory: default /usr/local/tcltextedit * .tcltextedit was renamed to rc an placed into $HOME/.tcltextedit/, wich also acts as a place to store tmp files and macro files. * Added macro functions * Added "Open Url" * Added filesaved check when closed by wm * Filenames are now displayed in the title bar (only name.ext part) * Changed help window * Load multiple files from commandline * Updated install script Version 0.6.8 released 98-05-21 * Tk/Tcl Version check at startup * The color settings are fixxed, They actually work ! * A popup menu was added, (Just press somewhere over the text with the third mouse button) * The clipboard routines are also fixed * You can now choose the nuber of windows in the .tcltextedit file * The Changed text now changes color thanks to Thierry Andry * Plus some small bugfixxes Version 0.6.5 released 98-05-14 * Handles up to 10 files * Supports X-clipboard and editation of the clipbord * Load clipboard from file * Search/Replace function * Improved keyboard-interface |
Added lib/Close.mac.
> > |
1 2 |
global current_window file::Close $current_window |
Added lib/New.mac.
> |
1 |
file::NewFile
|
Added lib/Open.mac.
> |
1 |
file::Load {file}
|
Added lib/Save.mac.
> > > |
1 2 3 |
global window current_window file::Save $window($current_window,info) -force |
Added lib/b_close.gif.
cannot compute difference between binary files
Added lib/b_new.gif.
cannot compute difference between binary files
Added lib/b_open.gif.
cannot compute difference between binary files
Added lib/b_save.gif.
cannot compute difference between binary files
Added lib/bar.gif.
cannot compute difference between binary files
Changes to lib/cfg.tcl.
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
{color-statustext} {Blue} {color-statustextchanged} {Red} {color-cursor} {Black} {color-textshellbg} {White} {color-textshellfg} {Black} {color-textshellcursor} {Blue} {filetypes} { {{All Files} {*} } {{Text Files} {.txt}} {{TCL Scripts} {.tcl}} {{HTML Scripts} {.html}} } {geometry} {=76x26} {numrecent} {6} {recent1} {} {recent2} {} {recent3} {} {recent4} {} {recent5} {} {recent6} {} {flist} {1} {textshell} {0} {speed} {HelloWorld TCL-Exec} {tearoff} {0} {key-macromgr} {Control-F11} {key-paste} {Shift-Insert} {key-copy} {Control-Insert} {key-copycut} {Control-Delete} {key-delline} {Control-y|Control-Y} {key-texteval} {Control-e|Control-E} ................................................................................ {key-searchagain} {Alt-F7} {key-closefile} {Alt-F3} {key-delete} {Delete} {key-backspace} {BackSpace} {key-undo} {Control-z|Control-Z} {key-lastmacro} {Alt-r|Alt-R} {font-editor} {system} " proc checkcfg {} { global cfg::cfglist c debug_messages set num [expr [llength $cfg::cfglist] / 2] for {set i 0} {$i < $num } {incr i } { set a "[lindex $cfg::cfglist [expr $i*2] ]" set b "[lindex $cfg::cfglist [expr $i*2+1] ]" if {![info exist c($a)]} { if {$debug_messages=="1"} { puts stdout "Adding $a with value $b to Config file" } set c($a) $b } } } proc del {n} { global c set c($n) "*del*" cfg::save |
|
>
>
|
>
|
>
>
>
>
>
>
>
>
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
{color-statustext} {Blue} {color-statustextchanged} {Red} {color-cursor} {Black} {color-textshellbg} {White} {color-textshellfg} {Black} {color-textshellcursor} {Blue} {filetypes} { {{All Files} {*} } {{Text Files} {.txt}} {{TCL Scripts} {.tcl}} {{HTML Scripts} {.html}} } {geometry} {550x350} {numrecent} {6} {recent1} {} {recent2} {} {recent3} {} {recent4} {} {recent5} {} {recent6} {} {flist} {1} {flist-width} {100} {textshell} {0} {textshell-height} {5} {speed} {Open New Save Close} {tearoff} {0} {key-macromgr} {Control-F11} {key-paste} {Shift-Insert} {key-copy} {Control-Insert} {key-copycut} {Control-Delete} {key-delline} {Control-y|Control-Y} {key-texteval} {Control-e|Control-E} ................................................................................ {key-searchagain} {Alt-F7} {key-closefile} {Alt-F3} {key-delete} {Delete} {key-backspace} {BackSpace} {key-undo} {Control-z|Control-Z} {key-lastmacro} {Alt-r|Alt-R} {font-editor} {system} {font-textshell} {Terminal} " proc checkcfg {} { global cfg::cfglist c debug_messages installdir set num [expr [llength $cfg::cfglist] / 2] for {set i 0} {$i < $num } {incr i } { set a "[lindex $cfg::cfglist [expr $i*2] ]" set b "[lindex $cfg::cfglist [expr $i*2+1] ]" if {![info exist c($a)]} { if {$debug_messages=="1"} { puts stdout "Adding $a with value $b to Config file" } set c($a) $b } } if {![info exist c(speed-icon)]} { set c(speed-icon) "Open [file join $installdir b_open.gif]" set c(speed-icon) "$c(speed-icon) New [file join $installdir b_new.gif]" set c(speed-icon) "$c(speed-icon) Save [file join $installdir b_save.gif]" set c(speed-icon) "$c(speed-icon) Close [file join $installdir b_close.gif]" } } proc del {n} { global c set c($n) "*del*" cfg::save |
Changes to lib/edit.tcl.
1
2
3
4
5
6
7
8
...
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
set debug_messages 0 set tcl_traceExec 0 set prgname "Tcl TextEdit 0.9.9" #?-About #?%2TCL TextEdit v0.9.x% #? ................................................................................ # Load images image create photo warn -file [file join $installdir/stop.gif] image create photo i_folder -file [file join $installdir/folder.gif] image create photo i_openfile -file [file join $installdir/openfile.gif] image create photo i_savedfile -file [file join $installdir/savedfile.gif] image create photo i_file -file [file join $installdir/file.gif] tk_setPalette background $c(color-background) } #------------------------------------------------------------------------------+ |
|
>
|
1
2
3
4
5
6
7
8
...
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
set debug_messages 1 set tcl_traceExec 0 set prgname "Tcl TextEdit 0.9.9" #?-About #?%2TCL TextEdit v0.9.x% #? ................................................................................ # Load images image create photo warn -file [file join $installdir/stop.gif] image create photo i_folder -file [file join $installdir/folder.gif] image create photo i_openfile -file [file join $installdir/openfile.gif] image create photo i_savedfile -file [file join $installdir/savedfile.gif] image create photo i_file -file [file join $installdir/file.gif] image create photo bar -file [file join $installdir/bar.gif] tk_setPalette background $c(color-background) } #------------------------------------------------------------------------------+ |
Changes to lib/findreplace.tcl.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
-labelanchor w \ -columnborderwidth 0 \ -selectmode extended \ -labelborderwidth 1 \ -fillcolumn file \ -xscrollcommand [list $glb.hsb set] \ -yscrollcommand [list $glb.vsb set] \ -background $c(color-editbg) -borderwidth 0 # add the columns we want to see $glb.listbox column add file -label "File" -width 20 $glb.listbox column add text -label "Text" -width 40 |
| > |
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
-labelanchor w \ -columnborderwidth 0 \ -selectmode extended \ -labelborderwidth 1 \ -fillcolumn file \ -xscrollcommand [list $glb.hsb set] \ -yscrollcommand [list $glb.vsb set] \ -background $c(color-editbg) -borderwidth 0 \ -labelbg $c(color-background) # add the columns we want to see $glb.listbox column add file -label "File" -width 20 $glb.listbox column add text -label "Text" -width 40 |
Changes to lib/folder.gif.
cannot compute difference between binary files
Changes to lib/gui.tcl.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 ... 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 ... 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 ... 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 ... 318 319 320 321 322 323 324 325 326 |
c eval "entry $w $args -background $c(color-editbg) -foreground $c(color-edittxt) -borderwidth 1" } proc xmenu {w args} { global c c eval "menu $w $args -tearoff $c(tearoff) -background $c(color-menubg) -foreground $c(color-menutxt) -activebackground $c(color-menuactive) -activeforeground $c(color-menuactivetext)" } #---------------------------------------------------------- proc Dialog {name inputname} { global r set dlg .dlg ................................................................................ vwait r if {$r=="ok"} {set r [$dlg.input.entry get] } destroy $dlg return $r } #------------------------ Flist procedure ----------------- proc doflist {act} { global c if {$act==1} { canvas .flist -background $c(color-listbg) -width 100 -borderwidth 2 -relief sunken -xscrollcommand ".fscrollx set" -yscrollcommand ".fscrolly set" flist::Show .flist scrollbar .fscrollx -command ".flist xview" -orient horiz -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) scrollbar .fscrolly -command ".flist yview" -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) entry .path -borderwidth 1 grid .scrollx -column 2 -row 3 -sticky ew -columnspan 1 grid .text -column 2 -row 1 -sticky nsew -rowspan 2 -columnspan 1 grid .path -column 0 -row 1 -sticky nsew grid .flist -column 0 -row 2 -sticky nsew grid .fscrolly -column 1 -row 1 -sticky ns -rowspan 2 grid .fscrollx -column 0 -row 3 -sticky ew bind .path <Return> { cd [%W get] flist::showdir .flist * } bind .flist <Button-3> {.fmnu post [winfo pointerx . ] [winfo pointery .]} ................................................................................ bind .flist <Button-1> {.fmnu unpost} } else { destroy .flist destroy .fscrolly destroy .fscrollx destroy .path grid .scrollx -column 0 -row 3 -sticky ew -columnspan 3 grid .text -column 0 -row 1 -sticky nsew -columnspan 3 } } #--------------------------- text shell ------------------- proc dotextshell {act} { global c if {$act==1} { c "Activate textshell" text .textshell -height 5 -yscrollcommand ".shscrolly set" -xscrollcommand ".shscrollx set" -wrap none -foreground $c(color-textshellfg) -background $c(color-textshellbg) -insertbackground $c(color-textshellcursor) -insertborderwidth 0 -insertwidth 6 scrollbar .shscrolly -command ".textshell yview" -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) scrollbar .shscrollx -command ".textshell xview" -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) -orient horiz grid .textshell -column 0 -row 5 -sticky ew -columnspan 3 grid .shscrolly -column 3 -row 5 -sticky ns grid .shscrollx -column 0 -row 6 -sticky ew -columnspan 3 textsh::start .textshell } else { c "Deactivate textshell" textsh::stop destroy .textshell destroy .shscrolly destroy .shscrollx } } #---------------------------------------------------------- proc gbn {n} { global c return "([lindex [split $c($n) "|"] 0])" } set dbutton 0 #make window buttons frame .wl -height 20 -relief sunken -borderwidth 1 -background $c(color-background) bind .wl <Button-3> speed::Side Supertext::text .text -yscrollcommand ".scrolly set" -xscrollcommand ".scrollx set" \ -setgrid true -wrap none -background $c(color-editbg) -foreground $c(color-edittxt) \ -exportselection 0 -borderwidth 2 -highlightthickness 0 -insertbackground $c(color-cursor) \ -font $c(font-editor) -borderwidth 1 scrollbar .scrolly -command ".text yview" -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) scrollbar .scrollx -command ".text xview" -orient horiz -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) frame .status -borderwidth 1 -relief flat label .status.l1 -text "1" -relief sunken -borderwidth 1 -width 10 ................................................................................ .status.c create line 19 2 3 18 -fill gray70 .status.c create line 19 6 7 18 -fill white .status.c create line 19 7 8 18 -fill gray70 .status.c create line 19 8 9 18 -fill gray70 .status.c create line 19 12 13 18 -fill white .status.c create line 19 13 14 18 -fill gray70 #bind .status.c <Motion> { #global dbutton dxx dyy # #set gr [wm grid .] # #if {$dbutton} { # set WW [expr ((%X-[winfo rootx .]) / [lindex $gr 2])-2 ] # set HH [expr ((%Y-[winfo rooty .]) / [lindex $gr 3])-3 ] # set q "x" # if {$WW<56} { set WW 56 } # if {$HH<1} { set HH 1 } # wm geometry . "=$WW$q$HH" # update # } #} bind .status.c <ButtonPress> { global dbutton dxx dyy set dxx %x set dyy %y set dbutton 1 } bind .status.c <ButtonRelease> { global dbutton set dbutton 0 } bind .status.c <FocusOut> { global dbutton set dbutton 0 } grid .wl -row 0 -column 0 -sticky ew -columnspan 4 grid .text -column 0 -row 1 -sticky nsew -rowspan 2 -columnspan 3 grid .scrolly -column 3 -row 1 -sticky ns -rowspan 2 grid .scrollx -column 0 -row 3 -sticky ew -columnspan 3 grid .status -column 0 -row 7 -sticky ew -columnspan 4 grid rowconfigure . 2 -weight 3 grid columnconfigure . 2 -weight 3 grid columnconfigure . 0 -weight 2 if {$c(flist)==1} {doflist 1} if {$c(textshell)==1} {dotextshell 1} #------------------------------- Make menu -------------------------------- xmenu .menu -borderwidth 0 set menu .menu.file xmenu $menu .menu add cascade -label "File" -underline 0 -menu $menu $menu add command -label "New file" -underline 0 -command "file::NewFile" $menu add command -label "Open..." -accelerator [gbn key-load] -underline 0 -command "file::Load file" $menu add command -label "Save" -accelerator [gbn key-save] -underline 0 -command { file::Save $window($current_window,info) -force } $menu add command -label "Save As..." -accelerator [gbn key-saveas ] -underline 4 -command { file::Save $window($current_window,info) } $menu add command -label "Save All" -accelerator [gbn key-saveall ] -underline 4 -command { file::SaveAll } $menu add cascade -label "Recent..." -menu $menu.rcent -underline 0 xmenu $menu.rcent ................................................................................ .menu add cascade -label "Help" -underline 0 -menu $menu $menu add command -label "Help" -command "win::activate 300" $menu add separator $menu add command -label "About" -hidemargin 1 -command { win::activate 300; pml::inserttext .text [pml::gettopic about] } . configure -menu .menu .menu configure -background $c(color-menubg) -foreground $c(color-menutxt) -activebackground $c(color-menuactive) -activeforeground $c(color-menuactivetext) |
| | > > | | < < | | > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > | > > > > > | > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > | | > > > > > | < < |
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 ... 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 ... 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 ... 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 ... 422 423 424 425 426 427 428 |
c eval "entry $w $args -background $c(color-editbg) -foreground $c(color-edittxt) -borderwidth 1" } proc xmenu {w args} { global c c eval "menu $w $args -tearoff $c(tearoff) -background $c(color-menubg) -foreground $c(color-menutxt) -activebackground $c(color-menuactive) -activeforeground $c(color-menuactivetext) -borderwidth 1 -activeborderwidth 0" } #---------------------------------------------------------- proc Dialog {name inputname} { global r set dlg .dlg ................................................................................ vwait r if {$r=="ok"} {set r [$dlg.input.entry get] } destroy $dlg return $r } #------------------------ Flist procedure ----------------- proc doflist {act} { global c flistw if {$act==1} { frame .hz -relief raised -borderwidth 1 -cursor sb_h_double_arrow -width 4 canvas .flist -background $c(color-listbg) -width $c(flist-width) -borderwidth 1 -relief sunken -xscrollcommand ".fscrollx set" -yscrollcommand ".fscrolly set" flist::Show .flist scrollbar .fscrollx -command ".flist xview" -orient horiz -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) scrollbar .fscrolly -command ".flist yview" -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) entry .path -borderwidth 1 -width 1 grid .path -column 0 -row 1 -sticky nsew grid .flist -column 0 -row 2 -sticky nsew grid .fscrollx -column 0 -row 3 -sticky ew grid .fscrolly -column 1 -row 1 -sticky ns -rowspan 2 grid .hz -column 2 -row 1 -sticky ns -rowspan 2 grid .text -column 3 -row 1 -sticky nsew -rowspan 2 -columnspan 2 grid .scrolly -column 4 -row 1 -sticky ns -rowspan 2 grid .scrollx -column 3 -row 3 -sticky ew -columnspan 1 grid rowconfigure . 2 -weight 3 grid columnconfigure . 0 -weight 0 grid columnconfigure . 1 -weight 0 grid columnconfigure . 2 -weight 0 grid columnconfigure . 3 -weight 1 grid columnconfigure . 4 -weight 0 set flistw "" bind .hz <Button-1> { global flistw flistow %W configure -background $c(color-menuactive) set flistw %X set flistow [expr [winfo width .flist]-4] } bind .hz <ButtonRelease> { global flistw set flistw "" %W configure -background $c(color-background) } bind .hz <Enter> " %W configure -background $c(color-menuactive) " bind .hz <Leave> " %W configure -background $c(color-background) " bind .hz <Motion> { global flistw flistow c if {$flistw!=""} { set w [expr $flistow + (%X - $flistw)] if {$w>0} { .flist configure -width $w set c(flist-width) $w } } } bind .path <Return> { cd [%W get] flist::showdir .flist * } bind .flist <Button-3> {.fmnu post [winfo pointerx . ] [winfo pointery .]} ................................................................................ bind .flist <Button-1> {.fmnu unpost} } else { destroy .flist destroy .fscrolly destroy .fscrollx destroy .path destroy .hz grid .scrollx -column 0 -row 3 -sticky ew -columnspan 3 grid .text -column 0 -row 1 -sticky nsew -columnspan 3 grid rowconfigure . 2 -weight 3 grid columnconfigure . 3 -weight 0 grid columnconfigure . 1 -weight 2 } } #--------------------------- text shell ------------------- proc dotextshell {act} { global c textshh if {$act==1} { c "Activate textshell" frame .wz -relief raised -borderwidth 1 -cursor sb_v_double_arrow -height 4 text .textshell -height $c(textshell-height) -yscrollcommand ".shscrolly set" -xscrollcommand ".shscrollx set" \ -wrap none -foreground $c(color-textshellfg) -background $c(color-textshellbg) \ -insertbackground $c(color-textshellcursor) -insertborderwidth 0 -insertwidth 6 \ -font $c(font-textshell) -borderwidth 1 -highlightthickness 0 scrollbar .shscrolly -command ".textshell yview" -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) scrollbar .shscrollx -command ".textshell xview" -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) -orient horiz grid .scrolly -column 4 -row 1 -sticky ns -rowspan 2 grid .wz -column 0 -row 5 -sticky ew -columnspan 4 grid .textshell -column 0 -row 6 -sticky ew -columnspan 4 grid .shscrolly -column 4 -row 6 -sticky ns grid .shscrollx -column 0 -row 7 -sticky ew -columnspan 4 grid .status -column 0 -row 8 -sticky ew -columnspan 5 grid rowconfigure . 5 -weight 0 textsh::start .textshell set textshh "" bind .wz <Button-1> { global textshh textshoh hfont %W configure -background $c(color-menuactive) set textshh %Y set textshoh [expr [winfo height .textshell]-4] # Get the height of the current font set hfont [font metrics [.textshell cget -font] -displayof .textshell -linespace] } bind .wz <ButtonRelease> { global textshh set textshh "" %W configure -background $c(color-background) } bind .wz <Enter> " %W configure -background $c(color-menuactive) " bind .wz <Leave> " %W configure -background $c(color-background) " bind .wz <Motion> { global textshh textshoh hfont c if {$textshh!=""} { set w [expr ($textshoh + ($textshh -%Y)) /$hfont] if {$w>0} { .textshell configure -height $w set c(textshell-height) $w } } } } else { c "Deactivate textshell" textsh::stop destroy .textshell destroy .shscrolly destroy .shscrollx destroy .wz } } #---------------------------------------------------------- proc gbn {n} { global c return "([lindex [split $c($n) "|"] 0])" } #make window buttons frame .wl -height 20 -relief sunken -borderwidth 0 -background $c(color-background) bind .wl <Button-3> speed::Side Supertext::text .text -yscrollcommand ".scrolly set" -xscrollcommand ".scrollx set" \ -setgrid false -wrap none -background $c(color-editbg) -foreground $c(color-edittxt) \ -exportselection 0 -borderwidth 1 -highlightthickness 0 -insertbackground $c(color-cursor) \ -font $c(font-editor) -borderwidth 1 scrollbar .scrolly -command ".text yview" -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) scrollbar .scrollx -command ".text xview" -orient horiz -background $c(color-menubg) -activebackground $c(color-menuactive) -troughcolor $c(color-menubg) frame .status -borderwidth 1 -relief flat label .status.l1 -text "1" -relief sunken -borderwidth 1 -width 10 ................................................................................ .status.c create line 19 2 3 18 -fill gray70 .status.c create line 19 6 7 18 -fill white .status.c create line 19 7 8 18 -fill gray70 .status.c create line 19 8 9 18 -fill gray70 .status.c create line 19 12 13 18 -fill white .status.c create line 19 13 14 18 -fill gray70 #------------------------ Window resizing ------------------------------------ set zpos "" set wpos "" bind all <ButtonRelease> { global zpos set zpos "" } bind .status.c <Button> { global zpos wpos set zpos "%X %Y" set wpos [split [winfo geometry .] "+x"] } bind .status.c <Motion> { global zpos wpos if {$zpos!=""} { set diffx [expr %X - [lindex $zpos 0] ] set diffy [expr %Y - [lindex $zpos 1] ] set w [expr [lindex $wpos 0] + $diffx] set h [expr [lindex $wpos 1] + $diffy] if {$w<0} { set w [lindex $wpos 0] } if {$h<0} { set h [lindex $wpos 1] } set s "x" if {$tcl_platform(platform)!="windows"} { # For X11 we need to compensate for menubar set menuh [winfo height .#menu] wm geometry . "=$w$s$h+[winfo x .]+[expr [winfo y .] - $menuh ]" } else { wm geometry . "=$w$s$h" } } } #---------------------------------------------------------------- grid .wl -row 0 -column 0 -sticky ew -columnspan 5 grid .text -column 0 -row 1 -sticky nsew -rowspan 2 -columnspan 3 grid .scrolly -column 3 -row 1 -sticky ns -rowspan 2 grid .scrollx -column 0 -row 3 -sticky ew -columnspan 2 grid .status -column 0 -row 7 -sticky ew -columnspan 5 grid rowconfigure . 2 -weight 3 grid columnconfigure . 3 -weight 0 grid columnconfigure . 1 -weight 2 if {$c(flist)==1} {doflist 1} if {$c(textshell)==1} {dotextshell 1} #------------------------------- Make menu -------------------------------- xmenu .menu set menu .menu.file xmenu $menu #-activeborderwidth 0 .menu add cascade -label "File" -underline 0 -menu $menu set co [.menu cget -background] .menu.file add command -image bar -columnbreak 0 -hidemargin 1 -activeforeground $co -activebackground $co -foreground $co -background $co $menu add command -label "New file" -underline 0 -command "file::NewFile" -columnbreak 1 $menu add command -label "Open..." -accelerator [gbn key-load] -underline 0 -command "file::Load file" $menu add command -label "Save" -accelerator [gbn key-save] -underline 0 -command { file::Save $window($current_window,info) -force } $menu add command -label "Save As..." -accelerator [gbn key-saveas ] -underline 4 -command { file::Save $window($current_window,info) } $menu add command -label "Save All" -accelerator [gbn key-saveall ] -underline 4 -command { file::SaveAll } $menu add cascade -label "Recent..." -menu $menu.rcent -underline 0 xmenu $menu.rcent ................................................................................ .menu add cascade -label "Help" -underline 0 -menu $menu $menu add command -label "Help" -command "win::activate 300" $menu add separator $menu add command -label "About" -hidemargin 1 -command { win::activate 300; pml::inserttext .text [pml::gettopic about] } . configure -menu .menu .menu configure -background $c(color-menubg) -foreground $c(color-menutxt) -activebackground $c(color-menuactive) -activeforeground $c(color-menuactivetext) |
Changes to lib/macro.tcl.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 ... 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 ... 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 ... 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 ... 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
#? This type of macro files must be created from the %lMACRO_MANAGER% #? #? These files must contain "#!/bin/sh" as the first line, otherwise #? the texteditor won't recognise it as a shell macro. #? #? When a shell macro is executed it will either be executed in the #? background, or if the TextShell window is open, it will be executed there. #? #? Related topics: %lMACROS% %lMACRO_MANAGER% namespace eval macro { namespace export rec play new buttonconf update names files manager realnames ................................................................................ puts $f $macro_data nonewline close $f macro::update speed::Update } proc play {n} { global c set last_macro $n macro::rec macro::play $n set file [macro::get_path $n] if {[macro::get_type $n]=="sh"} { c "Macro type SH" exec "chmod" "774" "$file" if {$c(textshell)} { textsh::runcmd $file } else { exec "$file" } } else { c "Macro type TCL" source $file } } proc get_path {n} { global home installdir if {[file exists "$home/$n.mac"]==1} { return "$home/$n.mac" } else { if {[file exists "$installdir/$n.mac"]==1} { return "$installdir/$n.mac" } } ................................................................................ set typ "$typ {[$w.e get]}" destroy $w if {$r=="ok"} { return $typ } else { return $r} } proc manager_update {} { #BUG! must check if .mgui.l is valid! c set w .mgui.l $w delete 0 end foreach n [macro::names] { $w insert end "{$n} {[macro::get_type $n]}" } } proc Rename_DLG {s} { global r set ou .ou catch {destroy $ou} toplevel $ou ................................................................................ c "Macro manager" set w .mgui catch {destroy $w} toplevel $w wm title $w "Macro manager" scrollbar $w.scroll -command "$w.l yview" mclistbox::mclistbox $w.l -yscrollcommand "$w.scroll set" -width 47 -background $c(color-listbg) frame $w.b xbutton $w.b.new -text "New" -width 6 -command "macro::create" xbutton $w.b.del -text "Delete" -width 6 -command { set sel [.mgui.l curselection] if {$sel!=""} { macro::delete "[lindex [macro::names] $sel]" } } ................................................................................ grid $w.b.ren -column 0 -row 2 grid $w.b.ed -column 0 -row 3 grid $w.b -column 2 -row 0 -sticky n grid $w.ok -column 2 -row 9 -sticky s grid columnconfigure $w 0 -weight 1 grid rowconfigure $w 0 -weight 1 $w.l column add macro -label "Macro" -width 40 $w.l column add type -label "Type" -width 7 manager_update bind $w.l <Double-Button-1> { macro::edit "[lindex [macro::names] [.mgui.l curselection]]" } |
> > > > > > > > > > > | > > > > > > > > > > > > | | > < > | | | | | > | | |
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 ... 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 ... 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 ... 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 ... 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
#? This type of macro files must be created from the %lMACRO_MANAGER% #? #? These files must contain "#!/bin/sh" as the first line, otherwise #? the texteditor won't recognise it as a shell macro. #? #? When a shell macro is executed it will either be executed in the #? background, or if the TextShell window is open, it will be executed there. #? #? All shell macro files are executed with commandline parameters #? accesible with $0... #? #? The commandline parameters are: #? #? $0 - The path to the executed macro file. (Controlled by sh) #? $1 - The path and name combined, of the currently open file. #? $2 - The name of the currently open file. #? $3 - The path of the currently open file. #? $4 - The filename without the last . #? #? Related topics: %lMACROS% %lMACRO_MANAGER% namespace eval macro { namespace export rec play new buttonconf update names files manager realnames ................................................................................ puts $f $macro_data nonewline close $f macro::update speed::Update } proc play {n} { global c window current_window set last_macro $n macro::rec macro::play $n c $n set file [macro::get_path $n] if {[macro::get_type $n]=="sh"} { c "Macro type SH" exec "chmod" "774" "$file" if {$c(textshell)} { set p1 $window($current_window,name) set l [file split $p1] set p2 [lindex $l [expr [llength $l] -1]] set p3 [file dirname $p1] set p4 [file rootname $p2] textsh::runcmd $file "$p1 $p2 $p3 $p4" } else { exec "$file" } } else { c "Macro type TCL $file" source $file } } proc get_path {n} { global home installdir c $n if {[file exists "$home/$n.mac"]==1} { return "$home/$n.mac" } else { if {[file exists "$installdir/$n.mac"]==1} { return "$installdir/$n.mac" } } ................................................................................ set typ "$typ {[$w.e get]}" destroy $w if {$r=="ok"} { return $typ } else { return $r} } proc manager_update {} { c if {[winfo exists .mgui.l]} { set w .mgui.l $w delete 0 end foreach n [macro::names] { $w insert end "{$n} {[macro::get_type $n]}" } } } proc Rename_DLG {s} { global r set ou .ou catch {destroy $ou} toplevel $ou ................................................................................ c "Macro manager" set w .mgui catch {destroy $w} toplevel $w wm title $w "Macro manager" scrollbar $w.scroll -command "$w.l yview" mclistbox::mclistbox $w.l -yscrollcommand "$w.scroll set" -width 47 -background $c(color-listbg) -labelbg $c(color-background) frame $w.b xbutton $w.b.new -text "New" -width 6 -command "macro::create" xbutton $w.b.del -text "Delete" -width 6 -command { set sel [.mgui.l curselection] if {$sel!=""} { macro::delete "[lindex [macro::names] $sel]" } } ................................................................................ grid $w.b.ren -column 0 -row 2 grid $w.b.ed -column 0 -row 3 grid $w.b -column 2 -row 0 -sticky n grid $w.ok -column 2 -row 9 -sticky s grid columnconfigure $w 0 -weight 1 grid rowconfigure $w 0 -weight 1 $w.l column add macro -label "Macro" -width 40 $w.l column add type -label "Type" -width 7 manager_update bind $w.l <Double-Button-1> { macro::edit "[lindex [macro::names] [.mgui.l curselection]]" } |
Changes to lib/speed.tcl.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 .. 36 37 38 39 40 41 42 43 44 45 46 47 48 49 .. 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
#? #? Related topics: %lMACROS% #? namespace eval speed { namespace export Update Button Side Assign Remove Edit proc Edit {} { global current_button c home installdir c $current_button macro::edit "[lindex $c(speed) [expr $current_button - 1]]" .mnu unpost ................................................................................ c $current_button macro::rec global current_button macro::rec "set current_button $current_button" macro::rec "speed::Remove" if {$current_button!=-1} { set n [expr $current_button - 1] set c(speed) [ lreplace $c(speed) $n $n] speed::Update } .mnu unpost } ................................................................................ set c(speed) [ lreplace $c(speed) $n $n $name ] } speed::Update .mnu unpost } proc Update {} { global current_button c c set menu .mnu destroy $menu menu $menu -tearoff 0 menu $menu.macros $menu add command -label "Never mind" -command "$menu unpost" $menu add command -label "Remove this." -command "speed::Remove" $menu add command -label "Edit this." -command "speed::Edit" $menu add cascade -label "Assign" -menu $menu.list xmenu $menu.list $menu configure -tearoff $c(tearoff) -background $c(color-menubg) -foreground $c(color-menutxt) -activebackground $c(color-menuactive) -activeforeground $c(color-menuactivetext) foreach n [macro::names] { $menu.list add command -label $n -command "speed::Assign {$n}" } set current_button -1 #Delete all buttons within frame .wl foreach n [winfo children .wl] { destroy $n } #Add all relevant buttons to frame set i 1 foreach n $c(speed) { xbutton .wl.t$i -text "$n" -command "macro::play {$n}" pack .wl.t$i -side left bind .wl.t$i <Button-3> "speed::Button $i" incr i } if {[llength $c(speed)]==0} { label .wl.t -text "Right click here to add macro buttons" pack .wl.t bind .wl.t <Button-3> speed::Side |
| > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > | > > > > > | | > > > > > > > > | > > > > > > > > > > > > |
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 .. 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 .. 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
#? #? Related topics: %lMACROS% #? namespace eval speed { namespace export Update Button Side Assign Remove Edit selIcon proc Edit {} { global current_button c home installdir c $current_button macro::edit "[lindex $c(speed) [expr $current_button - 1]]" .mnu unpost ................................................................................ c $current_button macro::rec global current_button macro::rec "set current_button $current_button" macro::rec "speed::Remove" if {$current_button!=-1} { speed::removeIcon set n [expr $current_button - 1] set c(speed) [ lreplace $c(speed) $n $n] speed::Update } .mnu unpost } ................................................................................ set c(speed) [ lreplace $c(speed) $n $n $name ] } speed::Update .mnu unpost } proc selIcon {} { global current_button c set file [tk_getOpenFile -title "Select Icon" -filetypes "{{Gif file} {.gif}} {{All Files} {*}}" ] if {($current_button!=-1) && ($file!="")} { set n [expr $current_button - 1] set sb [lindex $c(speed) $n] set ni [lsearch $c(speed-icon) $sb] c $ni if {$ni==-1} { set c(speed-icon) "$c(speed-icon) $sb $file" } else { set ni [expr $ni +1] set c(speed-icon) [ lreplace $c(speed-icon) $ni $ni $file ] } } c $c(speed-icon) speed::Update } proc removeIcon {} { global current_button c if {$current_button!=-1} { set n [expr $current_button - 1] set sb [lindex $c(speed) $n] set ni [lsearch $c(speed-icon) $sb] if {$ni!=-1} { set c(speed-icon) [ lreplace $c(speed-icon) $ni $ni] set c(speed-icon) [ lreplace $c(speed-icon) $ni $ni] c "Remove Icon for: $sb" } } } proc Update {} { global current_button c c set menu .mnu destroy $menu xmenu $menu xmenu $menu.macros $menu add command -label "Never mind" -command "$menu unpost" $menu add command -label "Remove this." -command "speed::Remove" $menu add command -label "Edit this." -command "speed::Edit" $menu add cascade -label "Icon" -menu $menu.icon $menu add cascade -label "Assign" -menu $menu.list xmenu $menu.icon $menu.icon add command -label "Select icon..." -command "speed::selIcon" $menu.icon add command -label "Remove icon" -command { speed::removeIcon speed::Update } xmenu $menu.list $menu configure -background $c(color-menubg) -foreground $c(color-menutxt) -activebackground $c(color-menuactive) -activeforeground $c(color-menuactivetext) foreach n [macro::names] { $menu.list add command -label $n -command "speed::Assign {$n}" } set current_button -1 #Delete all buttons within frame .wl foreach n [winfo children .wl] { destroy $n } #Add all relevant buttons to frame set i 1 foreach n $c(speed) { set ni [lsearch $c(speed-icon) $n] if {$ni==-1} { xbutton .wl.t$i -text "$n" -command "macro::play {$n}" } else { image create photo "icon.$n" -file [lindex $c(speed-icon) [expr $ni+1]] xbutton .wl.t$i -image "icon.$n" -command "macro::play {$n}" } pack .wl.t$i -side left bind .wl.t$i <Button-3> "speed::Button $i" bind .wl.t$i <Enter> ".status.filler config -text $n" bind .wl.t$i <Leave> {.status.filler config -text ""} incr i } if {[llength $c(speed)]==0} { label .wl.t -text "Right click here to add macro buttons" pack .wl.t bind .wl.t <Button-3> speed::Side |
Changes to lib/textsh.tcl.
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
..
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
tkTextSetCursor $w end $w see end } } } } proc runcmd {cmd} { variable pipe variable cmds variable w set cmds "" switch $cmd { clear { $w delete 0.0 end $w see end ................................................................................ runcmd "" } exit { $w insert end "\ntextsh: unsupported command" } default { puts $pipe $cmd flush $pipe } } } proc startsh {} { |
|
>
>
>
>
>
>
>
>
>
>
>
|
|
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
..
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
tkTextSetCursor $w end $w see end } } } } proc runcmd {cmd args} { variable pipe variable cmds variable w c set argstring "" for {set i 0} {$i <[string length $args]} {incr i } { set c [string index $args $i] if {($c!="\173") && ($c!="\175")} { set argstring "$argstring$c" } } set cmds "" switch $cmd { clear { $w delete 0.0 end $w see end ................................................................................ runcmd "" } exit { $w insert end "\ntextsh: unsupported command" } default { puts $pipe "$cmd $argstring" flush $pipe } } } proc startsh {} { |
Changes to lib/window.tcl.
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
...
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
} } return $r } proc exit {} { global c c set gr [wm grid .] c $gr # Keep track of the compensation factors! set wf "-3" set hf "-12" set WW [expr (([winfo width .]) / [lindex $gr 2]) $wf ] set HH [expr (([winfo height .]) / [lindex $gr 3]) $hf ] set q "x" set c(geometry) "=$WW$q$HH" c $c(geometry) } proc count {} { global numw window set num 0 for {set i 1} {$i < $numw+1 } {incr i} { ................................................................................ if {$window($i,echange)==1} { .menu.windowmenu add command -label "$i. [pton $window($i,name)]" -command "win::activate $i" } } .menu.windowmenu add separator .menu.windowmenu add command -label "Filelist" -underline 5 -command { global c if {$c(flist)==1} {set c(flist) 0} else {set c(flist) 1} doflist $c(flist) } .menu.windowmenu add command -label "TextShell" -underline 5 -command { global c if {$c(textshell)==1} {set c(textshell) 0} else {set c(textshell) 1} dotextshell $c(textshell) } .menu.windowmenu add command -label "Help" -underline 0 -command "win::activate 300" .menu.windowmenu add command -label "View/Edit Clipboard" -underline 5 -command "win::activate 100" |
<
<
<
<
<
<
<
<
<
<
|
|
<
<
>
<
|
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
...
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
} } return $r } proc exit {} { global c set c(geometry) [wm geometry .] c $c(geometry) } proc count {} { global numw window set num 0 for {set i 1} {$i < $numw+1 } {incr i} { ................................................................................ if {$window($i,echange)==1} { .menu.windowmenu add command -label "$i. [pton $window($i,name)]" -command "win::activate $i" } } .menu.windowmenu add separator .menu.windowmenu add checkbutton -label "Filelist" -variable c(flist) -underline 5 -onvalue 1 -offvalue 0 -command { global c doflist $c(flist) } .menu.windowmenu add checkbutton -label "TextShell" -variable c(textshell) -onvalue 1 -offvalue 0 -underline 5 -command { global c dotextshell $c(textshell) } .menu.windowmenu add command -label "Help" -underline 0 -command "win::activate 300" .menu.windowmenu add command -label "View/Edit Clipboard" -underline 5 -command "win::activate 100" |