diff options
Diffstat (limited to 'ext/tk/lib/tkextlib/bwidget')
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/button.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/buttonbox.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/dialog.rb | 10 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/dynamichelp.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/entry.rb | 10 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/label.rb | 10 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/labelentry.rb | 10 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/labelframe.rb | 11 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/listbox.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/mainframe.rb | 14 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/messagedlg.rb | 11 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/notebook.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/panelframe.rb | 51 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/passwddlg.rb | 11 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/scrollview.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/selectfont.rb | 6 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/spinbox.rb | 15 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/statusbar.rb | 46 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/tree.rb | 11 |
19 files changed, 246 insertions, 0 deletions
diff --git a/ext/tk/lib/tkextlib/bwidget/button.rb b/ext/tk/lib/tkextlib/bwidget/button.rb index 1432458cc7..4a9d4a7948 100644 --- a/ext/tk/lib/tkextlib/bwidget/button.rb +++ b/ext/tk/lib/tkextlib/bwidget/button.rb @@ -19,6 +19,11 @@ class Tk::BWidget::Button WidgetClassName = 'Button'.freeze WidgetClassNames[WidgetClassName] = self + def __strval_optkeys + super() << 'helptext' + end + private :__strval_optkeys + def __tkvariable_optkeys super() << 'helpvar' end diff --git a/ext/tk/lib/tkextlib/bwidget/buttonbox.rb b/ext/tk/lib/tkextlib/bwidget/buttonbox.rb index 477de8a61f..ef999239f9 100644 --- a/ext/tk/lib/tkextlib/bwidget/buttonbox.rb +++ b/ext/tk/lib/tkextlib/bwidget/buttonbox.rb @@ -21,6 +21,11 @@ class Tk::BWidget::ButtonBox include TkItemConfigMethod + def __boolval_optkeys + super() << 'homogeneous' + end + private :__boolval_optkeys + def tagid(tagOrId) if tagOrId.kind_of?(Tk::BWidget::Button) name = tagOrId[:name] diff --git a/ext/tk/lib/tkextlib/bwidget/dialog.rb b/ext/tk/lib/tkextlib/bwidget/dialog.rb index d175a2d8bb..2790d88d24 100644 --- a/ext/tk/lib/tkextlib/bwidget/dialog.rb +++ b/ext/tk/lib/tkextlib/bwidget/dialog.rb @@ -22,6 +22,16 @@ class Tk::BWidget::Dialog include TkItemConfigMethod + def __strval_optkeys + super() << 'title' + end + private :__strval_optkeys + + def __boolval_optkeys + super() << 'transient' << 'homogeneous' + end + private :__boolval_optkeys + def initialize(parent=nil, keys=nil) @relative = '' if parent.kind_of?(Hash) diff --git a/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb b/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb index 4766a1ec6d..224304f2ab 100644 --- a/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb +++ b/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb @@ -21,6 +21,11 @@ module Tk::BWidget::DynamicHelp 'DynamicHelp::configure' end + def __strval_optkeys + super() << 'topbackground' + end + private :__strval_optkeys + def self.__cget_cmd ['DynamicHelp::configure'] end diff --git a/ext/tk/lib/tkextlib/bwidget/entry.rb b/ext/tk/lib/tkextlib/bwidget/entry.rb index 855d2194f2..aafb4aa7ff 100644 --- a/ext/tk/lib/tkextlib/bwidget/entry.rb +++ b/ext/tk/lib/tkextlib/bwidget/entry.rb @@ -21,6 +21,16 @@ class Tk::BWidget::Entry WidgetClassName = 'Entry'.freeze WidgetClassNames[WidgetClassName] = self + def __strval_optkeys + super() << 'helptext' << 'insertbackground' + end + private :__strval_optkeys + + def __boolval_optkeys + super() << 'dragenabled' << 'dropenabled' << 'editable' + end + private :__boolval_optkeys + def __tkvariable_optkeys super() << 'helpvar' end diff --git a/ext/tk/lib/tkextlib/bwidget/label.rb b/ext/tk/lib/tkextlib/bwidget/label.rb index 68bf8cdac4..ce10ecaf8b 100644 --- a/ext/tk/lib/tkextlib/bwidget/label.rb +++ b/ext/tk/lib/tkextlib/bwidget/label.rb @@ -19,6 +19,16 @@ class Tk::BWidget::Label WidgetClassName = 'Label'.freeze WidgetClassNames[WidgetClassName] = self + def __strval_optkeys + super() << 'helptext' + end + private :__strval_optkeys + + def __boolval_optkeys + super() << 'dragenabled' << 'dropenabled' + end + private :__boolval_optkeys + def __tkvariable_optkeys super() << 'helpvar' end diff --git a/ext/tk/lib/tkextlib/bwidget/labelentry.rb b/ext/tk/lib/tkextlib/bwidget/labelentry.rb index b516a7d206..931feb9b48 100644 --- a/ext/tk/lib/tkextlib/bwidget/labelentry.rb +++ b/ext/tk/lib/tkextlib/bwidget/labelentry.rb @@ -23,11 +23,21 @@ class Tk::BWidget::LabelEntry WidgetClassName = 'LabelEntry'.freeze WidgetClassNames[WidgetClassName] = self + def __strval_optkeys + super() << 'helptext' << 'insertbackground' << 'entryfg' << 'entrybg' + end + private :__strval_optkeys + def __tkvariable_optkeys super() << 'helpvar' end private :__tkvariable_optkeys + def __font_optkeys + super() << 'labelfont' + end + private :__font_optkeys + #def entrybind(*args) # _bind([path, 'bind'], *args) # self diff --git a/ext/tk/lib/tkextlib/bwidget/labelframe.rb b/ext/tk/lib/tkextlib/bwidget/labelframe.rb index 3450be6e70..f7b267eebb 100644 --- a/ext/tk/lib/tkextlib/bwidget/labelframe.rb +++ b/ext/tk/lib/tkextlib/bwidget/labelframe.rb @@ -6,6 +6,7 @@ require 'tk' require 'tk/frame' require 'tkextlib/bwidget.rb' +require 'tkextlib/bwidget/label' module Tk module BWidget @@ -19,6 +20,16 @@ class Tk::BWidget::LabelFrame WidgetClassName = 'LabelFrame'.freeze WidgetClassNames[WidgetClassName] = self + def __strval_optkeys + super() << 'helptext' + end + private :__strval_optkeys + + def __boolval_optkeys + super() << 'dragenabled' << 'dropenabled' + end + private :__boolval_optkeys + def __tkvariable_optkeys super() << 'helpvar' end diff --git a/ext/tk/lib/tkextlib/bwidget/listbox.rb b/ext/tk/lib/tkextlib/bwidget/listbox.rb index 3d26081e6c..1267500661 100644 --- a/ext/tk/lib/tkextlib/bwidget/listbox.rb +++ b/ext/tk/lib/tkextlib/bwidget/listbox.rb @@ -35,6 +35,11 @@ class Tk::BWidget::ListBox end end + def __boolval_optkeys + super() << 'autofocus' << 'dragenabled' << 'dropenabled' << 'selectfill' + end + private :__boolval_optkeys + def tagid(tag) if tag.kind_of?(Tk::BWidget::ListBox::Item) tag.id diff --git a/ext/tk/lib/tkextlib/bwidget/mainframe.rb b/ext/tk/lib/tkextlib/bwidget/mainframe.rb index 7f87894586..c54e878557 100644 --- a/ext/tk/lib/tkextlib/bwidget/mainframe.rb +++ b/ext/tk/lib/tkextlib/bwidget/mainframe.rb @@ -20,11 +20,25 @@ class Tk::BWidget::MainFrame WidgetClassName = 'MainFrame'.freeze WidgetClassNames[WidgetClassName] = self + def __strval_optkeys + super() << 'progressfg' + end + private :__strval_optkeys + def __tkvariable_optkeys super() << 'progressvar' end private :__tkvariable_optkeys + def __val2ruby_optkeys # { key=>proc, ... } + # The method is used to convert a opt-value to a ruby's object. + # When get the value of the option "key", "proc.call(value)" is called. + { + 'menu'=>proc{|v| simplelist(v).collect!{|elem| simplelist(v)}} + } + end + private :__val2ruby_optkeys + def add_indicator(keys={}, &b) win = window(tk_send('addindicator', *hash_kv(keys))) win.instance_eval(&b) if b diff --git a/ext/tk/lib/tkextlib/bwidget/messagedlg.rb b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb index d7b2bbc32b..9c946d0630 100644 --- a/ext/tk/lib/tkextlib/bwidget/messagedlg.rb +++ b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb @@ -5,6 +5,7 @@ require 'tk' require 'tkextlib/bwidget.rb' +require 'tkextlib/bwidget/dialog.rb' module Tk module BWidget @@ -43,6 +44,16 @@ class Tk::BWidget::MessageDlg end private :create_self + def __strval_optkeys + super() << 'message' << 'title' + end + private :__strval_optkeys + + def __listval_optkeys + super() << 'buttons' + end + private :__listval_optkeys + def cget(slot) slot = slot.to_s if slot == 'relative' diff --git a/ext/tk/lib/tkextlib/bwidget/notebook.rb b/ext/tk/lib/tkextlib/bwidget/notebook.rb index 2bef13dffd..5146d4915d 100644 --- a/ext/tk/lib/tkextlib/bwidget/notebook.rb +++ b/ext/tk/lib/tkextlib/bwidget/notebook.rb @@ -29,6 +29,11 @@ class Tk::BWidget::NoteBook end end + def __boolval_optkeys + super() << 'homogeneous' + end + private :__boolval_optkeys + def tagid(id) if id.kind_of?(TkWindow) #id.path diff --git a/ext/tk/lib/tkextlib/bwidget/panelframe.rb b/ext/tk/lib/tkextlib/bwidget/panelframe.rb new file mode 100644 index 0000000000..13f8817d74 --- /dev/null +++ b/ext/tk/lib/tkextlib/bwidget/panelframe.rb @@ -0,0 +1,51 @@ +# +# tkextlib/bwidget/panelframe.rb +# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) +# + +require 'tk' +require 'tk/frame' +require 'tkextlib/bwidget.rb' + +module Tk + module BWidget + class PanelFrame < TkWindow + end + end +end + +class Tk::BWidget::PanelFrame + TkCommandNames = ['PanelFrame'.freeze].freeze + WidgetClassName = 'PanelFrame'.freeze + WidgetClassNames[WidgetClassName] = self + + def __strval_optkeys + super() + ['panelforeground', 'panelbackground'] + end + private :__strval_optkeys + + def add(win, keys={}) + tk_send('add', win, keys) + self + end + + def delete(*wins) + tk_send('delete', *wins) + self + end + + def get_frame(&b) + win = window(tk_send_without_enc('getframe')) + win.instance_eval(&b) if b + win + end + + def items + list(tk_send('items')) + end + + def remove(*wins) + tk_send('remove', *wins) + self + end +end diff --git a/ext/tk/lib/tkextlib/bwidget/passwddlg.rb b/ext/tk/lib/tkextlib/bwidget/passwddlg.rb index bfab7a078f..0b635d97bb 100644 --- a/ext/tk/lib/tkextlib/bwidget/passwddlg.rb +++ b/ext/tk/lib/tkextlib/bwidget/passwddlg.rb @@ -19,6 +19,17 @@ class Tk::BWidget::PasswdDlg WidgetClassName = 'PasswdDlg'.freeze WidgetClassNames[WidgetClassName] = self + def __strval_optkeys + super() << 'loginhelptext' << 'loginlabel' << 'logintext' << + 'passwdlabel' << 'passwdtext' + end + private :__strval_optkeys + + def __boolval_optkeys + super() << 'passwdeditable' << 'homogeneous' + end + private :__boolval_optkeys + def __tkvariable_optkeys super() << 'loginhelpvar' << 'logintextvariable' << 'passwdhelpvar' << 'passwdtextvariable' diff --git a/ext/tk/lib/tkextlib/bwidget/scrollview.rb b/ext/tk/lib/tkextlib/bwidget/scrollview.rb index 5da528bd49..0546af2c43 100644 --- a/ext/tk/lib/tkextlib/bwidget/scrollview.rb +++ b/ext/tk/lib/tkextlib/bwidget/scrollview.rb @@ -17,4 +17,9 @@ class Tk::BWidget::ScrollView TkCommandNames = ['ScrollView'.freeze].freeze WidgetClassName = 'ScrollView'.freeze WidgetClassNames[WidgetClassName] = self + + def __strval_optkeys + super() << 'fill' + end + private :__strval_optkeys end diff --git a/ext/tk/lib/tkextlib/bwidget/selectfont.rb b/ext/tk/lib/tkextlib/bwidget/selectfont.rb index 46ca0dbca8..478787602a 100644 --- a/ext/tk/lib/tkextlib/bwidget/selectfont.rb +++ b/ext/tk/lib/tkextlib/bwidget/selectfont.rb @@ -25,9 +25,15 @@ class Tk::BWidget::SelectFont WidgetClassName = 'SelectFont'.freeze WidgetClassNames[WidgetClassName] = self + def __strval_optkeys + super() << 'sampletext' << 'title' + end + private :__strval_optkeys + def __font_optkeys [] # without fontobj operation end + private :__font_optkeys def create tk_call(self.class::TkCommandNames[0], @path, *hash_kv(@keys)) diff --git a/ext/tk/lib/tkextlib/bwidget/spinbox.rb b/ext/tk/lib/tkextlib/bwidget/spinbox.rb index 9560abb663..ca4c046e5c 100644 --- a/ext/tk/lib/tkextlib/bwidget/spinbox.rb +++ b/ext/tk/lib/tkextlib/bwidget/spinbox.rb @@ -22,6 +22,21 @@ class Tk::BWidget::SpinBox WidgetClassName = 'SpinBox'.freeze WidgetClassNames[WidgetClassName] = self + def __strval_optkeys + super() << 'helptext' << 'insertbackground' << 'entryfg' << 'entrybg' + end + private :__strval_optkeys + + def __boolval_optkeys + super() << 'dragenabled' << 'dropenabled' << 'editable' + end + private :__boolval_optkeys + + def __listval_optkeys + super() << 'values' + end + private :__listval_optkeys + def __tkvariable_optkeys super() << 'helpvar' end diff --git a/ext/tk/lib/tkextlib/bwidget/statusbar.rb b/ext/tk/lib/tkextlib/bwidget/statusbar.rb new file mode 100644 index 0000000000..df16e4c0b7 --- /dev/null +++ b/ext/tk/lib/tkextlib/bwidget/statusbar.rb @@ -0,0 +1,46 @@ +# +# tkextlib/bwidget/statusbar.rb +# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) +# + +require 'tk' +require 'tk/frame' +require 'tkextlib/bwidget.rb' + +module Tk + module BWidget + class StatusBar < TkWindow + end + end +end + +class Tk::BWidget::StatusBar + TkCommandNames = ['StatusBar'.freeze].freeze + WidgetClassName = 'StatusBar'.freeze + WidgetClassNames[WidgetClassName] = self + + def __boolval_optkeys + super() << 'showresize' + end + private :__boolval_optkeys + + def add(win, keys={}) + tk_send('add', win, keys) + self + end + + def delete(*wins) + tk_send('delete', *wins) + self + end + + def get_frame(&b) + win = window(tk_send_without_enc('getframe')) + win.instance_eval(&b) if b + win + end + + def items + list(tk_send('items')) + end +end diff --git a/ext/tk/lib/tkextlib/bwidget/tree.rb b/ext/tk/lib/tkextlib/bwidget/tree.rb index c405736653..e7178debe2 100644 --- a/ext/tk/lib/tkextlib/bwidget/tree.rb +++ b/ext/tk/lib/tkextlib/bwidget/tree.rb @@ -32,6 +32,17 @@ class Tk::BWidget::Tree end end + def __strval_optkeys + super() << 'crossfill' << 'linesfill' + end + private :__strval_optkeys + + def __boolval_optkeys + super() << 'dragenabled' << 'dropenabled' << + 'redraw' << 'selectfill' << 'showlines' + end + private :__boolval_optkeys + def __tkvariable_optkeys super() << 'helpvar' end |