Tk Text Edit

Check-in [6fb2d79ec9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add special char dialog and speedbutton with icon
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6fb2d79ec9b03f9fbf0efa0a8e50d71229d254fe
User & Date: dennis 2001-01-25 23:39:19
Context
2001-02-04
00:22
Made special char interactive+ improvements check-in: b9e97f721a user: dennis tags: trunk
2001-01-25
23:39
Add special char dialog and speedbutton with icon check-in: 6fb2d79ec9 user: dennis tags: trunk
2001-01-24
22:36
Changed powin so that the windows will appear in cetre off app check-in: 7fa8d72df5 user: dennis tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/CHANGES.


1
2
3
4
5
6
7

* Add posibility to delete files in filelist window.
* Add new common dialog window.
* Various bug fixes on the file list.

Version 0.9.9 released 00-12-25

* Logo in File menu
>







1
2
3
4
5
6
7
8
* Add "Insert Special char" dialog
* Add posibility to delete files in filelist window.
* Add new common dialog window.
* Various bug fixes on the file list.

Version 0.9.9 released 00-12-25

* Logo in File menu

Added lib/SpecChar.mac.



>
1
.text insert end [format "%c" [specc::specc]]

Added lib/b_specc.gif.

cannot compute difference between binary files

Changes to lib/cfg.tcl.

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
..
77
78
79
80
81
82
83

84
85

86
87
88
89
90
91
92
..
98
99
100
101
102
103
104

105
106
107
108
109
110
111
{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-saveas}            {Alt-F2}
{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] ]"
................................................................................
}

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







|







 







>


>







 







>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
..
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
...
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{recent4}		  {}
{recent5}		  {}
{recent6}		  {}
{flist}                   {1}
{flist-width}		  {100}
{textshell}		  {0}
{textshell-height}	  {5}
{speed}                   {Open New Save Close SpecChar}
{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-saveas}            {Alt-F2}
{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}
{key-specc}             {Control-F12}
{font-editor}           {system}
{font-textshell}        {Terminal}
{specc-fontsize}	{12}
"

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] ]"
................................................................................
}

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]"
	set c(speed-icon) "$c(speed-icon) SpecChar [file join $installdir b_specc.gif]"
	}

}


proc del {n} {
global c

Changes to lib/edit.tcl.

245
246
247
248
249
250
251

252
253
254
255

256
257
258
259
260
261
262
source $installdir/findreplace.tcl
source $installdir/file.tcl
source $installdir/ftp_lib.tcl
source $installdir/cmds.tcl
source $installdir/exec.tcl
source $installdir/flist.tcl
source $installdir/textsh.tcl

source $installdir/gui.tcl
source $installdir/txt.tcl
source $installdir/bindings.tcl
source $installdir/speed.tcl



#------------------------------------------------------------------------------+

#Check if user supplied anything at the command line

set i 1







>




>







245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
source $installdir/findreplace.tcl
source $installdir/file.tcl
source $installdir/ftp_lib.tcl
source $installdir/cmds.tcl
source $installdir/exec.tcl
source $installdir/flist.tcl
source $installdir/textsh.tcl
source $installdir/specc.tcl
source $installdir/gui.tcl
source $installdir/txt.tcl
source $installdir/bindings.tcl
source $installdir/speed.tcl



#------------------------------------------------------------------------------+

#Check if user supplied anything at the command line

set i 1

Changes to lib/gui.tcl.

509
510
511
512
513
514
515

516
517
518
519
520
521
522
$menu add command -label "Copy" -accelerator [gbn key-copy] -underline 0 -command "txt::copy .text"
$menu add command -label "Copy from..." -accelerator [gbn key-copyfromclip ] -underline 5 -command "txt::copyfrom_clip .text"
$menu add command -label "Cut" -accelerator [gbn key-delete ] -underline 1 -command "txt::cut .text"
$menu add command -label "CopyCut" -accelerator [gbn key-copycut ] -command "txt::copycut .text"
$menu add command -label "Paste" -accelerator [gbn key-paste ] -underline 0 -command "txt::paste .text"
$menu add command -label "Select all" -accelerator [gbn key-tagall ] -underline 0 -command "txt::tagall .text"
$menu add command -label "Evaluate" -accelerator [gbn key-texteval ] -underline 0 -command "txt::texteval .text"


$menu add separator
$menu add checkbutton -label "Wrap lines" -variable wraping -offvalue "none" -onvalue "word" -command { .text configure -wrap $wraping }   

set menu .menu.searchmenu
xmenu $menu 
.menu add cascade -label "Search" -underline 0 -menu $menu 







>







509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
$menu add command -label "Copy" -accelerator [gbn key-copy] -underline 0 -command "txt::copy .text"
$menu add command -label "Copy from..." -accelerator [gbn key-copyfromclip ] -underline 5 -command "txt::copyfrom_clip .text"
$menu add command -label "Cut" -accelerator [gbn key-delete ] -underline 1 -command "txt::cut .text"
$menu add command -label "CopyCut" -accelerator [gbn key-copycut ] -command "txt::copycut .text"
$menu add command -label "Paste" -accelerator [gbn key-paste ] -underline 0 -command "txt::paste .text"
$menu add command -label "Select all" -accelerator [gbn key-tagall ] -underline 0 -command "txt::tagall .text"
$menu add command -label "Evaluate" -accelerator [gbn key-texteval ] -underline 0 -command "txt::texteval .text"
$menu add command -label "Special Char..." -accelerator [gbn key-specc ] -underline 0 -command { .text insert end [format "%c" [specc::specc]] }

$menu add separator
$menu add checkbutton -label "Wrap lines" -variable wraping -offvalue "none" -onvalue "word" -command { .text configure -wrap $wraping }   

set menu .menu.searchmenu
xmenu $menu 
.menu add cascade -label "Search" -underline 0 -menu $menu 

Added lib/specc.tcl.























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
namespace eval  specc {

namespace export specc

proc enter {w p} {
$w.l config -text [format "Dec: %d Hex: %x  Oct: %o" $p $p $p]
$w.c itemconfigure "t$p" -fill green
}

proc leave {w p} {
$w.c itemconfigure "t$p" -fill black
}

proc specc {args} {
global result1 c
set result1 "<None>"
set w .wdlgc

if {$args==""} {
	set font $c(font-editor)
} else {
	set font $args
}

set font "[lindex $font 0] $c(specc-fontsize) [lindex $font 2] [lindex $font 3] [lindex $font 4] [lindex $font 5] [lindex $font 6]"
set cellsize [lindex [font metrics $font] 5]

catch {destroy $w}
toplevel $w

wm title $w "Select special char"
wm resizable $w false false
wm transient $w .
wm protocol  $w WM_DELETE_WINDOW "set result1 <None>" 

canvas  $w.c -width [expr $cellsize*17] -height [expr $cellsize*17] -borderwidth 1 -relief raised
label $w.l 
set p 0

for {set y 1} {$y <17 } {incr y } {
	for {set x 0} {$x <16 } {incr x } {
		$w.c create text  [expr $x*$cellsize+$cellsize] [expr $y*$cellsize]  -text  [format "%c" $p] -font $font -tag "t$p"
		$w.c bind "t$p" <Motion>  "specc::enter $w $p"
		$w.c bind "t$p" <Enter>   "specc::enter $w $p"
		$w.c bind "t$p" <Leave>  "specc::leave $w $p"
		$w.c bind "t$p" <Button-1>  "set result1 $p"
		incr p
	}
}

grid $w.c -column 0 -row 0
grid $w.l

vwait result1
destroy $w
return $result1
}

}