1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/tk/sample/demos-jp/menu84.rb

214 lines
9 KiB
Ruby
Raw Normal View History

* 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-24 23:29:39 -04:00
# -*- coding: euc-jp -*-
#
# menus widget demo (called by 'widget')
#
# toplevel widget
if defined?($menu84_demo) && $menu84_demo
$menu84_demo.destroy
$menu84_demo = nil
end
# demo toplevel widget
$menu84_demo = TkToplevel.new {|w|
title("File Selection Dialogs")
iconname("menu84")
positionWindow(w)
}
* ext/tk/tcltklib.c: SEGV when tcltk-stubs is enabled. * ext/tk/tcltklib.c: avoid error on a shared object. * ext/tk/extconf.rb: support --with-tcltkversion * ext/tk/README.tcltklib: add document about --with-tcltkversion * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb, ext/tk/lib/remote-tk.rb: not work on $SAFE==4 * ext/tk/lib/multi-tk.rb: Object#methods returns Symbols on Ruby1.9. * ext/tk/lib/tk/timer.rb: add TkTimer#at_end(proc) to register the procedure which called at end of the timer. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemfont.rb, ext/tk/lib/font.rb: support __IGNORE_UNKNOWN_CONFIGURE_OPTION__ about font options. * ext/tk/lib/*: treat __IGNORE_UNKNOWN_CONFIGURE_OPTION__ * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb, ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb, ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: bug fix. * ext/tk/lib/tk/text.rb: typo. call a wrong method. * ext/tk/lib/tk/itemconfig.rb: ditto. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/canvas.rb: support alias names of option keys. * ext/tk/lib/tk/grid.rb: lack of module-method definitions. * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: increase supported parameter patterns of configure method. * ext/tk/lib/tk.rb: add TkWindow#grid_anchor, grid_column, grid_row. * ext/tk/lib/tk/wm.rb: methods of Tk::Wm_for_General module cannot pass the given block to methods of Tk::Wm module. * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to an invalid value. * ext/tk/lib/tk.rb: fix memory (object) leak bug. * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak. * ext/tk/sample/demos-jp/aniwave.rb, ext/tk/sample/demos-en/aniwave.rb: bug fix. * ext/tk/lib/tkextlib/blt/component.rb, ext/tk/lib/tkextlib/tile/tentry.rb, ext/tk/lib/tkextlib/tile/treeview.rb: ditto. * ext/tk/lib/tkextlib/tile/tpaned.rb: improve TPaned#add. * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/style.rb, ext/tk/sample/demos-en/style.rb, ext/tk/sample/demos-jp/bind.rb, ext/tk/sample/demos-en/bind.rb: bug fix. * ext/tk/sample/ttk_wrapper.rb: ditto. * ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom. * ext/tk/sample/tktextio.rb: add binding for 'Ctrl-u' at console mode. * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb, ext/tk/sample/ttk_wrapper.rb: improve treating and control themes. add Tk::Tile.themes and Tk::Tile.set_theme(theme). * ext/tk/lib/tkextlib/tile.rb: lack of autoload definitions. * ext/tk/lib/tkextlib/tile/tnotebook.rb: cannot use kanji (not UTF-8) characters for headings. * ext/tk/lib/tkextlib/tkDND/shape.rb: wrong package name. * ext/tk/tkutil/tkutil.c: improve handling callback-subst-keys. Now, support longnam-keys (e.g. '%CTT' on tkdnd-2.0; however, still not support tkdnd-2.0 on tkextlib), and symbols of parameters (e.g. :widget=>'%W', :keycode=>'%k', '%x'=>:x, '%X'=>:root_x, and so on; those are attributes of event object). It means that Ruby/Tk accepts not only "widget.bind(ev, '%W', '%k', ...){|w, k, ...| ... }", but also "widget.bind(ev, :widget, :keycode, ...){|w, k, ...| ... }". It is potentially incompatible, when user passes symbols to the arguments of the callback block (the block receives the symbols as strings). I think that is very rare case (probably, used by Ruby/Tk experts only). When causes such trouble, please give strings instead of such symbol parameters (e.g. call Symbol#to_s method). * ext/tk/lib/tk/event.rb, ext/tk/lib/tk/validation.rb, ext/tk/lib/tkextlib/blt/treeview.rb, ext/tk/lib/tkextlib/winico/winico.rb: ditto. * ext/tk/tkutil/tkutil.c: strings are available on subst_tables on TkUtil::CallbackSubst class (it is useful on Ruby 1.9). * ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tkextlib/iwidgets/hierarchy.rb, ext/tk/lib/tkextlib/iwidgets/spinner.rb, ext/tk/lib/tkextlib/iwidgets/entryfield.rb, ext/tk/lib/tkextlib/iwidgets/calendar.rb, ext/tk/lib/tkextlib/blt/dragdrop.rb, ext/tk/lib/tkextlib/tkDND/tkdnd.rb, ext/tk/lib/tkextlib/treectrl/tktreectrl.rb, ext/tk/lib/tkextlib/tktable/tktable.rb: disable code piece became unnecessary by reason of the changes of ext/tk/tkutil/tkutil.c. * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb: change strategy to define the constant WITH_ENCODING. * ext/tk/lib/tk.rb: fix bug on Tk::Encoding.tk_encoding_names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10 16:59:10 -04:00
base_frame = TkFrame.new($menu84_demo).pack(:fill=>:both, :expand=>true)
begin
windowingsystem = Tk.windowingsystem()
rescue
windowingsystem = ""
end
# label
* ext/tk/tcltklib.c: SEGV when tcltk-stubs is enabled. * ext/tk/tcltklib.c: avoid error on a shared object. * ext/tk/extconf.rb: support --with-tcltkversion * ext/tk/README.tcltklib: add document about --with-tcltkversion * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb, ext/tk/lib/remote-tk.rb: not work on $SAFE==4 * ext/tk/lib/multi-tk.rb: Object#methods returns Symbols on Ruby1.9. * ext/tk/lib/tk/timer.rb: add TkTimer#at_end(proc) to register the procedure which called at end of the timer. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemfont.rb, ext/tk/lib/font.rb: support __IGNORE_UNKNOWN_CONFIGURE_OPTION__ about font options. * ext/tk/lib/*: treat __IGNORE_UNKNOWN_CONFIGURE_OPTION__ * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb, ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb, ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: bug fix. * ext/tk/lib/tk/text.rb: typo. call a wrong method. * ext/tk/lib/tk/itemconfig.rb: ditto. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/canvas.rb: support alias names of option keys. * ext/tk/lib/tk/grid.rb: lack of module-method definitions. * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: increase supported parameter patterns of configure method. * ext/tk/lib/tk.rb: add TkWindow#grid_anchor, grid_column, grid_row. * ext/tk/lib/tk/wm.rb: methods of Tk::Wm_for_General module cannot pass the given block to methods of Tk::Wm module. * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to an invalid value. * ext/tk/lib/tk.rb: fix memory (object) leak bug. * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak. * ext/tk/sample/demos-jp/aniwave.rb, ext/tk/sample/demos-en/aniwave.rb: bug fix. * ext/tk/lib/tkextlib/blt/component.rb, ext/tk/lib/tkextlib/tile/tentry.rb, ext/tk/lib/tkextlib/tile/treeview.rb: ditto. * ext/tk/lib/tkextlib/tile/tpaned.rb: improve TPaned#add. * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/style.rb, ext/tk/sample/demos-en/style.rb, ext/tk/sample/demos-jp/bind.rb, ext/tk/sample/demos-en/bind.rb: bug fix. * ext/tk/sample/ttk_wrapper.rb: ditto. * ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom. * ext/tk/sample/tktextio.rb: add binding for 'Ctrl-u' at console mode. * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb, ext/tk/sample/ttk_wrapper.rb: improve treating and control themes. add Tk::Tile.themes and Tk::Tile.set_theme(theme). * ext/tk/lib/tkextlib/tile.rb: lack of autoload definitions. * ext/tk/lib/tkextlib/tile/tnotebook.rb: cannot use kanji (not UTF-8) characters for headings. * ext/tk/lib/tkextlib/tkDND/shape.rb: wrong package name. * ext/tk/tkutil/tkutil.c: improve handling callback-subst-keys. Now, support longnam-keys (e.g. '%CTT' on tkdnd-2.0; however, still not support tkdnd-2.0 on tkextlib), and symbols of parameters (e.g. :widget=>'%W', :keycode=>'%k', '%x'=>:x, '%X'=>:root_x, and so on; those are attributes of event object). It means that Ruby/Tk accepts not only "widget.bind(ev, '%W', '%k', ...){|w, k, ...| ... }", but also "widget.bind(ev, :widget, :keycode, ...){|w, k, ...| ... }". It is potentially incompatible, when user passes symbols to the arguments of the callback block (the block receives the symbols as strings). I think that is very rare case (probably, used by Ruby/Tk experts only). When causes such trouble, please give strings instead of such symbol parameters (e.g. call Symbol#to_s method). * ext/tk/lib/tk/event.rb, ext/tk/lib/tk/validation.rb, ext/tk/lib/tkextlib/blt/treeview.rb, ext/tk/lib/tkextlib/winico/winico.rb: ditto. * ext/tk/tkutil/tkutil.c: strings are available on subst_tables on TkUtil::CallbackSubst class (it is useful on Ruby 1.9). * ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tkextlib/iwidgets/hierarchy.rb, ext/tk/lib/tkextlib/iwidgets/spinner.rb, ext/tk/lib/tkextlib/iwidgets/entryfield.rb, ext/tk/lib/tkextlib/iwidgets/calendar.rb, ext/tk/lib/tkextlib/blt/dragdrop.rb, ext/tk/lib/tkextlib/tkDND/tkdnd.rb, ext/tk/lib/tkextlib/treectrl/tktreectrl.rb, ext/tk/lib/tkextlib/tktable/tktable.rb: disable code piece became unnecessary by reason of the changes of ext/tk/tkutil/tkutil.c. * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb: change strategy to define the constant WITH_ENCODING. * ext/tk/lib/tk.rb: fix bug on Tk::Encoding.tk_encoding_names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10 16:59:10 -04:00
TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
if $tk_platform['platform'] == 'macintosh' ||
windowingsystem == "classic" || windowingsystem == "aqua"
text("<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><EFBFBD>ˤ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A4>С<EFBFBD><D0A1><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>줿<EFBFBD><ECA4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>Ȥǡ<C8A4><C7A1><EFBFBD><EFBFBD>˥塼<CBA5><E5A1BC>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥʤ<C8A4>ľ<EFBFBD>ܤ<EFBFBD><DCA4>ι<EFBFBD><CEB9>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ƤӽФ<D3BD><D0A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ǹ<EFBFBD><C7B8>Υ<EFBFBD><CEA5>˥塼<CBA5>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD>˥塼<CBA5>κǽ<CEBA><C7BD>ι<EFBFBD><CEB9>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD>򤹤뤳<F2A4B9A4>Ȥˤ<C8A4><CBA4>äơ<C3A4><C6A1><EFBFBD>Ω<EFBFBD><CEA9><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><D1A5>åȤȤʤ<C8A4><CAA4><EFBFBD><E8A4A6><EFBFBD>ڤ<EFBFBD><DAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD>ǽ<EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD>")
end
}.pack('side'=>'top')
menustatus = TkVariable.new(" ")
* ext/tk/tcltklib.c: SEGV when tcltk-stubs is enabled. * ext/tk/tcltklib.c: avoid error on a shared object. * ext/tk/extconf.rb: support --with-tcltkversion * ext/tk/README.tcltklib: add document about --with-tcltkversion * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb, ext/tk/lib/remote-tk.rb: not work on $SAFE==4 * ext/tk/lib/multi-tk.rb: Object#methods returns Symbols on Ruby1.9. * ext/tk/lib/tk/timer.rb: add TkTimer#at_end(proc) to register the procedure which called at end of the timer. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemfont.rb, ext/tk/lib/font.rb: support __IGNORE_UNKNOWN_CONFIGURE_OPTION__ about font options. * ext/tk/lib/*: treat __IGNORE_UNKNOWN_CONFIGURE_OPTION__ * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb, ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb, ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: bug fix. * ext/tk/lib/tk/text.rb: typo. call a wrong method. * ext/tk/lib/tk/itemconfig.rb: ditto. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/canvas.rb: support alias names of option keys. * ext/tk/lib/tk/grid.rb: lack of module-method definitions. * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: increase supported parameter patterns of configure method. * ext/tk/lib/tk.rb: add TkWindow#grid_anchor, grid_column, grid_row. * ext/tk/lib/tk/wm.rb: methods of Tk::Wm_for_General module cannot pass the given block to methods of Tk::Wm module. * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to an invalid value. * ext/tk/lib/tk.rb: fix memory (object) leak bug. * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak. * ext/tk/sample/demos-jp/aniwave.rb, ext/tk/sample/demos-en/aniwave.rb: bug fix. * ext/tk/lib/tkextlib/blt/component.rb, ext/tk/lib/tkextlib/tile/tentry.rb, ext/tk/lib/tkextlib/tile/treeview.rb: ditto. * ext/tk/lib/tkextlib/tile/tpaned.rb: improve TPaned#add. * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/style.rb, ext/tk/sample/demos-en/style.rb, ext/tk/sample/demos-jp/bind.rb, ext/tk/sample/demos-en/bind.rb: bug fix. * ext/tk/sample/ttk_wrapper.rb: ditto. * ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom. * ext/tk/sample/tktextio.rb: add binding for 'Ctrl-u' at console mode. * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb, ext/tk/sample/ttk_wrapper.rb: improve treating and control themes. add Tk::Tile.themes and Tk::Tile.set_theme(theme). * ext/tk/lib/tkextlib/tile.rb: lack of autoload definitions. * ext/tk/lib/tkextlib/tile/tnotebook.rb: cannot use kanji (not UTF-8) characters for headings. * ext/tk/lib/tkextlib/tkDND/shape.rb: wrong package name. * ext/tk/tkutil/tkutil.c: improve handling callback-subst-keys. Now, support longnam-keys (e.g. '%CTT' on tkdnd-2.0; however, still not support tkdnd-2.0 on tkextlib), and symbols of parameters (e.g. :widget=>'%W', :keycode=>'%k', '%x'=>:x, '%X'=>:root_x, and so on; those are attributes of event object). It means that Ruby/Tk accepts not only "widget.bind(ev, '%W', '%k', ...){|w, k, ...| ... }", but also "widget.bind(ev, :widget, :keycode, ...){|w, k, ...| ... }". It is potentially incompatible, when user passes symbols to the arguments of the callback block (the block receives the symbols as strings). I think that is very rare case (probably, used by Ruby/Tk experts only). When causes such trouble, please give strings instead of such symbol parameters (e.g. call Symbol#to_s method). * ext/tk/lib/tk/event.rb, ext/tk/lib/tk/validation.rb, ext/tk/lib/tkextlib/blt/treeview.rb, ext/tk/lib/tkextlib/winico/winico.rb: ditto. * ext/tk/tkutil/tkutil.c: strings are available on subst_tables on TkUtil::CallbackSubst class (it is useful on Ruby 1.9). * ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tkextlib/iwidgets/hierarchy.rb, ext/tk/lib/tkextlib/iwidgets/spinner.rb, ext/tk/lib/tkextlib/iwidgets/entryfield.rb, ext/tk/lib/tkextlib/iwidgets/calendar.rb, ext/tk/lib/tkextlib/blt/dragdrop.rb, ext/tk/lib/tkextlib/tkDND/tkdnd.rb, ext/tk/lib/tkextlib/treectrl/tktreectrl.rb, ext/tk/lib/tkextlib/tktable/tktable.rb: disable code piece became unnecessary by reason of the changes of ext/tk/tkutil/tkutil.c. * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb: change strategy to define the constant WITH_ENCODING. * ext/tk/lib/tk.rb: fix bug on Tk::Encoding.tk_encoding_names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10 16:59:10 -04:00
TkFrame.new(base_frame) {|frame|
TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken',
'bd'=>1, 'font'=>['Helvetica', '10'],
'anchor'=>'w').pack('side'=>'left', 'padx'=>2,
'expand'=>true, 'fill'=>'both')
pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
}
# frame
* ext/tk/tcltklib.c: SEGV when tcltk-stubs is enabled. * ext/tk/tcltklib.c: avoid error on a shared object. * ext/tk/extconf.rb: support --with-tcltkversion * ext/tk/README.tcltklib: add document about --with-tcltkversion * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb, ext/tk/lib/remote-tk.rb: not work on $SAFE==4 * ext/tk/lib/multi-tk.rb: Object#methods returns Symbols on Ruby1.9. * ext/tk/lib/tk/timer.rb: add TkTimer#at_end(proc) to register the procedure which called at end of the timer. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemfont.rb, ext/tk/lib/font.rb: support __IGNORE_UNKNOWN_CONFIGURE_OPTION__ about font options. * ext/tk/lib/*: treat __IGNORE_UNKNOWN_CONFIGURE_OPTION__ * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb, ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb, ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: bug fix. * ext/tk/lib/tk/text.rb: typo. call a wrong method. * ext/tk/lib/tk/itemconfig.rb: ditto. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/canvas.rb: support alias names of option keys. * ext/tk/lib/tk/grid.rb: lack of module-method definitions. * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: increase supported parameter patterns of configure method. * ext/tk/lib/tk.rb: add TkWindow#grid_anchor, grid_column, grid_row. * ext/tk/lib/tk/wm.rb: methods of Tk::Wm_for_General module cannot pass the given block to methods of Tk::Wm module. * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to an invalid value. * ext/tk/lib/tk.rb: fix memory (object) leak bug. * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak. * ext/tk/sample/demos-jp/aniwave.rb, ext/tk/sample/demos-en/aniwave.rb: bug fix. * ext/tk/lib/tkextlib/blt/component.rb, ext/tk/lib/tkextlib/tile/tentry.rb, ext/tk/lib/tkextlib/tile/treeview.rb: ditto. * ext/tk/lib/tkextlib/tile/tpaned.rb: improve TPaned#add. * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/style.rb, ext/tk/sample/demos-en/style.rb, ext/tk/sample/demos-jp/bind.rb, ext/tk/sample/demos-en/bind.rb: bug fix. * ext/tk/sample/ttk_wrapper.rb: ditto. * ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom. * ext/tk/sample/tktextio.rb: add binding for 'Ctrl-u' at console mode. * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb, ext/tk/sample/ttk_wrapper.rb: improve treating and control themes. add Tk::Tile.themes and Tk::Tile.set_theme(theme). * ext/tk/lib/tkextlib/tile.rb: lack of autoload definitions. * ext/tk/lib/tkextlib/tile/tnotebook.rb: cannot use kanji (not UTF-8) characters for headings. * ext/tk/lib/tkextlib/tkDND/shape.rb: wrong package name. * ext/tk/tkutil/tkutil.c: improve handling callback-subst-keys. Now, support longnam-keys (e.g. '%CTT' on tkdnd-2.0; however, still not support tkdnd-2.0 on tkextlib), and symbols of parameters (e.g. :widget=>'%W', :keycode=>'%k', '%x'=>:x, '%X'=>:root_x, and so on; those are attributes of event object). It means that Ruby/Tk accepts not only "widget.bind(ev, '%W', '%k', ...){|w, k, ...| ... }", but also "widget.bind(ev, :widget, :keycode, ...){|w, k, ...| ... }". It is potentially incompatible, when user passes symbols to the arguments of the callback block (the block receives the symbols as strings). I think that is very rare case (probably, used by Ruby/Tk experts only). When causes such trouble, please give strings instead of such symbol parameters (e.g. call Symbol#to_s method). * ext/tk/lib/tk/event.rb, ext/tk/lib/tk/validation.rb, ext/tk/lib/tkextlib/blt/treeview.rb, ext/tk/lib/tkextlib/winico/winico.rb: ditto. * ext/tk/tkutil/tkutil.c: strings are available on subst_tables on TkUtil::CallbackSubst class (it is useful on Ruby 1.9). * ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tkextlib/iwidgets/hierarchy.rb, ext/tk/lib/tkextlib/iwidgets/spinner.rb, ext/tk/lib/tkextlib/iwidgets/entryfield.rb, ext/tk/lib/tkextlib/iwidgets/calendar.rb, ext/tk/lib/tkextlib/blt/dragdrop.rb, ext/tk/lib/tkextlib/tkDND/tkdnd.rb, ext/tk/lib/tkextlib/treectrl/tktreectrl.rb, ext/tk/lib/tkextlib/tktable/tktable.rb: disable code piece became unnecessary by reason of the changes of ext/tk/tkutil/tkutil.c. * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb: change strategy to define the constant WITH_ENCODING. * ext/tk/lib/tk.rb: fix bug on Tk::Encoding.tk_encoding_names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10 16:59:10 -04:00
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
#text 'λ<><CEBB>'
text '<27>Ĥ<EFBFBD><C4A4><EFBFBD>'
command proc{
tmppath = $menu84_demo
$menu84_demo = nil
tmppath.destroy
}
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
text '<27><><EFBFBD><EFBFBD><EFBFBD>ɻ<EFBFBD><C9BB><EFBFBD>'
command proc{showCode 'menu84'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# create menu frame
$menu84_frame = TkMenu.new($menu84_demo, 'tearoff'=>false)
# menu
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'File', 'menu'=>m, 'underline'=>0)
add('command', 'label'=>'Open...', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Open..." <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('command', 'label'=>'New', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"New" <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('command', 'label'=>'Save', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Save" <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('command', 'label'=>'Save As...', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Save As..." <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('separator')
add('command', 'label'=>'Print Setup...', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Print Setup..." <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('command', 'label'=>'Print...', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Print..." <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('separator')
add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu84_demo.destroy})
}
if $tk_platform['platform'] == 'macintosh' ||
windowingsystem = "classic" || windowingsystem = "aqua"
modifier = 'Command'
elsif $tk_platform['platform'] == 'windows'
modifier = 'Control'
else
modifier = 'Meta'
end
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'Basic', 'menu'=>m, 'underline'=>0)
add('command', 'label'=>'Long entry that does nothing')
['A','B','C','D','E','F','G'].each{|c|
add('command', 'label'=>"Print letter \"#{c}\"",
'underline'=>14, 'accelerator'=>"Meta+#{c}",
'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
$menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
}
}
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'Cascades', 'menu'=>m, 'underline'=>0)
add('command', 'label'=>'Print hello',
'command'=>proc{print "Hello\n"},
'accelerator'=>"#{modifier}+H", 'underline'=>6)
$menu84_demo.bind("#{modifier}-h", proc{print "Hello\n"})
add('command', 'label'=>'Print goodbye',
'command'=>proc{print "Goodbye\n"},
'accelerator'=>"#{modifier}+G", 'underline'=>6)
$menu84_demo.bind("#{modifier}-g", proc{print "Goodbye\n"})
TkMenu.new(m, 'tearoff'=>false) {|cascade_check|
m.add('cascade', 'label'=>'Check button',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
add('check', 'label'=>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB8A1>', 'variable'=>oil)
trans = TkVariable.new(0)
add('check', 'label'=>'<27>ȥ<EFBFBD><C8A5>󥹥ߥå<DFA5><C3A5><EFBFBD><EFBFBD>󸡺<EFBFBD>', 'variable'=>trans)
brakes = TkVariable.new(0)
add('check', 'label'=>'<27>֥졼<D6A5><ECA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', 'variable'=>brakes)
lights = TkVariable.new(0)
add('check', 'label'=>'<27><EFBFBD>ȸ<EFBFBD><C8B8><EFBFBD>', 'variable'=>lights)
add('separator')
add('command', 'label'=>'Show current values',
'command'=>proc{showVars($menu84_demo,
['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', oil],
['<27>ȥ<EFBFBD><C8A5>󥹥ߥå<DFA5><C3A5><EFBFBD><EFBFBD><EFBFBD>', trans],
['<27>֥졼<D6A5><ECA1BC>', brakes],
['<27><EFBFBD><E9A5A4>', lights])} )
invoke 1
invoke 3
}
TkMenu.new(m, 'tearoff'=>false) {|cascade_radio|
m.add('cascade', 'label'=>'Radio buttons',
'menu'=>cascade_radio, 'underline'=>0)
pointSize = TkVariable.new
add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10)
add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14)
add('radio', 'label'=>'18 point', 'variable'=>pointSize, 'value'=>18)
add('radio', 'label'=>'24 point', 'variable'=>pointSize, 'value'=>24)
add('radio', 'label'=>'32 point', 'variable'=>pointSize, 'value'=>32)
add('separator')
style = TkVariable.new
add('radio', 'label'=>'Roman', 'variable'=>style, 'value'=>'roman')
add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold')
add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic')
add('separator')
add('command', 'label'=>'<27><><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD>ɽ<EFBFBD><C9BD>',
'command'=>proc{showVars($menu84_demo,
['pointSize', pointSize],
['style', style])} )
invoke 1
invoke 7
}
}
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0)
add('command', 'hidemargin'=>1,
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
'text'=>'<27><><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򤷤<EFBFBD><F2A4B7A4><EFBFBD><EFBFBD>˥塼<CBA5><E5A1BC><EFBFBD>ܤϡ<DCA4>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥ӥåȥޥåץ<C3A5><D7A5><EFBFBD><E1A1BC><EFBFBD>ǹ<EFBFBD><C7B9>ܤ<EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4><CFA1>ۤ<EFBFBD><DBA4>Υ<EFBFBD><CEA5>˥塼<CBA5><E5A1BC><EFBFBD>ܤȤδ֤<CEB4><D6A4>ä˰㤤<CBB0><E3A4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǤϤ<C7A4><CFA4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>',
'bitmap'=>'', 'default'=>0,
'buttons'=>'<27>Ĥ<EFBFBD><C4A4><EFBFBD>')} )
['info', 'questhead', 'error'].each{|icon|
add('command', 'bitmap'=>icon, 'hidemargin'=>1,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
}
entryconfigure(2, :columnbreak=>true)
}
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'More', 'menu'=>m, 'underline'=>0)
[ 'An entry','Another entry','Does nothing','Does almost nothing',
'Make life meaningful' ].each{|i|
add('command', 'label'=>i,
'command'=>proc{print "You invoked \"#{i}\"\n"})
}
m.entryconfigure('Does almost nothing',
'bitmap'=>'questhead', 'compound'=>'left',
'command'=>proc{
TkDialog.new('title'=>'Compound Menu Entry',
'message'=>'<27><><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򤷤<EFBFBD><F2A4B7A4><EFBFBD><EFBFBD>˥塼<CBA5><E5A1BC><EFBFBD>ܤϡ<DCA4><CFA1>ӥåȥޥåץ<C3A5><D7A5><EFBFBD><E1A1BC><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>˰<EFBFBD><CBB0>Ĥι<C4A4><CEB9>ܤ<EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4><CFA1>ۤ<EFBFBD><DBA4>Υ<EFBFBD><CEA5>˥塼<CBA5><E5A1BC><EFBFBD>ܤȤδ֤<CEB4><D6A4>ä˰㤤<CBB0><E3A4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǤϤ<C7A4><CFA4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>',
'buttons'=>[<><CEBB>'], 'bitmap'=>'')
})
}
TkMenu.new($menu84_frame) {|m|
$menu84_frame.add('cascade', 'label'=>'Colors', 'menu'=>m, 'underline'=>0)
['red', 'orange', 'yellow', 'green', 'blue'].each{|c|
add('command', 'label'=>c, 'background'=>c,
'command'=>proc{print "You invoked \"#{c}\"\n"})
}
}
$menu84_demo.menu($menu84_frame)
TkMenu.bind('<MenuSelect>', proc{|w|
begin
label = w.entrycget('active', 'label')
rescue
label = " "
end
menustatus.value = label
Tk.update(true)
}, '%W')