From 4007644d8378c85c0e90ddd9d29e90e3713546af Mon Sep 17 00:00:00 2001 From: nagai Date: Wed, 16 Mar 2005 09:12:16 +0000 Subject: * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: bug fix and suppot TkTreeCtrl-1.1 * ext/tk/lib/tkextlib/SUPPORT_STATUS: change the supported version of TkTreeCtrl extension git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/ChangeLog.tkextlib | 177 ++++++++++++++++------------- ext/tk/lib/tkextlib/SUPPORT_STATUS | 9 +- ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 158 +++++++++++++++++++++++-- 3 files changed, 257 insertions(+), 87 deletions(-) (limited to 'ext/tk') diff --git a/ext/tk/ChangeLog.tkextlib b/ext/tk/ChangeLog.tkextlib index 94f05c230e..8eab1c01c0 100644 --- a/ext/tk/ChangeLog.tkextlib +++ b/ext/tk/ChangeLog.tkextlib @@ -1,194 +1,217 @@ +2005-03-16 Hidetoshi NAGAI + + * lib/tkextlib/SUPPORT_STATUS: change the status of TkImg + + * lib/tkextlib/treectrl/tktreectrl.rb: bug fix and support + TkTreeCtrl-1.1 + + * lib/tkextlib/SUPPORT_STATUS: change the supported version of + TkTreeCtrl + +2005-03-15 Hidetoshi NAGAI + + * sample/tkextlib/tkimg: add sample + +2005-03-06 Hidetoshi NAGAI + + * lib/tkextlib/SUPPORT_STATUS: add version info of each extension + 2005-03-05 Hidetoshi NAGAI - * ext/tk/lib/tkextlib/tile.rb: lack of "autoload TProgressbar" + * lib/tkextlib/tile.rb: lack of "autoload TProgressbar" 2005-03-05 Hidetoshi NAGAI - * ext/tk/lib/tkextlib/tile.rb: support tile-0.6 + * lib/tkextlib/tile.rb: support tile-0.6 - * ext/tk/lib/tkextlib/tile/tbutton.rb: ditto + * lib/tkextlib/tile/tbutton.rb: ditto - * ext/tk/lib/tkextlib/tile/tcheckbutton.rb: ditto + * lib/tkextlib/tile/tcheckbutton.rb: ditto - * ext/tk/lib/tkextlib/tile/tlabel.rb: ditto + * lib/tkextlib/tile/tlabel.rb: ditto - * ext/tk/lib/tkextlib/tile/tmenubutton.rb: ditto + * lib/tkextlib/tile/tmenubutton.rb: ditto - * ext/tk/lib/tkextlib/tile/tnotebook.rb: ditto + * lib/tkextlib/tile/tnotebook.rb: ditto - * ext/tk/lib/tkextlib/tile/tradiobutton.rb: ditto + * lib/tkextlib/tile/tradiobutton.rb: ditto - * ext/tk/lib/tkextlib/tile/tcombobox.rb: [new] ditto + * lib/tkextlib/tile/tcombobox.rb: [new] ditto - * ext/tk/lib/tkextlib/tile/tentry.rb: [new] ditto + * lib/tkextlib/tile/tentry.rb: [new] ditto - * ext/tk/lib/tkextlib/tile/tframe.rb: [new] ditto + * lib/tkextlib/tile/tframe.rb: [new] ditto - * ext/tk/lib/tkextlib/tile/tlabelframe.rb: [new] ditto + * lib/tkextlib/tile/tlabelframe.rb: [new] ditto - * ext/tk/lib/tkextlib/tile/tprogressbar.rb: [new] ditto + * lib/tkextlib/tile/tprogressbar.rb: [new] ditto - * ext/tk/lib/tkextlib/tile/treeview.rb: [new] ditto + * lib/tkextlib/tile/treeview.rb: [new] ditto - * ext/tk/lib/tkextlib/tile/tscrollbar.rb: [new] ditto + * lib/tkextlib/tile/tscrollbar.rb: [new] ditto - * ext/tk/lib/tkextlib/tile/tseparator.rb: [new] ditto + * lib/tkextlib/tile/tseparator.rb: [new] ditto - * ext/tk/lib/tkextlib/tile/tsquare.rb: [new] ditto + * lib/tkextlib/tile/tsquare.rb: [new] ditto 2005-02-20 Hidetoshi NAGAI - * ext/tk/lib/tkextlib/tclx/tclx.rb: warning TclX's 'signal' command. + * lib/tkextlib/tclx/tclx.rb: warning TclX's 'signal' command. 2005-01-25 Hidetoshi NAGAI - * ext/tk/lib/tkextlib/blt/component.rb: bug fix. cannot accept + * lib/tkextlib/blt/component.rb: bug fix. cannot accept a callback ID string for a command argument. [ruby-dev:25479] - * ext/tk/lib/tkextlib/blt/tabset.rb: ditto + * lib/tkextlib/blt/tabset.rb: ditto - * ext/tk/lib/tkextlib/blt/treeview.rb: ditto + * lib/tkextlib/blt/treeview.rb: ditto - * ext/tk/lib/tkextlib/bwidget/labelentry.rb: ditto + * lib/tkextlib/bwidget/labelentry.rb: ditto - * ext/tk/lib/tkextlib/bwidget/listbox.rb: ditto + * lib/tkextlib/bwidget/listbox.rb: ditto - * ext/tk/lib/tkextlib/bwidget/notebook.rb: ditto + * lib/tkextlib/bwidget/notebook.rb: ditto - * ext/tk/lib/tkextlib/bwidget/spinbox.rb: ditto + * lib/tkextlib/bwidget/spinbox.rb: ditto - * ext/tk/lib/tkextlib/bwidget/tree.rb: ditto + * lib/tkextlib/bwidget/tree.rb: ditto - * ext/tk/lib/tkextlib/itk/incr_tk.rb: ditto + * lib/tkextlib/itk/incr_tk.rb: ditto - * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto + * lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto - * ext/tk/lib/tkextlib/tkDND/tkdnd.rb: ditto + * lib/tkextlib/tkDND/tkdnd.rb: ditto - * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: ditto + * lib/tkextlib/treectrl/tktreectrl.rb: ditto - * ext/tk/sample/tkHTML/ss.rb: local variable scope bug fix + * sample/tkextlib/tkHTML/ss.rb: local variable scope bug fix [ruby-dev:25479] - * ext/tk/sample/vu/vu_demo.rb: rename from vu.rb; avoid the bug on + * sample/tkextlib/vu/vu_demo.rb: rename from vu.rb; avoid the bug on Windows version of Tcl/Tk. The trouble based on the bug occurs when the script name (without extension) is a same name as a Tcl/Tk's library file name (without extension) required in the script. 2004-12-24 Hidetoshi NAGAI - * add BLT extension support + * lib/tkextlib/blt: add BLT extension support 2004-12-16 Hidetoshi NAGAI - * bwidget/labelentry.rb: use TkCore.callback_obj?() + * lib/tkextlib/bwidget/labelentry.rb: use TkCore.callback_obj?() - * bwidget/listbox.rb: ditto + * lib/tkextlib/bwidget/listbox.rb: ditto - * bwidget/notebook.rb: ditto + * lib/tkextlib/bwidget/notebook.rb: ditto - * bwidget/spinbox.rb: ditto + * lib/tkextlib/bwidget/spinbox.rb: ditto - * itk/incr_tk.rb: ditto + * lib/tkextlib/itk/incr_tk.rb: ditto - * iwidgets/scrolledcanvas.rb: ditto + * lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto - * tkDND/tkdnd.rb: ditto + * lib/tkextlib/tkDND/tkdnd.rb: ditto - * treectrl/tktreectrl.rb: ditto + * lib/tkextlib/treectrl/tktreectrl.rb: ditto - * winico/winico.rb: ditto + * lib/tkextlib/winico/winico.rb: ditto 2004-12-10 Hidetoshi NAGAI - * tile/style.rb: 'theme_use' method bug fix + * lib/tkextlib/tile/style.rb: 'theme_use' method bug fix 2004-12-08 Hidetoshi NAGAI - * bwidget/notebook.rb: raise method cannot return the raised page. + * lib/tkextlib/bwidget/notebook.rb: raise method cannot return + the raised page. - * bwidget/labelentry.rb: bind methods accept subst_args + block + * lib/tkextlib/bwidget/labelentry.rb: bind methods accept + subst_args + block - * bwidget/listbox.rb: ditto + * lib/tkextlib/bwidget/listbox.rb: ditto - * bwidget/notebook.rb: ditto + * lib/tkextlib/bwidget/notebook.rb: ditto - * bwidget/spinbox.rb: ditto + * lib/tkextlib/bwidget/spinbox.rb: ditto - * bwidget/tree.rb: ditto + * lib/tkextlib/bwidget/tree.rb: ditto - * itk/incr_tk.rb: ditto + * lib/tkextlib/itk/incr_tk.rb: ditto - * iwidgets/scrolledcanvas.rb: ditto + * lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto - * tkDND/tkdnd.rb: ditto + * lib/tkextlib/tkDND/tkdnd.rb: ditto - * treectrl/tktreectrl.rb: ditto + * lib/tkextlib/treectrl/tktreectrl.rb: ditto 2004-11-26 Hidetoshi NAGAI - * bwidget/notebook.rb: uses epath + * lib/tkextlib/bwidget/notebook.rb: uses epath - * bwidget/widget.rb: ditto + * lib/tkextlib/bwidget/widget.rb: ditto - * tktable/tktable.rb: ditto + * lib/tkextlib/tktable/tktable.rb: ditto - * tcllib/cursor.rb: ditto, and bug fix + * lib/tkextlib/tcllib/cursor.rb: ditto, and bug fix 2004-11-10 Hidetoshi NAGAI - * tile/style.rb: bug fix + * lib/tkextlib/tile/style.rb: bug fix 2004-11-07 Hidetoshi NAGAI - * iwidgets/scrolledcanvas.rb: bind-event methods accept multi - substitution arguments. + * lib/tkextlib/iwidgets/scrolledcanvas.rb: bind-event methods + accept multi substitution arguments. - * tktable/tktable.rb: ditto. + * lib/tkextlib/tktable/tktable.rb: ditto. - * treectrl/tktreectrl.rb: ditto + * lib/tkextlib/treectrl/tktreectrl.rb: ditto 2004-11-03 Hidetoshi NAGAI - * SUPPORT_STATUS: BLT moves to 'plan to support' from 'not determined' + * lib/tkextlib/SUPPORT_STATUS: BLT moves to 'plan to support' + from 'not determined' - * itk/incr_tk.rb: __cget_cmd and __config_cmd are private methods + * lib/tkextlib/itk/incr_tk.rb: __cget_cmd and __config_cmd are + private methods - * tcllib/autoscroll.rb: extend TkCore + * lib/tkextlib/tcllib/autoscroll.rb: extend TkCore - * tcllib/cursor.rb: ditto. + * lib/tkextlib/tcllib/cursor.rb: ditto. - * tcllib/plotchart.rb: ditto. + * lib/tkextlib/tcllib/plotchart.rb: ditto. - * tcllib/style.rb: ditto. + * lib/tkextlib/tcllib/style.rb: ditto. - * tile/style.rb: ditto. + * lib/tkextlib/tile/style.rb: ditto. - * tkDND/shape.rb: ditto. + * lib/tkextlib/tkDND/shape.rb: ditto. 2004-10-24 Hidetoshi NAGAI - * bwidget/tree.rb: bug fix on Windows + * lib/tkextlib/bwidget/tree.rb: bug fix on Windows 2004-10-16 Hidetoshi NAGAI - * tcllib/ico.rb: new library (Tk::Tcllib:ICO) + * lib/tkextlib/tcllib/ico.rb: new library (Tk::Tcllib:ICO) - * tcllib.rb: add Tk::Tcllib::ICO (based on tcllib 1.7) + * lib/tkextlib/tcllib.rb: add Tk::Tcllib::ICO (based on tcllib 1.7) 2004-10-06 Hidetoshi NAGAI - * bwidget.rb (BWidget.grab): bug fix + * lib/tkextlib/bwidget.rb (BWidget.grab): bug fix - * tcllib.rb: typo fix + * lib/tkextlib/tcllib.rb: typo fix 2004-07-28 Hidetoshi NAGAI - * add winico support + * lib/tkextlib/add winico support 2004-07-23 Hidetoshi NAGAI - * add TclX support (partially; infox command and XPG/3 MsgCat only) + * lib/tkextlib/add TclX support (partially; infox command and + XPG/3 MsgCat only) 2004-07-15 Hidetoshi NAGAI diff --git a/ext/tk/lib/tkextlib/SUPPORT_STATUS b/ext/tk/lib/tkextlib/SUPPORT_STATUS index e041d8abd2..9cfc02d473 100644 --- a/ext/tk/lib/tkextlib/SUPPORT_STATUS +++ b/ext/tk/lib/tkextlib/SUPPORT_STATUS @@ -18,6 +18,13 @@ script may give you some hints about that. 'not support' does *NOT* mean that the extension doesn't work on Ruby/Tk. + The version number of each extension means the latest version + which is checked its feature. That is, it does NOT means only + version of working. Library files maybe include some features + which is included in the former version but removed from the + latest, and maybe able to support the later version then the + shown version. + Even if the status of the extension is 'not support', you can control the functions/widgets of the extension without wrapper libraries by Tk.tk_call(), Tk.ip_eval(), and so on. @@ -77,7 +84,7 @@ TclX CVS/Hd(2005-02-07) ==> tclx (partial support; infox command and XPG/3 message catalogs only) -TkTreeCtrl 1.0 http://tktreectrl.sourceforge.net/ ==> treectrl +TkTreeCtrl 1.1 http://tktreectrl.sourceforge.net/ ==> treectrl Tile 0.6 http://tktable.sourceforge.net/tile/ ==> tile diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb index e5d58ef79d..96bfa9fdb2 100644 --- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb +++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb @@ -12,6 +12,7 @@ require 'tkextlib/setup.rb' require 'tkextlib/treectrl/setup.rb' # TkPackage.require('treectrl', '1.0') +# TkPackage.require('treectrl', '1.1') TkPackage.require('treectrl') module Tk @@ -43,6 +44,14 @@ module Tk Tk.tk_call_without_enc('loupe', img, x, y, w, h, zoom) end + def self.text_layout(font, text, keys={}) + TkComm.list(Tk.tk_call_without_enc('textlayout', font, text, keys)) + end + + def self.image_tint(img, color, alpha) + Tk.tk_call_without_enc('imagetint', img, color, alpha) + end + class NotifyEvent < TkUtil::CallbackSubst end @@ -62,11 +71,11 @@ class Tk::TreeCtrl::NotifyEvent [ ?D, ?l, :items ], [ ?e, ?e, :event ], [ ?I, ?n, :id ], - [ ?l, ?b, :lower_bound ], + [ ?l, ?n, :lower_bound ], [ ?p, ?n, :active_id ], [ ?S, ?l, :sel_items ], [ ?T, ?w, :widget ], - [ ?U, ?b, :upper_bound ], + [ ?u, ?n, :upper_bound ], [ ?W, ?o, :object ], nil ] @@ -78,8 +87,6 @@ class Tk::TreeCtrl::NotifyEvent [ ?l, TkComm.method(:list) ], [ ?w, TkComm.method(:window) ], - [ ?b, proc{|val| list(val)} ], - [ ?e, proc{|val| case val when /^<<[^<>]+>>$/ @@ -128,6 +135,9 @@ module Tk::TreeCtrl::ConfigMethod when 'column' obj + when 'debug' + obj + when 'dragimage' obj @@ -219,8 +229,55 @@ module Tk::TreeCtrl::ConfigMethod end private :__item_configinfo_struct + def __item_numstrval_optkeys(id) + if id.kind_of?(Array) && id[0] == 'debug' + ['displaydelay'] + else + super(id) + end + end + private :__item_numstrval_optkeys + + def __item_boolval_optkeys(id) + if id.kind_of?(Array) + case id[0] + when 'debug' + ['data', 'display', 'enable'] + when 'column' + ['button', 'expand', 'squeeze', 'sunken', 'visible', 'widthhack'] + when 'element' + ['filled', 'showfocus'] + else + super(id) + end + else + super(id) + end + end + private :__item_listval_optkeys + + def __item_strval_optkeys(id) + if id.kind_of?(Array) && id[0] == 'debug' + ['erasecolor'] + else + super(id) + end + end + private :__item_strval_optkeys + def __item_listval_optkeys(id) - [] + if id.kind_of?(Array) + case id[0] + when 'column' + ['itembackground'] + when 'element' + ['relief'] + else + [] + end + else + [] + end end private :__item_listval_optkeys @@ -250,6 +307,19 @@ module Tk::TreeCtrl::ConfigMethod itemconfigure(['column', tagOrId], slot) end + def debug_cget(tagOrId, option) + itemcget(['debug', tagOrId], option) + end + def debug_configure(tagOrId, slot, value=None) + itemconfigure(['debug', tagOrId], slot, value) + end + def debug_configinfo(tagOrId, slot=nil) + itemconfigure(['debug', tagOrId], slot) + end + def debug_element_configinfo(tagOrId, slot=nil) + itemconfigure(['debug', tagOrId], slot) + end + def dragimage_cget(tagOrId, option) itemcget(['dragimage', tagOrId], option) end @@ -340,6 +410,23 @@ class Tk::TreeCtrl WidgetClassName = ''.freeze WidgetClassNames[WidgetClassName] = self + ######################### + + def __boolval_optkeys + [ + 'showbuttons', 'showheader', 'showlines', 'showroot', + 'showrootbutton', + ] + end + private :__boolval_optkeys + + def __listval_optkeys + [ 'defaultstyle' ] + end + private :__listval_optkeys + + ######################### + def install_bind(cmd, *args) install_bind_for_event_class(Tk::TreeCtrl::NotifyEvent, cmd, *args) end @@ -384,6 +471,14 @@ class Tk::TreeCtrl list(tk_send('column', 'bbox', idx)) end + def column_create(keys=nil) + if keys && keys.kind_of?(Hash) + num_or_str(tk_send('column', 'create', *hash_kv(keys))) + else + num_or_str(tk_send('column', 'create')) + end + end + def column_delete(idx) tk_send('column', 'delete', idx) self @@ -450,6 +545,15 @@ class Tk::TreeCtrl dragimage_visible() end + def debug_dinfo + tk_send('debug', 'dinfo') + self + end + + def debug_scroll + tk_send('debug', 'scroll') + end + def element_create(elem, type, keys=nil) if keys && keys.kind_of?(Hash) tk_send('element', 'create', elem, type, *hash_kv(keys)) @@ -501,13 +605,23 @@ class Tk::TreeCtrl list(tk_send('item', 'children', item)) end + def item_collapse(item) + tk_send('item', 'collapse', item) + self + end + + def item_collapse_recurse(item) + tk_send('item', 'collapse', item, '-recurse') + self + end + def item_complex(item, *args) tk_send('item', 'complex', item, *args) self end - def item_create() - num_or_str(tk_send('item', 'create')) + def item_create(keys={}) + num_or_str(tk_send('item', 'create', keys)) end def item_delete(first, last=None) @@ -523,6 +637,16 @@ class Tk::TreeCtrl tk_send('item', 'element', 'actual', item, column, elem, "-#{key}") end + def item_expand(item) + tk_send('item', 'expand', item) + self + end + + def item_expand_recurse(item) + tk_send('item', 'expand', item, '-recurse') + self + end + def item_firstchild(parent, child=nil) if child tk_send('item', 'firstchild', parent, child) @@ -639,6 +763,12 @@ class Tk::TreeCtrl end end + def item_state_forcolumn(item, column, *args) + tk_send('item', 'state', 'forcolumn', item, column, *args) + self + end + alias item_state_for_column item_state_forcolumn + def item_state_get(item, *args) if args.empty? list(tk_send('item', 'state', 'get', item *args)) @@ -648,11 +778,11 @@ class Tk::TreeCtrl end def item_state_set(item, *args) - tk_send('item', 'state', 'set', *args) + tk_send('item', 'state', 'set', item, *args) self end - def item_style_elements(item, colun) + def item_style_elements(item, column) list(tk_send('item', 'style', 'elements', item, column)) end @@ -688,6 +818,16 @@ class Tk::TreeCtrl end end + def item_toggle(item) + tk_send('item', 'toggle', item) + self + end + + def item_toggle_recurse(item) + tk_send('item', 'toggle', item, '-recurse') + self + end + def item_visible(item, st=None) if st == None bool(tk_send('item', 'visible', item)) -- cgit v1.2.3