1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/tk/sample/demos-jp/menu84.rb

209 lines
8.3 KiB
Ruby
Raw Normal View History

#
# menus widget demo (called by 'widget')
#
# toplevel widget
if defined?($menu84_demo) && $menu84_demo
$menu84_demo.destroy
$menu84_demo = nil
end
# demo toplevel widget
$menu84_demo = TkToplevel.new {|w|
title("File Selection Dialogs")
iconname("menu84")
positionWindow(w)
}
begin
windowingsystem = Tk.windowingsystem()
rescue
windowingsystem = ""
end
# label
TkLabel.new($menu84_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
if $tk_platform['platform'] == 'macintosh' ||
windowingsystem == "classic" || windowingsystem == "aqua"
text("<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><EFBFBD>ˤϥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><EFBFBD>˥塼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĥ<EFBFBD><EFBFBD>˥塼<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>Command+x ('x'<27>ϥ<EFBFBD><CFA5>ޥ<EFBFBD><DEA5>ɥ<EFBFBD><C9A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܥ<EFBFBD><DCA5><EFBFBD>³<EFBFBD><C2B3><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD>Ǥ<EFBFBD>) <20>ȥ<EFB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<F2A4B9A4>Ȥˤ<C8A4><CBA4>äơ<C3A4><C6A1><EFBFBD>Ω<EFBFBD><CEA9><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><D1A5>åȤȤʤ<C8A4><CAA4><EFBFBD><E8A4A6><EFBFBD>ڤ<EFBFBD><DAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD>ǽ<EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD>")
end
}.pack('side'=>'top')
menustatus = TkVariable.new(" ")
TkFrame.new($menu84_demo) {|frame|
TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken',
'bd'=>1, 'font'=>['Helvetica', '10'],
'anchor'=>'w').pack('side'=>'left', 'padx'=>2,
'expand'=>true, 'fill'=>'both')
pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
}
# frame
TkFrame.new($menu84_demo) {|frame|
TkButton.new(frame) {
text <><CEBB>'
command proc{
tmppath = $menu84_demo
$menu84_demo = nil
tmppath.destroy
}
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
text '<27><><EFBFBD><EFBFBD><EFBFBD>ɻ<EFBFBD><C9BB><EFBFBD>'
command proc{showCode 'menu84'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# create menu frame
$menu84_frame = TkMenu.new($menu84_demo, 'tearoff'=>false)
# menu
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'File', 'menu'=>m, 'underline'=>0)
add('command', 'label'=>'Open...', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Open..." <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('command', 'label'=>'New', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"New" <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('command', 'label'=>'Save', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>Ǥ<EFBFBD><C7A4>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Save" <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('command', 'label'=>'Save As...', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>Ǥ<EFBFBD><C7A4>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Save As..." <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('separator')
add('command', 'label'=>'Print Setup...', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Print Setup..." <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('command', 'label'=>'Print...', 'command'=>proc{fail '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ʤ<EFBFBD><CAA4>ǥ<EFBFBD><C7A5>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>顢"Print..." <20><><EFBFBD>ܤε<DCA4>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤϤ<C6A4><CFA4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>'})
add('separator')
add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu84_demo.destroy})
}
if $tk_platform['platform'] == 'macintosh' ||
windowingsystem = "classic" || windowingsystem = "aqua"
modifier = 'Command'
elsif $tk_platform['platform'] == 'windows'
modifier = 'Control'
else
modifier = 'Meta'
end
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'Basic', 'menu'=>m, 'underline'=>0)
add('command', 'label'=>'Long entry that does nothing')
['A','B','C','D','E','F','G'].each{|c|
add('command', 'label'=>"Print letter \"#{c}\"",
'underline'=>14, 'accelerator'=>"Meta+#{c}",
'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
$menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
}
}
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'Cascades', 'menu'=>m, 'underline'=>0)
add('command', 'label'=>'Print hello',
'command'=>proc{print "Hello\n"},
'accelerator'=>"#{modifier}+H", 'underline'=>6)
$menu84_demo.bind("#{modifier}-h", proc{print "Hello\n"})
add('command', 'label'=>'Print goodbye',
'command'=>proc{print "Goodbye\n"},
'accelerator'=>"#{modifier}+G", 'underline'=>6)
$menu84_demo.bind("#{modifier}-g", proc{print "Goodbye\n"})
TkMenu.new(m, 'tearoff'=>false) {|cascade_check|
m.add('cascade', 'label'=>'Check button',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
add('check', 'label'=>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB8A1>', 'variable'=>oil)
trans = TkVariable.new(0)
add('check', 'label'=>'<27>ȥ<EFBFBD><C8A5>󥹥ߥå<DFA5><C3A5><EFBFBD><EFBFBD>󸡺<EFBFBD>', 'variable'=>trans)
brakes = TkVariable.new(0)
add('check', 'label'=>'<27>֥졼<D6A5><ECA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', 'variable'=>brakes)
lights = TkVariable.new(0)
add('check', 'label'=>'<27><EFBFBD>ȸ<EFBFBD><C8B8><EFBFBD>', 'variable'=>lights)
add('separator')
add('command', 'label'=>'Show current values',
'command'=>proc{showVars($menu84_demo,
['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', oil],
['<27>ȥ<EFBFBD><C8A5>󥹥ߥå<DFA5><C3A5><EFBFBD><EFBFBD><EFBFBD>', trans],
['<27>֥졼<D6A5><ECA1BC>', brakes],
['<27><EFBFBD><E9A5A4>', lights])} )
invoke 1
invoke 3
}
TkMenu.new(m, 'tearoff'=>false) {|cascade_radio|
m.add('cascade', 'label'=>'Radio buttons',
'menu'=>cascade_radio, 'underline'=>0)
pointSize = TkVariable.new
add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10)
add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14)
add('radio', 'label'=>'18 point', 'variable'=>pointSize, 'value'=>18)
add('radio', 'label'=>'24 point', 'variable'=>pointSize, 'value'=>24)
add('radio', 'label'=>'32 point', 'variable'=>pointSize, 'value'=>32)
add('separator')
style = TkVariable.new
add('radio', 'label'=>'Roman', 'variable'=>style, 'value'=>'roman')
add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold')
add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic')
add('separator')
add('command', 'label'=>'<27><><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD>ɽ<EFBFBD><C9BD>',
'command'=>proc{showVars($menu84_demo,
['pointSize', pointSize],
['style', style])} )
invoke 1
invoke 7
}
}
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0)
add('command', 'hidemargin'=>1,
'bitmap'=>'@'+[$demo_dir,'images','pattern.bmp'].join(File::Separator),
'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
'text'=>'<27><><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򤷤<EFBFBD><F2A4B7A4><EFBFBD><EFBFBD>˥塼<CBA5><E5A1BC><EFBFBD>ܤϡ<DCA4>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥ӥåȥޥåץ<C3A5><D7A5><EFBFBD><E1A1BC><EFBFBD>ǹ<EFBFBD><C7B9>ܤ<EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4><CFA1>ۤ<EFBFBD><DBA4>Υ<EFBFBD><CEA5>˥塼<CBA5><E5A1BC><EFBFBD>ܤȤδ֤<CEB4><D6A4>ä˰㤤<CBB0><E3A4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǤϤ<C7A4><CFA4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>',
'bitmap'=>'', 'default'=>0,
'buttons'=>'<27>Ĥ<EFBFBD><C4A4><EFBFBD>')} )
['info', 'questhead', 'error'].each{|icon|
add('command', 'bitmap'=>icon, 'hidemargin'=>1,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
}
entryconfigure(2, :columnbreak=>true)
}
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'More', 'menu'=>m, 'underline'=>0)
[ 'An entry','Another entry','Does nothing','Does almost nothing',
'Make life meaningful' ].each{|i|
add('command', 'label'=>i,
'command'=>proc{print "You invoked \"#{i}\"\n"})
}
m.entryconfigure('Does almost nothing',
'bitmap'=>'questhead', 'compound'=>'left',
'command'=>proc{
TkDialog.new('title'=>'Compound Menu Entry',
'message'=>'<27><><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򤷤<EFBFBD><F2A4B7A4><EFBFBD><EFBFBD>˥塼<CBA5><E5A1BC><EFBFBD>ܤϡ<DCA4><CFA1>ӥåȥޥåץ<C3A5><D7A5><EFBFBD><E1A1BC><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>˰<EFBFBD><CBB0>Ĥι<C4A4><CEB9>ܤ<EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4><CFA1>ۤ<EFBFBD><DBA4>Υ<EFBFBD><CEA5>˥塼<CBA5><E5A1BC><EFBFBD>ܤȤδ֤<CEB4><D6A4>ä˰㤤<CBB0><E3A4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǤϤ<C7A4><CFA4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>',
'buttons'=>[<><CEBB>'], 'bitmap'=>'')
})
}
TkMenu.new($menu84_frame) {|m|
$menu84_frame.add('cascade', 'label'=>'Colors', 'menu'=>m, 'underline'=>0)
['red', 'orange', 'yellow', 'green', 'blue'].each{|c|
add('command', 'label'=>c, 'background'=>c,
'command'=>proc{print "You invoked \"#{c}\"\n"})
}
}
$menu84_demo.menu($menu84_frame)
TkMenu.bind('<MenuSelect>', proc{|w|
begin
label = w.entrycget('active', 'label')
rescue
label = " "
end
menustatus.value = label
Tk.update(true)
}, '%W')