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
|
# RCS: @(#) $Id: ctext_tcl.tcl,v 1.2 2005/03/31 03:15:48 andreas_kupries Exp $
package provide ctext_tcl 0.8
proc ctext::setHighlightTcl {w} {
set color(widgets) red3
set color(flags) orange3
set color(stackControl) red
set color(vars) magenta4
set color(variable_funcs) red4
set color(brackets) DeepPink
set color(comments) blue4
set color(strings) green4
ctext::addHighlightClass $w widgets $color(widgets) \
[list obutton button label text frame toplevel cscrollbar \
scrollbar checkbutton canvas listbox menu menubar menubutton \
radiobutton scale entry message tk_chooseDir tk_getSaveFile \
tk_getOpenFile tk_chooseColor tk_optionMenu]
ctext::addHighlightClass $w flags $color(flags) \
[list -text -command -yscrollcommand \
-xscrollcommand -background -foreground -fg -bg \
-highlightbackground -y -x -highlightcolor -relief -width \
-height -wrap -font -fill -side -outline -style -insertwidth \
-textvariable -activebackground -activeforeground \
-insertbackground -anchor -orient -troughcolor -nonewline \
-expand -type -message -title -offset -in -after -yscroll \
-xscroll -forward -regexp -count -exact -padx -ipadx \
-filetypes -all -from -to -label -value -variable \
-regexp -backwards -forwards -bd -pady -ipady -state -row \
-column -cursor -highlightcolors -linemap -menu -tearoff \
-displayof -cursor -underline -tags -tag -length]
ctext::addHighlightClass $w stackControl $color(stackControl) \
[list proc uplevel namespace while for foreach if else]
ctext::addHighlightClassWithOnlyCharStart $w vars $color(vars) "\$"
ctext::addHighlightClass $w variable_funcs $color(variable_funcs) \
[list set global variable unset]
ctext::addHighlightClassForSpecialChars $w brackets $color(brackets) {[]{}}
ctext::addHighlightClassForRegexp $w comments $color(comments) {\#[^\n\r]*}
ctext::addHighlightClassForRegexp $w strings $color(strings) {"(\\"|[^"])*"}
}
|