summaryrefslogtreecommitdiff
path: root/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-11 04:51:21 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-11 04:51:21 +0000
commit3514110b89bee5c37e308b4ca887e66dfe841456 (patch)
treed280d8542cc44d1cd1a75e8ec87b1f9d231561b7 /ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
parent05f5928c9d0f094d1e7e21a9bd9d8a8fc2f1a805 (diff)
* ext/tk/lib/tk/*: untabify
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/tkextlib/bwidget/tmpldlg.rb')
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tmpldlg.rb180
1 files changed, 90 insertions, 90 deletions
diff --git a/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb b/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
index 1ed84e21aa..3d19c8d092 100644
--- a/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
+++ b/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
@@ -24,14 +24,14 @@ module DemoDialog
subf = titf1.get_frame
cmd = proc{ TkOption.read_file(File.join(Tk::BWidget::LIBRARY, 'lang',
- @@resources.value + '.rc')) }
+ @@resources.value + '.rc')) }
Tk.pack(TkRadiobutton.new(subf, :text=>'English', :value=>'en',
- :variable=>@@resources, :command=>cmd),
- TkRadiobutton.new(subf, :text=>'French', :value=>'fr',
- :variable=>@@resources, :command=>cmd),
- TkRadiobutton.new(subf, :text=>'German', :value=>'de',
- :variable=>@@resources, :command=>cmd),
- :side=>:left)
+ :variable=>@@resources, :command=>cmd),
+ TkRadiobutton.new(subf, :text=>'French', :value=>'fr',
+ :variable=>@@resources, :command=>cmd),
+ TkRadiobutton.new(subf, :text=>'German', :value=>'de',
+ :variable=>@@resources, :command=>cmd),
+ :side=>:left)
_tmpldlg(titf2.get_frame)
_msgdlg(titf3.get_frame)
@@ -47,34 +47,34 @@ module DemoDialog
@@tmpl['anchor'] = :c
labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Button side',
- :side=>:top, :anchor=>:w,
- :relief=>:sunken, :borderwidth=>1)
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>1)
subf = labf1.get_frame
Tk.pack(TkRadiobutton.new(subf, :text=>'Bottom', :value=>:bottom,
- :variable=>@@tmpl.ref('side'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Left', :value=>:left,
- :variable=>@@tmpl.ref('side'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Right', :value=>:right,
- :variable=>@@tmpl.ref('side'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Top', :value=>:top,
- :variable=>@@tmpl.ref('side'), :anchor=>:w),
- :fill=>:x, :anchor=>:w)
+ :variable=>@@tmpl.ref('side'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Left', :value=>:left,
+ :variable=>@@tmpl.ref('side'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Right', :value=>:right,
+ :variable=>@@tmpl.ref('side'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Top', :value=>:top,
+ :variable=>@@tmpl.ref('side'), :anchor=>:w),
+ :fill=>:x, :anchor=>:w)
labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Button anchor',
- :side=>:top, :anchor=>:w,
- :relief=>:sunken, :borderwidth=>1)
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>1)
subf = labf2.get_frame
Tk.pack(TkRadiobutton.new(subf, :text=>'North', :value=>:n,
- :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'West', :value=>:w,
- :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'East', :value=>:e,
- :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'South', :value=>:s,
- :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Center', :value=>:c,
- :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
- :fill=>:x, :anchor=>:w)
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'West', :value=>:w,
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'East', :value=>:e,
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'South', :value=>:s,
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Center', :value=>:c,
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ :fill=>:x, :anchor=>:w)
sep = Tk::BWidget::Separator.new(parent, :orient=>:horizontal)
button = TkButton.new(parent, :text=>'Show', :command=>proc{_show_tmpldlg})
@@ -89,44 +89,44 @@ module DemoDialog
@@msg['icon'] = 'info'
labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Type', :side=>:top,
- :anchor=>:w, :relief=>:sunken,
- :borderwidth=>1)
+ :anchor=>:w, :relief=>:sunken,
+ :borderwidth=>1)
subf = labf1.get_frame
Tk.pack(TkRadiobutton.new(subf, :text=>'Ok', :value=>'ok',
- :variable=>@@msg.ref('type'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Ok, Cancel', :value=>'okcancel',
- :variable=>@@msg.ref('type'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Retry, Cancel',
- :value=>'retrycancel',
- :variable=>@@msg.ref('type'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Yes, No', :value=>'yesno',
- :variable=>@@msg.ref('type'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Yes, No, Cancel',
- :value=>'yesnocancel',
- :variable=>@@msg.ref('type'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Abort, Retry, Ignore',
- :value=>'abortretryignore',
- :variable=>@@msg.ref('type'), :anchor=>:w),
- :fill=>:x, :anchor=>:w)
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Ok, Cancel', :value=>'okcancel',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Retry, Cancel',
+ :value=>'retrycancel',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Yes, No', :value=>'yesno',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Yes, No, Cancel',
+ :value=>'yesnocancel',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Abort, Retry, Ignore',
+ :value=>'abortretryignore',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ :fill=>:x, :anchor=>:w)
Tk.pack(TkRadiobutton.new(subf, :text=>'User', :value=>'user',
- :variable=>@@msg.ref('type'), :anchor=>:w),
- Tk::BWidget::Entry.new(subf, :textvariable=>@@msg.ref('buttons')),
- :side=>:left)
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ Tk::BWidget::Entry.new(subf, :textvariable=>@@msg.ref('buttons')),
+ :side=>:left)
labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Icon', :side=>:top,
- :anchor=>:w, :relief=>:sunken,
- :borderwidth=>1)
+ :anchor=>:w, :relief=>:sunken,
+ :borderwidth=>1)
subf = labf2.get_frame
Tk.pack(TkRadiobutton.new(subf, :text=>'Information', :value=>'info',
- :variable=>@@msg.ref('icon'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Question', :value=>'question',
- :variable=>@@msg.ref('icon'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Warning', :value=>'warning',
- :variable=>@@msg.ref('icon'), :anchor=>:w),
- TkRadiobutton.new(subf, :text=>'Error', :value=>'error',
- :variable=>@@msg.ref('icon'), :anchor=>:w),
- :fill=>:x, :anchor=>:w)
+ :variable=>@@msg.ref('icon'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Question', :value=>'question',
+ :variable=>@@msg.ref('icon'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Warning', :value=>'warning',
+ :variable=>@@msg.ref('icon'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Error', :value=>'error',
+ :variable=>@@msg.ref('icon'), :anchor=>:w),
+ :fill=>:x, :anchor=>:w)
sep = Tk::BWidget::Separator.new(parent, :orient=>:horizontal)
button = TkButton.new(parent, :text=>'Show', :command=>proc{_show_msgdlg})
@@ -138,15 +138,15 @@ module DemoDialog
def self._stddlg(parent)
Tk.pack(TkButton.new(parent, :text=>'Select a color '){|w|
- command(proc{DemoDialog._show_color(w)})
- },
- TkButton.new(parent, :text=>'Font selector dialog',
- :command=>proc{_show_fontdlg}),
- TkButton.new(parent, :text=>'Progression dialog',
- :command=>proc{_show_progdlg}),
- TkButton.new(parent, :text=>'Password dialog',
- :command=>proc{_show_passdlg}),
- :side=>:left, :padx=>5, :anchor=>:w)
+ command(proc{DemoDialog._show_color(w)})
+ },
+ TkButton.new(parent, :text=>'Font selector dialog',
+ :command=>proc{_show_fontdlg}),
+ TkButton.new(parent, :text=>'Progression dialog',
+ :command=>proc{_show_progdlg}),
+ TkButton.new(parent, :text=>'Password dialog',
+ :command=>proc{_show_passdlg}),
+ :side=>:left, :padx=>5, :anchor=>:w)
end
def self._show_color(w)
@@ -159,15 +159,15 @@ module DemoDialog
def self._show_tmpldlg
dlg = Tk::BWidget::Dialog.new(:relative=>Tk.root, :modal=>:local,
- :separator=>true, :title=>'Template dialog',
- :side=>@@tmpl['side'],
- :anchor=>@@tmpl['anchor'],
- :default=>0, :cancel=>1)
+ :separator=>true, :title=>'Template dialog',
+ :side=>@@tmpl['side'],
+ :anchor=>@@tmpl['anchor'],
+ :default=>0, :cancel=>1)
dlg.add('name'=>'ok')
dlg.add('name'=>'cancel')
TkMessage.new(dlg.get_frame, :text=>"Template\nDialog", :justify=>:center,
- :anchor=>:c, :width=>80).pack(:fill=>:both, :expand=>true,
- :padx=>100, :pady=>100)
+ :anchor=>:c, :width=>80).pack(:fill=>:both, :expand=>true,
+ :padx=>100, :pady=>100)
dlg.draw
dlg.destroy
end
@@ -175,16 +175,16 @@ module DemoDialog
def self._show_msgdlg
@@msgdlg.destroy if @@msgdlg
@@msgdlg = Tk::BWidget::MessageDlg.new(:relative=>Tk.root,
- :message=>'Message for MessageBox',
- :type=>@@msg['type'],
- :icon=>@@msg['icon'],
- :buttons=>@@msg['buttons'])
+ :message=>'Message for MessageBox',
+ :type=>@@msg['type'],
+ :icon=>@@msg['icon'],
+ :buttons=>@@msg['buttons'])
@@msgdlg.create
end
def self._show_fontdlg
font = Tk::BWidget::SelectFont.new(:relative=>Tk.root,
- :font=>DemoVar.font).create
+ :font=>DemoVar.font).create
DemoVar::Demo.update_font(font)
end
@@ -193,11 +193,11 @@ module DemoDialog
@@progval.value = 0
@@progdlg = Tk::BWidget::ProgressDlg.new(:relative=>Tk.root,
- :title=>'Wait...',
- :type=>'infinite', :width=>20,
- :textvariable=>@@progmsg,
- :variable=>@@progval,
- :stop=>'Stop') {
+ :title=>'Wait...',
+ :type=>'infinite', :width=>20,
+ :textvariable=>@@progmsg,
+ :variable=>@@progval,
+ :stop=>'Stop') {
command(proc{self.destroy})
create
}
@@ -206,12 +206,12 @@ module DemoDialog
def self._update_progdlg
TkTimer.new(20, -1, proc{
- if @@progdlg && @@progdlg.winfo_exist?
- @@progval.value = 2
- else
- stop
- end
- }).start
+ if @@progdlg && @@progdlg.winfo_exist?
+ @@progval.value = 2
+ else
+ stop
+ end
+ }).start
end
def self._show_passdlg