[Tkabber-dev] r827 - in trunk/tkabber-plugins: . tkabber-khim tkabber-khim/khim

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Dec 15 20:24:55 MSK 2006


Author: sergei
Date: 2006-12-15 20:24:52 +0300 (Fri, 15 Dec 2006)
New Revision: 827

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/tkabber-khim/ChangeLog
   trunk/tkabber-plugins/tkabber-khim/khim/khim.tcl
Log:
	* tkabber-khim/khim/khim.tcl: Changed Unicode charmap colors.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2006-12-13 19:09:46 UTC (rev 826)
+++ trunk/tkabber-plugins/ChangeLog	2006-12-15 17:24:52 UTC (rev 827)
@@ -1,3 +1,7 @@
+2006-12-15  Sergei Golovan  <sgolovan at nes.ru>
+
+	* tkabber-khim/khim/khim.tcl: Changed Unicode charmap colors.
+
 2006-12-13  Sergei Golovan  <sgolovan at nes.ru>
 
 	* tkabber-khim/*: Added tkabber-khim plugin by Konstantin

Modified: trunk/tkabber-plugins/tkabber-khim/ChangeLog
===================================================================
--- trunk/tkabber-plugins/tkabber-khim/ChangeLog	2006-12-13 19:09:46 UTC (rev 826)
+++ trunk/tkabber-plugins/tkabber-khim/ChangeLog	2006-12-15 17:24:52 UTC (rev 827)
@@ -1,3 +1,8 @@
+2006-12-15  Sergei Golovan <sgolovan at nes.ru>
+
+	* Changed colors of Unicode charmap. This change looks like a hack,
+	  so it's not for proposing uopstream.
+
 2006-12-13  Sergei Golovan <sgolovan at nes.ru>
 
 	* Removed autoscroll package and reference to it from KHIM to

Modified: trunk/tkabber-plugins/tkabber-khim/khim/khim.tcl
===================================================================
--- trunk/tkabber-plugins/tkabber-khim/khim/khim.tcl	2006-12-13 19:09:46 UTC (rev 826)
+++ trunk/tkabber-plugins/tkabber-khim/khim/khim.tcl	2006-12-15 17:24:52 UTC (rev 827)
@@ -1050,14 +1050,14 @@
     if { ![string is integer -strict $CMapInputCodePage($w)]
 	 || $CMapInputCodePage($w) < 0
 	 || $CMapInputCodePage($w) >= 0x100 } {
-	$spin configure -background \#ff6666
+	#$spin configure -background \#ff6666
     } else {
 
 	# Valid code page - generate the values list. Make sure that
 	# the current value is in the list, even if it's formatted
 	# eccentrically (e.g., 0x000012).
 
-	$spin configure -background white
+	#$spin configure -background white
 	if { [string match *0x* $CMapInputCodePage($w)] } {
 	    set format 0x%02X
 	} else {
@@ -1111,6 +1111,7 @@
     variable CMapYL
     variable CMapSelectedCharacter
     variable CMapAfter
+    variable CMapForeground
 
     if {[info exists CMapAfter($w)]} {
 	after cancel $CMapAfter($w)
@@ -1148,8 +1149,8 @@
 			   [expr { $point / 0x100 }] [expr { $point % 0x100 }]]
 		set f $CMapBadCharFont
 	    }
-	    set tags [list row$row col$col]
-	    $c create text 0 0 -text $t -font $f \
+	    set tags [list text row$row col$col]
+	    $c create text 0 0 -text $t -font $f -fill $CMapForeground\
 		-anchor center -justify center -tags $tags
 	    set tock [clock clicks -milliseconds]
 	    if {$ok && $tock-$tick > 1500} {
@@ -1202,10 +1203,10 @@
     # the separator lines and configure the canvas size
 
     foreach x $CMapXL($w) {
-	$c create line $x $ymin $x $ymax -width 0 -fill gray85
+	$c create line $x $ymin $x $ymax -width 0 -fill $CMapForeground
     }
     foreach y $CMapYL($w) {
-	$c create line $xmin $y $xmax $y -width 0 -fill gray85
+	$c create line $xmin $y $xmax $y -width 0 -fill $CMapForeground
     }
     $c configure -width [expr { $xmax + $pad }] \
 	-height [expr { $ymax + $pad }] \
@@ -1286,6 +1287,9 @@
     variable CMapSelectedCharacter
     variable CMapXL
     variable CMapYL
+    variable CMapForeground
+    variable CMapSelectBackground
+    variable CMapSelectForeground
     if { $CMapSelectedCharacter($w) < $CMapCodePage($w) * 0x0100
 	 || $CMapSelectedCharacter($w) >= ($CMapCodePage($w) + 1) * 0x100 } {
 	set CMapSelectedCharacter($w) \
@@ -1296,15 +1300,22 @@
     set rem [expr { $CMapSelectedCharacter($w) % 0x0100 }]
     set row [expr { $rem / 16 }]
     set col [expr { $rem % 16 }]
+
+    $c itemconfigure text -fill $CMapForeground
+    $c itemconfigure text&&row$row&&col$col -fill $CMapSelectForeground
+
     set xmin [lindex $CMapXL($w) $col]
     incr col
     set xmax [lindex $CMapXL($w) $col]
+
     set ymin [lindex $CMapYL($w) $row]
     incr row
     set ymax [lindex $CMapYL($w) $row]
     catch { $c delete selectrect }
     $c create rectangle $xmin $ymin $xmax $ymax \
-	-width 2 -fill {} -outline blue -tags selectrect
+	-width 2 -fill $CMapSelectBackground \
+	-outline $CMapSelectBackground -tags selectrect
+    $c lower selectrect
     return
 }
 
@@ -1586,6 +1597,10 @@
     variable CMapInputCodePage
     variable CMapCodePage
     variable CMapFocus
+    variable CMapBackground
+    variable CMapForeground
+    variable CMapSelectBackground
+    variable CMapSelectForeground
     set t [winfo toplevel $w]
     if { $t eq "." } {
 	set t {}
@@ -1608,8 +1623,17 @@
     grid [spinbox $map.spin -textvariable khim::CMapInputCodePage($map) \
 	      -width 4] \
 	-row 0 -column 1 -sticky w
+
+    # Get canvas background from spinbox background
+    set CMapBackground [lindex [$map.spin configure -background] 4]
+    # Get text foreground and grid lines color from spinbox text foreground
+    set CMapForeground [lindex [$map.spin configure -foreground] 4]
+    # Get rectangle outline from spinbox selectbackground
+    set CMapSelectBackground [lindex [$map.spin configure -selectbackground] 4]
+    set CMapSelectForeground [lindex [$map.spin configure -selectforeground] 4]
+
     set c $map.c
-    grid [canvas $c -width 400 -height 400 -bg white -takefocus 1] \
+    grid [canvas $c -width 400 -height 400 -bg $CMapBackground -takefocus 1] \
 	-columnspan 2 -padx 3 -pady 3
     grid [frame $map.f] -row 2 -column 0 -columnspan 2 -sticky ew -pady 3
     button $map.f.b1 -text [mc OK] -command [list khim::CMapOK $map]



More information about the Tkabber-dev mailing list