diff options
Diffstat (limited to 'ext/tk/sample/tkextlib/bwidget/demo.rb')
-rw-r--r-- | ext/tk/sample/tkextlib/bwidget/demo.rb | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/ext/tk/sample/tkextlib/bwidget/demo.rb b/ext/tk/sample/tkextlib/bwidget/demo.rb index e192cd6364..785d2681a8 100644 --- a/ext/tk/sample/tkextlib/bwidget/demo.rb +++ b/ext/tk/sample/tkextlib/bwidget/demo.rb @@ -54,26 +54,26 @@ class BWidget_Demo descmenu = [ '&File', 'all', 'file', 0, [ - ['command', 'E&xit', [], 'Exit BWidget demo', [], - {:command=>proc{exit}}] + ['command', 'E&xit', [], 'Exit BWidget demo', [], + {:command=>proc{exit}}] ], '&Options', 'all', 'options', 0, [ - ['checkbutton', 'Toolbar &1', ['all', 'option'], - 'Show/hide toolbar 1', [], - { :variable=>DemoVar.toolbar1, - :command=>proc{ - DemoVar.mainframe.show_toolbar(0, DemoVar.toolbar1.value) - } - } - ], - ['checkbutton', 'Toolbar &2', ['all', 'option'], - 'Show/hide toolbar 2', [], - { :variable=>DemoVar.toolbar2, - :command=>proc{ - DemoVar.mainframe.show_toolbar(1, DemoVar.toolbar2.value) - } - } - ] + ['checkbutton', 'Toolbar &1', ['all', 'option'], + 'Show/hide toolbar 1', [], + { :variable=>DemoVar.toolbar1, + :command=>proc{ + DemoVar.mainframe.show_toolbar(0, DemoVar.toolbar1.value) + } + } + ], + ['checkbutton', 'Toolbar &2', ['all', 'option'], + 'Show/hide toolbar 2', [], + { :variable=>DemoVar.toolbar2, + :command=>proc{ + DemoVar.mainframe.show_toolbar(1, DemoVar.toolbar2.value) + } + } + ] ] ] @@ -81,63 +81,63 @@ class BWidget_Demo DemoVar.prgindic.value = 0 DemoVar.mainframe = Tk::BWidget::MainFrame.new( - :menu=>descmenu, - :textvariable=>DemoVar.status, - :progressvar=>DemoVar.prgindic - ) + :menu=>descmenu, + :textvariable=>DemoVar.status, + :progressvar=>DemoVar.prgindic + ) # toobar 1 creation DemoVar.prgindic.numeric += 1 DemoVar.mainframe.add_toolbar{|tb1| Tk::BWidget::ButtonBox.new(tb1, :spacing=>0, :padx=>1, :pady=>1){|bbox| - add(:image=>Tk::BWidget::Bitmap.new('new'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Create a new file" icon'}, - :helptext=>"Create a new file") - - add(:image=>Tk::BWidget::Bitmap.new('open'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Open an existing file" icon'}, - :helptext=>"Open an existing file") - - add(:image=>Tk::BWidget::Bitmap.new('save'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Save file" icon'}, - :helptext=>"Save file") - - pack(:side=>:left, :anchor=>:w) + add(:image=>Tk::BWidget::Bitmap.new('new'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Create a new file" icon'}, + :helptext=>"Create a new file") + + add(:image=>Tk::BWidget::Bitmap.new('open'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Open an existing file" icon'}, + :helptext=>"Open an existing file") + + add(:image=>Tk::BWidget::Bitmap.new('save'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Save file" icon'}, + :helptext=>"Save file") + + pack(:side=>:left, :anchor=>:w) } Tk::BWidget::Separator.new(tb1, :orient=>:vertical){ - pack(:side=>:left, :fill=>:y, :padx=>4, :anchor=>:w) + pack(:side=>:left, :fill=>:y, :padx=>4, :anchor=>:w) } DemoVar.prgindic.numeric += 1 Tk::BWidget::ButtonBox.new(tb1, :spacing=>0, :padx=>1, :pady=>1){|bbox| - add(:image=>Tk::BWidget::Bitmap.new('cut'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Cut selection" icon'}, - :helptext=>"Cut selection") - - add(:image=>Tk::BWidget::Bitmap.new('copy'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Copy selection" icon'}, - :helptext=>"Copy selection") - - add(:image=>Tk::BWidget::Bitmap.new('paste'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Paste selection" icon'}, - :helptext=>"Paste selection") - - pack(:side=>:left, :anchor=>:w) + add(:image=>Tk::BWidget::Bitmap.new('cut'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Cut selection" icon'}, + :helptext=>"Cut selection") + + add(:image=>Tk::BWidget::Bitmap.new('copy'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Copy selection" icon'}, + :helptext=>"Copy selection") + + add(:image=>Tk::BWidget::Bitmap.new('paste'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Paste selection" icon'}, + :helptext=>"Paste selection") + + pack(:side=>:left, :anchor=>:w) } } @@ -147,7 +147,7 @@ class BWidget_Demo tb2 = DemoVar.mainframe.add_toolbar DemoVar._wfont = Tk::BWidget::SelectFont::Toolbar.new(tb2, :command=>proc{update_font(DemoVar._wfont[:font])} - ) + ) DemoVar.font = DemoVar._wfont[:font] DemoVar._wfont.pack(:side=>:left, :anchor=>:w) @@ -214,18 +214,18 @@ class BWidget_Demo top.overrideredirect(true) ximg = TkLabel.new(top, :bitmap=>"@#{File.join(DEMODIR,'x1.xbm')}", - :foreground=>'grey90', :background=>'white') + :foreground=>'grey90', :background=>'white') bwimg = TkLabel.new(ximg, :bitmap=>"@#{File.join(DEMODIR,'bwidget.xbm')}", - :foreground=>'grey90', :background=>'white') + :foreground=>'grey90', :background=>'white') frame = TkFrame.new(ximg, :background=>'white') TkLabel.new(frame, :text=>'Loading demo', - :background=>'white', :font=>'times 8').pack + :background=>'white', :font=>'times 8').pack TkLabel.new(frame, :textvariable=>DemoVar.prgtext, - :background=>'white', :font=>'times 8', :width=>35).pack + :background=>'white', :font=>'times 8', :width=>35).pack Tk::BWidget::ProgressBar.new(frame, :width=>50, :height=>10, - :background=>'white', - :variable=>DemoVar.prgindic, - :maximum=>10).pack + :background=>'white', + :variable=>DemoVar.prgindic, + :maximum=>10).pack frame.place(:x=>0, :y=>0, :anchor=>:nw) bwimg.place(:relx=>1, :rely=>1, :anchor=>:se) ximg.pack |