* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 03:29:39 +00:00
|
|
|
|
# -*- coding: euc-jp -*-
|
2003-07-31 20:52:40 +00:00
|
|
|
|
#
|
|
|
|
|
# listbox widget demo 'states' (called by 'widget')
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# toplevel widget <20><>¸<EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if defined?($states_demo) && $states_demo
|
|
|
|
|
$states_demo.destroy
|
|
|
|
|
$states_demo = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# demo <20>Ѥ<EFBFBD> toplevel widget <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
$states_demo = TkToplevel.new {|w|
|
|
|
|
|
title("Listbox Demonstration (states)")
|
|
|
|
|
iconname("states")
|
|
|
|
|
positionWindow(w)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# label <20><><EFBFBD><EFBFBD>
|
|
|
|
|
msg = TkLabel.new($states_demo) {
|
|
|
|
|
font $font
|
|
|
|
|
wraplength '4i'
|
|
|
|
|
justify 'left'
|
|
|
|
|
text "<EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>ܸ<EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>դΥꥹ<EFBFBD>ȥܥå<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꥹ<EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τϥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꥹ<EFBFBD>ȥܥå<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥޥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υܥ<EFBFBD><EFBFBD><EFBFBD>2(<28><><EFBFBD>ܥ<EFBFBD><DCA5><EFBFBD>)<29><EFBFBD><F2B2A1A4><EFBFBD><EFBFBD>ޤޥɥ<DEA5><C9A5>å<EFBFBD><C3A5><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD>"
|
|
|
|
|
}
|
|
|
|
|
msg.pack('side'=>'top')
|
|
|
|
|
|
|
|
|
|
# frame <20><><EFBFBD><EFBFBD>
|
|
|
|
|
TkFrame.new($states_demo) {|frame|
|
|
|
|
|
TkButton.new(frame) {
|
2004-05-01 16:09:54 +00:00
|
|
|
|
#text 'λ<><CEBB>'
|
|
|
|
|
text '<27>Ĥ<EFBFBD><C4A4><EFBFBD>'
|
2003-07-31 20:52:40 +00:00
|
|
|
|
command proc{
|
|
|
|
|
tmppath = $states_demo
|
|
|
|
|
$states_demo = nil
|
|
|
|
|
tmppath.destroy
|
|
|
|
|
}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes')
|
|
|
|
|
|
|
|
|
|
TkButton.new(frame) {
|
|
|
|
|
text '<27><><EFBFBD><EFBFBD><EFBFBD>ɻ<EFBFBD><C9BB><EFBFBD>'
|
|
|
|
|
command proc{showCode 'states'}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes')
|
|
|
|
|
|
|
|
|
|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
|
|
|
|
|
|
|
|
|
|
# frame <20><><EFBFBD><EFBFBD>
|
|
|
|
|
states_lbox = nil
|
|
|
|
|
TkFrame.new($states_demo, 'borderwidth'=>'.5c') {|w|
|
|
|
|
|
s = TkScrollbar.new(w)
|
|
|
|
|
states_lbox = TkListbox.new(w) {
|
|
|
|
|
setgrid 1
|
|
|
|
|
height 12
|
|
|
|
|
yscrollcommand proc{|first,last| s.set first,last}
|
|
|
|
|
}
|
|
|
|
|
s.command(proc{|*args| states_lbox.yview(*args)})
|
|
|
|
|
s.pack('side'=>'right', 'fill'=>'y')
|
|
|
|
|
states_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both')
|
|
|
|
|
}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y')
|
|
|
|
|
|
|
|
|
|
ins_data = [
|
|
|
|
|
'<27><><EFBFBD><EFBFBD>','<27>Ŀ<EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><>ɲ',
|
|
|
|
|
'<27><>ʬ','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
|
|
|
|
'<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>',
|
|
|
|
|
'<27><><EFBFBD><EFBFBD>','<27>Ų<EFBFBD>','<27>纬','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>',
|
|
|
|
|
'Ļ<><C4BB>','<27>ٻ<EFBFBD>','Ĺ<><C4B9>','Ĺ<><C4B9>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','ʼ<><CABC>',
|
|
|
|
|
'<27><><EFBFBD><EFBFBD>','ʡ<><CAA1>','ʡ<><CAA1>','ʡ<><CAA1>','<27>̳<EFBFBD>ƻ','<27><><EFBFBD><EFBFBD>','<27>ܾ<EFBFBD>',
|
|
|
|
|
'<27>ܺ<EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>','<27>²λ<C2B2>'
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
states_lbox.insert(0, *ins_data)
|
|
|
|
|
|