1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/tk/lib/tk/*: untabify

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2004-10-11 04:51:21 +00:00
parent 5716ff7b80
commit 94d960beb5
296 changed files with 13591 additions and 13558 deletions

View file

@ -130,12 +130,12 @@ applet_cmd = proc{|w, arglist|
# Construct the main HTML viewer
#
html = Tk::HTML_Widget.new(:padx=>5, :pady=>9,
:formcommand=>form_cmd,
:imagecommand=>image_cmd,
:scriptcommand=>script_cmd,
:appletcommand=>applet_cmd,
:underlinehyperlinks=>0,
:bg=>'white', :tablerelief=>:raised)
:formcommand=>form_cmd,
:imagecommand=>image_cmd,
:scriptcommand=>script_cmd,
:appletcommand=>applet_cmd,
:underlinehyperlinks=>0,
:bg=>'white', :tablerelief=>:raised)
vscr = html.yscrollbar(TkScrollbar.new)
hscr = html.xscrollbar(TkScrollbar.new)
@ -162,7 +162,7 @@ read_file = proc{|name|
ret = nil
fp = nil
Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'",
:type=>:ok)
:type=>:ok)
ensure
fp.close if fp
end
@ -212,15 +212,15 @@ html.clipping_window.bind('1', href_binding, '%x %y')
# marking text with the mouse and copying to the clipboard just with tkhtml2.0 working
html.clipping_window.bind('B1-Motion', proc{|w, x, y|
w.selection_set(priv['mark'], "@#{x},#{y}")
TkClipboard.clear
# avoid tkhtml0.0 errors
# anyone can fix this for tkhtml0.0
begin
TkClipboard.append(TkSelection.get)
rescue
end
}, '%W %x %y')
w.selection_set(priv['mark'], "@#{x},#{y}")
TkClipboard.clear
# avoid tkhtml0.0 errors
# anyone can fix this for tkhtml0.0
begin
TkClipboard.append(TkSelection.get)
rescue
end
}, '%W %x %y')
# This procedure is called when the user selects the File/Open
# menu option.
@ -249,14 +249,14 @@ refresh = proc{|*args|
# top of a hyperlink.
#
Tk::HTML_Widget::ClippingWindow.bind('Motion', proc{|w, x, y|
parent = w.winfo_parent
url = parent.href(x, y)
unless url.empty?
parent[:cursor] = 'hand2'
else
parent[:cursor] = ''
end
}, '%W %x %y')
parent = w.winfo_parent
url = parent.href(x, y)
unless url.empty?
parent[:cursor] = 'hand2'
else
parent[:cursor] = ''
end
}, '%W %x %y')
#
# Setup menu
#
@ -279,18 +279,18 @@ mbar = Tk.root.add_menubar(menu_spec)
# Setup trace
#
ul_hyper.trace('w', proc{
html[:underlinehyperlinks] = ul_hyper.value
refresh.call
})
html[:underlinehyperlinks] = ul_hyper.value
refresh.call
})
show_tbl.trace('w', proc{
if show_tbl.bool
html[:tablerelief] = :flat
else
html[:tablerelief] = :raised
end
refresh.call
})
if show_tbl.bool
html[:tablerelief] = :flat
else
html[:tablerelief] = :raised
end
refresh.call
})
show_img.trace('w', refresh)

View file

@ -198,7 +198,7 @@ read_file = proc{|name|
ret = nil
fp = nil
Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'",
:type=>:ok)
:type=>:ok)
ensure
fp.close if fp
end
@ -291,20 +291,20 @@ fullscreen = proc{
width = root.winfo_screenwidth
height = root.winfo_screenheight
fswin = TkToplevel.new(:overrideredirect=>true,
:geometry=>"#{width}x#{height}+0+0")
:geometry=>"#{width}x#{height}+0+0")
html_fs = Tk::HTML_Widget.new(fswin, :padx=>5, :pady=>9,
:formcommand=>form_cmd,
:imagecommand=>proc{image_cmd.call(0)},
:scriptcommand=>script_cmd,
:appletcommand=>applet_cmd,
:hyperlinkcommand=>hyper_cmd,
:bg=>'white', :tablerelief=>:raised,
:appletcommand=>proc{|*args|
run_applet('big', *args)
},
:fontcommand=>pick_font_fs,
:cursor=>:tcross) {
:formcommand=>form_cmd,
:imagecommand=>proc{image_cmd.call(0)},
:scriptcommand=>script_cmd,
:appletcommand=>applet_cmd,
:hyperlinkcommand=>hyper_cmd,
:bg=>'white', :tablerelief=>:raised,
:appletcommand=>proc{|*args|
run_applet('big', *args)
},
:fontcommand=>pick_font_fs,
:cursor=>:tcross) {
pack(:fill=>:both, :expand=>true)
token_handler('meta', proc{|*args| meta.call(self, *args)})
}
@ -361,19 +361,19 @@ menu_spec = [
mbar = root.add_menubar(menu_spec)
html = Tk::HTML_Widget.new(:width=>512, :height=>384,
:padx=>5, :pady=>9,
:formcommand=>form_cmd,
:imagecommand=>proc{|*args|
image_cmd.call(1, *args)
},
:scriptcommand=>script_cmd,
:appletcommand=>applet_cmd,
:hyperlinkcommand=>hyper_cmd,
:fontcommand=>pick_font,
:appletcommand=>proc{|*args|
run_applet.call('small', *args)
},
:bg=>'white', :tablerelief=>:raised)
:padx=>5, :pady=>9,
:formcommand=>form_cmd,
:imagecommand=>proc{|*args|
image_cmd.call(1, *args)
},
:scriptcommand=>script_cmd,
:appletcommand=>applet_cmd,
:hyperlinkcommand=>hyper_cmd,
:fontcommand=>pick_font,
:appletcommand=>proc{|*args|
run_applet.call('small', *args)
},
:bg=>'white', :tablerelief=>:raised)
html.token_handler('meta', proc{|*args| meta.call(html, *args)})