Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6f8c33

Browse files
committed
Allow pgaccess to input Japanese. See included mail.
Subject: [HACKERS] pgaccess Japanese input capability patchFrom: Tatsuo Ishii <t-ishii@sra.co.jp>To: teo@flex.roCc: pgsql-hackers@postgresql.org, pgsql-interfaces@postgresql.orgDate: Sat, 24 Feb 2001 21:41:14 +0900Hi Teodorescu,I have made patches which enable pgaccess to input Japanese charactersin the table editing window. As you might know, to input Japanesecharacters, we first type in "hiragana" then convert it to "kanji". Tomake this proccess transparent to tcl application programs, librariesare provided with localized version of Tcl/Tk. The patches bindcertain keys to initiate a function (kanjiInput) that is responsiblefor the conversion process. If the function is not available, thosekeys will not be binded.Comments?--Tatsuo Ishii
1 parent9c99365 commitf6f8c33

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

‎src/bin/pgaccess/lib/tables.tcl

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,10 @@ set PgAcVar(mw,$wn,toprec) 0
813813
setScrollbar$wn
814814
if {$PgAcVar(mw,$wn,updatable)}then {
815815
$wn.c bind q <Key>"Tables::editText$wn %A %K"
816+
if {[info commands kanjiInput] =="kanjiInput"}then {
817+
$wn.c bind q <Control-backslash>"pgaccess_kinput_start %W";
818+
$wn.c bind q <Control-Kanji>"pg_access_kinput_start %W";
819+
}
816820
}else {
817821
$wn.c bind q <Key> {}
818822
}
@@ -2161,3 +2165,80 @@ proc vTclWindow.pgaw:Permissions {base} {
21612165
grid$base.fb.btncancel\
21622166
-in .pgaw:Permissions.fb -column 1 -row 0 -columnspan 1 -rowspan 1
21632167
}
2168+
2169+
#
2170+
# NOTE: following two procedures _kinput_trace_root and _kinput_trace_over
2171+
# were originaly part of kinput.tcl.
2172+
# -- Tatuso Ishii 2000/08/18
2173+
2174+
# kinput.tcl --
2175+
#
2176+
# This file contains Tcl procedures used to input Japanese text.
2177+
#
2178+
# $Header: /cvsroot/pgsql/src/bin/pgaccess/lib/Attic/tables.tcl,v 1.7 2001/02/26 05:15:48 ishii Exp $
2179+
#
2180+
# Copyright (c) 1993 Software Research Associates, Inc.
2181+
#
2182+
# Permission to use, copy, modify, and distribute this software and its
2183+
# documentation for any purpose and without fee is hereby granted, provided
2184+
# that the above copyright notice appear in all copies and that both that
2185+
# copyright notice and this permission notice appear in supporting
2186+
# documentation, and that the name of Software Research Associates not be
2187+
# used in advertising or publicity pertaining to distribution of the
2188+
# software without specific, written prior permission. Software Research
2189+
# Associates makes no representations about the suitability of this software
2190+
# for any purpose. It is provided "as is" without express or implied
2191+
# warranty.
2192+
#
2193+
2194+
# The procedure below is invoked in order to start Japanese text input
2195+
# for the specified widget. It sends a request to the input server to
2196+
# start conversion on that widget.
2197+
# Second argument specifies input style. Valid values are "over" (for
2198+
# over-the-spot style) and "root" (for root window style). See X11R5
2199+
# Xlib manual for the meaning of these styles). The default is root
2200+
# window style.
2201+
2202+
procpgaccess_kinput_start {w {style root}} {
2203+
global _kinput_priv
2204+
catch {unset _kinput_priv($w)}
2205+
if {$style=="over"}then {
2206+
set spot [_kinput_spot$w]
2207+
if {"$spot" !=""}then {
2208+
trace variable _kinput_priv($w) w _pgaccess_kinput_trace_$style
2209+
kanjiInput start$w\
2210+
-variable _kinput_priv($w)\
2211+
-inputStyle over\
2212+
-foreground [_kinput_attr$w -foreground]\
2213+
-background [_kinput_attr$w -background]\
2214+
-fonts [list [_kinput_attr$w -font]\
2215+
[_kinput_attr$w -kanjifont]]\
2216+
-clientArea [_kinput_area$w]\
2217+
-spot$spot
2218+
return
2219+
}
2220+
}
2221+
trace variable _kinput_priv($w) w _pgaccess_kinput_trace_root
2222+
kanjiInput start$w -variable _kinput_priv($w) -inputStyle root
2223+
}
2224+
2225+
# for root style
2226+
proc_pgaccess_kinput_trace_root {name1 name2 op} {
2227+
global PgAcVar
2228+
set wn [string trimright$name2".c"]
2229+
upvar #0$name1 trvar
2230+
set c$trvar($name2)
2231+
Tables::editText$wn$c$c
2232+
unset$trvar($name2)
2233+
}
2234+
2235+
# for over-the-spot style
2236+
proc_pgaccess_kinput_trace_over {name1 name2 op} {
2237+
global PgAcVar
2238+
set wn [string trimright$name2".c"]
2239+
upvar #0$name1 trvar
2240+
set c$trvar($name2)
2241+
Tables::editText$wn$c$c
2242+
kinput_send_spot$name2
2243+
unset$trvar($name2)
2244+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp