diff --git a/ChangeLog b/ChangeLog index 780aa6a864..d65350b611 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +Fri Dec 17 16:28:12 2004 Hidetoshi NAGAI + + * ext/tk/lib/tk.rb: fix bug on setting up system encoding + + * ext/tk/lib/tk/event.rb: fix error on require process + + * ext/tk/lib/font.rb: fix abnormal termination error on Windows + + * ext/tk/lib/tk/virtevent.rb: TkVirtualEvent::PreDefVirtEvent.new() + accepts event-sequence arguments + + * ext/tk/lib/text.rb: fail to dump embedded images + + * ext/tk/lib/text.rb: tag_nextrange and tag_prevrange returns wrong + types of values + + * ext/tk/lib/texttag.rb: nextrange and prevrange returns wrong + types of values + + * ext/tk/lib/text.rb: add TkText::IndexModMethods module and + TkText::IndexString class to treat text index modifiers + + * ext/tk/lib/texttag.rb: use TkText::IndexModMethods module + + * ext/tk/lib/textmark.rb: ditto + + * ext/tk/lib/textimage.rb: ditto + + * ext/tk/lib/textwindow.rb: ditto + + * ext/tk/lib/textimage.rb: wrong gravity of text mark for embedded + image + + * ext/tk/lib/textwindow.rb: wrong gravity of text mark for + embedded window + Fri Dec 17 13:33:58 2004 Nobuyoshi Nakada * lib/cgi/session.rb (CGI::Session#initialize): control adding diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 3cb911147a..97535af124 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -2056,15 +2056,28 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK) case $KCODE when /^e/i # EUC Tk.encoding = 'euc-jp' + Tk.encoding_system = 'euc-jp' when /^s/i # SJIS - Tk.encoding = 'shiftjis' + begin + if Tk.encoding_system == 'cp932' + Tk.encoding = 'cp932' + else + Tk.encoding = 'shiftjis' + Tk.encoding_system = 'shiftjis' + end + rescue StandardError, NameError + Tk.encoding = 'shiftjis' + Tk.encoding_system = 'shiftjis' + end when /^u/i # UTF8 Tk.encoding = 'utf-8' + Tk.encoding_system = 'utf-8' else # NONE begin Tk.encoding = Tk.encoding_system rescue StandardError, NameError Tk.encoding = 'utf-8' + Tk.encoding_system = 'utf-8' end end diff --git a/ext/tk/lib/tk/event.rb b/ext/tk/lib/tk/event.rb index 5af0fcd44d..dd01ba6309 100644 --- a/ext/tk/lib/tk/event.rb +++ b/ext/tk/lib/tk/event.rb @@ -8,7 +8,7 @@ end ######################## require 'tkutil' -require 'tk' +# require 'tk' ######################## diff --git a/ext/tk/lib/tk/font.rb b/ext/tk/lib/tk/font.rb index 1e314e5bb9..790537ef8d 100644 --- a/ext/tk/lib/tk/font.rb +++ b/ext/tk/lib/tk/font.rb @@ -53,7 +53,8 @@ class TkFont '-compound')) else # unknown Tcl/Tk-JP - platform = tk_call('set', 'tcl_platform(platform)') + #platform = tk_call('set', 'tcl_platform(platform)') + platform = Tk::PLATFORM['platform'] case platform when 'unix' ltn = {'family'=>'Helvetica'.freeze, @@ -79,7 +80,8 @@ class TkFont else # not JAPANIZED_TK begin - platform = tk_call('set', 'tcl_platform(platform)') + #platform = tk_call('set', 'tcl_platform(platform)') + platform = Tk::PLATFORM['platform'] case platform when 'unix' ltn = {'family'=>'Helvetica'.freeze, diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb index a79f50616a..f99337b3e9 100644 --- a/ext/tk/lib/tk/text.rb +++ b/ext/tk/lib/tk/text.rb @@ -66,6 +66,64 @@ class TkText