diff options
Diffstat (limited to 'ext/tk/sample/demos-jp')
39 files changed, 1648 insertions, 1648 deletions
diff --git a/ext/tk/sample/demos-jp/arrow.rb b/ext/tk/sample/demos-jp/arrow.rb index 70fe346b65..477a0abf6f 100644 --- a/ext/tk/sample/demos-jp/arrow.rb +++ b/ext/tk/sample/demos-jp/arrow.rb @@ -9,7 +9,7 @@ # interactively. # # Arguments: -# c - Name of the canvas widget. +# c - Name of the canvas widget. def arrowSetup(c) v = $demo_arrowInfo @@ -25,59 +25,59 @@ def arrowSetup(c) # Create the arrow and outline. c.delete('all') TkcLine.new(c, v.x1, v.y, v.x2, v.y, - { 'width'=>10 * v.width, - 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c], - 'arrow'=>'last' - }.update(v.bigLineStyle) ) + { 'width'=>10 * v.width, + 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c], + 'arrow'=>'last' + }.update(v.bigLineStyle) ) xtip = v.x2 - 10*v.b deltaY = 10*v.c + 5*v.width TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY, - v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y, - 'width'=>2, 'capstyle'=>'round', 'joinstyle'=>'round') + v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y, + 'width'=>2, 'capstyle'=>'round', 'joinstyle'=>'round') # Create the boxes for reshaping the line and arrowhead. TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5, - {'tags'=>['box1', $arrowTag_box]}.update(v.boxStyle) ) + {'tags'=>['box1', $arrowTag_box]}.update(v.boxStyle) ) TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5, - {'tags'=>['box2', $arrowTag_box]}.update(v.boxStyle) ) + {'tags'=>['box2', $arrowTag_box]}.update(v.boxStyle) ) TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5, - {'tags'=>['box3', $arrowTag_box]}.update(v.boxStyle) ) + {'tags'=>['box3', $arrowTag_box]}.update(v.boxStyle) ) c.itemconfigure cur, v.activeStyle if cur # Create three arrows in actual size with the same parameters TkcLine.new(c, v.x2+50, 0, v.x2+50, 1000, 'width'=>2) tmp = v.x2+100 TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width, - 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) + 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width, - 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) + 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width, - 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) + 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) # Create a bunch of other arrows and text items showing the # current dimensions. tmp = v.x2+10 TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) + 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x2+15, v.y-deltaY+5*v.c, 'text'=>v.c, 'anchor'=>'w') tmp = v.x1-10 TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) + 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x1-15, v.y, 'text'=>v.width, 'anchor'=>'e') tmp = v.y+5*v.width+10*v.c+10 TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) + 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x2-5*v.a, tmp+5, 'text'=>v.a, 'anchor'=>'n') tmp = tmp+25 TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) + 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x2-5*v.b, tmp+5, 'text'=>v.b, 'anchor'=>'n') TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') + 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') TkcText.new(c, v.x1, 330, - 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]", 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') + 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]", 'anchor'=>'w', + 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') v.count += 1 end @@ -97,7 +97,7 @@ $arrow_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($arrow_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"この widget で、キャンバスで使われるラインについて様々な幅や矢印の頭の形を試してみることができます。線の幅や矢印の形を変えるには、拡大された矢印についている 3つの四角をドラッグしてください。右側の矢印は普通の大きさでのサンプルを示しています。下のテキストはラインアイテムに対する設定オプションです。"){ + 'text'=>"この widget で、キャンバスで使われるラインについて様々な幅や矢印の頭の形を試してみることができます。線の幅や矢印の形を変えるには、拡大された矢印についている 3つの四角をドラッグしてください。右側の矢印は普通の大きさでのサンプルを示しています。下のテキストはラインアイテムに対する設定オプションです。"){ pack('side'=>'top') } @@ -122,14 +122,14 @@ $arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # canvas 設定 $arrow_canvas = TkCanvas.new($arrow_demo, 'width'=>500, 'height'=>350, - 'relief'=>'sunken', 'borderwidth'=>2) + 'relief'=>'sunken', 'borderwidth'=>2) $arrow_canvas.pack('expand'=>'yes', 'fill'=>'both') # 値設定 unless Struct.const_defined?("ArrowInfo") $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc, - :x1, :x2, :y, :smallTips, :count, - :bigLineStyle, :boxStyle, :activeStyle).new + :x1, :x2, :y, :smallTips, :count, + :bigLineStyle, :boxStyle, :activeStyle).new end $demo_arrowInfo.a = 8 $demo_arrowInfo.b = 10 @@ -158,16 +158,16 @@ $arrowTag_box.bind('Leave', proc{$arrow_canvas.itemconfigure('current', $demo_ar $arrowTag_box.bind('B1-Enter', proc{}) $arrowTag_box.bind('B1-Leave', proc{}) $arrow_canvas.itembind('box1', '1', - proc{$demo_arrowInfo.motionProc \ - = proc{|x,y| arrowMove1 $arrow_canvas, x, y}}) + proc{$demo_arrowInfo.motionProc \ + = proc{|x,y| arrowMove1 $arrow_canvas, x, y}}) $arrow_canvas.itembind('box2', '1', - proc{$demo_arrowInfo.motionProc \ - = proc{|x,y| arrowMove2 $arrow_canvas, x, y}}) + proc{$demo_arrowInfo.motionProc \ + = proc{|x,y| arrowMove2 $arrow_canvas, x, y}}) $arrow_canvas.itembind('box3', '1', - proc{$demo_arrowInfo.motionProc \ - = proc{|x,y| arrowMove3 $arrow_canvas, x, y}}) + proc{$demo_arrowInfo.motionProc \ + = proc{|x,y| arrowMove3 $arrow_canvas, x, y}}) $arrowTag_box.bind('B1-Motion', - proc{|x,y| $demo_arrowInfo.motionProc.call(x,y)}, "%x %y") + proc{|x,y| $demo_arrowInfo.motionProc.call(x,y)}, "%x %y") $arrow_canvas.bind('Any-ButtonRelease-1', proc{arrowSetup $arrow_canvas}) # arrowMove1 -- @@ -176,8 +176,8 @@ $arrow_canvas.bind('Any-ButtonRelease-1', proc{arrowSetup $arrow_canvas}) # for the line and arrowhead. # # Arguments: -# c - The name of the canvas window. -# x, y - The coordinates of the mouse. +# c - The name of the canvas window. +# x, y - The coordinates of the mouse. def arrowMove1(c,x,y) v = $demo_arrowInfo @@ -196,8 +196,8 @@ end # parameters for the line and arrowhead. # # Arguments: -# c - The name of the canvas window. -# x, y - The coordinates of the mouse. +# c - The name of the canvas window. +# x, y - The coordinates of the mouse. def arrowMove2(c,x,y) v = $demo_arrowInfo @@ -220,8 +220,8 @@ end # controlling parameters for the line and arrowhead. # # Arguments: -# c - The name of the canvas window. -# x, y - The coordinates of the mouse. +# c - The name of the canvas window. +# x, y - The coordinates of the mouse. def arrowMove3(c,x,y) v = $demo_arrowInfo diff --git a/ext/tk/sample/demos-jp/bind.rb b/ext/tk/sample/demos-jp/bind.rb index eebd62fc09..70127424c5 100644 --- a/ext/tk/sample/demos-jp/bind.rb +++ b/ext/tk/sample/demos-jp/bind.rb @@ -73,34 +73,34 @@ TkText.new($bind_demo){|t| insert('end', '2. 簡単な 2次元のプロット。データを表す点を動かすことができる。', (d2 = TkTextTag.new(t)) ) insert('end', "\n\n") insert('end', '3. テキストアイテムのアンカーと行揃え。', - (d3 = TkTextTag.new(t)) ) + (d3 = TkTextTag.new(t)) ) insert('end', "\n\n") insert('end', '4. ラインアイテムのための矢印の頭の形のエディタ。', - (d4 = TkTextTag.new(t)) ) + (d4 = TkTextTag.new(t)) ) insert('end', "\n\n") insert('end', '5. タブストップを変更するための機能つきのルーラー。', - (d5 = TkTextTag.new(t)) ) + (d5 = TkTextTag.new(t)) ) insert('end', "\n\n") insert('end', - '6. キャンバスがどうやってスクロールするのかを示すグリッド。', - (d6 = TkTextTag.new(t)) ) + '6. キャンバスがどうやってスクロールするのかを示すグリッド。', + (d6 = TkTextTag.new(t)) ) # binding [d1, d2, d3, d4, d5, d6].each{|tag| tag_binding_for_bind_demo(tag, tagstyle_bold, tagstyle_normal) } d1.bind('1', - proc{eval `cat #{[$demo_dir,'items.rb'].join(File::Separator)}`}) + proc{eval `cat #{[$demo_dir,'items.rb'].join(File::Separator)}`}) d2.bind('1', - proc{eval `cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`}) + proc{eval `cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`}) d3.bind('1', - proc{eval `cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`}) + proc{eval `cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`}) d4.bind('1', - proc{eval `cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`}) + proc{eval `cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`}) d5.bind('1', - proc{eval `cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`}) + proc{eval `cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`}) d6.bind('1', - proc{eval `cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`}) + proc{eval `cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`}) TkTextMarkInsert.new(t, '0.0') configure('state','disabled') diff --git a/ext/tk/sample/demos-jp/bitmap.rb b/ext/tk/sample/demos-jp/bitmap.rb index 644b960815..b71c67d3fd 100644 --- a/ext/tk/sample/demos-jp/bitmap.rb +++ b/ext/tk/sample/demos-jp/bitmap.rb @@ -6,19 +6,19 @@ # Create a row of bitmap items in a window. # # Arguments: -# w - The parent window that is to contain the row. -# args - The names of one or more bitmaps, which will be displayed -# in a new row across the bottom of w along with their -# names. +# w - The parent window that is to contain the row. +# args - The names of one or more bitmaps, which will be displayed +# in a new row across the bottom of w along with their +# names. def bitmapRow(w,*args) TkFrame.new(w){|row| pack('side'=>'top', 'fill'=>'both') for bitmap in args TkFrame.new(row){|base| - pack('side'=>'left', 'fill'=>'both', 'pady'=>'.25c', 'padx'=>'.25c') - TkLabel.new(base, 'text'=>bitmap, 'width'=>9).pack('side'=>'bottom') - TkLabel.new(base, 'bitmap'=>bitmap).pack('side'=>'bottom') + pack('side'=>'left', 'fill'=>'both', 'pady'=>'.25c', 'padx'=>'.25c') + TkLabel.new(base, 'text'=>bitmap, 'width'=>9).pack('side'=>'bottom') + TkLabel.new(base, 'bitmap'=>bitmap).pack('side'=>'bottom') } end } @@ -39,7 +39,7 @@ $bitmap_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($bitmap_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"このウィンドウには、Tk に組み込まれたすべてのビットマップが、それらの名前と共に表示されています。Tcl のスクリプト中では、それぞれの名前を用いて参照します。"){ + 'text'=>"このウィンドウには、Tk に組み込まれたすべてのビットマップが、それらの名前と共に表示されています。Tcl のスクリプト中では、それぞれの名前を用いて参照します。"){ pack('side'=>'top') } diff --git a/ext/tk/sample/demos-jp/check.rb b/ext/tk/sample/demos-jp/check.rb index 88e90c71d0..be675b9042 100644 --- a/ext/tk/sample/demos-jp/check.rb +++ b/ext/tk/sample/demos-jp/check.rb @@ -52,7 +52,7 @@ TkFrame.new($check_demo) {|frame| text '変数参照' command proc{ showVars($check_demo, - ['wipers', wipers], ['brakes', brakes], ['sober', sober]) + ['wipers', wipers], ['brakes', brakes], ['sober', sober]) } }.pack('side'=>'left', 'expand'=>'yes') diff --git a/ext/tk/sample/demos-jp/check2.rb b/ext/tk/sample/demos-jp/check2.rb index 63d3bf9398..5d0c74a743 100644 --- a/ext/tk/sample/demos-jp/check2.rb +++ b/ext/tk/sample/demos-jp/check2.rb @@ -33,35 +33,35 @@ sober = TkVariable.new(0) # frame 生成 TkFrame.new($check2_demo) {|frame| TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), - :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) + :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - TkButton.new(frame, :text=>'変数参照', - :image=>$image['view'], :compound=>:left, - :command=>proc{ - showVars($check2_demo, - ['safety', safety], ['wipers', wipers], - ['brakes', brakes], ['sober', sober]) - }), - TkButton.new(frame, :text=>'コード参照', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'check2'}), - TkButton.new(frame, :text=>'閉じる', - :image=>$image['delete'], :compound=>:left, - :command=>proc{ - tmppath = $check2_demo - $check2_demo = nil - $showVarsWin[tmppath.path] = nil - tmppath.destroy - }), - :padx=>4, :pady=>4) + TkButton.new(frame, :text=>'変数参照', + :image=>$image['view'], :compound=>:left, + :command=>proc{ + showVars($check2_demo, + ['safety', safety], ['wipers', wipers], + ['brakes', brakes], ['sober', sober]) + }), + TkButton.new(frame, :text=>'コード参照', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'check2'}), + TkButton.new(frame, :text=>'閉じる', + :image=>$image['delete'], :compound=>:left, + :command=>proc{ + tmppath = $check2_demo + $check2_demo = nil + $showVarsWin[tmppath.path] = nil + tmppath.destroy + }), + :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) }.pack('side'=>'bottom', 'fill'=>'x') # checkbutton 生成 TkCheckButton.new($check2_demo, :text=>'安全性検査', :variable=>safety, - :relief=>:flat, :onvalue=>'all', :offvalue=>'none', - :tristatevalue=>'partial'){ + :relief=>:flat, :onvalue=>'all', :offvalue=>'none', + :tristatevalue=>'partial'){ pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') } @@ -82,21 +82,21 @@ tristate_check = proc{|n1,n2,op| begin if n1 == safety if safety == 'none' - wipers.value = 0 - brakes.value = 0 - sober.value = 0 + wipers.value = 0 + brakes.value = 0 + sober.value = 0 elsif safety == 'all' - wipers.value = 1 - brakes.value = 1 - sober.value = 1 + wipers.value = 1 + brakes.value = 1 + sober.value = 1 end else if wipers == 1 && brakes == 1 && sober == 1 - safety.value = 'all' + safety.value = 'all' elsif wipers == 1 || brakes == 1 || sober == 1 - safety.value = 'partial' + safety.value = 'partial' else - safety.value = 'none' + safety.value = 'none' end end ensure diff --git a/ext/tk/sample/demos-jp/clrpick.rb b/ext/tk/sample/demos-jp/clrpick.rb index 284611a774..de8cd80fcd 100644 --- a/ext/tk/sample/demos-jp/clrpick.rb +++ b/ext/tk/sample/demos-jp/clrpick.rb @@ -17,7 +17,7 @@ $clrpick_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"以下のボタンを押して、このウィンドウ上にあるウィジェットの前景色と背景色を選択して下さい。").pack('side'=>'top') + 'text'=>"以下のボタンを押して、このウィンドウ上にあるウィジェットの前景色と背景色を選択して下さい。").pack('side'=>'top') # frame 生成 TkFrame.new($clrpick_demo) {|frame| @@ -40,7 +40,7 @@ TkFrame.new($clrpick_demo) {|frame| # button 生成 TkButton.new($clrpick_demo, 'text'=>'背景色を設定 ...') {|b| command(proc{setColor $clrpick_demo, b, 'background', - ['background', 'highlightbackground']}) + ['background', 'highlightbackground']}) pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') } @@ -53,7 +53,7 @@ def setColor(w,button,name,options) w.grab initialColor = button[name] color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w, - 'initialcolor'=>initialColor) + 'initialcolor'=>initialColor) if color != "" setColor_helper(w,options,color) end diff --git a/ext/tk/sample/demos-jp/cscroll.rb b/ext/tk/sample/demos-jp/cscroll.rb index d128b63a7b..0d6db69af6 100644 --- a/ext/tk/sample/demos-jp/cscroll.rb +++ b/ext/tk/sample/demos-jp/cscroll.rb @@ -17,7 +17,7 @@ $cscroll_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($cscroll_demo, 'font'=>$font, 'wraplength'=>'4i', - 'justify'=>'left', 'text'=>"このウィンドウにはスクロールバーやマウスのボタン2 でスクロールできるキャンバス widget が表示されています。四角の上でボタン1 をクリックすると、そのインデックスが標準出力に出力されます。"){ + 'justify'=>'left', 'text'=>"このウィンドウにはスクロールバーやマウスのボタン2 でスクロールできるキャンバス widget が表示されています。四角の上でボタン1 をクリックすると、そのインデックスが標準出力に出力されます。"){ pack('side'=>'top') } @@ -51,14 +51,14 @@ end # canvas 設定 $cscroll_canvas = TkCanvas.new($cscroll_demo, - 'relief'=>'sunken', 'borderwidth'=>2, - 'scrollregion'=>['-11c', '-11c', '50c', '20c'] - ) {|c| + 'relief'=>'sunken', 'borderwidth'=>2, + 'scrollregion'=>['-11c', '-11c', '50c', '20c'] + ) {|c| if $tk_version =~ /^4\.[01]/ pack('expand'=>'yes', 'fill'=>'both') else grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') end TkScrollbar.new($cscroll_demo, 'command'=>proc{|*args| c.yview(*args)}) {|vs| @@ -67,18 +67,18 @@ $cscroll_canvas = TkCanvas.new($cscroll_demo, pack('side'=>'right', 'fill'=>'y') else grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') end } TkScrollbar.new($cscroll_demo, 'orient'=>'horiz', - 'command'=>proc{|*args| c.xview(*args)}) {|hs| + 'command'=>proc{|*args| c.xview(*args)}) {|hs| c.xscrollcommand(proc{|first,last| hs.set first,last}) if $tk_version =~ /^4\.[01]/ pack('side'=>'bottom', 'fill'=>'x') else grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') end } } @@ -89,9 +89,9 @@ bg = $cscroll_canvas.configinfo('bg')[4] y = -10 (0..9).each{|j| TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c", - 'outline'=>'black', 'fill'=>bg, 'tags'=>'rect') + 'outline'=>'black', 'fill'=>bg, 'tags'=>'rect') TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c", - 'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text') + 'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text') y += 3 } } @@ -102,7 +102,7 @@ $cscroll_canvas.itembind('all', '1', proc{scrollButton $cscroll_canvas}) $cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas}) $cscroll_canvas.bind('2', proc{|x,y| $cscroll_canvas.scan_mark(x,y)}, '%x %y') $cscroll_canvas.bind('B2-Motion', - proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y') + proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y') def scrollEnter(c) id = c.find_withtag('current')[0].id diff --git a/ext/tk/sample/demos-jp/ctext.rb b/ext/tk/sample/demos-jp/ctext.rb index 4704b41411..a71b6f2cb0 100644 --- a/ext/tk/sample/demos-jp/ctext.rb +++ b/ext/tk/sample/demos-jp/ctext.rb @@ -17,7 +17,7 @@ $ctext_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($ctext_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"このウィンドウにはキャンバスwidgetのテキスト機能をデモするためのテキスト文字列が表示されています。マウスを四角の中に持っていき、クリックすると位置ぎめ用の点からの相対位置を変えたり、行揃えを変えたりすることができます。また以下のような編集のための簡単なバインディングをサポートしています。 + 'text'=>"このウィンドウにはキャンバスwidgetのテキスト機能をデモするためのテキスト文字列が表示されています。マウスを四角の中に持っていき、クリックすると位置ぎめ用の点からの相対位置を変えたり、行揃えを変えたりすることができます。また以下のような編集のための簡単なバインディングをサポートしています。 1. マウスを持っていき、クリックし、入力できます。 2. ボタン1で選択できます。 @@ -48,7 +48,7 @@ $ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # canvas 生成 $ctext_canvas = TkCanvas.new($ctext_demo, 'relief'=>'flat', - 'borderwidth'=>0, 'width'=>500, 'height'=>350) + 'borderwidth'=>0, 'width'=>500, 'height'=>350) $ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both') # font 設定 @@ -56,37 +56,37 @@ textFont = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*' # canvas 設定 TkcRectangle.new($ctext_canvas, 245, 195, 255, 205, - 'outline'=>'black', 'fill'=>'red') + 'outline'=>'black', 'fill'=>'red') $ctag_text = TkcTag.new($ctext_canvas) $ctag_text.withtag(TkcText.new($ctext_canvas, 250, 200, - 'text'=>"これはキャンバスwidgetのテキスト機能をデモするための文字列です。マウスを持っていき、クリックして入力できます。選択してコントロール-Dで消去することもできます。", - 'width'=>440, 'anchor'=>'n', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*', - 'kanjifont'=>'-*-r-*--24-*-jisx0208.1983-0', - 'justify'=>'left') ) + 'text'=>"これはキャンバスwidgetのテキスト機能をデモするための文字列です。マウスを持っていき、クリックして入力できます。選択してコントロール-Dで消去することもできます。", + 'width'=>440, 'anchor'=>'n', + 'font'=>'-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*', + 'kanjifont'=>'-*-r-*--24-*-jisx0208.1983-0', + 'justify'=>'left') ) $ctag_text.bind('1', proc{|x,y| textB1Press $ctext_canvas,x,y}, "%x %y") $ctag_text.bind('B1-Motion', proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") $ctag_text.bind('Shift-1', - proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"}, - "%x %y") + proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"}, + "%x %y") $ctag_text.bind('Shift-B1-Motion', - proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") + proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") $ctag_text.bind('KeyPress', proc{|a| textInsert $ctext_canvas,a}, "%A") $ctag_text.bind('Return', proc{textInsert $ctext_canvas,"\n"}) $ctag_text.bind('Control-h', proc{textBs $ctext_canvas}) $ctag_text.bind('BackSpace', proc{textBs $ctext_canvas}) $ctag_text.bind('Delete', proc{textDel $ctext_canvas}) $ctag_text.bind('2', proc{|x,y| textPaste $ctext_canvas, "@#{x},#{y}"}, - "%x %y") + "%x %y") # Next, create some items that allow the text's anchor position # to be edited. def mkTextConfig(w,x,y,option,value,color) item = TkcRectangle.new(w, x, y, x+30, y+30, - 'outline'=>'black', 'fill'=>color, 'width'=>1) + 'outline'=>'black', 'fill'=>color, 'width'=>1) item.bind('1', proc{$ctag_text.configure option, value}) w.addtag_withtag('config', item) end @@ -104,11 +104,11 @@ mkTextConfig $ctext_canvas, x, y+60, 'anchor', 'ne', color mkTextConfig $ctext_canvas, x+30, y+60, 'anchor', 'n', color mkTextConfig $ctext_canvas, x+60, y+60, 'anchor', 'nw', color item = TkcRectangle.new($ctext_canvas, x+40, y+40, x+50, y+50, - 'outline'=>'black', 'fill'=>'red') + 'outline'=>'black', 'fill'=>'red') item.bind('1', proc{$ctag_text.configure 'anchor', 'center'}) TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', 'anchor'=>'s', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', - 'fill'=>'brown') + 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', + 'fill'=>'brown') # Lastly, create some items that allow the text's justification to be # changed. @@ -120,14 +120,14 @@ mkTextConfig $ctext_canvas, x, y, 'justify', 'left', color mkTextConfig $ctext_canvas, x+30, y, 'justify', 'center', color mkTextConfig $ctext_canvas, x+60, y, 'justify', 'right', color TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', 'anchor'=>'s', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', - 'fill'=>'brown') + 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', + 'fill'=>'brown') $ctext_canvas.itembind('config', 'Enter', proc{textEnter $ctext_canvas}) $ctext_canvas.itembind('config', 'Leave', - proc{$ctext_canvas\ - .itemconfigure('current', - 'fill'=>$textConfigFill)}) + proc{$ctext_canvas\ + .itemconfigure('current', + 'fill'=>$textConfigFill)}) $textConfigFill = '' diff --git a/ext/tk/sample/demos-jp/dialog2.rb b/ext/tk/sample/demos-jp/dialog2.rb index 36b2356cc1..a934378dda 100644 --- a/ext/tk/sample/demos-jp/dialog2.rb +++ b/ext/tk/sample/demos-jp/dialog2.rb @@ -28,9 +28,9 @@ class TkDialog_Demo2 < TkDialog end ret = TkDialog_Demo2.new('message_config'=>{'wraplength'=>'4i'}, - 'prev_command'=>proc{|dialog| - Tk.after 100, proc{dialog.grab('global')} - }).value + 'prev_command'=>proc{|dialog| + Tk.after 100, proc{dialog.grab('global')} + }).value case ret when 0 print "あなたは「了解」を押しましたね。\n" diff --git a/ext/tk/sample/demos-jp/entry3.rb b/ext/tk/sample/demos-jp/entry3.rb index 4dff97a93a..f57dc13553 100644 --- a/ext/tk/sample/demos-jp/entry3.rb +++ b/ext/tk/sample/demos-jp/entry3.rb @@ -18,8 +18,8 @@ $entry3_demo = TkToplevel.new {|w| } TkLabel.new($entry3_demo, - :font=>$font, :wraplength=>'5i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) + :font=>$font, :wraplength=>'5i', :justify=>:left, + :text=><<EOL).pack(:side=>:top) 以下には4種類のエントリボックスが表示されています.各エントリボックスは,\ マウスクリックで選択し文字を打ち込むことが可能ですが,それぞれがどのような\ 入力を受け付けることができるかには制約が設けられています.\ @@ -42,13 +42,13 @@ TkFrame.new($entry3_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ - $entry3_demo.destroy - $entry3_demo = nil - }).pack(:side=>:left, :expand=>true) + $entry3_demo.destroy + $entry3_demo = nil + }).pack(:side=>:left, :expand=>true) TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ - showCode 'entry3' - }).pack(:side=>:left, :expand=>true) + showCode 'entry3' + }).pack(:side=>:left, :expand=>true) } # focusAndFlash -- @@ -58,32 +58,32 @@ TkFrame.new($entry3_demo){|f| # 2.5Hz). # # Arguments: -# widget - entry widget to flash -# fg - Initial foreground colour -# bg - Initial background colour -# count - Counter to control the number of times flashed +# widget - entry widget to flash +# fg - Initial foreground colour +# bg - Initial background colour +# count - Counter to control the number of times flashed def focusAndFlash(widget, fg, bg, count=5) return if count <= 0 TkTimer.new(100, count, - proc{widget.configure(:foreground=>bg, :background=>fg)}, - proc{widget.configure(:foreground=>fg, :background=>bg)} - ).start + proc{widget.configure(:foreground=>bg, :background=>fg)}, + proc{widget.configure(:foreground=>fg, :background=>bg)} + ).start widget.focus(true) end l1 = TkLabelFrame.new($entry3_demo, :text=>"整数エントリ") TkEntry.new(l1, :validate=>:focus, - :vcmd=>[ - proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' - ]) {|e| + :vcmd=>[ + proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' + ]) {|e| invalidcommand [proc{|w| focusAndFlash(w, e.fg, e.bg)}, '%W'] pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') } l2 = TkLabelFrame.new($entry3_demo, :text=>"長さ制約付きエントリ") TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell}, - :vcmd=>[proc{|s| s.length < 10}, '%P'] - ).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') + :vcmd=>[proc{|s| s.length < 10}, '%P'] + ).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') ### PHONE NUMBER ENTRY ### # Note that the source to this is quite a bit longer as the behaviour @@ -105,7 +105,7 @@ Hash[*(%w(abc 2 def 3 ghi 4 jkl 5 mno 6 pqrs 7 tuv 8 wxyz 9))].each{|chars, n| # Skip over fixed characters in a phone-number string when moving left. # # Arguments: -# widget - The entry widget containing the phone-number. +# widget - The entry widget containing the phone-number. def phoneSkipLeft(widget) idx = widget.index('insert') if idx == 8 @@ -125,7 +125,7 @@ end # Skip over fixed characters in a phone-number string when moving right. # # Arguments: -# widget - The entry widget containing the phone-number. +# widget - The entry widget containing the phone-number. # add - Offset to add to index before calculation (used by validation.) def phoneSkipRight(widget, add = 0) idx = widget.index('insert') @@ -149,14 +149,14 @@ end # # widget - entry widget to validate # vmode - The widget's validation mode -# idx - The index where replacement is to occur +# idx - The index where replacement is to occur # char - The character (or string, though that will always be -# refused) to be overwritten at that point. +# refused) to be overwritten at that point. def validatePhoneChange(widget, vmode, idx, char) return true if idx == nil Tk.after_idle(proc{widget.configure(:validate=>vmode, - :invcmd=>proc{Tk.bell})}) + :invcmd=>proc{Tk.bell})}) if !(idx<3 || idx==6 || idx==7 || idx==11 || idx>15) && char =~ /[0-9A-Za-z]/ widget.delete(idx) widget.insert(idx, $phoneNumberMap[char] || char) @@ -171,17 +171,17 @@ end l3 = TkLabelFrame.new($entry3_demo, :text=>"米国電話番号エントリ") TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, - :textvariable=>entry3content, - :vcmd=>[ - proc{|w,v,i,s| validatePhoneChange(w,v,i,s)}, - "%W %v %i %S" - ]){|e| + :textvariable=>entry3content, + :vcmd=>[ + proc{|w,v,i,s| validatePhoneChange(w,v,i,s)}, + "%W %v %i %S" + ]){|e| # Click to focus goes to the first editable character... bind('FocusIn', proc{|d,w| - if d != "NotifyAncestor" - w.cursor = 3 - Tk.after_idle(proc{w.selection_clear}) - end + if d != "NotifyAncestor" + w.cursor = 3 + Tk.after_idle(proc{w.selection_clear}) + end }, '%d %W') bind('Left', proc{|w| phoneSkipLeft(w)}, '%W') bind('Right', proc{|w| phoneSkipRight(w)}, '%W') @@ -190,10 +190,10 @@ TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, l4 = TkLabelFrame.new($entry3_demo, :text=>"パスワードエントリ") TkEntry.new(l4, :validate=>:key, :show=>'*', - :vcmd=>[ - proc{|s| s.length <= 8}, - '%P' - ]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') + :vcmd=>[ + proc{|s| s.length <= 8}, + '%P' + ]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') TkFrame.new($entry3_demo){|f| lower diff --git a/ext/tk/sample/demos-jp/filebox.rb b/ext/tk/sample/demos-jp/filebox.rb index 78ae50a45b..f3608ab70f 100644 --- a/ext/tk/sample/demos-jp/filebox.rb +++ b/ext/tk/sample/demos-jp/filebox.rb @@ -17,7 +17,7 @@ $filebox_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($filebox_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"エントリにファイル名を直接入力するか、\"Browse\" ボタンを押してファイル選択ダイアログからファイル名を選んで下さい。").pack('side'=>'top') + 'text'=>"エントリにファイル名を直接入力するか、\"Browse\" ボタンを押してファイル選択ダイアログからファイル名を選んで下さい。").pack('side'=>'top') # frame 生成 TkFrame.new($filebox_demo) {|frame| @@ -47,7 +47,7 @@ TkFrame.new($filebox_demo) {|frame| pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x') TkButton.new(f, 'text'=>'Browse ...', - 'command'=>proc{fileDialog $filebox_demo,e,type})\ + 'command'=>proc{fileDialog $filebox_demo,e,type})\ .pack('side'=>'left') } @@ -58,9 +58,9 @@ TkFrame.new($filebox_demo) {|frame| $tk_strictMotif = TkVarAccess.new('tk_strictMotif') if ($tk_platform['platform'] == 'unix') TkCheckButton.new($filebox_demo, - 'text'=>'Motifスタイルのダイアログを用いる', - 'variable'=>$tk_strictMotif, - 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c') + 'text'=>'Motifスタイルのダイアログを用いる', + 'variable'=>$tk_strictMotif, + 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c') end def fileDialog(w,ent,operation) @@ -84,8 +84,8 @@ def fileDialog(w,ent,operation) file = Tk.getOpenFile('filetypes'=>types, 'parent'=>w) else file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w, - 'initialfile'=>'Untitled', - 'defaultextension'=>'.txt') + 'initialfile'=>'Untitled', + 'defaultextension'=>'.txt') end if file != "" ent.delete 0, 'end' diff --git a/ext/tk/sample/demos-jp/floor.rb b/ext/tk/sample/demos-jp/floor.rb index d9d17ee949..517600de92 100644 --- a/ext/tk/sample/demos-jp/floor.rb +++ b/ext/tk/sample/demos-jp/floor.rb @@ -8,8 +8,8 @@ # visible. # # Arguments: -# w - Name of the canvas window. -# active - Number of active floor (1, 2, or 3). +# w - Name of the canvas window. +# active - Number of active floor (1, 2, or 3). def floorDisplay(w,active) return if $activeFloor == active @@ -59,7 +59,7 @@ end # highlighted. # # Arguments: -# w - The name of the canvas window. +# w - The name of the canvas window. def newRoom(w) id = w.find_withtag('current')[0] @@ -72,8 +72,8 @@ end # It highlights the current room and unhighlights any previous room. # # Arguments: -# w - The canvas window displaying the floorplan. -# args - Not used. +# w - The canvas window displaying the floorplan. +# args - Not used. def roomChanged(w,*args) w.delete('highlight') @@ -90,24 +90,24 @@ end # floor. # # Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. +# w - The canvas window. +# fill - Fill color to use for the floor's background. +# outline - Color to use for the floor's outline. def floor_bg1(w,fill,outline) TkcPolygon.new(w,347,80,349,82,351,84,353,85,363,92,375,99,386,104, - 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725, - 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327, - 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404, - 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325, - 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332, - 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363, - 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391, - 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7, - 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221, - 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5, - 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70, - 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill) + 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725, + 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327, + 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404, + 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325, + 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332, + 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363, + 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391, + 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7, + 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221, + 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5, + 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70, + 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill) TkcLine.new(w,386,129,398,129, 'fill'=>outline, 'tags'=>['floor1','bg']) TkcLine.new(w,258,355,258,387, 'fill'=>outline, 'tags'=>['floor1','bg']) TkcLine.new(w,60,387,60,391, 'fill'=>outline, 'tags'=>['floor1','bg']) @@ -214,17 +214,17 @@ end # floor. # # Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. +# w - The canvas window. +# fill - Fill color to use for the floor's background. +# outline - Color to use for the floor's outline. def floor_bg2(w,fill,outline) TkcPolygon.new(w,559,129,484,129,484,162,398,162,398,129,315,129, - 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391, - 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280, - 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644, - 367,802,367,802,129,725,129,725,133,559,133,559,129, - 'tags'=>['floor2','bg'], 'fill'=>fill) + 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391, + 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280, + 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644, + 367,802,367,802,129,725,129,725,133,559,133,559,129, + 'tags'=>['floor2','bg'], 'fill'=>fill) TkcLine.new(w,350,311,350,329, 'fill'=>outline, 'tags'=>['floor2','bg']) TkcLine.new(w,398,129,398,162, 'fill'=>outline, 'tags'=>['floor2','bg']) TkcLine.new(w,802,367,802,129, 'fill'=>outline, 'tags'=>['floor2','bg']) @@ -269,17 +269,17 @@ end # floor. # # Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. +# w - The canvas window. +# fill - Fill color to use for the floor's background. +# outline - Color to use for the floor's outline. def floor_bg3(w,fill,outline) TkcPolygon.new(w,159,300,107,300,107,248,159,248,159,129,96,129,96, - 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300, - 'tags'=>['floor3','bg'], 'fill'=>fill) + 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300, + 'tags'=>['floor3','bg'], 'fill'=>fill) TkcPolygon.new(w,258,370,258,329,350,329,350,311,399,311,399,129, - 315,129,315,133,176,133,176,129,159,129,159,370,258,370, - 'tags'=>['floor3','bg'], 'fill'=>fill) + 315,129,315,133,176,133,176,129,159,129,159,370,258,370, + 'tags'=>['floor3','bg'], 'fill'=>fill) TkcLine.new(w,96,133,96,129, 'fill'=>outline, 'tags'=>['floor3','bg']) TkcLine.new(w,176,129,96,129, 'fill'=>outline, 'tags'=>['floor3','bg']) TkcLine.new(w,176,129,176,133, 'fill'=>outline, 'tags'=>['floor3','bg']) @@ -299,7 +299,7 @@ def floor_bg3(w,fill,outline) TkcLine.new(w,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) TkcLine.new(w,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) TkcLine.new(w,107,300,159,300,159,248,107,248,107,300, - 'fill'=>outline, 'tags'=>['floor3','bg']) + 'fill'=>outline, 'tags'=>['floor3','bg']) end # floor_fg1 -- @@ -308,321 +308,321 @@ end # floor (office outlines and numbers). # # Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. +# w - The canvas window. +# color - Color to use for drawing foreground information. def floor_fg1(w,color) i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '101' $floorItems['101'] = i TkcText.new(w,358,209, 'text'=>'101', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Pub Lift1' $floorItems['Pub Lift1'] = i TkcText.new(w,323,223, 'text'=>'Pub Lift1', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Priv Lift1' $floorItems['Priv Lift1'] = i TkcText.new(w,323,188, 'text'=>'Priv Lift1', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '110' $floorItems['110'] = i TkcText.new(w,21.5,363, 'text'=>'110', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '109' $floorItems['109'] = i TkcText.new(w,67,363, 'text'=>'109', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '111' $floorItems['111'] = i TkcText.new(w,28.5,276.5, 'text'=>'111', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '117B' $floorItems['117B'] = i TkcText.new(w,88.5,278.5, 'text'=>'117B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '112' $floorItems['112'] = i TkcText.new(w,28.5,227.5, 'text'=>'112', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '113' $floorItems['113'] = i TkcText.new(w,28.5,179.5, 'text'=>'113', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '117A' $floorItems['117A'] = i TkcText.new(w,82,180.5, 'text'=>'117A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '117' $floorItems['117'] = i TkcText.new(w,65,235, 'text'=>'117', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '114' $floorItems['114'] = i TkcText.new(w,28.5,135, 'text'=>'114', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '115' $floorItems['115'] = i TkcText.new(w,74,141.5, 'text'=>'115', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '116' $floorItems['116'] = i TkcText.new(w,48.5,70, 'text'=>'116', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '118' $floorItems['118'] = i TkcText.new(w,108.5,102, 'text'=>'118', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,178,128,178,132,216,132,216,91, - 163,91,163,112,149,112,149,128, - 'fill'=>'', 'tags'=>['floor1','room']) + 163,91,163,112,149,112,149,128, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '120' $floorItems['120'] = i TkcText.new(w,189.5,111.5, 'text'=>'120', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192, - 156,192,156,169,175,169,175,246,79,246, - 'fill'=>'', 'tags'=>['floor1','room']) + 156,192,156,169,175,169,175,246,79,246, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '122' $floorItems['122'] = i TkcText.new(w,131,207.5, 'text'=>'122', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '121' $floorItems['121'] = i TkcText.new(w,146,180, 'text'=>'121', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '106A' $floorItems['106A'] = i TkcText.new(w,112.5,304.5, 'text'=>'106A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '105' $floorItems['105'] = i TkcText.new(w,124.5,278.5, 'text'=>'105', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '106B' $floorItems['106B'] = i TkcText.new(w,163,304.5, 'text'=>'106B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '104' $floorItems['104'] = i TkcText.new(w,184,278.5, 'text'=>'104', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '108' $floorItems['108'] = i TkcText.new(w,114.5,361, 'text'=>'108', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '107' $floorItems['107'] = i TkcText.new(w,198,361, 'text'=>'107', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Smoking' $floorItems['Smoking'] = i TkcText.new(w,280,341, 'text'=>'Smoking', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '123' $floorItems['123'] = i TkcText.new(w,245.5,190.5, 'text'=>'123', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '103' $floorItems['103'] = i TkcText.new(w,259,287, 'text'=>'103', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '124' $floorItems['124'] = i TkcText.new(w,356,150, 'text'=>'124', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '125' $floorItems['125'] = i TkcText.new(w,392,217.5, 'text'=>'125', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '126' $floorItems['126'] = i TkcText.new(w,436.5,185.5, 'text'=>'126', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,409,209,409,229,399,229,399,253, - 486,253,486,239,474,239,474,209, - 'fill'=>'', 'tags'=>['floor1','room']) + 486,253,486,239,474,239,474,209, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '127' $floorItems['127'] = i TkcText.new(w,436.5,'231', 'text'=>'127', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,501,164,501,174,495,174,495,188, - 490,188,490,204,476,204,476,164, - 'fill'=>'', 'tags'=>['floor1','room']) + 490,188,490,204,476,204,476,164, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'MShower' $floorItems['MShower'] = i TkcText.new(w,488.5,'184', 'text'=>'MShower', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Closet' $floorItems['Closet'] = i TkcText.new(w,502.5,190, 'text'=>'Closet', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'WShower' $floorItems['WShower'] = i TkcText.new(w,494.5,230, 'text'=>'WShower', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166, - 697,166,697,275,553,275,531,254,515,254, - 515,174,503,174,503,161,486,161, - 'fill'=>'', 'tags'=>['floor1','room']) + 697,166,697,275,553,275,531,254,515,254, + 515,174,503,174,503,161,486,161, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '130' $floorItems['130'] = i TkcText.new(w,638.5,205, 'text'=>'130', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,308,242,339,242,339,248,342,248, - 342,246,397,246,397,276,393,276, - 393,309,300,309,300,248,308,248, - 'fill'=>'', 'tags'=>['floor1','room']) + 342,246,397,246,397,276,393,276, + 393,309,300,309,300,248,308,248, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '102' $floorItems['102'] = i TkcText.new(w,367.5,278.5, 'text'=>'102', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '128' $floorItems['128'] = i TkcText.new(w,441.5,265.5, 'text'=>'128', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,510,309,486,309,486,255,530,255, - 552,277,561,277,561,325,510,325, - 'fill'=>'', 'tags'=>['floor1','room']) + 552,277,561,277,561,325,510,325, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '129' $floorItems['129'] = i TkcText.new(w,535.5,293, 'text'=>'129', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,696,281,740,281,740,387,642,387, - 642,389,561,389,561,277,696,277, - 'fill'=>'', 'tags'=>['floor1','room']) + 642,389,561,389,561,277,696,277, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '133' $floorItems['133'] = i TkcText.new(w,628.5,335, 'text'=>'133', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '132' $floorItems['132'] = i TkcText.new(w,771,334, 'text'=>'132', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '134' $floorItems['134'] = i TkcText.new(w,749.5,224, 'text'=>'134', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '135' $floorItems['135'] = i TkcText.new(w,763,148.5, 'text'=>'135', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366, - 304,312,396,312,396,288,400,288,404,288, - 409,290,413,292,418,297,421,302,422,309, - 421,318,417,325,411,330,405,332,397,333, - 344,333,340,334,336,336,335,338,332,342, - 331,347,332,351,334,354,336,357,341,359, - 'fill'=>'', 'tags'=>['floor1','room']) + 304,312,396,312,396,288,400,288,404,288, + 409,290,413,292,418,297,421,302,422,309, + 421,318,417,325,411,330,405,332,397,333, + 344,333,340,334,336,336,335,338,332,342, + 331,347,332,351,334,354,336,357,341,359, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Ramona Stair' $floorItems['Ramona Stair'] = i TkcText.new(w,368,323, 'text'=>'Ramona Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20, - 122,28,123,32,123,68,220,68,220,87,90,87,90,23, - 'fill'=>'', 'tags'=>['floor1','room']) + 122,28,123,32,123,68,220,68,220,87,90,87,90,23, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'University Stair' $floorItems['University Stair'] = i TkcText.new(w,155,77.5, 'text'=>'University Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56, - 358,48,363,39,365,29,348,25,335,22,321,14, - 300,5,283,1,260,0,246,0,242,2,236,4,231,8, - 227,13,223,17,221,22,220,34,260,34, - 'fill'=>'', 'tags'=>['floor1','room']) + 358,48,363,39,365,29,348,25,335,22,321,14, + 300,5,283,1,260,0,246,0,242,2,236,4,231,8, + 227,13,223,17,221,22,220,34,260,34, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Plaza Stair' $floorItems['Plaza Stair'] = i TkcText.new(w,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49, - 323,56,337,70,350,83,365,94,377,100, - 386,104,386,128,220,128, - 'fill'=>'', 'tags'=>['floor1','room']) + 323,56,337,70,350,83,365,94,377,100, + 386,104,386,128,220,128, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Plaza Deck' $floorItems['Plaza Deck'] = i TkcText.new(w,303,81, 'text'=>'Plaza Deck', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '106' $floorItems['106'] = i TkcText.new(w,131.5,318.5, 'text'=>'106', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115, - 95,128,114,128,114,151,157,151,157,153,112,153, - 112,130,97,130,97,168,175,168,175,131,146,131, - 'fill'=>'', 'tags'=>['floor1','room']) + 95,128,114,128,114,151,157,151,157,153,112,153, + 112,130,97,130,97,168,175,168,175,131,146,131, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '119' $floorItems['119'] = i TkcText.new(w,143.5,133, 'text'=>'119', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) TkcLine.new(w,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall']) TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall']) TkcLine.new(w,96,129,96,169, 'fill'=>color, 'tags'=>['floor1','wall']) @@ -789,327 +789,327 @@ end # floor (office outlines and numbers). # # Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. +# w - The canvas window. +# color - Color to use for drawing foreground information. def floor_fg2(w,color) i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222, - 800,222,800,168,748,168, - 'fill'=>'', 'tags'=>['floor2','room']) + 800,222,800,168,748,168, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '238' $floorItems['238'] = i TkcText.new(w,774,195, 'text'=>'238', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '237' $floorItems['237'] = i TkcText.new(w,763,148.5, 'text'=>'237', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324, - 643,324,643,291,641,291,641,205,696,205, - 696,291,694,291,694,314,715,314,715,291, - 715,205,755,205,755,190,724,190,724,187, - 'fill'=>'', 'tags'=>['floor2','room']) + 643,324,643,291,641,291,641,205,696,205, + 696,291,694,291,694,314,715,314,715,291, + 715,205,755,205,755,190,724,190,724,187, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '246' $floorItems['246'] = i TkcText.new(w,600,264, 'text'=>'246', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '247' $floorItems['247'] = i TkcText.new(w,668.5,296.5, 'text'=>'247', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246, - 397,246,397,255,476,255,476,250,482,250,559,250, - 559,274,482,274,482,278,396,278,396,274,232,274, - 'fill'=>'', 'tags'=>['floor2','room']) + 397,246,397,255,476,255,476,250,482,250,559,250, + 559,274,482,274,482,278,396,278,396,274,232,274, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '202' $floorItems['202'] = i TkcText.new(w,285.5,260, 'text'=>'202', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196, - 306,196,306,180,175,180,175,169,156,169, - 156,196,176,196,176,228, - 'fill'=>'', 'tags'=>['floor2','room']) + 306,196,306,180,175,180,175,169,156,169, + 156,196,176,196,176,228, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '206' $floorItems['206'] = i TkcText.new(w,143,267, 'text'=>'206', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '212' $floorItems['212'] = i TkcText.new(w,28.5,307.5, 'text'=>'212', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '245' $floorItems['245'] = i TkcText.new(w,521.5,300.5, 'text'=>'245', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '244' $floorItems['244'] = i TkcText.new(w,579.5,357.5, 'text'=>'244', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '243' $floorItems['243'] = i TkcText.new(w,622,357.5, 'text'=>'243', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '242' $floorItems['242'] = i TkcText.new(w,666.5,340.5, 'text'=>'242', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = 'Barbecue Deck' $floorItems['Barbecue Deck'] = i TkcText.new(w,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '240' $floorItems['240'] = i TkcText.new(w,736,288, 'text'=>'240', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '241' $floorItems['241'] = i TkcText.new(w,722,340.5, 'text'=>'241', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '239' $floorItems['239'] = i TkcText.new(w,736,233.5, 'text'=>'239', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '248' $floorItems['248'] = i TkcText.new(w,669,241.5, 'text'=>'248', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '236' $floorItems['236'] = i TkcText.new(w,700,160, 'text'=>'236', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '235' $floorItems['235'] = i TkcText.new(w,651.5,160, 'text'=>'235', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,626,143,633,143,633,135,572,135, - 572,143,579,143,579,185,626,185, - 'fill'=>'', 'tags'=>['floor2','room']) + 572,143,579,143,579,185,626,185, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '234' $floorItems['234'] = i TkcText.new(w,606,160, 'text'=>'234', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,557,135,571,135,571,145,578,145, - 578,185,527,185,527,131,557,131, - 'fill'=>'', 'tags'=>['floor2','room']) + 578,185,527,185,527,131,557,131, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '233' $floorItems['233'] = i TkcText.new(w,552.5,158, 'text'=>'233', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,249,557,249,557,205,476,205, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '230' $floorItems['230'] = i TkcText.new(w,516.5,227, 'text'=>'230', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '232' $floorItems['232'] = i TkcText.new(w,500.5,158, 'text'=>'232', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '229' $floorItems['229'] = i TkcText.new(w,485.5,195, 'text'=>'229', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '227' $floorItems['227'] = i TkcText.new(w,436.5,185.5, 'text'=>'227', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '228' $floorItems['228'] = i TkcText.new(w,436.5,231, 'text'=>'228', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '226' $floorItems['226'] = i TkcText.new(w,392,217.5, 'text'=>'226', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '225' $floorItems['225'] = i TkcText.new(w,356.5,150, 'text'=>'225', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '224' $floorItems['224'] = i TkcText.new(w,270,223.5, 'text'=>'224', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '223' $floorItems['223'] = i TkcText.new(w,292,157, 'text'=>'223', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '222' $floorItems['222'] = i TkcText.new(w,244.5,157, 'text'=>'222', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '221' $floorItems['221'] = i TkcText.new(w,198,157, 'text'=>'221', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '204' $floorItems['204'] = i TkcText.new(w,324,301.5, 'text'=>'204', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '205' $floorItems['205'] = i TkcText.new(w,265.5,307, 'text'=>'205', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,256,385,256,340,212,340,212,385, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '207' $floorItems['207'] = i TkcText.new(w,234,362.5, 'text'=>'207', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '208' $floorItems['208'] = i TkcText.new(w,187,362.5, 'text'=>'208', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '209' $floorItems['209'] = i TkcText.new(w,138.5,362.5, 'text'=>'209', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '217' $floorItems['217'] = i TkcText.new(w,71,192, 'text'=>'217', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '217A' $floorItems['217A'] = i TkcText.new(w,93,179.5, 'text'=>'217A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '216' $floorItems['216'] = i TkcText.new(w,71,145.5, 'text'=>'216', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '215' $floorItems['215'] = i TkcText.new(w,28.5,157, 'text'=>'215', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '214' $floorItems['214'] = i TkcText.new(w,28.5,203.5, 'text'=>'214', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '213' $floorItems['213'] = i TkcText.new(w,28.5,252, 'text'=>'213', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '210' $floorItems['210'] = i TkcText.new(w,90.5,362.5, 'text'=>'210', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '211' $floorItems['211'] = i TkcText.new(w,33,364.5, 'text'=>'211', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '203' $floorItems['203'] = i TkcText.new(w,367.5,292.5, 'text'=>'203', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198, - 154,198,154,192,109,192,109,169,99,169, - 'fill'=>'', 'tags'=>['floor2','room']) + 154,198,154,192,109,192,109,169,99,169, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '220' $floorItems['220'] = i TkcText.new(w,132.5,208.5, 'text'=>'220', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = 'Priv Lift2' $floorItems['Priv Lift2'] = i TkcText.new(w,323,188, 'text'=>'Priv Lift2', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = 'Pub Lift 2' $floorItems['Pub Lift 2'] = i TkcText.new(w,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '218' $floorItems['218'] = i TkcText.new(w,136,149.5, 'text'=>'218', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '219' $floorItems['219'] = i TkcText.new(w,132.5,180, 'text'=>'219', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '201' $floorItems['201'] = i TkcText.new(w,358,209, 'text'=>'201', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) TkcLine.new(w,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall']) TkcLine.new(w,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall']) TkcLine.new(w,634,133,634,144, 'fill'=>color, 'tags'=>['floor2','wall']) @@ -1271,215 +1271,215 @@ end # floor (office outlines and numbers). # # Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. +# w - The canvas window. +# color - Color to use for drawing foreground information. def floor_fg3(w,color) i = TkcPolygon.new(w,89,228,89,180,70,180,70,228, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '316' $floorItems['316'] = i TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '309' $floorItems['309'] = i TkcText.new(w,138.5,345.5, 'text'=>'309', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '308' $floorItems['308'] = i TkcText.new(w,187.5,345.5, 'text'=>'308', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '307' $floorItems['307'] = i TkcText.new(w,234,345.5, 'text'=>'307', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '305' $floorItems['305'] = i TkcText.new(w,270.5,301.5, 'text'=>'305', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,251,219,251,203,244,203,244,219, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '324B' $floorItems['324B'] = i TkcText.new(w,247.5,211, 'text'=>'324B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '324A' $floorItems['324A'] = i TkcText.new(w,247.5,240.5, 'text'=>'324A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '320' $floorItems['320'] = i TkcText.new(w,200,157, 'text'=>'320', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '310' $floorItems['310'] = i TkcText.new(w,90.5,345.5, 'text'=>'310', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '312' $floorItems['312'] = i TkcText.new(w,45.5,299, 'text'=>'312', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '313' $floorItems['313'] = i TkcText.new(w,45.5,252, 'text'=>'313', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '314' $floorItems['314'] = i TkcText.new(w,40.5,203.5, 'text'=>'314', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '315' $floorItems['315'] = i TkcText.new(w,59,157, 'text'=>'315', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '316B' $floorItems['316B'] = i TkcText.new(w,95,215, 'text'=>'316B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '316A' $floorItems['316A'] = i TkcText.new(w,95,191, 'text'=>'316A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198, - 174,198,174,226,101,226,101,179,97,179, - 'fill'=>'', 'tags'=>['floor3','room']) + 174,198,174,226,101,226,101,179,97,179, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '319' $floorItems['319'] = i TkcText.new(w,141.5,209, 'text'=>'319', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '311' $floorItems['311'] = i TkcText.new(w,29.5,361, 'text'=>'311', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '318' $floorItems['318'] = i TkcText.new(w,132.5,180, 'text'=>'318', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '317' $floorItems['317'] = i TkcText.new(w,136,149.5, 'text'=>'317', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '323' $floorItems['323'] = i TkcText.new(w,290,207.5, 'text'=>'323', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '325' $floorItems['325'] = i TkcText.new(w,290,235.5, 'text'=>'325', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '321' $floorItems['321'] = i TkcText.new(w,243.5,157, 'text'=>'321', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,314,169,306,169,306,192,273,192, - 264,181,264,135,314,135, - 'fill'=>'', 'tags'=>['floor3','room']) + 264,181,264,135,314,135, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '322' $floorItems['322'] = i TkcText.new(w,293.5,163.5, 'text'=>'322', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = 'Pub Lift3' $floorItems['Pub Lift3'] = i TkcText.new(w,323,223, 'text'=>'Pub Lift3', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = 'Priv Lift3' $floorItems['Priv Lift3'] = i TkcText.new(w,323,188, 'text'=>'Priv Lift3', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '303' $floorItems['303'] = i TkcText.new(w,373.5,292.5, 'text'=>'303', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,272,203,272,249,252,249,252,230, - 244,230,244,221,252,221,252,203, - 'fill'=>'', 'tags'=>['floor3','room']) + 244,230,244,221,252,221,252,203, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '324' $floorItems['324'] = i TkcText.new(w,262,226, 'text'=>'324', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '304' $floorItems['304'] = i TkcText.new(w,324,301.5, 'text'=>'304', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '301' $floorItems['301'] = i TkcText.new(w,358,209, 'text'=>'301', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '327' $floorItems['327'] = i TkcText.new(w,387,215.5, 'text'=>'327', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '326' $floorItems['326'] = i TkcText.new(w,365.5,150, 'text'=>'326', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282, - 375,274,397,274,397,248,339,248,339,242,308,242, - 'fill'=>'', 'tags'=>['floor3','room']) + 375,274,397,274,397,248,339,248,339,242,308,242, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '302' $floorItems['302'] = i TkcText.new(w,319.5,261, 'text'=>'302', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203, - 272,193,263,180,242,180,175,180,175,169,156,169, - 156,196,177,196,177,228,107,228,70,228,70,275,107,275, - 107,248,160,248,160,301,107,301,107,275,70,275, - 'fill'=>'', 'tags'=>['floor3','room']) + 272,193,263,180,242,180,175,180,175,169,156,169, + 156,196,177,196,177,228,107,228,70,228,70,275,107,275, + 107,248,160,248,160,301,107,301,107,275,70,275, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '306' $floorItems['306'] = i TkcText.new(w,200.5,284.5, 'text'=>'306', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall']) TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall']) TkcLine.new(w,396,247,399,247, 'fill'=>color, 'tags'=>['floor3','wall']) @@ -1588,7 +1588,7 @@ $floor_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($floor_demo, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', - 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){ + 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){ pack('side'=>'top') } @@ -1618,12 +1618,12 @@ $floorItems = {} # canvas 設定 if $tk_version =~ /^4\.[01]/ $floor_canvas_frame = TkFrame.new($floor_demo,'bd'=>2,'relief'=>'sunken', - 'highlightthickness'=>2) + 'highlightthickness'=>2) $floor_canvas = TkCanvas.new($floor_canvas_frame, - 'width'=>900, 'height'=>500, 'borderwidth'=>0, - 'highlightthickness'=>0) {|c| + 'width'=>900, 'height'=>500, 'borderwidth'=>0, + 'highlightthickness'=>0) {|c| TkScrollbar.new($floor_demo, 'orient'=>'horiz', - 'command'=>proc{|*args| c.xview(*args)}){|hs| + 'command'=>proc{|*args| c.xview(*args)}){|hs| c.xscrollcommand(proc{|first,last| hs.set first,last}) pack('side'=>'bottom', 'fill'=>'x') } @@ -1644,20 +1644,20 @@ else TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1| $floor_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, - 'borderwidth'=>0, - 'highlightthickness'=>0) { - xscrollcommand(proc{|first,last| h.set first,last}) - yscrollcommand(proc{|first,last| v.set first,last}) - pack('expand'=>'yes', 'fill'=>'both') + 'borderwidth'=>0, + 'highlightthickness'=>0) { + xscrollcommand(proc{|first,last| h.set first,last}) + yscrollcommand(proc{|first,last| v.set first,last}) + pack('expand'=>'yes', 'fill'=>'both') } grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') } v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) @@ -1674,7 +1674,7 @@ end $currentRoom = TkVariable.new $floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken', - 'bd'=>2, 'textvariable'=>$currentRoom) + 'bd'=>2, 'textvariable'=>$currentRoom) # Choose colors, then fill in the floorplan. @@ -1711,7 +1711,7 @@ $floor_canvas.itembind('room', 'Enter', proc{newRoom $floor_canvas}) $floor_canvas.itembind('room', 'Leave', proc{$currentRoom.value = ''}) $floor_canvas.bind('2', proc{|x,y| $floor_canvas.scan_mark x,y}, '%x %y') $floor_canvas.bind('B2-Motion', - proc{|x,y| $floor_canvas.scan_dragto x,y}, '%x %y') + proc{|x,y| $floor_canvas.scan_dragto x,y}, '%x %y') $floor_canvas.bind('Destroy', proc{$currentRoom.unset}) $currentRoom.value = '' $currentRoom.trace('w',proc{roomChanged $floor_canvas}) diff --git a/ext/tk/sample/demos-jp/floor2.rb b/ext/tk/sample/demos-jp/floor2.rb index e5a8f53f2a..fcf208b61f 100644 --- a/ext/tk/sample/demos-jp/floor2.rb +++ b/ext/tk/sample/demos-jp/floor2.rb @@ -8,8 +8,8 @@ # visible. # # Arguments: -# w - Name of the canvas window. -# active - Number of active floor (1, 2, or 3). +# w - Name of the canvas window. +# active - Number of active floor (1, 2, or 3). def floorDisplay2(w,active) return if $activeFloor2 == active @@ -59,7 +59,7 @@ end # highlighted. # # Arguments: -# w - The name of the canvas window. +# w - The name of the canvas window. def newRoom2(w) id = w.find_withtag('current')[0] @@ -72,8 +72,8 @@ end # It highlights the current room and unhighlights any previous room. # # Arguments: -# w - The canvas window displaying the floorplan. -# args - Not used. +# w - The canvas window displaying the floorplan. +# args - Not used. def roomChanged2(w,*args) w.delete('highlight') @@ -90,24 +90,24 @@ end # floor. # # Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. +# w - The canvas window. +# fill - Fill color to use for the floor's background. +# outline - Color to use for the floor's outline. def floor2_bg1(w,fill,outline) w.create(TkcPolygon,347,80,349,82,351,84,353,85,363,92,375,99,386,104, - 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725, - 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327, - 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404, - 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325, - 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332, - 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363, - 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391, - 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7, - 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221, - 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5, - 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70, - 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill) + 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725, + 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327, + 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404, + 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325, + 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332, + 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363, + 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391, + 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7, + 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221, + 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5, + 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70, + 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill) w.create(TkcLine,386,129,398,129, 'fill'=>outline, 'tags'=>['floor1','bg']) w.create(TkcLine,258,355,258,387, 'fill'=>outline, 'tags'=>['floor1','bg']) w.create(TkcLine,60,387,60,391, 'fill'=>outline, 'tags'=>['floor1','bg']) @@ -214,17 +214,17 @@ end # floor. # # Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. +# w - The canvas window. +# fill - Fill color to use for the floor's background. +# outline - Color to use for the floor's outline. def floor2_bg2(w,fill,outline) w.create(TkcPolygon,559,129,484,129,484,162,398,162,398,129,315,129, - 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391, - 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280, - 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644, - 367,802,367,802,129,725,129,725,133,559,133,559,129, - 'tags'=>['floor2','bg'], 'fill'=>fill) + 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391, + 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280, + 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644, + 367,802,367,802,129,725,129,725,133,559,133,559,129, + 'tags'=>['floor2','bg'], 'fill'=>fill) w.create(TkcLine,350,311,350,329, 'fill'=>outline, 'tags'=>['floor2','bg']) w.create(TkcLine,398,129,398,162, 'fill'=>outline, 'tags'=>['floor2','bg']) w.create(TkcLine,802,367,802,129, 'fill'=>outline, 'tags'=>['floor2','bg']) @@ -269,17 +269,17 @@ end # floor. # # Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. +# w - The canvas window. +# fill - Fill color to use for the floor's background. +# outline - Color to use for the floor's outline. def floor2_bg3(w,fill,outline) w.create(TkcPolygon,159,300,107,300,107,248,159,248,159,129,96,129,96, - 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300, - 'tags'=>['floor3','bg'], 'fill'=>fill) + 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300, + 'tags'=>['floor3','bg'], 'fill'=>fill) w.create(TkcPolygon,258,370,258,329,350,329,350,311,399,311,399,129, - 315,129,315,133,176,133,176,129,159,129,159,370,258,370, - 'tags'=>['floor3','bg'], 'fill'=>fill) + 315,129,315,133,176,133,176,129,159,129,159,370,258,370, + 'tags'=>['floor3','bg'], 'fill'=>fill) w.create(TkcLine,96,133,96,129, 'fill'=>outline, 'tags'=>['floor3','bg']) w.create(TkcLine,176,129,96,129, 'fill'=>outline, 'tags'=>['floor3','bg']) w.create(TkcLine,176,129,176,133, 'fill'=>outline, 'tags'=>['floor3','bg']) @@ -299,7 +299,7 @@ def floor2_bg3(w,fill,outline) w.create(TkcLine,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) w.create(TkcLine,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) w.create(TkcLine,107,300,159,300,159,248,107,248,107,300, - 'fill'=>outline, 'tags'=>['floor3','bg']) + 'fill'=>outline, 'tags'=>['floor3','bg']) end # floor2_fg1 -- @@ -308,321 +308,321 @@ end # floor (office outlines and numbers). # # Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. +# w - The canvas window. +# color - Color to use for drawing foreground information. def floor2_fg1(w,color) i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '101' $floorItems2['101'] = i w.create(TkcText,358,209, 'text'=>'101', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Pub Lift1' $floorItems2['Pub Lift1'] = i w.create(TkcText,323,223, 'text'=>'Pub Lift1', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Priv Lift1' $floorItems2['Priv Lift1'] = i w.create(TkcText,323,188, 'text'=>'Priv Lift1', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '110' $floorItems2['110'] = i w.create(TkcText,21.5,363, 'text'=>'110', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '109' $floorItems2['109'] = i w.create(TkcText,67,363, 'text'=>'109', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '111' $floorItems2['111'] = i w.create(TkcText,28.5,276.5, 'text'=>'111', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '117B' $floorItems2['117B'] = i w.create(TkcText,88.5,278.5, 'text'=>'117B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '112' $floorItems2['112'] = i w.create(TkcText,28.5,227.5, 'text'=>'112', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '113' $floorItems2['113'] = i w.create(TkcText,28.5,179.5, 'text'=>'113', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '117A' $floorItems2['117A'] = i w.create(TkcText,82,180.5, 'text'=>'117A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '117' $floorItems2['117'] = i w.create(TkcText,65,235, 'text'=>'117', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '114' $floorItems2['114'] = i w.create(TkcText,28.5,135, 'text'=>'114', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '115' $floorItems2['115'] = i w.create(TkcText,74,141.5, 'text'=>'115', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '116' $floorItems2['116'] = i w.create(TkcText,48.5,70, 'text'=>'116', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '118' $floorItems2['118'] = i w.create(TkcText,108.5,102, 'text'=>'118', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,178,128,178,132,216,132,216,91, - 163,91,163,112,149,112,149,128, - 'fill'=>'', 'tags'=>['floor1','room']) + 163,91,163,112,149,112,149,128, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '120' $floorItems2['120'] = i w.create(TkcText,189.5,111.5, 'text'=>'120', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192, - 156,192,156,169,175,169,175,246,79,246, - 'fill'=>'', 'tags'=>['floor1','room']) + 156,192,156,169,175,169,175,246,79,246, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '122' $floorItems2['122'] = i w.create(TkcText,131,207.5, 'text'=>'122', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '121' $floorItems2['121'] = i w.create(TkcText,146,180, 'text'=>'121', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '106A' $floorItems2['106A'] = i w.create(TkcText,112.5,304.5, 'text'=>'106A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '105' $floorItems2['105'] = i w.create(TkcText,124.5,278.5, 'text'=>'105', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '106B' $floorItems2['106B'] = i w.create(TkcText,163,304.5, 'text'=>'106B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '104' $floorItems2['104'] = i w.create(TkcText,184,278.5, 'text'=>'104', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '108' $floorItems2['108'] = i w.create(TkcText,114.5,361, 'text'=>'108', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '107' $floorItems2['107'] = i w.create(TkcText,198,361, 'text'=>'107', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Smoking' $floorItems2['Smoking'] = i w.create(TkcText,280,341, 'text'=>'Smoking', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '123' $floorItems2['123'] = i w.create(TkcText,245.5,190.5, 'text'=>'123', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '103' $floorItems2['103'] = i w.create(TkcText,259,287, 'text'=>'103', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '124' $floorItems2['124'] = i w.create(TkcText,356,150, 'text'=>'124', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '125' $floorItems2['125'] = i w.create(TkcText,392,217.5, 'text'=>'125', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '126' $floorItems2['126'] = i w.create(TkcText,436.5,185.5, 'text'=>'126', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,409,209,409,229,399,229,399,253, - 486,253,486,239,474,239,474,209, - 'fill'=>'', 'tags'=>['floor1','room']) + 486,253,486,239,474,239,474,209, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '127' $floorItems2['127'] = i w.create(TkcText,436.5,'231', 'text'=>'127', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,501,164,501,174,495,174,495,188, - 490,188,490,204,476,204,476,164, - 'fill'=>'', 'tags'=>['floor1','room']) + 490,188,490,204,476,204,476,164, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'MShower' $floorItems2['MShower'] = i w.create(TkcText,488.5,'184', 'text'=>'MShower', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Closet' $floorItems2['Closet'] = i w.create(TkcText,502.5,190, 'text'=>'Closet', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'WShower' $floorItems2['WShower'] = i w.create(TkcText,494.5,230, 'text'=>'WShower', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166, - 697,166,697,275,553,275,531,254,515,254, - 515,174,503,174,503,161,486,161, - 'fill'=>'', 'tags'=>['floor1','room']) + 697,166,697,275,553,275,531,254,515,254, + 515,174,503,174,503,161,486,161, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '130' $floorItems2['130'] = i w.create(TkcText,638.5,205, 'text'=>'130', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,308,242,339,242,339,248,342,248, - 342,246,397,246,397,276,393,276, - 393,309,300,309,300,248,308,248, - 'fill'=>'', 'tags'=>['floor1','room']) + 342,246,397,246,397,276,393,276, + 393,309,300,309,300,248,308,248, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '102' $floorItems2['102'] = i w.create(TkcText,367.5,278.5, 'text'=>'102', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '128' $floorItems2['128'] = i w.create(TkcText,441.5,265.5, 'text'=>'128', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,510,309,486,309,486,255,530,255, - 552,277,561,277,561,325,510,325, - 'fill'=>'', 'tags'=>['floor1','room']) + 552,277,561,277,561,325,510,325, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '129' $floorItems2['129'] = i w.create(TkcText,535.5,293, 'text'=>'129', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,696,281,740,281,740,387,642,387, - 642,389,561,389,561,277,696,277, - 'fill'=>'', 'tags'=>['floor1','room']) + 642,389,561,389,561,277,696,277, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '133' $floorItems2['133'] = i w.create(TkcText,628.5,335, 'text'=>'133', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '132' $floorItems2['132'] = i w.create(TkcText,771,334, 'text'=>'132', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '134' $floorItems2['134'] = i w.create(TkcText,749.5,224, 'text'=>'134', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '135' $floorItems2['135'] = i w.create(TkcText,763,148.5, 'text'=>'135', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366, - 304,312,396,312,396,288,400,288,404,288, - 409,290,413,292,418,297,421,302,422,309, - 421,318,417,325,411,330,405,332,397,333, - 344,333,340,334,336,336,335,338,332,342, - 331,347,332,351,334,354,336,357,341,359, - 'fill'=>'', 'tags'=>['floor1','room']) + 304,312,396,312,396,288,400,288,404,288, + 409,290,413,292,418,297,421,302,422,309, + 421,318,417,325,411,330,405,332,397,333, + 344,333,340,334,336,336,335,338,332,342, + 331,347,332,351,334,354,336,357,341,359, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Ramona Stair' $floorItems2['Ramona Stair'] = i w.create(TkcText,368,323, 'text'=>'Ramona Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20, - 122,28,123,32,123,68,220,68,220,87,90,87,90,23, - 'fill'=>'', 'tags'=>['floor1','room']) + 122,28,123,32,123,68,220,68,220,87,90,87,90,23, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'University Stair' $floorItems2['University Stair'] = i w.create(TkcText,155,77.5, 'text'=>'University Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56, - 358,48,363,39,365,29,348,25,335,22,321,14, - 300,5,283,1,260,0,246,0,242,2,236,4,231,8, - 227,13,223,17,221,22,220,34,260,34, - 'fill'=>'', 'tags'=>['floor1','room']) + 358,48,363,39,365,29,348,25,335,22,321,14, + 300,5,283,1,260,0,246,0,242,2,236,4,231,8, + 227,13,223,17,221,22,220,34,260,34, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Plaza Stair' $floorItems2['Plaza Stair'] = i w.create(TkcText,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49, - 323,56,337,70,350,83,365,94,377,100, - 386,104,386,128,220,128, - 'fill'=>'', 'tags'=>['floor1','room']) + 323,56,337,70,350,83,365,94,377,100, + 386,104,386,128,220,128, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Plaza Deck' $floorItems2['Plaza Deck'] = i w.create(TkcText,303,81, 'text'=>'Plaza Deck', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310, - 'fill'=>'', 'tags'=>['floor1','room']) + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '106' $floorItems2['106'] = i w.create(TkcText,131.5,318.5, 'text'=>'106', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115, - 95,128,114,128,114,151,157,151,157,153,112,153, - 112,130,97,130,97,168,175,168,175,131,146,131, - 'fill'=>'', 'tags'=>['floor1','room']) + 95,128,114,128,114,151,157,151,157,153,112,153, + 112,130,97,130,97,168,175,168,175,131,146,131, + 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '119' $floorItems2['119'] = i w.create(TkcText,143.5,133, 'text'=>'119', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) + 'anchor'=>'c', 'tags'=>['floor1','label']) w.create(TkcLine,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall']) w.create(TkcLine,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall']) w.create(TkcLine,96,129,96,169, 'fill'=>color, 'tags'=>['floor1','wall']) @@ -789,327 +789,327 @@ end # floor (office outlines and numbers). # # Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. +# w - The canvas window. +# color - Color to use for drawing foreground information. def floor2_fg2(w,color) i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222, - 800,222,800,168,748,168, - 'fill'=>'', 'tags'=>['floor2','room']) + 800,222,800,168,748,168, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '238' $floorItems2['238'] = i w.create(TkcText,774,195, 'text'=>'238', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '237' $floorItems2['237'] = i w.create(TkcText,763,148.5, 'text'=>'237', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324, - 643,324,643,291,641,291,641,205,696,205, - 696,291,694,291,694,314,715,314,715,291, - 715,205,755,205,755,190,724,190,724,187, - 'fill'=>'', 'tags'=>['floor2','room']) + 643,324,643,291,641,291,641,205,696,205, + 696,291,694,291,694,314,715,314,715,291, + 715,205,755,205,755,190,724,190,724,187, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '246' $floorItems2['246'] = i w.create(TkcText,600,264, 'text'=>'246', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '247' $floorItems2['247'] = i w.create(TkcText,668.5,296.5, 'text'=>'247', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246, - 397,246,397,255,476,255,476,250,482,250,559,250, - 559,274,482,274,482,278,396,278,396,274,232,274, - 'fill'=>'', 'tags'=>['floor2','room']) + 397,246,397,255,476,255,476,250,482,250,559,250, + 559,274,482,274,482,278,396,278,396,274,232,274, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '202' $floorItems2['202'] = i w.create(TkcText,285.5,260, 'text'=>'202', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196, - 306,196,306,180,175,180,175,169,156,169, - 156,196,176,196,176,228, - 'fill'=>'', 'tags'=>['floor2','room']) + 306,196,306,180,175,180,175,169,156,169, + 156,196,176,196,176,228, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '206' $floorItems2['206'] = i w.create(TkcText,143,267, 'text'=>'206', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '212' $floorItems2['212'] = i w.create(TkcText,28.5,307.5, 'text'=>'212', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '245' $floorItems2['245'] = i w.create(TkcText,521.5,300.5, 'text'=>'245', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '244' $floorItems2['244'] = i w.create(TkcText,579.5,357.5, 'text'=>'244', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '243' $floorItems2['243'] = i w.create(TkcText,622,357.5, 'text'=>'243', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '242' $floorItems2['242'] = i w.create(TkcText,666.5,340.5, 'text'=>'242', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = 'Barbecue Deck' $floorItems2['Barbecue Deck'] = i w.create(TkcText,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '240' $floorItems2['240'] = i w.create(TkcText,736,288, 'text'=>'240', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '241' $floorItems2['241'] = i w.create(TkcText,722,340.5, 'text'=>'241', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '239' $floorItems2['239'] = i w.create(TkcText,736,233.5, 'text'=>'239', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '248' $floorItems2['248'] = i w.create(TkcText,669,241.5, 'text'=>'248', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '236' $floorItems2['236'] = i w.create(TkcText,700,160, 'text'=>'236', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '235' $floorItems2['235'] = i w.create(TkcText,651.5,160, 'text'=>'235', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,626,143,633,143,633,135,572,135, - 572,143,579,143,579,185,626,185, - 'fill'=>'', 'tags'=>['floor2','room']) + 572,143,579,143,579,185,626,185, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '234' $floorItems2['234'] = i w.create(TkcText,606,160, 'text'=>'234', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,557,135,571,135,571,145,578,145, - 578,185,527,185,527,131,557,131, - 'fill'=>'', 'tags'=>['floor2','room']) + 578,185,527,185,527,131,557,131, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '233' $floorItems2['233'] = i w.create(TkcText,552.5,158, 'text'=>'233', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,249,557,249,557,205,476,205, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '230' $floorItems2['230'] = i w.create(TkcText,516.5,227, 'text'=>'230', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '232' $floorItems2['232'] = i w.create(TkcText,500.5,158, 'text'=>'232', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '229' $floorItems2['229'] = i w.create(TkcText,485.5,195, 'text'=>'229', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '227' $floorItems2['227'] = i w.create(TkcText,436.5,185.5, 'text'=>'227', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '228' $floorItems2['228'] = i w.create(TkcText,436.5,231, 'text'=>'228', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '226' $floorItems2['226'] = i w.create(TkcText,392,217.5, 'text'=>'226', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '225' $floorItems2['225'] = i w.create(TkcText,356.5,150, 'text'=>'225', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '224' $floorItems2['224'] = i w.create(TkcText,270,223.5, 'text'=>'224', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '223' $floorItems2['223'] = i w.create(TkcText,292,157, 'text'=>'223', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '222' $floorItems2['222'] = i w.create(TkcText,244.5,157, 'text'=>'222', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '221' $floorItems2['221'] = i w.create(TkcText,198,157, 'text'=>'221', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '204' $floorItems2['204'] = i w.create(TkcText,324,301.5, 'text'=>'204', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '205' $floorItems2['205'] = i w.create(TkcText,265.5,307, 'text'=>'205', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,256,385,256,340,212,340,212,385, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '207' $floorItems2['207'] = i w.create(TkcText,234,362.5, 'text'=>'207', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '208' $floorItems2['208'] = i w.create(TkcText,187,362.5, 'text'=>'208', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '209' $floorItems2['209'] = i w.create(TkcText,138.5,362.5, 'text'=>'209', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '217' $floorItems2['217'] = i w.create(TkcText,71,192, 'text'=>'217', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '217A' $floorItems2['217A'] = i w.create(TkcText,93,179.5, 'text'=>'217A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '216' $floorItems2['216'] = i w.create(TkcText,71,145.5, 'text'=>'216', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '215' $floorItems2['215'] = i w.create(TkcText,28.5,157, 'text'=>'215', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '214' $floorItems2['214'] = i w.create(TkcText,28.5,203.5, 'text'=>'214', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '213' $floorItems2['213'] = i w.create(TkcText,28.5,252, 'text'=>'213', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '210' $floorItems2['210'] = i w.create(TkcText,90.5,362.5, 'text'=>'210', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '211' $floorItems2['211'] = i w.create(TkcText,33,364.5, 'text'=>'211', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '203' $floorItems2['203'] = i w.create(TkcText,367.5,292.5, 'text'=>'203', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198, - 154,198,154,192,109,192,109,169,99,169, - 'fill'=>'', 'tags'=>['floor2','room']) + 154,198,154,192,109,192,109,169,99,169, + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '220' $floorItems2['220'] = i w.create(TkcText,132.5,208.5, 'text'=>'220', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = 'Priv Lift2' $floorItems2['Priv Lift2'] = i w.create(TkcText,323,188, 'text'=>'Priv Lift2', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = 'Pub Lift 2' $floorItems2['Pub Lift 2'] = i w.create(TkcText,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '218' $floorItems2['218'] = i w.create(TkcText,136,149.5, 'text'=>'218', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '219' $floorItems2['219'] = i w.create(TkcText,132.5,180, 'text'=>'219', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor2','room']) + 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '201' $floorItems2['201'] = i w.create(TkcText,358,209, 'text'=>'201', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) + 'anchor'=>'c', 'tags'=>['floor2','label']) w.create(TkcLine,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall']) w.create(TkcLine,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall']) w.create(TkcLine,634,133,634,144, 'fill'=>color, 'tags'=>['floor2','wall']) @@ -1271,215 +1271,215 @@ end # floor (office outlines and numbers). # # Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. +# w - The canvas window. +# color - Color to use for drawing foreground information. def floor2_fg3(w,color) i = TkcPolygon.new(w,89,228,89,180,70,180,70,228, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '316' $floorItems2['316'] = i w.create(TkcText,79.5,204, 'text'=>'316', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '309' $floorItems2['309'] = i w.create(TkcText,138.5,345.5, 'text'=>'309', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '308' $floorItems2['308'] = i w.create(TkcText,187.5,345.5, 'text'=>'308', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '307' $floorItems2['307'] = i w.create(TkcText,234,345.5, 'text'=>'307', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '305' $floorItems2['305'] = i w.create(TkcText,270.5,301.5, 'text'=>'305', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,251,219,251,203,244,203,244,219, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '324B' $floorItems2['324B'] = i w.create(TkcText,247.5,211, 'text'=>'324B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '324A' $floorItems2['324A'] = i w.create(TkcText,247.5,240.5, 'text'=>'324A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '320' $floorItems2['320'] = i w.create(TkcText,200,157, 'text'=>'320', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '310' $floorItems2['310'] = i w.create(TkcText,90.5,345.5, 'text'=>'310', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '312' $floorItems2['312'] = i w.create(TkcText,45.5,299, 'text'=>'312', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '313' $floorItems2['313'] = i w.create(TkcText,45.5,252, 'text'=>'313', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '314' $floorItems2['314'] = i w.create(TkcText,40.5,203.5, 'text'=>'314', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '315' $floorItems2['315'] = i w.create(TkcText,59,157, 'text'=>'315', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '316B' $floorItems2['316B'] = i w.create(TkcText,95,215, 'text'=>'316B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '316A' $floorItems2['316A'] = i w.create(TkcText,95,191, 'text'=>'316A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198, - 174,198,174,226,101,226,101,179,97,179, - 'fill'=>'', 'tags'=>['floor3','room']) + 174,198,174,226,101,226,101,179,97,179, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '319' $floorItems2['319'] = i w.create(TkcText,141.5,209, 'text'=>'319', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '311' $floorItems2['311'] = i w.create(TkcText,29.5,361, 'text'=>'311', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '318' $floorItems2['318'] = i w.create(TkcText,132.5,180, 'text'=>'318', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '317' $floorItems2['317'] = i w.create(TkcText,136,149.5, 'text'=>'317', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '323' $floorItems2['323'] = i w.create(TkcText,290,207.5, 'text'=>'323', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '325' $floorItems2['325'] = i w.create(TkcText,290,235.5, 'text'=>'325', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '321' $floorItems2['321'] = i w.create(TkcText,243.5,157, 'text'=>'321', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,314,169,306,169,306,192,273,192, - 264,181,264,135,314,135, - 'fill'=>'', 'tags'=>['floor3','room']) + 264,181,264,135,314,135, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '322' $floorItems2['322'] = i w.create(TkcText,293.5,163.5, 'text'=>'322', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = 'Pub Lift3' $floorItems2['Pub Lift3'] = i w.create(TkcText,323,223, 'text'=>'Pub Lift3', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = 'Priv Lift3' $floorItems2['Priv Lift3'] = i w.create(TkcText,323,188, 'text'=>'Priv Lift3', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '303' $floorItems2['303'] = i w.create(TkcText,373.5,292.5, 'text'=>'303', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,272,203,272,249,252,249,252,230, - 244,230,244,221,252,221,252,203, - 'fill'=>'', 'tags'=>['floor3','room']) + 244,230,244,221,252,221,252,203, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '324' $floorItems2['324'] = i w.create(TkcText,262,226, 'text'=>'324', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '304' $floorItems2['304'] = i w.create(TkcText,324,301.5, 'text'=>'304', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '301' $floorItems2['301'] = i w.create(TkcText,358,209, 'text'=>'301', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '327' $floorItems2['327'] = i w.create(TkcText,387,215.5, 'text'=>'327', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, - 'fill'=>'', 'tags'=>['floor3','room']) + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '326' $floorItems2['326'] = i w.create(TkcText,365.5,150, 'text'=>'326', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282, - 375,274,397,274,397,248,339,248,339,242,308,242, - 'fill'=>'', 'tags'=>['floor3','room']) + 375,274,397,274,397,248,339,248,339,242,308,242, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '302' $floorItems2['302'] = i w.create(TkcText,319.5,261, 'text'=>'302', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203, - 272,193,263,180,242,180,175,180,175,169,156,169, - 156,196,177,196,177,228,107,228,70,228,70,275,107,275, - 107,248,160,248,160,301,107,301,107,275,70,275, - 'fill'=>'', 'tags'=>['floor3','room']) + 272,193,263,180,242,180,175,180,175,169,156,169, + 156,196,177,196,177,228,107,228,70,228,70,275,107,275, + 107,248,160,248,160,301,107,301,107,275,70,275, + 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '306' $floorItems2['306'] = i w.create(TkcText,200.5,284.5, 'text'=>'306', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) + 'anchor'=>'c', 'tags'=>['floor3','label']) w.create(TkcLine,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall']) w.create(TkcLine,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall']) w.create(TkcLine,396,247,399,247, 'fill'=>color, 'tags'=>['floor3','wall']) @@ -1588,7 +1588,7 @@ $floor2_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($floor2_demo, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', - 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){ + 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){ pack('side'=>'top') } @@ -1618,12 +1618,12 @@ $floorItems2 = {} # canvas 設定 if $tk_version =~ /^4\.[01]/ $floor2_canvas_frame = TkFrame.new($floor2_demo,'bd'=>2,'relief'=>'sunken', - 'highlightthickness'=>2) + 'highlightthickness'=>2) $floor2_canvas = TkCanvas.new($floor2_canvas_frame, - 'width'=>900, 'height'=>500, 'borderwidth'=>0, - 'highlightthickness'=>0) {|c| + 'width'=>900, 'height'=>500, 'borderwidth'=>0, + 'highlightthickness'=>0) {|c| TkScrollbar.new($floor2_demo, 'orient'=>'horiz', - 'command'=>proc{|*args| c.xview(*args)}){|hs| + 'command'=>proc{|*args| c.xview(*args)}){|hs| c.xscrollcommand(proc{|first,last| hs.set first,last}) pack('side'=>'bottom', 'fill'=>'x') } @@ -1644,20 +1644,20 @@ else TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1| $floor2_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, - 'borderwidth'=>0, - 'highlightthickness'=>0) { - xscrollcommand(proc{|first,last| h.set first,last}) - yscrollcommand(proc{|first,last| v.set first,last}) - pack('expand'=>'yes', 'fill'=>'both') + 'borderwidth'=>0, + 'highlightthickness'=>0) { + xscrollcommand(proc{|first,last| h.set first,last}) + yscrollcommand(proc{|first,last| v.set first,last}) + pack('expand'=>'yes', 'fill'=>'both') } grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') } v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) @@ -1673,7 +1673,7 @@ end $currentRoom2 = TkVariable.new $floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken', - 'bd'=>2, 'textvariable'=>$currentRoom2) + 'bd'=>2, 'textvariable'=>$currentRoom2) # Choose colors, then fill in the floorplan. @@ -1710,7 +1710,7 @@ $floor2_canvas.itembind('room', 'Enter', proc{newRoom2 $floor2_canvas}) $floor2_canvas.itembind('room', 'Leave', proc{$currentRoom2.value = ''}) $floor2_canvas.bind('2', proc{|x,y| $floor2_canvas.scan_mark x,y}, '%x %y') $floor2_canvas.bind('B2-Motion', - proc{|x,y| $floor2_canvas.scan_dragto x,y}, '%x %y') + proc{|x,y| $floor2_canvas.scan_dragto x,y}, '%x %y') $floor2_canvas.bind('Destroy', proc{$currentRoom2.unset}) $currentRoom2.value = '' $currentRoom2.trace('w',proc{roomChanged2 $floor2_canvas}) diff --git a/ext/tk/sample/demos-jp/icon.rb b/ext/tk/sample/demos-jp/icon.rb index 3180787dac..e4fef5cae7 100644 --- a/ext/tk/sample/demos-jp/icon.rb +++ b/ext/tk/sample/demos-jp/icon.rb @@ -47,14 +47,14 @@ TkFrame.new($icon_demo) {|frame| flagup = \ TkBitmapImage.new('file'=>[$demo_dir,'..', 'images','flagup.xbm'].join(File::Separator), - 'maskfile'=>\ - [$demo_dir,'..','images','flagup.xbm'].join(File::Separator)) + 'maskfile'=>\ + [$demo_dir,'..','images','flagup.xbm'].join(File::Separator)) flagdown = \ TkBitmapImage.new('file'=>[$demo_dir,'..', 'images','flagdown.xbm'].join(File::Separator), - 'maskfile'=>\ - [$demo_dir,'..', - 'images','flagdown.xbm'].join(File::Separator)) + 'maskfile'=>\ + [$demo_dir,'..', + 'images','flagdown.xbm'].join(File::Separator)) # 変数生成 letters = TkVariable.new @@ -64,14 +64,14 @@ TkFrame.new($icon_demo, 'borderwidth'=>10){|w| TkFrame.new(w) {|f| TkRadioButton.new(f){ bitmap '@' + [$demo_dir,'..', - 'images','letters.xbm'].join(File::Separator) + 'images','letters.xbm'].join(File::Separator) variable letters value 'full' }.pack('side'=>'top', 'expand'=>'yes') TkRadioButton.new(f){ bitmap '@' + [$demo_dir,'..', - 'images','noletter.xbm'].join(File::Separator) + 'images','noletter.xbm'].join(File::Separator) variable letters value 'empty' }.pack('side'=>'top', 'expand'=>'yes') diff --git a/ext/tk/sample/demos-jp/image3.rb b/ext/tk/sample/demos-jp/image3.rb index d42650f45f..549152514b 100644 --- a/ext/tk/sample/demos-jp/image3.rb +++ b/ext/tk/sample/demos-jp/image3.rb @@ -33,7 +33,7 @@ end # listbox from the directory named in the demo's entry. # # Arguments: -# w - Name of the toplevel window of the demo. +# w - Name of the toplevel window of the demo. def selectAndLoadDir3(w, lbox) dir = Tk.chooseDirectory(:initialdir=>$dirName, :parent=>w, :mustexist=>true) if dir.length > 0 @@ -91,11 +91,11 @@ image3_f = TkFrame.new($image3_demo).pack(:fill=>:both, :expand=>true) image3_df = TkLabelFrame.new($image3_demo, :text=>'ディレクトリ:') image3_ff = TkLabelFrame.new($image3_demo, :text=>'ファイル:', - :padx=>'2m', :pady=>'2m') + :padx=>'2m', :pady=>'2m') image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) { pack(:side=>:left, :fill=>:y, :expand=>true) yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y, - :expand=>true)) + :expand=>true)) insert(0, *(%w(earth.gif earthris.gif teapot.ppm))) bind('Double-1', proc{|x,y| loadImage3(self, x, y)}, '%x %y') } @@ -106,7 +106,7 @@ image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){ } TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"ディレクトリ選択", - :command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) { + :command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) { pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m') } @@ -115,8 +115,8 @@ image3_if = TkLabelFrame.new($image3_demo, :text=>'イメージ:') {|f| } Tk.grid(image3_df, '-', - :sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f) + :sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f) Tk.grid(image3_ff, image3_if, - :sticky=>:nw, :padx=>'1m', :pady=>'1m', :in=>image3_f) + :sticky=>:nw, :padx=>'1m', :pady=>'1m', :in=>image3_f) TkGrid.columnconfigure(image3_f, 1, :weight=>1) diff --git a/ext/tk/sample/demos-jp/items.rb b/ext/tk/sample/demos-jp/items.rb index 0dc604bb6b..38774d10d2 100644 --- a/ext/tk/sample/demos-jp/items.rb +++ b/ext/tk/sample/demos-jp/items.rb @@ -71,11 +71,11 @@ TkFrame.new($items_demo) {|cf| else c.grid('in'=>cf, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') vs.grid('row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') hs.grid('row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) TkGrid.columnconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) @@ -111,126 +111,126 @@ $tag_item = TkcGroup.new(cvs) # Set up demos within each of the areas of the grid. TkcText.new(cvs, '5c', '.2c', 'text'=>'ライン', 'anchor'=>'n') TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c', - 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt', - 'join'=>'miter', 'tags'=>$tag_item ) + 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt', + 'join'=>'miter', 'tags'=>$tag_item ) TkcLine.new(cvs, '4.67c','1c','4.67c','4c', 'arrow'=>'last', 'tags'=>$tag_item) TkcLine.new(cvs, '6.33c','1c','6.33c','4c', 'arrow'=>'both', 'tags'=>$tag_item) TkcLine.new(cvs, '5c','6c','9c','6c','9c','1c','8c','1c','8c','4.8c','8.8c', - '4.8c','8.8c','1.2c','8.2c','1.2c','8.2c','4.6c','8.6c','4.6c', - '8.6c','1.4c','8.4c','1.4c','8.4c','4.4c', - 'width'=>3, 'fill'=>red, 'tags'=>$tag_item ) + '4.8c','8.8c','1.2c','8.2c','1.2c','8.2c','4.6c','8.6c','4.6c', + '8.6c','1.4c','8.4c','1.4c','8.4c','4.4c', + 'width'=>3, 'fill'=>red, 'tags'=>$tag_item ) TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c', - 'stipple'=>'@'+[$demo_dir,'..', - 'images','gray25.xbm'].join(File::Separator), - 'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item ) + 'stipple'=>'@'+[$demo_dir,'..', + 'images','gray25.xbm'].join(File::Separator), + 'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item ) TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c', - 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round', - 'tags'=>$tag_item ) + 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round', + 'tags'=>$tag_item ) TkcText.new(cvs, '15c', '.2c', - 'text'=>'曲線 (滑らかにつないだ直線)', 'anchor'=>'n') + 'text'=>'曲線 (滑らかにつないだ直線)', 'anchor'=>'n') TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c', - 'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item ) + 'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item ) TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c', - 'smooth'=>'on', 'arrow'=>'both', 'width'=>3, 'tags'=>$tag_item ) + 'smooth'=>'on', 'arrow'=>'both', 'width'=>3, 'tags'=>$tag_item ) TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c', - '16.5c','4.5c','13.5c','7.5c','12c','6c', - 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round', - 'stipple'=>'@'+[$demo_dir, '..', - 'images', 'gray25.xbm'].join(File::Separator), - 'fill'=>red, 'tags'=>$tag_item ) + '16.5c','4.5c','13.5c','7.5c','12c','6c', + 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round', + 'stipple'=>'@'+[$demo_dir, '..', + 'images', 'gray25.xbm'].join(File::Separator), + 'fill'=>red, 'tags'=>$tag_item ) TkcText.new(cvs, '25c', '.2c', 'text'=>'多角形', 'anchor'=>'n') TkcPolygon.new(cvs, '21c','1.0c','22.5c','1.75c','24c','1.0c','23.25c','2.5c', - '24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c', - 'fill'=>'green', 'outline'=>'black', 'width'=>4, - 'tags'=>$tag_item ) + '24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c', + 'fill'=>'green', 'outline'=>'black', 'width'=>4, + 'tags'=>$tag_item ) TkcPolygon.new(cvs, '25c','4c','25c','4c','25c','1c','26c','1c','27c','4c', - '28c','1c','29c','1c','29c','4c','29c','4c', - 'fill'=>red, 'smooth'=>'on', 'tags'=> $tag_item) + '28c','1c','29c','1c','29c','4c','29c','4c', + 'fill'=>red, 'smooth'=>'on', 'tags'=> $tag_item) TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c', - '28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c', - '7.5c','22c','7.5c', - 'stipple'=>'@' + [$demo_dir, '..', + '28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c', + '7.5c','22c','7.5c', + 'stipple'=>'@' + [$demo_dir, '..', 'images', 'gray25.xbm'].join(File::Separator), - 'outline'=>'black', 'tags'=>$tag_item ) + 'outline'=>'black', 'tags'=>$tag_item ) TkcText.new(cvs, '5c', '8.2c', 'text'=>'矩形', 'anchor'=>'n') TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c', - 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) + 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c', - 'fill'=>green, 'tags'=>$tag_item ) + 'fill'=>green, 'tags'=>$tag_item ) TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'', - 'stipple'=>'@'+[$demo_dir,'..', - 'images','gray25.xbm'].join(File::Separator), - 'fill'=>blue, 'tags'=>$tag_item ) + 'stipple'=>'@'+[$demo_dir,'..', + 'images','gray25.xbm'].join(File::Separator), + 'fill'=>blue, 'tags'=>$tag_item ) TkcText.new(cvs, '15c', '8.2c', 'text'=>'楕円', 'anchor'=>'n') TkcOval.new(cvs, '11c','9.5c','14c','12.5c', - 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) + 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c', - 'fill'=>green, 'tags'=>$tag_item ) + 'fill'=>green, 'tags'=>$tag_item ) TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'', - 'stipple'=>'@'+[$demo_dir,'..', - 'images','gray25.xbm'].join(File::Separator), - 'fill'=>blue, 'tags'=>$tag_item ) + 'stipple'=>'@'+[$demo_dir,'..', + 'images','gray25.xbm'].join(File::Separator), + 'fill'=>blue, 'tags'=>$tag_item ) TkcText.new(cvs, '25c', '8.2c', 'text'=>'テキスト', 'anchor'=>'n') TkcRectangle.new(cvs, '22.4c','8.9c','22.6c','9.1c') TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c', - 'text'=>'短いテキスト。ワードラップ、左揃え、アンカーは北(上)。□は各テキストのアンカーポイントを示す。', 'tags'=>$tag_item ) + 'text'=>'短いテキスト。ワードラップ、左揃え、アンカーは北(上)。□は各テキストのアンカーポイントを示す。', 'tags'=>$tag_item ) TkcRectangle.new(cvs, '25.4c','10.9c','25.6c','11.1c') TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue, - 'text'=>"いくつかの行。\nそれぞれ独立に\n行揃え。\n全て左端がアンカーされている。", 'justify'=>'center', 'tags'=>$tag_item ) + 'text'=>"いくつかの行。\nそれぞれ独立に\n行揃え。\n全て左端がアンカーされている。", 'justify'=>'center', 'tags'=>$tag_item ) TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c') if $tk_version =~ /^4\.[01]/ TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, - 'stipple'=>'@' + [$demo_dir, '..', + 'stipple'=>'@' + [$demo_dir, '..', 'images', 'grey.5'].join(File::Separator), - 'text'=>'Stippled characters', 'tags'=>$tag_item ) + 'text'=>'Stippled characters', 'tags'=>$tag_item ) else TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, - 'stipple'=>'gray50', 'text'=>'Stippled characters', - 'tags'=>$tag_item ) + 'stipple'=>'gray50', 'text'=>'Stippled characters', + 'tags'=>$tag_item ) end TkcText.new(cvs, '5c', '16.2c', 'text'=>'弧', 'anchor'=>'n') TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black', - 'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item) + 'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item) #TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', -# 'outline'=>blue, 'start'=>135, 'extent'=>270, -# 'outlinestipple'=>'@' + ['images', 'grey.25'].join(File::Separator), -# 'tags'=>$tag_item) +# 'outline'=>blue, 'start'=>135, 'extent'=>270, +# 'outlinestipple'=>'@' + ['images', 'grey.25'].join(File::Separator), +# 'tags'=>$tag_item) TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', - 'outline'=>blue, 'start'=>135, 'extent'=>270, - 'outlinestipple'=>'@'+[$demo_dir, '..', + 'outline'=>blue, 'start'=>135, 'extent'=>270, + 'outlinestipple'=>'@'+[$demo_dir, '..', 'images','gray25.xbm'].join(File::Separator), - 'tags'=>$tag_item) + 'tags'=>$tag_item) TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice', - 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90, - 'tags'=>$tag_item) + 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90, + 'tags'=>$tag_item) TkcArc.new(cvs, '5.5c','20.5c','9.5c','23.5c', 'width'=>'4m', 'style'=>'chord', - 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270, - 'tags'=>$tag_item) + 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270, + 'tags'=>$tag_item) TkcText.new(cvs, '15c', '16.2c', 'text'=>'ビットマップ', 'anchor'=>'n') #TkcBitmap.new(cvs, '13c','20c', -# 'bitmap'=>'@' + ['images', 'face'].join(File::Separator), -# 'tags'=>$tag_item) +# 'bitmap'=>'@' + ['images', 'face'].join(File::Separator), +# 'tags'=>$tag_item) TkcBitmap.new(cvs, '13c','20c', - 'bitmap'=>'@' + [$demo_dir, '..', + 'bitmap'=>'@' + [$demo_dir, '..', 'images', 'face.xbm'].join(File::Separator), - 'tags'=>$tag_item) + 'tags'=>$tag_item) #TkcBitmap.new(cvs, '17c','18.5c', -# 'bitmap'=>'@' + ['images', 'noletters'].join(File::Separator), -# 'tags'=>$tag_item) +# 'bitmap'=>'@' + ['images', 'noletters'].join(File::Separator), +# 'tags'=>$tag_item) TkcBitmap.new(cvs, '17c','18.5c', - 'bitmap'=>'@' + [$demo_dir, '..', - 'images', 'noletter.xbm'].join(File::Separator), - 'tags'=>$tag_item) + 'bitmap'=>'@' + [$demo_dir, '..', + 'images', 'noletter.xbm'].join(File::Separator), + 'tags'=>$tag_item) #TkcBitmap.new(cvs, '17c','21.5c', -# 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator), -# 'tags'=>$tag_item) +# 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator), +# 'tags'=>$tag_item) # ↓の形式でも可能 TkcBitmap.new(cvs, '17c','21.5c') { bitmap '@' + [$demo_dir, '..', 'images', 'letters.xbm'].join(File::Separator) @@ -246,17 +246,17 @@ TkButton.new(cvs) {|b| text '押してね' command proc{butPress cvs, red} TkcWindow.new(cvs, '21c','18c', - 'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item) + 'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item) } TkEntry.new(cvs, 'width'=>20, 'relief'=>'sunken') {|e| insert 'end', '編集してね' TkcWindow.new(cvs, '21c','21c', - 'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item) + 'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item) } TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c', - 'width'=>'.5c', 'tickinterval'=>0 ) {|scl| + 'width'=>'.5c', 'tickinterval'=>0 ) {|scl| TkcWindow.new(cvs, '28.5c','17.5c', - 'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item) + 'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item) } TkcText.new(cvs, '21c', '17.9c', 'text'=>'ボタン:', 'anchor'=>'sw') TkcText.new(cvs, '21c', '20.9c', 'text'=>'エントリ:', 'anchor'=>'sw') @@ -321,7 +321,7 @@ def itemStroke(c,x,y) if $areaX1 != x && $areaY1 != y c.delete 'area' c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y, - '-outline', 'black') + '-outline', 'black') $areaX2 = x $areaY2 = y end @@ -366,6 +366,6 @@ end def butPress(w,color) i = TkcText.new(w, '25c', '18.1c', - 'text'=>'いてて!!', 'fill'=>color, 'anchor'=>'n') + 'text'=>'いてて!!', 'fill'=>color, 'anchor'=>'n') Tk.after(500, proc{w.delete i}) end diff --git a/ext/tk/sample/demos-jp/label.rb b/ext/tk/sample/demos-jp/label.rb index 425654216c..59626289fc 100644 --- a/ext/tk/sample/demos-jp/label.rb +++ b/ext/tk/sample/demos-jp/label.rb @@ -47,12 +47,12 @@ TkFrame.new($label_demo) {|frame| f_left = TkFrame.new($label_demo) f_right = TkFrame.new($label_demo) [f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes', - 'padx'=>10, 'pady'=>10, 'fill'=>'both')} + 'padx'=>10, 'pady'=>10, 'fill'=>'both')} # label 生成 [ TkLabel.new(f_left, 'text'=>'最初のラベル'), TkLabel.new(f_left, 'text'=>'2 番目。ちょっと浮き上がらせてみました', - 'relief'=>'raised'), + 'relief'=>'raised'), TkLabel.new(f_left, 'text'=>'3 番目。沈んでいます ', 'relief'=>'sunken') ].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')} diff --git a/ext/tk/sample/demos-jp/labelframe.rb b/ext/tk/sample/demos-jp/labelframe.rb index 8f76ffacfb..23c974dcc2 100644 --- a/ext/tk/sample/demos-jp/labelframe.rb +++ b/ext/tk/sample/demos-jp/labelframe.rb @@ -19,8 +19,8 @@ $labelframe_demo = TkToplevel.new {|w| # Some information TkLabel.new($labelframe_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) + :font=>$font, :wraplength=>'4i', :justify=>:left, + :text=><<EOL).pack(:side=>:top) TkLabelFrame ウィジェットは関連する widget 群をまとめて取り扱うために用いられます。ラ ベルは通常の文字列でも何らかのウィジェット @@ -38,28 +38,28 @@ TkFrame.new($labelframe_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ - $labelframe_demo.destroy - $labelframe_demo = nil - }).pack(:side=>:left, :expand=>true) + $labelframe_demo.destroy + $labelframe_demo = nil + }).pack(:side=>:left, :expand=>true) TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ - showCode 'labelframe' - }).pack(:side=>:left, :expand=>true) + showCode 'labelframe' + }).pack(:side=>:left, :expand=>true) } # Demo area w = TkFrame.new($labelframe_demo).pack(:side=>:bottom, :fill=>:both, - :expand=>true) + :expand=>true) # A group of radiobuttons in a labelframe TkLabelFrame.new(w, :text=>'選択値', - :padx=>2, :pady=>2) {|f| + :padx=>2, :pady=>2) {|f| grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m') v = TkVariable.new (1..4).each{|i| TkRadiobutton.new(f, :text=>"This is value #{i}", - :variable=>v, :value=>i) { + :variable=>v, :value=>i) { pack(:side=>:top, :fill=>:x, :pady=>2) } } @@ -82,7 +82,7 @@ end TkLabelFrame.new(w, :pady=>2, :padx=>2){|f| TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy, - :text=>"オプションを使用", :padx=>0) {|cb| + :text=>"オプションを使用", :padx=>0) {|cb| command proc{lfEnableButtons(f)} f.labelwidget(cb) } diff --git a/ext/tk/sample/demos-jp/menu.rb b/ext/tk/sample/demos-jp/menu.rb index 79d5b3d4ca..50152cead3 100644 --- a/ext/tk/sample/demos-jp/menu.rb +++ b/ext/tk/sample/demos-jp/menu.rb @@ -79,8 +79,8 @@ TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|m| ['A','B','C','D','E','F','G'].each{|c| # add('command', 'label'=>"文字 \"#{c}\" を印字", 'underline'=>4, add('command', 'label'=>"Print letter \"#{c}\" (文字 \"#{c}\" を印字)", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", - 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") + 'underline'=>14, 'accelerator'=>"Meta+#{c}", + 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } } @@ -91,17 +91,17 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m| TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| m.configure('menu'=>cascade_menu) add('command', 'label'=>'Print hello(こんにちは)', - 'command'=>proc{print "Hello(こんにちは)\n"}, - 'accelerator'=>"#{modifier}+H", 'underline'=>6) + 'command'=>proc{print "Hello(こんにちは)\n"}, + 'accelerator'=>"#{modifier}+H", 'underline'=>6) $menu_demo.bind("#{modifier}-h", proc{print "Hello(こんにちは)\n"}) add('command', 'label'=>'Print goodbye(さようなら)', - 'command'=>proc{print "Goodbye(さようなら)\n"}, - 'accelerator'=>"#{modifier}+G", 'underline'=>6) + 'command'=>proc{print "Goodbye(さようなら)\n"}, + 'accelerator'=>"#{modifier}+G", 'underline'=>6) $menu_demo.bind("#{modifier}-g", proc{print "Goodbye(さようなら)\n"}) TkMenu.new(m, 'tearoff'=>false) {|cascade_check| cascade_menu.add('cascade', 'label'=>'Check buttons(チェックボタン)', - 'menu'=>cascade_check, 'underline'=>0) + 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'オイル点検', 'variable'=>oil) trans = TkVariable.new(0) @@ -112,18 +112,18 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m| add('check', 'label'=>'ライト点検', 'variable'=>lights) add('separator') add('command', 'label'=>'現在の値を表示', - 'command'=>proc{showVars($menu_demo, - ['オイル点検', oil], - ['トランスミッション点検', trans], - ['ブレーキ点検', brakes], - ['ライト点検', lights])} ) + 'command'=>proc{showVars($menu_demo, + ['オイル点検', oil], + ['トランスミッション点検', trans], + ['ブレーキ点検', brakes], + ['ライト点検', lights])} ) invoke 1 invoke 3 } TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| cascade_menu.add('cascade', 'label'=>'Radio buttons(ラジオボタン)', - 'menu'=>cascade_radio, 'underline'=>0) + 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new add('radio', 'label'=>'10 ポイント', 'variable'=>pointSize, 'value'=>10) add('radio', 'label'=>'14 ポイント', 'variable'=>pointSize, 'value'=>14) @@ -137,9 +137,9 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m| add('radio', 'label'=>'イタリック', 'variable'=>style, 'value'=>'italic') add('separator') add('command', 'label'=>'現在の値を表示', - 'command'=>proc{showVars($menu_demo, - ['ポイントサイズ', pointSize], - ['スタイル', style])} ) + 'command'=>proc{showVars($menu_demo, + ['ポイントサイズ', pointSize], + ['スタイル', style])} ) invoke 1 invoke 7 } @@ -151,15 +151,15 @@ TkMenubutton.new($menu_frame, 'text'=>'Icons', 'underline'=>0) {|m| TkMenu.new(m, 'tearoff'=>false) {|icon_menu| m.configure('menu'=>icon_menu) add('command', - 'bitmap'=>'@'+[$demo_dir,'..', - 'images','pattern.xbm'].join(File::Separator), - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'了解')} ) + 'bitmap'=>'@'+[$demo_dir,'..', + 'images','pattern.xbm'].join(File::Separator), + 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', + 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。', + 'bitmap'=>'', 'default'=>0, + 'buttons'=>'了解')} ) ['info', 'questhead', 'error'].each{|icon| add('command', 'bitmap'=>icon, - 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) + 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) } } } @@ -171,7 +171,7 @@ TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|m| [ 'エントリ','別のエントリ','何もしない','ほとんど何もしない', '人生を意義あるものに' ].each{|i| add('command', 'label'=>i, - 'command'=>proc{print "You invoked \"#{i}\"\n"}) + 'command'=>proc{print "You invoked \"#{i}\"\n"}) } } } @@ -182,7 +182,7 @@ TkMenubutton.new($menu_frame, 'text'=>'Colors', 'underline'=>0) {|m| m.configure('menu'=>colors_menu) ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| add('command', 'label'=>c, 'background'=>c, - 'command'=>proc{print "You invoked \"#{c}\"\n"}) + 'command'=>proc{print "You invoked \"#{c}\"\n"}) } } } diff --git a/ext/tk/sample/demos-jp/menu84.rb b/ext/tk/sample/demos-jp/menu84.rb index 78d4e68872..8c2a815d78 100644 --- a/ext/tk/sample/demos-jp/menu84.rb +++ b/ext/tk/sample/demos-jp/menu84.rb @@ -35,9 +35,9 @@ TkLabel.new($menu84_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { 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') + 'bd'=>1, 'font'=>['Helvetica', '10'], + 'anchor'=>'w').pack('side'=>'left', 'padx'=>2, + 'expand'=>true, 'fill'=>'both') pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) } @@ -92,8 +92,8 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| 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}") + 'underline'=>14, 'accelerator'=>"Meta+#{c}", + 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } } @@ -111,7 +111,7 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| TkMenu.new(m, 'tearoff'=>false) {|cascade_check| m.add('cascade', 'label'=>'Check button', - 'menu'=>cascade_check, 'underline'=>0) + 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'オイル検査', 'variable'=>oil) trans = TkVariable.new(0) @@ -122,18 +122,18 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| add('check', 'label'=>'ライト検査', 'variable'=>lights) add('separator') add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['オイル', oil], - ['トランスミッション', trans], - ['ブレーキ', brakes], - ['ライト', lights])} ) + 'command'=>proc{showVars($menu84_demo, + ['オイル', oil], + ['トランスミッション', trans], + ['ブレーキ', brakes], + ['ライト', lights])} ) invoke 1 invoke 3 } TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| m.add('cascade', 'label'=>'Radio buttons', - 'menu'=>cascade_radio, 'underline'=>0) + '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) @@ -147,9 +147,9 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') add('separator') add('command', 'label'=>'現在値の表示', - 'command'=>proc{showVars($menu84_demo, - ['pointSize', pointSize], - ['style', style])} ) + 'command'=>proc{showVars($menu84_demo, + ['pointSize', pointSize], + ['style', style])} ) invoke 1 invoke 7 } @@ -159,14 +159,14 @@ 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.xbm'].join(File::Separator), + 'images','pattern.xbm'].join(File::Separator), 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'あなたが選択したメニュー項目は、文字列の代わりにビットマップイメージで項目を表示したものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'閉じる')} ) + 'text'=>'あなたが選択したメニュー項目は、文字列の代わりにビットマップイメージで項目を表示したものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', + 'bitmap'=>'', 'default'=>0, + 'buttons'=>'閉じる')} ) ['info', 'questhead', 'error'].each{|icon| add('command', 'bitmap'=>icon, 'hidemargin'=>1, - 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) + 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) } entryconfigure(2, :columnbreak=>true) @@ -177,34 +177,34 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| [ '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"}) + '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'=>'あなたが選択したメニュー項目は、ビットマップイメージと文字列とを同時に一つの項目に表示するようにしたものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', - 'buttons'=>['了解'], 'bitmap'=>'') - }) + 'bitmap'=>'questhead', 'compound'=>'left', + 'command'=>proc{ + TkDialog.new('title'=>'Compound Menu Entry', + 'message'=>'あなたが選択したメニュー項目は、ビットマップイメージと文字列とを同時に一つの項目に表示するようにしたものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', + 'buttons'=>['了解'], '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"}) + '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') + begin + label = w.entrycget('active', 'label') + rescue + label = " " + end + menustatus.value = label + Tk.update(true) + }, '%W') diff --git a/ext/tk/sample/demos-jp/menu8x.rb b/ext/tk/sample/demos-jp/menu8x.rb index e2f477da8b..ab691a42b5 100644 --- a/ext/tk/sample/demos-jp/menu8x.rb +++ b/ext/tk/sample/demos-jp/menu8x.rb @@ -56,7 +56,7 @@ TkLabel.new($menu8x_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { $menu8xstatus = TkVariable.new(" ") TkFrame.new($menu8x_demo) {|frame| TkLabel.new(frame, 'textvariable'=>$menu8xstatus, 'relief'=>'sunken', - 'bd'=>1, 'font'=>['Helvetica', '10'], 'anchor'=>'w')\ + 'bd'=>1, 'font'=>['Helvetica', '10'], 'anchor'=>'w')\ .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) @@ -107,8 +107,8 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| ['A','B','C','D','E','F','G'].each{|c| # add('command', 'label'=>"文字 \"#{c}\" を印字", 'underline'=>4, add('command', 'label'=>"Print letter \"#{c}\" (文字 \"#{c}\" を印字)", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", - 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") + 'underline'=>14, 'accelerator'=>"Meta+#{c}", + 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu8x_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } } @@ -116,17 +116,17 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| m.add('cascade', 'label'=>'Cascades', 'menu'=>cascade_menu, 'underline'=>0) add('command', 'label'=>'Print hello(こんにちは)', - 'command'=>proc{print "Hello(こんにちは)\n"}, - 'accelerator'=>"#{modifier}+H", 'underline'=>6) + 'command'=>proc{print "Hello(こんにちは)\n"}, + 'accelerator'=>"#{modifier}+H", 'underline'=>6) $menu8x_demo.bind("#{modifier}-h", proc{print "Hello(こんにちは)\n"}) add('command', 'label'=>'Print goodbye(さようなら)', - 'command'=>proc{print "Goodbye(さようなら)\n"}, - 'accelerator'=>"#{modifier}+G", 'underline'=>6) + 'command'=>proc{print "Goodbye(さようなら)\n"}, + 'accelerator'=>"#{modifier}+G", 'underline'=>6) $menu8x_demo.bind("#{modifier}-g", proc{print "Goodbye(さようなら)\n"}) TkMenu.new(m, 'tearoff'=>false) {|cascade_check| cascade_menu.add('cascade', 'label'=>'Check buttons(チェックボタン)', - 'menu'=>cascade_check, 'underline'=>0) + 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'オイル点検', 'variable'=>oil) trans = TkVariable.new(0) @@ -137,18 +137,18 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| add('check', 'label'=>'ライト点検', 'variable'=>lights) add('separator') add('command', 'label'=>'現在の値を表示', - 'command'=>proc{showVars($menu8x_demo, - ['オイル点検', oil], - ['トランスミッション点検', trans], - ['ブレーキ点検', brakes], - ['ライト点検', lights])} ) + 'command'=>proc{showVars($menu8x_demo, + ['オイル点検', oil], + ['トランスミッション点検', trans], + ['ブレーキ点検', brakes], + ['ライト点検', lights])} ) invoke 1 invoke 3 } TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| cascade_menu.add('cascade', 'label'=>'Radio buttons(ラジオボタン)', - 'menu'=>cascade_radio, 'underline'=>0) + 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new add('radio', 'label'=>'10 ポイント', 'variable'=>pointSize, 'value'=>10) add('radio', 'label'=>'14 ポイント', 'variable'=>pointSize, 'value'=>14) @@ -162,9 +162,9 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| add('radio', 'label'=>'イタリック', 'variable'=>style, 'value'=>'italic') add('separator') add('command', 'label'=>'現在の値を表示', - 'command'=>proc{showVars($menu8x_demo, - ['ポイントサイズ', pointSize], - ['スタイル', style])} ) + 'command'=>proc{showVars($menu8x_demo, + ['ポイントサイズ', pointSize], + ['スタイル', style])} ) invoke 1 invoke 7 } @@ -173,16 +173,16 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| TkMenu.new(m, 'tearoff'=>false) {|icon_menu| m.add('cascade', 'label'=>'Icons', 'menu'=>icon_menu, 'underline'=>0) add('command', - 'bitmap'=>'@'+[$demo_dir,'..', - 'images','pattern.xbm'].join(File::Separator), - 'hidemargin'=>1, - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'了解')} ) + 'bitmap'=>'@'+[$demo_dir,'..', + 'images','pattern.xbm'].join(File::Separator), + 'hidemargin'=>1, + 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', + 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。', + 'bitmap'=>'', 'default'=>0, + 'buttons'=>'了解')} ) ['info', 'questhead', 'error'].each{|icon| add('command', 'bitmap'=>icon, 'hidemargin'=>1, - 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) + 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) } entryconfigure(2, 'columnbreak'=>1) @@ -193,7 +193,7 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| [ 'エントリ','別のエントリ','何もしない','ほとんど何もしない', '人生を意義あるものに' ].each{|i| add('command', 'label'=>i, - 'command'=>proc{print "You invoked \"#{i}\"\n"}) + 'command'=>proc{print "You invoked \"#{i}\"\n"}) } } @@ -201,7 +201,7 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| m.add('cascade', 'label'=>'Colors', 'menu'=>colors_menu, 'underline'=>1) ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| add('command', 'label'=>c, 'background'=>c, - 'command'=>proc{print "You invoked \"#{c}\"\n"}) + 'command'=>proc{print "You invoked \"#{c}\"\n"}) } } @@ -209,14 +209,14 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| } TkMenu.bind('<MenuSelect>', - proc{|w| - begin - label = w.entrycget('active', 'label') - rescue - label = ' ' - end - $menu8xstatus.value = label - Tk.update('idletasks') - }, '%W') + proc{|w| + begin + label = w.entrycget('active', 'label') + rescue + label = ' ' + end + $menu8xstatus.value = label + Tk.update('idletasks') + }, '%W') end ; # Tk 8.x diff --git a/ext/tk/sample/demos-jp/menubu.rb b/ext/tk/sample/demos-jp/menubu.rb index 1308014183..aa90a3087f 100644 --- a/ext/tk/sample/demos-jp/menubu.rb +++ b/ext/tk/sample/demos-jp/menubu.rb @@ -187,7 +187,7 @@ TkFrame.new(center) {|f| menubuttonoptions = TkVariable.new mbutton = TkMenubutton.new(f) options = optionMenu(mbutton, menubuttonoptions, - 'one', 'two', 'three') + 'one', 'two', 'three') mbutton.pack('side'=>'left', 'padx'=>25, 'pady'=>25) paletteColor = TkVariable.new colors = ['Black','red4','DarkGreen','NavyBlue', 'gray75', diff --git a/ext/tk/sample/demos-jp/msgbox.rb b/ext/tk/sample/demos-jp/msgbox.rb index 03ab1f7dbe..983e6b6589 100644 --- a/ext/tk/sample/demos-jp/msgbox.rb +++ b/ext/tk/sample/demos-jp/msgbox.rb @@ -17,7 +17,7 @@ $msgbox_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($msgbox_demo, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"表示するアイコンとメッセージボックスの種類を選んで下さい。そして \"メッセージボックス\" ボタンを押すと、指定したメッセージボックスが表示されます。").pack('side'=>'top') + 'text'=>"表示するアイコンとメッセージボックスの種類を選んで下さい。そして \"メッセージボックス\" ボタンを押すと、指定したメッセージボックスが表示されます。").pack('side'=>'top') # frame 生成 TkFrame.new($msgbox_demo) {|frame| @@ -46,9 +46,9 @@ TkFrame.new($msgbox_demo) {|frame| $msgbox_leftframe = TkFrame.new($msgbox_demo) $msgbox_rightframe = TkFrame.new($msgbox_demo) $msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', - 'pady'=>'.5c', 'padx'=>'.5c') + 'pady'=>'.5c', 'padx'=>'.5c') $msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', - 'pady'=>'.5c', 'padx'=>'.5c') + 'pady'=>'.5c', 'padx'=>'.5c') TkLabel.new($msgbox_leftframe, 'text'=>'アイコン').pack('side'=>'top') TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ @@ -57,9 +57,9 @@ TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ $msgboxIcon = TkVariable.new('info') ['error', 'info', 'question', 'warning'].each {|icon| TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, - 'relief'=>'flat', 'value'=>icon, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, - 'anchor'=>'w', 'fill'=>'x') + 'relief'=>'flat', 'value'=>icon, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + 'anchor'=>'w', 'fill'=>'x') } TkLabel.new($msgbox_rightframe, 'text'=>'種類').pack('side'=>'top') @@ -70,17 +70,17 @@ $msgboxType = TkVariable.new('ok') ['abortretryignore', 'ok', 'okcancel', 'retrycancel', 'yesno', 'yesnocancel'].each {|type| TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, - 'relief'=>'flat', 'value'=>type, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, - 'anchor'=>'w', 'fill'=>'x') + 'relief'=>'flat', 'value'=>type, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + 'anchor'=>'w', 'fill'=>'x') } def showMessageBox(w) button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, - 'title'=>'Message', 'parent'=>w, - 'message'=>"これは \"#{$msgboxType.value}\" という種類のメッセージボックスで、\"#{$msgboxIcon.value}\" のアイコンが表示されています。") + 'title'=>'Message', 'parent'=>w, + 'message'=>"これは \"#{$msgboxType.value}\" という種類のメッセージボックスで、\"#{$msgboxIcon.value}\" のアイコンが表示されています。") Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, - 'message'=>"あなたは \"#{button}\" を押しましたね。") + 'message'=>"あなたは \"#{button}\" を押しましたね。") end diff --git a/ext/tk/sample/demos-jp/paned1.rb b/ext/tk/sample/demos-jp/paned1.rb index cd51e34aa0..8d16d03c08 100644 --- a/ext/tk/sample/demos-jp/paned1.rb +++ b/ext/tk/sample/demos-jp/paned1.rb @@ -17,8 +17,8 @@ $paned1_demo = TkToplevel.new {|w| } TkLabel.new($paned1_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) + :font=>$font, :wraplength=>'4i', :justify=>:left, + :text=><<EOL).pack(:side=>:top) 下の色付けされた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。 もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない 場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような @@ -31,13 +31,13 @@ TkFrame.new($paned1_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ - $paned1_demo.destroy - $paned1_demo = nil - }).pack(:side=>:left, :expand=>true) + $paned1_demo.destroy + $paned1_demo = nil + }).pack(:side=>:left, :expand=>true) TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ - showCode 'paned1' - }).pack(:side=>:left, :expand=>true) + showCode 'paned1' + }).pack(:side=>:left, :expand=>true) } TkPanedwindow.new($paned1_demo){|f| diff --git a/ext/tk/sample/demos-jp/paned2.rb b/ext/tk/sample/demos-jp/paned2.rb index c6b0f06914..1e82eddda4 100644 --- a/ext/tk/sample/demos-jp/paned2.rb +++ b/ext/tk/sample/demos-jp/paned2.rb @@ -17,8 +17,8 @@ $paned2_demo = TkToplevel.new {|w| } TkLabel.new($paned2_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) + :font=>$font, :wraplength=>'4i', :justify=>:left, + :text=><<EOL).pack(:side=>:top) 下のスクロールバー付きのウィジェットが置かれた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。 もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない 場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような @@ -31,13 +31,13 @@ TkFrame.new($paned2_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ - $paned2_demo.destroy - $paned2_demo = nil - }).pack(:side=>:left, :expand=>true) + $paned2_demo.destroy + $paned2_demo = nil + }).pack(:side=>:left, :expand=>true) TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ - showCode 'paned2' - }).pack(:side=>:left, :expand=>true) + showCode 'paned2' + }).pack(:side=>:left, :expand=>true) } paneList = TkVariable.new # define as normal variable (not array) @@ -68,29 +68,29 @@ TkPanedwindow.new($paned2_demo, :orient=>:vertical){|f| pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m') add(TkFrame.new(f){|paned2_top| - TkListbox.new(paned2_top, :listvariable=>paneList) { - # Invert the first item to highlight it - itemconfigure(0, :background=>self.cget(:foreground), - :foreground=>self.cget(:background) ) - yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, - :fill=>:y)) - pack(:fill=>:both, :expand=>true) - } + TkListbox.new(paned2_top, :listvariable=>paneList) { + # Invert the first item to highlight it + itemconfigure(0, :background=>self.cget(:foreground), + :foreground=>self.cget(:background) ) + yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, + :fill=>:y)) + pack(:fill=>:both, :expand=>true) + } }, TkFrame.new(f, :height=>120) {|paned2_bottom| - # The bottom window is a text widget with scrollbar - paned2_xscr = TkScrollbar.new(paned2_bottom) - paned2_yscr = TkScrollbar.new(paned2_bottom) - paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) { - insert('1.0', 'ここに配置されているのは、' + - 'ごく普通のテキストウィジェットです。') - xscrollbar(paned2_xscr) - yscrollbar(paned2_yscr) - } - Tk.grid(paned2_text, paned2_yscr, :sticky=>'nsew') - Tk.grid(paned2_xscr, :sticky=>'nsew') - TkGrid.columnconfigure(paned2_bottom, 0, :weight=>1) - TkGrid.rowconfigure(paned2_bottom, 0, :weight=>1) + # The bottom window is a text widget with scrollbar + paned2_xscr = TkScrollbar.new(paned2_bottom) + paned2_yscr = TkScrollbar.new(paned2_bottom) + paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) { + insert('1.0', 'ここに配置されているのは、' + + 'ごく普通のテキストウィジェットです。') + xscrollbar(paned2_xscr) + yscrollbar(paned2_yscr) + } + Tk.grid(paned2_text, paned2_yscr, :sticky=>'nsew') + Tk.grid(paned2_xscr, :sticky=>'nsew') + TkGrid.columnconfigure(paned2_bottom, 0, :weight=>1) + TkGrid.rowconfigure(paned2_bottom, 0, :weight=>1) } ) } diff --git a/ext/tk/sample/demos-jp/plot.rb b/ext/tk/sample/demos-jp/plot.rb index c8025d8bf9..902b144f72 100644 --- a/ext/tk/sample/demos-jp/plot.rb +++ b/ext/tk/sample/demos-jp/plot.rb @@ -17,7 +17,7 @@ $plot_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($plot_demo, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"このウィンドウは簡単な2次元のプロットを含んだキャンバス widgetです。表示された点をマウスボタン1でドラッグしてデータをいじることができます。"){ + 'text'=>"このウィンドウは簡単な2次元のプロットを含んだキャンバス widgetです。表示された点をマウスボタン1でドラッグしてデータをいじることができます。"){ pack('side'=>'top') } @@ -51,39 +51,39 @@ $plot_canvas.pack('side'=>'top', 'fill'=>'x') TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2) TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2) TkcText.new($plot_canvas, 225, 20, - 'text'=>"簡単なプロット", 'font'=>plotFont, 'fill'=>'brown') + 'text'=>"簡単なプロット", 'font'=>plotFont, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) TkcLine.new($plot_canvas, x, 250, x, 245, 'width'=>2) TkcText.new($plot_canvas, x, 254, - 'text'=>10*i, 'font'=>plotFont, 'anchor'=>'n') + 'text'=>10*i, 'font'=>plotFont, 'anchor'=>'n') } (0..5).each {|i| y = 250 - (i * 40) TkcLine.new($plot_canvas, 100, y, 105, y, 'width'=>2) TkcText.new($plot_canvas, 96, y, - 'text'=>"#{i*50}.0", 'font'=>plotFont, 'anchor'=>'e') + 'text'=>"#{i*50}.0", 'font'=>plotFont, 'anchor'=>'e') } for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] x = 100 + (3*xx) y = 250 - (4*yy)/5 item = TkcOval.new($plot_canvas, x-6, y-6, x+6, y+6, - 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') + 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') item.addtag 'point' end $plot_canvas.itembind('point', 'Any-Enter', - proc{$plot_canvas.itemconfigure 'current','fill','red'}) + proc{$plot_canvas.itemconfigure 'current','fill','red'}) $plot_canvas.itembind('point', 'Any-Leave', - proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'}) + proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'}) $plot_canvas.itembind('point', '1', - proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y") + proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y") $plot_canvas.itembind('point', 'ButtonRelease-1', - proc{$plot_canvas.dtag 'selected'}) + proc{$plot_canvas.dtag 'selected'}) $plot_canvas.bind('B1-Motion', - proc{|x,y| plotMove $plot_canvas,x,y}, "%x %y") + proc{|x,y| plotMove $plot_canvas,x,y}, "%x %y") $plot = {'lastX'=>0, 'lastY'=>0} @@ -92,8 +92,8 @@ $plot = {'lastX'=>0, 'lastY'=>0} # data points. It sets up state to allow the point to be dragged. # # Arguments: -# w - The canvas window. -# x, y - The coordinates of the mouse press. +# w - The canvas window. +# x, y - The coordinates of the mouse press. def plotDown (w, x, y) w.dtag 'selected' @@ -108,8 +108,8 @@ end # current item. # # Arguments: -# w - The canvas window. -# x, y - The coordinates of the mouse. +# w - The canvas window. +# x, y - The coordinates of the mouse. def plotMove (w, x, y) w.move 'selected', x - $plot['lastX'], y - $plot['lastY'] diff --git a/ext/tk/sample/demos-jp/puzzle.rb b/ext/tk/sample/demos-jp/puzzle.rb index afef8fcb09..ad69775aab 100644 --- a/ext/tk/sample/demos-jp/puzzle.rb +++ b/ext/tk/sample/demos-jp/puzzle.rb @@ -89,7 +89,7 @@ order = [3,1,6,2,5,7,15,13,4,11,8,9,14,10,12] highlightthickness 0 command def_puzzleswitch_proc(w, num) }.place('relx'=>$xpos[num], 'rely'=>$ypos[num], - 'relwidth'=>0.25, 'relheight'=>0.25) + 'relwidth'=>0.25, 'relheight'=>0.25) } $xpos['space'] = 0.75 $ypos['space'] = 0.75 @@ -101,9 +101,9 @@ def puzzleSwitch(w, num) && ($xpos[num] >= ($xpos['space'] - 0.26)) \ && ($xpos[num] <= ($xpos['space'] + 0.26))) \ || (($xpos[num] >= ($xpos['space'] - 0.01)) \ - && ($xpos[num] <= ($xpos['space'] + 0.01)) \ - && ($ypos[num] >= ($ypos['space'] - 0.26)) \ - && ($ypos[num] <= ($ypos['space'] + 0.26))) + && ($xpos[num] <= ($xpos['space'] + 0.01)) \ + && ($ypos[num] >= ($ypos['space'] - 0.26)) \ + && ($ypos[num] <= ($ypos['space'] + 0.26))) tmp = $xpos['space'] $xpos['space'] = $xpos[num] $xpos[num] = tmp diff --git a/ext/tk/sample/demos-jp/radio2.rb b/ext/tk/sample/demos-jp/radio2.rb index c7b98e6312..5ac877d99a 100644 --- a/ext/tk/sample/demos-jp/radio2.rb +++ b/ext/tk/sample/demos-jp/radio2.rb @@ -55,18 +55,18 @@ TkFrame.new($radio2_demo) {|frame| text '変数参照' command proc{ showVars($radio2_demo, - ['size', size], ['color', color], ['compound', align]) + ['size', size], ['color', color], ['compound', align]) } }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # frame f_left = TkLabelFrame.new($radio2_demo, 'text'=>'文字サイズ', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_mid = TkLabelFrame.new($radio2_demo, 'text'=>'色', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_right = TkLabelFrame.new($radio2_demo, 'text'=>'ビットマップ配置', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') @@ -92,14 +92,14 @@ f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') } label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead', - 'compound'=>'left') + 'compound'=>'left') label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') label.height(TkWinfo.reqheight(label)) abtn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a| lower = a.downcase TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', - 'value'=>lower, 'indicatoron'=>0, 'width'=>7, - 'command'=>proc{label.compound(align.value)}) + 'value'=>lower, 'indicatoron'=>0, 'width'=>7, + 'command'=>proc{label.compound(align.value)}) } Tk.grid('x', abtn[0]) diff --git a/ext/tk/sample/demos-jp/radio3.rb b/ext/tk/sample/demos-jp/radio3.rb index bdc3ee0bf5..6e9a0f750b 100644 --- a/ext/tk/sample/demos-jp/radio3.rb +++ b/ext/tk/sample/demos-jp/radio3.rb @@ -36,43 +36,43 @@ align = TkVariable.new # frame TkFrame.new($radio3_demo) {|frame| TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), - :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) + :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - TkButton.new(frame, :text=>'変数参照', - :image=>$image['view'], :compound=>:left, - :command=>proc{ - showVars($radio3_demo, ['size', size], - ['color', color], ['compound', align]) - }), - TkButton.new(frame, :text=>'コード参照', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'radio3'}), - TkButton.new(frame, :text=>'閉じる', - :image=>$image['delete'], :compound=>:left, - :command=>proc{ - tmppath = $radio3_demo - $radio3_demo = nil - $showVarsWin[tmppath.path] = nil - tmppath.destroy - }), - :padx=>4, :pady=>4) + TkButton.new(frame, :text=>'変数参照', + :image=>$image['view'], :compound=>:left, + :command=>proc{ + showVars($radio3_demo, ['size', size], + ['color', color], ['compound', align]) + }), + TkButton.new(frame, :text=>'コード参照', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'radio3'}), + TkButton.new(frame, :text=>'閉じる', + :image=>$image['delete'], :compound=>:left, + :command=>proc{ + tmppath = $radio3_demo + $radio3_demo = nil + $showVarsWin[tmppath.path] = nil + tmppath.destroy + }), + :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) TkGrid(frame, :row=>3, :column=>0, :columnspan=>3, :sticky=>'nsew') } # frame f_left = TkLabelFrame.new($radio3_demo, 'text'=>'文字サイズ', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_mid = TkLabelFrame.new($radio3_demo, 'text'=>'色', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_right = TkLabelFrame.new($radio3_demo, 'text'=>'ビットマップ配置', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_left .grid('column'=>0, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2) f_mid .grid('column'=>1, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2) f_right.grid('column'=>2, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c') TkButton.new($radio3_demo, 'text'=>'トライステート', - 'command'=>proc{size.value = 'multi'; color.value = 'multi'}){ + 'command'=>proc{size.value = 'multi'; color.value = 'multi'}){ grid('column'=>2, 'row'=>2, 'pady'=>'.5c', 'padx'=>'.5c') } @@ -100,13 +100,13 @@ TkButton.new($radio3_demo, 'text'=>'トライステート', } label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead', - 'compound'=>'left') + 'compound'=>'left') label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') label.height(TkWinfo.reqheight(label)) a_btn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a| TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', - 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7, - 'command'=>proc{label.compound(align.value)}) + 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7, + 'command'=>proc{label.compound(align.value)}) } Tk.grid('x', a_btn[0]) diff --git a/ext/tk/sample/demos-jp/ruler.rb b/ext/tk/sample/demos-jp/ruler.rb index 5d8c0443c1..94b4c921d3 100644 --- a/ext/tk/sample/demos-jp/ruler.rb +++ b/ext/tk/sample/demos-jp/ruler.rb @@ -7,8 +7,8 @@ # represent a tab stop. # # Arguments: -# c - The canvas window. -# x, y - Coordinates at which to create the tab stop. +# c - The canvas window. +# x, y - Coordinates at which to create the tab stop. def rulerMkTab(c,x,y) v = $demo_rulerInfo @@ -30,7 +30,7 @@ $ruler_demo = TkToplevel.new {|w| # label 生成 TkLabel.new($ruler_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"このキャンバスwidgetはルーラーの模型です。ルーラーの右にあるのはタブストップの井戸で、ここから引っ張ってくることによってタブストップを作ることができます。また、すでにあるタブストップを動かすこともできます。タブストップを上方または下方にかすれて表示されるまでドラッグすると、マウスボタンを離した時にそのタブストップは消えます。"){ + 'text'=>"このキャンバスwidgetはルーラーの模型です。ルーラーの右にあるのはタブストップの井戸で、ここから引っ張ってくることによってタブストップを作ることができます。また、すでにあるタブストップを動かすこともできます。タブストップを上方または下方にかすれて表示されるまでドラッグすると、マウスボタンを離した時にそのタブストップは消えます。"){ pack('side'=>'top') } @@ -60,8 +60,8 @@ $ruler_canvas.pack('side'=>'top', 'fill'=>'x') # 値設定 unless Struct.const_defined?("RulerInfo") $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y, - :top, :bottom, :size, :normalStyle, - :activeStyle, :deleteStyle).new + :top, :bottom, :size, :normalStyle, + :activeStyle, :deleteStyle).new end $demo_rulerInfo.grid = '.25c' $demo_rulerInfo.left = TkWinfo.fpixels($ruler_canvas, '1c') @@ -83,7 +83,7 @@ else end TkcLine.new($ruler_canvas, - '1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1) + '1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1) (0..11).each{|i| x = i+1 TkcLine.new($ruler_canvas, "#{x}c", '1c', "#{x}c", '0.6c', 'width'=>1) @@ -96,22 +96,22 @@ TkcLine.new($ruler_canvas, $rulerTag_well = TkcTag.new($ruler_canvas) $ruler_canvas\ .addtag_withtag($rulerTag_well, - TkcRectangle.new($ruler_canvas, - '13.2c', '1c', '13.8c', '0.5c', - 'outline'=>'black', - 'fill'=>($ruler_canvas\ - .configinfo('background'))[4]) ) + TkcRectangle.new($ruler_canvas, + '13.2c', '1c', '13.8c', '0.5c', + 'outline'=>'black', + 'fill'=>($ruler_canvas\ + .configinfo('background'))[4]) ) $ruler_canvas\ .addtag_withtag($rulerTag_well, - rulerMkTab($ruler_canvas, - TkWinfo.pixels($ruler_canvas, '13.5c'), - TkWinfo.pixels($ruler_canvas, '.65c') ) ) + rulerMkTab($ruler_canvas, + TkWinfo.pixels($ruler_canvas, '13.5c'), + TkWinfo.pixels($ruler_canvas, '.65c') ) ) $rulerTag_well.bind('1', proc{|x,y| rulerNewTab($ruler_canvas,x,y)}, '%x %y') $ruler_canvas.itembind('tab', '1', - proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y') + proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y') $ruler_canvas.bind('B1-Motion', - proc{|x,y| rulerMoveTab($ruler_canvas,x,y)}, '%x %y') + proc{|x,y| rulerMoveTab($ruler_canvas,x,y)}, '%x %y') $ruler_canvas.bind('Any-ButtonRelease-1', proc{rulerReleaseTab($ruler_canvas)}) # rulerNewTab -- @@ -119,8 +119,8 @@ $ruler_canvas.bind('Any-ButtonRelease-1', proc{rulerReleaseTab($ruler_canvas)}) # triangle object and adding tags to it to give it tab behavior. # # Arguments: -# c - The canvas window. -# x, y - The coordinates of the tab stop. +# c - The canvas window. +# x, y - The coordinates of the tab stop. def rulerNewTab(c,x,y) v = $demo_rulerInfo @@ -137,9 +137,9 @@ end # be dragged interactively. # # Arguments: -# c - The canvas widget. -# x, y - The coordinates of the mouse (identifies the point by -# which the tab was picked up for dragging). +# c - The canvas widget. +# x, y - The coordinates of the mouse (identifies the point by +# which the tab was picked up for dragging). def rulerSelectTab(c,x,y) v = $demo_rulerInfo @@ -156,8 +156,8 @@ end # it is about to be dragged out of the ruler. # # Arguments: -# c - The canvas widget. -# x, y - The coordinates of the mouse. +# c - The canvas widget. +# x, y - The coordinates of the mouse. def rulerMoveTab(c,x,y) v = $demo_rulerInfo @@ -184,8 +184,8 @@ end # it was dragged out of the ruler. # # Arguments: -# c - The canvas widget. -# x, y - The coordinates of the mouse. +# c - The canvas widget. +# x, y - The coordinates of the mouse. def rulerReleaseTab(c) v = $demo_rulerInfo diff --git a/ext/tk/sample/demos-jp/sayings.rb b/ext/tk/sample/demos-jp/sayings.rb index bcbdd7a5e7..ce195a0e53 100644 --- a/ext/tk/sample/demos-jp/sayings.rb +++ b/ext/tk/sample/demos-jp/sayings.rb @@ -65,11 +65,11 @@ TkFrame.new($sayings_demo, 'borderwidth'=>10) {|w| else sayings_lbox.grid('row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') sv.grid('row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') sh.grid('row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(w, 0, 'weight'=>1, 'minsize'=>0) TkGrid.columnconfigure(w, 0, 'weight'=>1, 'minsize'=>0) end diff --git a/ext/tk/sample/demos-jp/search.rb b/ext/tk/sample/demos-jp/search.rb index 3ae7de769d..f5268f987f 100644 --- a/ext/tk/sample/demos-jp/search.rb +++ b/ext/tk/sample/demos-jp/search.rb @@ -8,9 +8,9 @@ # not affected, however. # # Arguments: -# w - The window into which to load the file. Must be a -# text widget. -# file - The name of the file to load. Must be readable. +# w - The window into which to load the file. Must be a +# text widget. +# file - The name of the file to load. Must be readable. def textLoadFile(w,file) w.delete('1.0', 'end') @@ -26,10 +26,10 @@ end # apply a given tag to each instance found. # # Arguments: -# w - The window in which to search. Must be a text widget. -# string - The string to search for. The search is done using -# exact matching only; no special characters. -# tag - Tag to apply to each instance of a matching string. +# w - The window in which to search. Must be a text widget. +# string - The string to search for. The search is done using +# exact matching only; no special characters. +# tag - Tag to apply to each instance of a matching string. def textSearch(w, string, tag) tag.remove('0.0', 'end') @@ -50,15 +50,15 @@ end # deleted) then it doesn't reschedule itself. # # Arguments: -# cmd1 - Command to execute when method is called. -# sleep1 - Ms to sleep after executing cmd1 before executing cmd2. -# cmd2 - Command to execute in the *next* invocation of this method. -# sleep2 - Ms to sleep after executing cmd2 before executing cmd1 again. +# cmd1 - Command to execute when method is called. +# sleep1 - Ms to sleep after executing cmd1 before executing cmd2. +# cmd2 - Command to execute in the *next* invocation of this method. +# sleep2 - Ms to sleep after executing cmd2 before executing cmd1 again. def textToggle(cmd1,sleep1,cmd2,sleep2) sleep_list = [sleep2, sleep1] TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep}, - -1, cmd1, cmd2).start(sleep1) + -1, cmd1, cmd2).start(sleep1) end # toplevel widget が存在すれば削除する @@ -96,35 +96,35 @@ $search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # frame 生成 TkFrame.new($search_demo) {|f| TkLabel.new(f, 'text'=>'ファイル名:', - 'width'=>13, 'anchor'=>'w').pack('side'=>'left') + 'width'=>13, 'anchor'=>'w').pack('side'=>'left') $search_fileName = TkVariable.new TkEntry.new(f, 'width'=>40, - 'textvariable'=>$search_fileName) { + 'textvariable'=>$search_fileName) { pack('side'=>'left') bind('Return', proc{textLoadFile($search_text, $search_fileName.value) - $search_string_entry.focus}) + $search_string_entry.focus}) focus } TkButton.new(f, 'text'=>'読み込み', - 'command'=>proc{textLoadFile($search_text, - $search_fileName.value)})\ + 'command'=>proc{textLoadFile($search_text, + $search_fileName.value)})\ .pack('side'=>'left', 'pady'=>5, 'padx'=>10) }.pack('side'=>'top', 'fill'=>'x') TkFrame.new($search_demo) {|f| TkLabel.new(f, 'text'=>'検索文字列:', - 'width'=>13, 'anchor'=>'w').pack('side'=>'left') + 'width'=>13, 'anchor'=>'w').pack('side'=>'left') $search_searchString = TkVariable.new $search_string_entry = TkEntry.new(f, 'width'=>40, - 'textvariable'=>$search_searchString) { + 'textvariable'=>$search_searchString) { pack('side'=>'left') bind('Return', proc{textSearch($search_text, $search_searchString.value, - $search_Tag)}) + $search_Tag)}) } TkButton.new(f, 'text'=>'反転', - 'command'=>proc{textSearch($search_text, - $search_searchString.value, - $search_Tag)}) { + 'command'=>proc{textSearch($search_text, + $search_searchString.value, + $search_Tag)}) { pack('side'=>'left', 'pady'=>5, 'padx'=>10) } }.pack('side'=>'top', 'fill'=>'x') @@ -142,24 +142,24 @@ $search_text = TkText.new($search_demo, 'setgrid'=>true) {|t| if TkWinfo.depth($search_demo) > 1 textToggle(proc{ - $search_Tag.configure('background'=>'#ce5555', - 'foreground'=>'white') - }, - 800, - proc{ - $search_Tag.configure('background'=>'', 'foreground'=>'') - }, - 200 ) + $search_Tag.configure('background'=>'#ce5555', + 'foreground'=>'white') + }, + 800, + proc{ + $search_Tag.configure('background'=>'', 'foreground'=>'') + }, + 200 ) else textToggle(proc{ - $search_Tag.configure('background'=>'black', - 'foreground'=>'white') - }, - 800, - proc{ - $search_Tag.configure('background'=>'', 'foreground'=>'') - }, - 200 ) + $search_Tag.configure('background'=>'black', + 'foreground'=>'white') + }, + 800, + proc{ + $search_Tag.configure('background'=>'', 'foreground'=>'') + }, + 200 ) end $search_text.insert('1.0', "\ このウィンドウは検索機構を実現するのにテキスト widget のタグ機能がどの \ diff --git a/ext/tk/sample/demos-jp/spin.rb b/ext/tk/sample/demos-jp/spin.rb index 69d6d71d8d..c7b8096723 100644 --- a/ext/tk/sample/demos-jp/spin.rb +++ b/ext/tk/sample/demos-jp/spin.rb @@ -16,8 +16,8 @@ $spin_demo = TkToplevel.new {|w| } TkLabel.new($spin_demo, - :font=>$font, :wraplength=>'5i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) + :font=>$font, :wraplength=>'5i', :justify=>:left, + :text=><<EOL).pack(:side=>:top) 下には3種類のスピンボックスが表示されています。\ それぞれ、マウスで選択して文字を入力することができます。 編集操作としては、Emacs 形式の多くに加えて、一般的な @@ -42,13 +42,13 @@ TkFrame.new($spin_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ - $spin_demo.destroy - $spin_demo = nil - }).pack(:side=>:left, :expand=>true) + $spin_demo.destroy + $spin_demo = nil + }).pack(:side=>:left, :expand=>true) TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ - showCode 'spin' - }).pack(:side=>:left, :expand=>true) + showCode 'spin' + }).pack(:side=>:left, :expand=>true) } australianCities = [ @@ -58,10 +58,10 @@ australianCities = [ [ TkSpinbox.new($spin_demo, :from=>1, :to=>10, :width=>10, :validate=>:key, - :validatecommand=>[ - proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' - ]), + :validatecommand=>[ + proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' + ]), TkSpinbox.new($spin_demo, :from=>0, :to=>3, :increment=>0.5, - :format=>'%05.2f', :width=>10), + :format=>'%05.2f', :width=>10), TkSpinbox.new($spin_demo, :values=>australianCities, :width=>10) ].each{|sbox| sbox.pack(:side=>:top, :pady=>5, :padx=>10)} diff --git a/ext/tk/sample/demos-jp/style.rb b/ext/tk/sample/demos-jp/style.rb index 458479611b..59e406bc80 100644 --- a/ext/tk/sample/demos-jp/style.rb +++ b/ext/tk/sample/demos-jp/style.rb @@ -62,13 +62,13 @@ TkText.new($style_demo){|t| # unless $style_demo_do_first # $style_demo_do_first = true # Tk.tk_call('font', 'create', '@bigascii', -# '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*') +# '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*') # Tk.tk_call('font', 'create', '@smallascii', -# '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*') +# '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*') # Tk.tk_call('font', 'create', '@cBigFont', -# '-compound', '@bigascii @msg_knj') +# '-compound', '@bigascii @msg_knj') # Tk.tk_call('font', 'create', '@cSmallFont', -# '-compound', '@smallascii @kanji') +# '-compound', '@smallascii @kanji') # end # style_tag_big = TkTextTag.new(t, 'font'=>'@cBigFont') # style_tag_small = TkTextTag.new(t, 'font'=>'@cSmallFont') @@ -82,24 +82,24 @@ TkText.new($style_demo){|t| style_tag_sunken = TkTextTag.new(t, 'relief'=>'sunken', 'borderwidth'=>1) else style_tag_color1 = TkTextTag.new(t, 'background'=>'black', - 'foreground'=>'white') + 'foreground'=>'white') style_tag_color2 = TkTextTag.new(t, 'background'=>'black', - 'foreground'=>'white') + 'foreground'=>'white') style_tag_raised = TkTextTag.new(t, 'background'=>'white', - 'relief'=>'raised', 'borderwidth'=>1) + 'relief'=>'raised', 'borderwidth'=>1) style_tag_sunken = TkTextTag.new(t, 'background'=>'white', - 'relief'=>'sunken', 'borderwidth'=>1) + 'relief'=>'sunken', 'borderwidth'=>1) end # テキストタグ設定 (その他) if $tk_version =~ /^4\.[01]/ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, - 'bgstipple'=>'gray25') + 'borderwidth'=>0, + 'bgstipple'=>'gray25') else style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, - 'bgstipple'=>'gray12') + 'borderwidth'=>0, + 'bgstipple'=>'gray12') end style_tag_fgstipple = TkTextTag.new(t, 'fgstipple'=>'gray50') style_tag_underline = TkTextTag.new(t, 'underline'=>'on') @@ -109,10 +109,10 @@ TkText.new($style_demo){|t| style_tag_super = TkTextTag.new(t, 'offset'=>'4p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*') style_tag_sub = TkTextTag.new(t, 'offset'=>'-2p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*') style_tag_margins = TkTextTag.new(t, 'lmargin1'=>'12m', 'lmargin2'=>'6m', - 'rmargin'=>'10m') + 'rmargin'=>'10m') style_tag_spacing = TkTextTag.new(t, 'spacing1'=>'10p', 'spacing2'=>'2p', - 'lmargin1'=>'12m', 'lmargin2'=>'6m', - 'rmargin'=>'10m') + 'lmargin1'=>'12m', 'lmargin2'=>'6m', + 'rmargin'=>'10m') # テキスト挿入 insert('end', 'このようにテキスト widget は情報を様々なスタイルで表示すること @@ -198,9 +198,9 @@ X') insert('end', 'テキストの左側に余分な空白を置くことができます: ') insert('end', 'この段落はマージンの使用例です。スクリーン', - style_tag_margins) + style_tag_margins) insert('end', '上で折り返されて表示されている1行のテキストです。', - style_tag_margins) + style_tag_margins) insert('end', '左側には2種類のマージンを持ちます。', style_tag_margins) insert('end', '1行目に対するものと、', style_tag_margins) insert('end', '2行目以降の連続したマージン', style_tag_margins) @@ -222,9 +222,9 @@ spacing3') くかを示します。 ') insert('end', 'これらのインデントされた段落はどのように', - style_tag_spacing) + style_tag_spacing) insert('end', 'スペーシングがが行われるのかを示します。', - style_tag_spacing) + style_tag_spacing) insert('end', '各段落は実際はテキストwidget', style_tag_spacing) insert('end', 'の1行で、widgetによって折り畳まれています。 ', style_tag_spacing) @@ -234,11 +234,11 @@ spacing3') insert('end', '存在しています。', style_tag_spacing) insert('end', 'Spacing2は2pointに設定されています。', style_tag_spacing) insert('end', 'これで段落の中にほんの少し間隔が存在しています。', - style_tag_spacing) + style_tag_spacing) insert('end', 'Spacing3はこの例では使用されていません。 ', style_tag_spacing) insert('end', '間隔がどこにあるかを見たければ、これらの段落の', - style_tag_spacing) + style_tag_spacing) insert('end', 'なかでテキストを選択してください。選択の', style_tag_spacing) insert('end', '反転した部分には余分にとられた間隔が', style_tag_spacing) insert('end', '含まれています。 diff --git a/ext/tk/sample/demos-jp/text.rb b/ext/tk/sample/demos-jp/text.rb index bec95ee525..0057d5dbdc 100644 --- a/ext/tk/sample/demos-jp/text.rb +++ b/ext/tk/sample/demos-jp/text.rb @@ -92,16 +92,16 @@ TkText.new($text_demo){|t| コントロール-K は挿入カーソルから行末までを削除し、その位置に改行 しかなかった場合は、改行を削除します。#{ if undo_support - undo_text = "Control-z は最後に行った変更の取り消し(undo)を行い、" - case $tk_platform['platform'] - when "unix", "macintosh" - undo_text << "Control-Shift-z" - else # 'windows' - undo_text << "Control-y" - end - undo_text << "はundoした変更の再適用(redo)を行います。" + undo_text = "Control-z は最後に行った変更の取り消し(undo)を行い、" + case $tk_platform['platform'] + when "unix", "macintosh" + undo_text << "Control-Shift-z" + else # 'windows' + undo_text << "Control-y" + end + undo_text << "はundoした変更の再適用(redo)を行います。" else - "" + "" end } diff --git a/ext/tk/sample/demos-jp/twind.rb b/ext/tk/sample/demos-jp/twind.rb index 8716ad7278..2b228e4acd 100644 --- a/ext/tk/sample/demos-jp/twind.rb +++ b/ext/tk/sample/demos-jp/twind.rb @@ -37,10 +37,10 @@ $twind_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # frame 生成 $twind_text = nil TkFrame.new($twind_demo, 'highlightthickness'=>2, 'borderwidth'=>2, - 'relief'=>'sunken') {|f| + 'relief'=>'sunken') {|f| $twind_text = TkText.new(f, 'setgrid'=>'true', 'font'=>$font, - 'width'=>'70', 'height'=>35, 'wrap'=>'word', - 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| + 'width'=>'70', 'height'=>35, 'wrap'=>'word', + 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| TkScrollbar.new(f) {|s| command proc{|*args| t.yview(*args)} t.yscrollcommand proc{|first,last| s.set first,last} @@ -50,60 +50,60 @@ TkFrame.new($twind_demo, 'highlightthickness'=>2, 'borderwidth'=>2, # タグ生成 $tag_center = TkTextTag.new($twind_text, - 'justify' =>'center', - 'spacing1'=>'5m', - 'spacing3'=>'5m' ) + 'justify' =>'center', + 'spacing1'=>'5m', + 'spacing3'=>'5m' ) $tag_buttons = TkTextTag.new($twind_text, - 'lmargin1'=>'1c', - 'lmargin2'=>'1c', - 'rmargin' =>'1c', - 'spacing1'=>'3m', - 'spacing2'=>0, - 'spacing3'=>0 ) + 'lmargin1'=>'1c', + 'lmargin2'=>'1c', + 'rmargin' =>'1c', + 'spacing1'=>'3m', + 'spacing2'=>0, + 'spacing3'=>0 ) # テキストの生成 $twind_text.insert('end', - 'テキストwidget上に他のwidgetを組み込むことができます。') + 'テキストwidget上に他のwidgetを組み込むことができます。') $twind_text.insert('end', - '組み込みウィンドウと呼ばれ、任意のwidgetが可能です。') + '組み込みウィンドウと呼ばれ、任意のwidgetが可能です。') $twind_text.insert('end', - '例えば、ここに2つのボタンwidgetが組み込まれています。') + '例えば、ここに2つのボタンwidgetが組み込まれています。') $twind_text.insert('end', '最初のボタンをクリックすと水平方向のスクロールを') TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - #text 'ON' - text 'オン' - command proc{textWindOn $twind_text,$twind_buttons} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind_text) { + #text 'ON' + text 'オン' + command proc{textWindOn $twind_text,$twind_buttons} + cursor 'top_left_arrow' + }) $twind_text.insert('end', "にします。また2つめのボタンをクリックすると\n") $twind_text.insert('end', '水平方向のスクロールを') TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - #text 'OFF' - text 'オフ' - command proc{textWindOff $twind_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind_text) { + #text 'OFF' + text 'オフ' + command proc{textWindOff $twind_text} + cursor 'top_left_arrow' + }) $twind_text.insert('end', 'にします。') $twind_text.insert('end', 'もうひとつの例です。') TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text 'ここをクリック' - command proc{textWindPlot $twind_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind_text) { + text 'ここをクリック' + command proc{textWindPlot $twind_text} + cursor 'top_left_arrow' + }) $twind_text.insert('end', 'すると、x-yプロットがここに現れます。') $mark_plot = TkTextMark.new($twind_text, 'insert') $mark_plot.gravity='left' $twind_text.insert('end', 'マウスでデータを描画することができます。') TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text '消去' - command proc{textWindDel $twind_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind_text) { + text '消去' + command proc{textWindDel $twind_text} + cursor 'top_left_arrow' + }) $twind_text.insert('end', 'をクリックすると元に戻ります。 ') @@ -123,27 +123,27 @@ $twind_text.insert('end', 'もう一度同じボタンを押すと元に戻ります。 ') TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) {|b| - text 'デフォルト' - command proc{embDefBg $twind_text} - cursor 'top_left_arrow' - $tag_buttons.add('end') - }, - 'padx'=>3 ) + 'window'=>TkButton.new($twind_text) {|b| + text 'デフォルト' + command proc{embDefBg $twind_text} + cursor 'top_left_arrow' + $tag_buttons.add('end') + }, + 'padx'=>3 ) embToggle = TkVariable.new('Short') TkTextWindow.new($twind_text, 'end', - 'window'=>TkCheckButton.new($twind_text) { - textvariable embToggle - indicatoron 0 - variable embToggle - onvalue 'A much longer string' - offvalue 'Short' - cursor 'top_left_arrow' - pady 5 - padx 2 - }, - 'padx'=>3, - 'pady'=>2 ) + 'window'=>TkCheckButton.new($twind_text) { + textvariable embToggle + indicatoron 0 + variable embToggle + onvalue 'A much longer string' + offvalue 'Short' + cursor 'top_left_arrow' + pady 5 + padx 2 + }, + 'padx'=>3, + 'pady'=>2 ) [ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', @@ -151,13 +151,13 @@ TkTextWindow.new($twind_text, 'end', 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' ].each{|twind_color| TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text twind_color - cursor 'top_left_arrow' - command proc{$twind_text.bg twind_color} - }, - 'padx'=>3, - 'pady'=>2 ) + 'window'=>TkButton.new($twind_text) { + text twind_color + cursor 'top_left_arrow' + command proc{$twind_text.bg twind_color} + }, + 'padx'=>3, + 'pady'=>2 ) } # メソッド定義 @@ -211,39 +211,39 @@ def textWindPlot (t) TkcLine.new($twind_plot, 100, 250, 400, 250, 'width'=>2) TkcLine.new($twind_plot, 100, 250, 100, 50, 'width'=>2) TkcText.new($twind_plot, 225, 20, - 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') + 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) TkcLine.new($twind_plot, x, 250, x, 245, 'width'=>2) TkcText.new($twind_plot, x, 254, - 'text'=>10*i, 'font'=>font, 'anchor'=>'n') + 'text'=>10*i, 'font'=>font, 'anchor'=>'n') } (0..5).each {|i| y = 250 - (i * 40) TkcLine.new($twind_plot, 100, y, 105, y, 'width'=>2) TkcText.new($twind_plot, 96, y, - 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') + 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') } for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] x = 100 + (3*xx) y = 250 - (4*yy)/5 item = TkcOval.new($twind_plot, x-6, y-6, x+6, y+6, - 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') + 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') item.addtag 'point' end $twind_plot.itembind('point', 'Any-Enter', - proc{$twind_plot.itemconfigure 'current', 'fill', 'red'}) + proc{$twind_plot.itemconfigure 'current', 'fill', 'red'}) $twind_plot.itembind('point', 'Any-Leave', - proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) + proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) $twind_plot.itembind('point', '1', - proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y") + proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y") $twind_plot.itembind('point', 'ButtonRelease-1', - proc{$twind_plot.dtag 'selected'}) + proc{$twind_plot.dtag 'selected'}) $twind_plot.bind('B1-Motion', - proc{|x,y| embPlotMove $twind_plot,x,y}, "%x %y") + proc{|x,y| embPlotMove $twind_plot,x,y}, "%x %y") while ($twind_text.get($mark_plot) =~ /[ \t\n]/) $twind_text.delete $mark_plot end diff --git a/ext/tk/sample/demos-jp/twind2.rb b/ext/tk/sample/demos-jp/twind2.rb index 8c871688b3..b634f07b4b 100644 --- a/ext/tk/sample/demos-jp/twind2.rb +++ b/ext/tk/sample/demos-jp/twind2.rb @@ -18,20 +18,20 @@ $twind2_demo = TkToplevel.new {|w| # frame 生成 $twind2_buttons = TkFrame.new($twind2_demo) {|frame| TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), - :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) + :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - TkButton.new(frame, :text=>'コード参照', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'twind2'}), - TkButton.new(frame, :text=>'閉じる', - :image=>$image['delete'], :compound=>:left, - :command=>proc{ - tmppath = $twind2_demo - $twind2_demo = nil - $showVarsWin[tmppath.path] = nil - tmppath.destroy - }), - :padx=>4, :pady=>4) + TkButton.new(frame, :text=>'コード参照', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'twind2'}), + TkButton.new(frame, :text=>'閉じる', + :image=>$image['delete'], :compound=>:left, + :command=>proc{ + tmppath = $twind2_demo + $twind2_demo = nil + $showVarsWin[tmppath.path] = nil + tmppath.destroy + }), + :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) } $twind2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') @@ -39,11 +39,11 @@ $twind2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # frame 生成 $twind2_text = nil TkFrame.new($twind2_demo, 'highlightthickness'=>2, 'borderwidth'=>2, - 'relief'=>'sunken') {|f| + 'relief'=>'sunken') {|f| $twind2_text = TkText.new(f, 'setgrid'=>true, 'font'=>$font, - # 'width'=>'70', 'height'=>35, 'wrap'=>'word', - 'width'=>'70', 'height'=>35, 'wrap'=>'char', - 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| + # 'width'=>'70', 'height'=>35, 'wrap'=>'word', + 'width'=>'70', 'height'=>35, 'wrap'=>'char', + 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| TkScrollbar.new(f) {|s| command proc{|*args| t.yview(*args)} t.yscrollcommand proc{|first,last| s.set first,last} @@ -53,16 +53,16 @@ TkFrame.new($twind2_demo, 'highlightthickness'=>2, 'borderwidth'=>2, # タグ生成 $tag2_center = TkTextTag.new($twind2_text, - 'justify' =>'center', - 'spacing1'=>'5m', - 'spacing3'=>'5m' ) + 'justify' =>'center', + 'spacing1'=>'5m', + 'spacing3'=>'5m' ) $tag2_buttons = TkTextTag.new($twind2_text, - 'lmargin1'=>'1c', - 'lmargin2'=>'1c', - 'rmargin' =>'1c', - 'spacing1'=>'3m', - 'spacing2'=>0, - 'spacing3'=>0 ) + 'lmargin1'=>'1c', + 'lmargin2'=>'1c', + 'rmargin' =>'1c', + 'spacing1'=>'3m', + 'spacing2'=>0, + 'spacing3'=>0 ) # テキストの生成 $twind2_text.insert('end', 'テキストウィジェットには色々な種類のアイテム') @@ -84,41 +84,41 @@ $twind2_text.insert('end', 'ボタンウィジェットが埋め込まれています。') $twind2_text.insert('end', '最初のボタンをクリックすると、') $twind2_text.insert('end', '水平方向のスクロールを ') TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text) { - #text 'ON' - text 'オン' - command proc{textWindOn2 $twind2_text,$twind2_buttons} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind2_text) { + #text 'ON' + text 'オン' + command proc{textWindOn2 $twind2_text,$twind2_buttons} + cursor 'top_left_arrow' + }) $twind2_text.insert('end', "にします。また、2つめのボタンをクリックすると\n") $twind2_text.insert('end', '水平方向のスクロールを') TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text) { - #text 'OFF' - text 'オフ' - command proc{textWindOff2 $twind2_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind2_text) { + #text 'OFF' + text 'オフ' + command proc{textWindOff2 $twind2_text} + cursor 'top_left_arrow' + }) $twind2_text.insert('end', "にします。\n\n") $twind2_text.insert('end', '次はもうひとつの例です。') TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text) { - text 'ここをクリック' - command proc{textWindPlot2 $twind2_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind2_text) { + text 'ここをクリック' + command proc{textWindPlot2 $twind2_text} + cursor 'top_left_arrow' + }) $twind2_text.insert('end', 'すると、x-yプロットがここに現れます。') $mark2_plot = TkTextMark.new($twind2_text, 'insert') $mark2_plot.gravity='left' $twind2_text.insert('end', 'マウスでドラッグすることで、') $twind2_text.insert('end', 'プロット上のデータ点を移動することができます。') TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text) { - text '消去' - command proc{textWindDel2 $twind2_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind2_text) { + text '消去' + command proc{textWindDel2 $twind2_text} + cursor 'top_left_arrow' + }) $twind2_text.insert('end', 'をクリックすると元に戻ります。') $twind2_text.insert('end', "\n\n") @@ -146,18 +146,18 @@ btn_default = TkButton.new($twind2_text) {|b| TkTextWindow.new($twind2_text, 'end', 'window'=>btn_default, 'padx'=>3) embToggle = TkVariable.new('Short') TkTextWindow.new($twind2_text, 'end', - 'window'=>TkCheckButton.new($twind2_text) { - textvariable embToggle - indicatoron 0 - variable embToggle - onvalue 'A much longer string' - offvalue 'Short' - cursor 'top_left_arrow' - pady 5 - padx 2 - }, - 'padx'=>3, - 'pady'=>2 ) + 'window'=>TkCheckButton.new($twind2_text) { + textvariable embToggle + indicatoron 0 + variable embToggle + onvalue 'A much longer string' + offvalue 'Short' + cursor 'top_left_arrow' + pady 5 + padx 2 + }, + 'padx'=>3, + 'pady'=>2 ) [ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', @@ -165,13 +165,13 @@ TkTextWindow.new($twind2_text, 'end', 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' ].each{|twind_color| TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text) { - text twind_color - cursor 'top_left_arrow' - command proc{$twind2_text.bg twind_color} - }, - 'padx'=>3, - 'pady'=>2 ) + 'window'=>TkButton.new($twind2_text) { + text twind_color + cursor 'top_left_arrow' + command proc{$twind2_text.bg twind_color} + }, + 'padx'=>3, + 'pady'=>2 ) } $tag2_buttons.add(btn_default, 'end') @@ -185,55 +185,55 @@ $twind2_text.insert('end', "\nborder width や highlightthickness, ") $twind2_text.insert('end', "padding を通常の値から変更することも可能です。\n") TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Big borders", - :cursor=>'top_left_arrow', - 'command'=>proc{ - textWinBigB2 $twind2_text - })) + 'window'=>TkButton.new($twind2_text, :text=>"Big borders", + :cursor=>'top_left_arrow', + 'command'=>proc{ + textWinBigB2 $twind2_text + })) TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Small borders", - :cursor=>'top_left_arrow', - 'command'=>proc{ - textWinSmallB2 $twind2_text - })) + 'window'=>TkButton.new($twind2_text, :text=>"Small borders", + :cursor=>'top_left_arrow', + 'command'=>proc{ + textWinSmallB2 $twind2_text + })) TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Big highlight", - :cursor=>'top_left_arrow', - 'command'=>proc{ - textWinBigH2 $twind2_text - })) + 'window'=>TkButton.new($twind2_text, :text=>"Big highlight", + :cursor=>'top_left_arrow', + 'command'=>proc{ + textWinBigH2 $twind2_text + })) TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Small highlight", - :cursor=>'top_left_arrow', - 'command'=>proc{ - textWinSmallH2 $twind2_text - })) + 'window'=>TkButton.new($twind2_text, :text=>"Small highlight", + :cursor=>'top_left_arrow', + 'command'=>proc{ + textWinSmallH2 $twind2_text + })) TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Big pad", - :cursor=>'top_left_arrow', - 'command'=>proc{ - textWinBigP2 $twind2_text - })) + 'window'=>TkButton.new($twind2_text, :text=>"Big pad", + :cursor=>'top_left_arrow', + 'command'=>proc{ + textWinBigP2 $twind2_text + })) TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Small pad", - :cursor=>'top_left_arrow', - 'command'=>proc{ - textWinSmallP2 $twind2_text - })) + 'window'=>TkButton.new($twind2_text, :text=>"Small pad", + :cursor=>'top_left_arrow', + 'command'=>proc{ + textWinSmallP2 $twind2_text + })) $twind2_text.insert('end', "\n\n更にイメージもテキストウィジェットに") $twind2_text.insert('end', "うまく配置できます:") TkTextImage.new($twind2_text, 'end', - 'image'=>TkBitmapImage.new(:file=>[ - $demo_dir, '..', - 'images', 'face.xbm' - ].join(File::Separator))) + 'image'=>TkBitmapImage.new(:file=>[ + $demo_dir, '..', + 'images', 'face.xbm' + ].join(File::Separator))) # メソッド定義 def textWinBigB2(w) @@ -307,39 +307,39 @@ def textWindPlot2 (t) TkcLine.new($twind2_plot, 100, 250, 400, 250, 'width'=>2) TkcLine.new($twind2_plot, 100, 250, 100, 50, 'width'=>2) TkcText.new($twind2_plot, 225, 20, - 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') + 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) TkcLine.new($twind2_plot, x, 250, x, 245, 'width'=>2) TkcText.new($twind2_plot, x, 254, - 'text'=>10*i, 'font'=>font, 'anchor'=>'n') + 'text'=>10*i, 'font'=>font, 'anchor'=>'n') } (0..5).each {|i| y = 250 - (i * 40) TkcLine.new($twind2_plot, 100, y, 105, y, 'width'=>2) TkcText.new($twind2_plot, 96, y, - 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') + 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') } for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] x = 100 + (3*xx) y = 250 - (4*yy)/5 item = TkcOval.new($twind2_plot, x-6, y-6, x+6, y+6, - 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') + 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') item.addtag 'point' end $twind2_plot.itembind('point', 'Any-Enter', - proc{$twind2_plot.itemconfigure 'current', 'fill', 'red'}) + proc{$twind2_plot.itemconfigure 'current', 'fill', 'red'}) $twind2_plot.itembind('point', 'Any-Leave', - proc{$twind2_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) + proc{$twind2_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) $twind2_plot.itembind('point', '1', - proc{|x,y| embPlotDown2 $twind2_plot,x,y}, "%x %y") + proc{|x,y| embPlotDown2 $twind2_plot,x,y}, "%x %y") $twind2_plot.itembind('point', 'ButtonRelease-1', - proc{$twind2_plot.dtag 'selected'}) + proc{$twind2_plot.dtag 'selected'}) $twind2_plot.bind('B1-Motion', - proc{|x,y| embPlotMove2 $twind2_plot,x,y}, "%x %y") + proc{|x,y| embPlotMove2 $twind2_plot,x,y}, "%x %y") while ($twind2_text.get($mark2_plot) =~ /[ \t\n]/) $twind2_text.delete $mark2_plot end diff --git a/ext/tk/sample/demos-jp/unicodeout.rb b/ext/tk/sample/demos-jp/unicodeout.rb index 37cc1699bb..090cdf3059 100644 --- a/ext/tk/sample/demos-jp/unicodeout.rb +++ b/ext/tk/sample/demos-jp/unicodeout.rb @@ -17,8 +17,8 @@ $unicodeout_demo = TkToplevel.new {|w| } TkLabel.new($unicodeout_demo, - :font=>$font, :wraplength=>'5.4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) + :font=>$font, :wraplength=>'5.4i', :justify=>:left, + :text=><<EOL).pack(:side=>:top) これは,Tkにおける非欧米文字集合を用いる言語に対するサポートについての\ サンプルです.ただし,下の表示においてあなたが実際にどのような表示を\ 目にするかは,あなたの環境にどのような文字集合がインストールされているかに\ @@ -42,19 +42,19 @@ TkFrame.new($unicodeout_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ - $unicodeout_demo.destroy - $unicodeout_demo = nil - }).pack(:side=>:left, :expand=>true) + $unicodeout_demo.destroy + $unicodeout_demo = nil + }).pack(:side=>:left, :expand=>true) TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ - showCode 'unicodeout' - }).pack(:side=>:left, :expand=>true) + showCode 'unicodeout' + }).pack(:side=>:left, :expand=>true) } wait_msg = TkLabel.new($unicodeout_demo, - :text=>"フォント読み込みの完了まで" + - "しばらくお待ち下さい...", - :font=>"Helvetica 12 italic").pack + :text=>"フォント読み込みの完了まで" + + "しばらくお待ち下さい...", + :font=>"Helvetica 12 italic").pack class Unicodeout_SampleFrame < TkFrame @@font = $font @@ -74,10 +74,10 @@ class Unicodeout_SampleFrame < TkFrame def add_sample(lang, *args) sample_txt = Tk::UTF8_String(args.join('')) l = TkLabel.new(self, :font=>@@font, :text=>lang+':', - :anchor=>:nw, :pady=>0) + :anchor=>:nw, :pady=>0) #s = TkLabel.new(self, :font=>@@font, :text=>sample_txt, s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt, - :anchor=>:nw, :width=>30, :pady=>0) + :anchor=>:nw, :width=>30, :pady=>0) Tk.grid(l, s, :sticky=>:ew, :pady=>0) l.grid_config(:padx, '1m') end @@ -93,23 +93,23 @@ $unicodeout_demo.cursor('watch') Tk.update f.add_sample('Arabic', - '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94', - '\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D') + '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94', + '\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D') f.add_sample('Trad. Chinese', '\u4E2D\u570B\u7684\u6F22\u5B57') f.add_sample('Simpl. Chinese', '\u6C49\u8BED') f.add_sample('Greek', - '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ', - '\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1') + '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ', + '\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1') f.add_sample('Hebrew', - '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ', - '\u05DC\u05D9\u05D0\u05E8\u05E9\u05D9') + '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ', + '\u05DC\u05D9\u05D0\u05E8\u05E9\u05D9') f.add_sample('Japanese', - '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ', - '\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA') + '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ', + '\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA') f.add_sample('Korean', '\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00') f.add_sample('Russian', - '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ', - '\u044F\u0437\u044B\u043A') + '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ', + '\u044F\u0437\u044B\u043A') wait_msg.destroy $unicodeout_demo.cursor(oldCursor) diff --git a/ext/tk/sample/demos-jp/widget b/ext/tk/sample/demos-jp/widget index 0544127cbb..e8196aec8f 100644 --- a/ext/tk/sample/demos-jp/widget +++ b/ext/tk/sample/demos-jp/widget @@ -28,10 +28,10 @@ when /^4.*/ $font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil) knjfont = '-*--16-*-jisx0208.1983-0' $kanji_font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', - knjfont) + knjfont) TkOption.add('*kanjiFont', knjfont, 'startupFile') $msg_kanji_font=TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', - '-*--24-*-jisx0208.1983-0') + '-*--24-*-jisx0208.1983-0') #when '8.0' # $font = TkFont.new('Helvetica -12') @@ -49,10 +49,10 @@ else $font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil) knjfont = '-*--16-*-jisx0208.1983-0' $kanji_font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', - knjfont) + knjfont) TkOption.add('*kanjiFont', knjfont, 'startupFile') $msg_kanji_font=TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', - '-*--24-*-jisx0208.1983-0') + '-*--24-*-jisx0208.1983-0') end ####### @@ -117,11 +117,11 @@ end # メニュー設定 TkMenubar.new($root, - [[['File', 0], - ['About ... ', proc{aboutBox}, 0, '<F1>'], - '---', - ['Quit', proc{exit}, 0, 'Meta-Q'] - ]]).pack('side'=>'top', 'fill'=>'x') + [[['File', 0], + ['About ... ', proc{aboutBox}, 0, '<F1>'], + '---', + ['Quit', proc{exit}, 0, 'Meta-Q'] + ]]).pack('side'=>'top', 'fill'=>'x') $root.bind('F1', proc{aboutBox}) $root.bind('Meta-q', proc{exit}) @@ -156,7 +156,7 @@ if $tk_version =~ /^4\.[01]/ else textFrame = TkFrame.new($root) scr = TkScrollbar.new($root, 'orient'=>'vertical', - 'highlightthickness'=>0, 'takefocus'=>1) { + 'highlightthickness'=>0, 'takefocus'=>1) { pack('in'=>textFrame, 'side'=>'right', 'fill'=>'y', 'padx'=>1) } txt = TkText.new($root) { @@ -182,10 +182,10 @@ else statusBar = TkFrame.new($root) {|f| $statusBarLabel = \ TkLabel.new(f, 'text'=>" ", 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ + 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both') TkLabel.new(f, 'width'=>8, 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ + 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ .pack('side'=>'left', 'padx'=>2) }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) end @@ -200,53 +200,53 @@ tag_demospace = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c') if TkWinfo.depth($root) == 1 tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'underline'=>1) + 'underline'=>1) $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'underline'=>1) + 'underline'=>1) tag_hot = TkTextTag.new(txt, 'background'=>'black', 'foreground'=>'white') else tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'foreground'=>'blue', 'underline'=>1) + 'foreground'=>'blue', 'underline'=>1) $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'foreground'=>'#303080', 'underline'=>1) + 'foreground'=>'#303080', 'underline'=>1) # tag_hot = TkTextTag.new(txt, 'relief'=>'raised', 'borderwidth'=>1, -# 'background'=>'SeaGreen3') +# 'background'=>'SeaGreen3') tag_hot = TkTextTag.new(txt, 'borderwidth'=>1, 'foreground'=>'red') end #tag_demo.bind('Button-1', proc{invoke txt, txt.index('current')}) tag_demo.bind('ButtonRelease-1', - proc{|x,y|invoke txt, txt.index("@#{x},#{y}")}, '%x %y') + proc{|x,y|invoke txt, txt.index("@#{x},#{y}")}, '%x %y') lastLine = TkVariable.new("") newLine = TkVariable.new("") tag_demo.bind('Enter', proc{|x,y| - lastLine.value = txt.index("@#{x},#{y} linestart") - tag_hot.add(lastLine.value, "#{lastLine.value} lineend") - showStatus txt, txt.index("@#{x},#{y}") - }, - '%x %y') + lastLine.value = txt.index("@#{x},#{y} linestart") + tag_hot.add(lastLine.value, "#{lastLine.value} lineend") + showStatus txt, txt.index("@#{x},#{y}") + }, + '%x %y') tag_demo.bind('Leave', - proc{ - tag_hot.remove('1.0','end') - txt.configure('cursor','xterm') - $statusBarLabel.configure('text'=>"") - }) + proc{ + tag_hot.remove('1.0','end') + txt.configure('cursor','xterm') + $statusBarLabel.configure('text'=>"") + }) tag_demo.bind('Motion', proc{|x, y| - newLine.value = txt.index("@#{x},#{y} linestart") - if newLine.value != lastLine.value - tag_hot.remove('1.0','end') - lastLine.value = newLine.value - if ( txt.tag_names("@#{x},#{y}").find{|t| - t.kind_of?(String) && t =~ /^demo-/ - } ) - tag_hot.add(lastLine.value, - "#{lastLine.value} lineend -1 chars") - end - end - showStatus txt, txt.index("@#{x},#{y}") - }, - '%x %y') + newLine.value = txt.index("@#{x},#{y} linestart") + if newLine.value != lastLine.value + tag_hot.remove('1.0','end') + lastLine.value = newLine.value + if ( txt.tag_names("@#{x},#{y}").find{|t| + t.kind_of?(String) && t =~ /^demo-/ + } ) + tag_hot.add(lastLine.value, + "#{lastLine.value} lineend -1 chars") + end + end + showStatus txt, txt.index("@#{x},#{y}") + }, + '%x %y') # テキスト生成 txt.insert('end', 'Ruby/Tk : Widget', tag_title) @@ -276,47 +276,47 @@ EOT #txt.insert('end',"ラベル, ボタン, チェックボタン, ラジオボタン\n",tag_middle) txt.insert('end', "ラベル, ボタン, チェックボタン, ラジオボタン\n", - tag_kanji_title) + tag_kanji_title) txt.insert('end', " \n ", tag_demospace) txt.insert('end', "1. ラベル (テキスト, ビットマップ)\n", - tag_demo, "demo-label") + tag_demo, "demo-label") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "2. ラベルとUNICODEテキスト (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-unicodeout") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "3. ボタン \n", tag_demo, "demo-button") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "4. チェックボタン (複数を選択可能)\n", - tag_demo, "demo-check") + tag_demo, "demo-check") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "5. 3状態チェックボタン (機能に対応したバージョンのTkが必要)\n", - tag_demo, "demo-check2") + tag_demo, "demo-check2") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "6. ラジオボタン (任意の一つを選択可能)\n", - tag_demo, "demo-radio") + tag_demo, "demo-radio") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "7. ラジオボタン (機能に対応したバージョンのTkが必要)\n", - tag_demo, "demo-radio2") + tag_demo, "demo-radio2") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "8. 3状態ラジオボタン (機能に対応したバージョンのTkが必要)\n", - tag_demo, "demo-radio3") + tag_demo, "demo-radio3") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "9. ボタンで作られた15-パズルゲーム\n", - tag_demo, "demo-puzzle") + tag_demo, "demo-puzzle") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "10. ビットマップを使用したアイコンボタン\n", - tag_demo, "demo-icon") + tag_demo, "demo-icon") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "11. 画像を表示する二つのラベル\n", - tag_demo, "demo-image1") + tag_demo, "demo-image1") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "12. 画像を見るための簡単なユーザインターフェース\n", - tag_demo, "demo-image2") + tag_demo, "demo-image2") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "13. 画像を見るための簡単なユーザインターフェース (機能に対応したバージョンのTkが必要)\n", - tag_demo, "demo-image3") + tag_demo, "demo-image3") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "14. ラベル付きフレーム (機能に対応したバージョンのTkが必要)\n", - tag_demo, "demo-labelframe") + tag_demo, "demo-labelframe") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") @@ -326,7 +326,7 @@ txt.insert('end', " \n ", tag_demospace) txt.insert('end', "1. 都道府県.\n", tag_demo, "demo-states") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "2. 色: アプリケーションのための配色を変える\n", - "#{tag_demo.id} demo-colors") + "#{tag_demo.id} demo-colors") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "3. 格言集\n", tag_demo, "demo-sayings") txt.insert('end', " \n ", tag_demospace) @@ -340,10 +340,10 @@ txt.insert('end', " \n ", tag_demospace) txt.insert('end', "2. スクロールバーあり\n", tag_demo, "demo-entry2") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "3. 認証処理付きのエントリボックスとパスワードフィールド (機能に対応したバージョンのTkが必要)\n", - tag_demo, "demo-entry3") + tag_demo, "demo-entry3") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "4. スピンボックス (機能に対応したバージョンのTkが必要)\n", - tag_demo, "demo-spin") + tag_demo, "demo-spin") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "5. 簡単なフォーム\n", tag_demo, "demo-form") txt.insert('end', " \n ", tag_demospace) @@ -357,13 +357,13 @@ txt.insert('end', " \n ", tag_demospace) txt.insert('end', "2. 表示スタイル.\n", tag_demo, "demo-style") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "3. ハイパーテキスト(タグバインド).\n", - tag_demo, "demo-bind") + tag_demo, "demo-bind") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "4. ウィンドウを埋め込んだテキスト\n", - tag_demo, "demo-twind") + tag_demo, "demo-twind") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "5. ウィンドウを埋め込んだテキスト (機能に対応したバージョンのTkが必要)\n", - tag_demo, "demo-twind2") + tag_demo, "demo-twind2") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "6. 検索\n", tag_demo, "demo-search") txt.insert('end', " \n ", tag_demospace) @@ -387,7 +387,7 @@ txt.insert('end', " \n ", tag_demospace) txt.insert('end', "7. フロアプラン (異なるキャンバスアイテム作成方法を使用)\n", tag_demo, "demo-floor2") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "8. スクロール可能なキャンバス\n", - tag_demo, "demo-cscroll") + tag_demo, "demo-cscroll") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") @@ -403,10 +403,10 @@ txt.insert('end', "\n") txt.insert('end', "ペインドウィンドウ\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) txt.insert('end', "1. 水平方向 (機能に対応したバージョンのTkが必要)\n", - tag_demo.id, "demo-paned1") + tag_demo.id, "demo-paned1") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "2. 垂直方向 (機能に対応したバージョンのTkが必要)\n", - tag_demo.id, "demo-paned2") + tag_demo.id, "demo-paned2") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") @@ -414,16 +414,16 @@ txt.insert('end', "\n") txt.insert('end', "メニュー\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) txt.insert('end', "1. メニューとカスケードを含んだウィンドウ\n", - tag_demo, "demo-menu") + tag_demo, "demo-menu") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "2. メニューとカスケードを含んだウィンドウ (Tk8.x 専用)\n", - tag_demo, "demo-menu8x") + tag_demo, "demo-menu8x") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "3. 〃 (機能に対応したバージョンのTkが必要)\n", - tag_demo, "demo-menu84") + tag_demo, "demo-menu84") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "4. メニューボタン (Tk8.x 専用)\n", - tag_demo, "demo-menubu") + tag_demo, "demo-menubu") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") @@ -444,10 +444,10 @@ txt.insert('end', " \n ", tag_demospace) txt.insert('end', "1. 組み込みのビットマップ\n", tag_demo, "demo-bitmap") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "2. モーダルダイアログ(ローカルグラブ)\n", - tag_demo, "demo-dialog1") + tag_demo, "demo-dialog1") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "3. モーダルダイアログ(グローバルグラブ)\n", - tag_demo, "demo-dialog2") + tag_demo, "demo-dialog2") txt.insert('end', " \n ", tag_demospace) txt.state('disabled') @@ -483,10 +483,10 @@ def showVars1(parent, *args) } args.each{|vnam,vbody| TkFrame.new(w){|f| - #TkLabel.new(f, 'text'=>"#{vnam}: ").pack('side'=>'left') - TkLabel.new(f, 'text'=>"#{vnam}: ",'width'=>len+2).pack('side'=>'left') - TkLabel.new(f, 'textvariable'=>vbody, 'anchor'=>'w')\ - .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x') + #TkLabel.new(f, 'text'=>"#{vnam}: ").pack('side'=>'left') + TkLabel.new(f, 'text'=>"#{vnam}: ",'width'=>len+2).pack('side'=>'left') + TkLabel.new(f, 'textvariable'=>vbody, 'anchor'=>'w')\ + .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x') }.pack('side'=>'top', 'anchor'=>'w', 'fill'=>'x') } TkButton.new(w) { @@ -508,11 +508,11 @@ def showVars2(parent, *args) title "Variable values" TkLabelFrame.new(w, :text=>"変数値:", - :font=>{:family=>'Helvetica', :size=>14}){|f| + :font=>{:family=>'Helvetica', :size=>14}){|f| args.each{|vnam,vbody| - TkGrid(TkLabel.new(f, :text=>"#{vnam}: ", :anchor=>'w'), - TkLabel.new(f, :textvariable=>vbody, :anchor=>'w'), - :padx=>2, :pady=>2, :sticky=>'w') + TkGrid(TkLabel.new(f, :text=>"#{vnam}: ", :anchor=>'w'), + TkLabel.new(f, :textvariable=>vbody, :anchor=>'w'), + :padx=>2, :pady=>2, :sticky=>'w') } f.grid(:sticky=>'news', :padx=>4) @@ -520,7 +520,7 @@ def showVars2(parent, *args) f.grid_rowconfig(100, :weight=>1) } TkButton.new(w, :text=>"了解", :width=>8, :default=>:active, - :command=>proc{w.destroy}){|b| + :command=>proc{w.destroy}){|b| w.bind('Return', proc{b.invoke}) w.bind('Escape', proc{b.invoke}) @@ -566,7 +566,7 @@ def showStatus (txt, index) else demoname = tag[5..-1] $statusBarLabel.configure('text', - "サンプルプログラム \"#{demoname}\" の実行 ") + "サンプルプログラム \"#{demoname}\" の実行 ") newcursor = 'hand2' end txt.configure('cursor'=>newcursor) if cursor != newcursor @@ -583,8 +583,8 @@ def showCode1(demo) #text "了解" text "閉じる" command proc{ - $code_window.destroy - $code_window = nil + $code_window.destroy + $code_window = nil } }.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2) TkButton.new(f) { @@ -597,43 +597,43 @@ def showCode1(demo) if $tk_version =~ /^4\.[01]/ s = TkScrollbar.new($code_window, 'orient'=>'vertical') $code_text = TkText.new($code_window) { - height 40 - setgrid 'yes' - yscrollcommand proc{|first,last| s.set first,last} + height 40 + setgrid 'yes' + yscrollcommand proc{|first,last| s.set first,last} } s.command(proc{|*args| $code_text.yview(*args)}) s.pack('side'=>'right', 'fill'=>'y') $code_text.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both') else TkFrame.new($code_window) {|f| - pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) - - hs = TkScrollbar.new($code_window, 'highlightthickness'=>0, - 'orient'=>'horizontal') - vs = TkScrollbar.new($code_window, 'highlightthickness'=>0, - 'orient'=>'vertical') - $code_text = TkText.new($code_window) {|t| - height 40 - #wrap 'word' - wrap 'char' - xscrollcommand proc{|first,last| hs.set first,last} - yscrollcommand proc{|first,last| vs.set first,last} - setgrid 'yes' - highlightthickness 0 - pady 2 - padx 3 - hs.command(proc{|*args| $code_text.xview(*args)}) - vs.command(proc{|*args| $code_text.yview(*args)}) - } - - $code_text.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - vs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') -# xs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, -# 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) + pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) + + hs = TkScrollbar.new($code_window, 'highlightthickness'=>0, + 'orient'=>'horizontal') + vs = TkScrollbar.new($code_window, 'highlightthickness'=>0, + 'orient'=>'vertical') + $code_text = TkText.new($code_window) {|t| + height 40 + #wrap 'word' + wrap 'char' + xscrollcommand proc{|first,last| hs.set first,last} + yscrollcommand proc{|first,last| vs.set first,last} + setgrid 'yes' + highlightthickness 0 + pady 2 + padx 3 + hs.command(proc{|*args| $code_text.xview(*args)}) + vs.command(proc{|*args| $code_text.yview(*args)}) + } + + $code_text.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + vs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, + 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') +# xs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, +# 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') + TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) + TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) } end else @@ -660,8 +660,8 @@ def showCode2(demo) $code_window = TkToplevel.new(nil) tf = TkFrame.new($code_window) $code_text = TkText.new(tf, :font=>'Courier 10', :height=>30, - :wrap=>'word', :bd=>1, :setgrid=>true, - :highlightthickness=>0, :pady=>2, :padx=>3) + :wrap=>'word', :bd=>1, :setgrid=>true, + :highlightthickness=>0, :pady=>2, :padx=>3) xscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)} yscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)} TkGrid($code_text, yscr, :sticky=>'news') @@ -673,17 +673,17 @@ def showCode2(demo) #b_dis = TkButton.new(bf, :text=>'了解', :default=>:active, b_dis = TkButton.new(bf, :text=>'閉じる', :default=>:active, - :command=>proc{ - $code_window.destroy - $code_window = nil - }, - :image=>$image['delete'], :compound=>:left) + :command=>proc{ + $code_window.destroy + $code_window = nil + }, + :image=>$image['delete'], :compound=>:left) b_prn = TkButton.new(bf, :text=>'印刷', - :command=>proc{printCode($code_text, file)}, - :image=>$image['print'], :compound=>:left) + :command=>proc{printCode($code_text, file)}, + :image=>$image['print'], :compound=>:left) b_run = TkButton.new(bf, :text=>'再実行', - :command=>proc{eval($code_text.get('1.0','end'))}, - :image=>$image['refresh'], :compound=>:left) + :command=>proc{eval($code_text.get('1.0','end'))}, + :image=>$image['refresh'], :compound=>:left) TkGrid('x', b_run, b_prn, b_dis, :padx=>4, :pady=>[6,4]) bf.grid_columnconfigure(0, :weight=>1) @@ -694,8 +694,8 @@ def showCode2(demo) $code_window.grid_rowconfigure(0, :weight=>1) $code_window.bind('Return', proc{|win| - b_dis.invoke unless win.kind_of?(TkText) - }, '%W') + b_dis.invoke unless win.kind_of?(TkText) + }, '%W') $code_window.bindinfo('Return').each{|cmd, arg| $code_window.bind_append('Escape', cmd, arg) } @@ -727,8 +727,8 @@ end # Much thanks to Arjen Markus for this. # # Arguments: -# txt - Name of text widget containing code to print -# file - Name of the original file (implicitly for title) +# txt - Name of text widget containing code to print +# file - Name of the original file (implicitly for title) def printCode(txt, file) code = txt.get('1.0', 'end - 1c') @@ -744,27 +744,27 @@ def printCode(txt, file) when 'unix' msg = `lp -c #{fname}` unless $?.exitstatus == 0 - Tk.messageBox(:title=>'Print spooling failure', - :message=>'エラーが発生しました.' + - '印刷に失敗したものと思われます : ' + msg) + Tk.messageBox(:title=>'Print spooling failure', + :message=>'エラーが発生しました.' + + '印刷に失敗したものと思われます : ' + msg) end when 'windows' begin - printTextWin32(fname) + printTextWin32(fname) rescue => e - Tk.messageBox(:title=>'Print spooling failure', - :message=>'エラーが発生しました.' + - '印刷に失敗したものと思われます : ' + - e.message) + Tk.messageBox(:title=>'Print spooling failure', + :message=>'エラーが発生しました.' + + '印刷に失敗したものと思われます : ' + + e.message) end when 'macintosh' Tk.messageBox(:title=>'Operation not Implemented', - :message=>'印刷機能はまだ実装されていません') + :message=>'印刷機能はまだ実装されていません') else Tk.messageBox(:title=>'Operation not Implemented', - :message=>'検出された環境 ' + - Tk::TCL_PLATFORM('platform') + - ' は未知の環境であるため,' + + :message=>'検出された環境 ' + + Tk::TCL_PLATFORM('platform') + + ' は未知の環境であるため,' + '印刷機能は実装されていません: ') end ensure @@ -776,7 +776,7 @@ end # Print a file under Windows # # Arguments: -# filename - Name of the file +# filename - Name of the file # def printTextWin32(fname) require 'win32/registry' @@ -807,12 +807,12 @@ end # def aboutBox Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo', - 'message'=>"Ruby/Tk ウィジェットデモ Ver.1.4.3-jp\n\n" + + 'message'=>"Ruby/Tk ウィジェットデモ Ver.1.4.3-jp\n\n" + "based on demos of Tk8.1 -- 8.5 " + - "( Copyright:: " + - "(c) 1996-1997 Sun Microsystems, Inc. / " + + "( Copyright:: " + + "(c) 1996-1997 Sun Microsystems, Inc. / " + "(c) 1997-2000 Ajuba Solutions, Inc. / " + - "(c) 2001-2003 Donal K. Fellows )\n\n" + + "(c) 2001-2003 Donal K. Fellows )\n\n" + "Your Ruby & Tk Version ::\n" + "Ruby#{RUBY_VERSION}(#{RUBY_RELEASE_DATE})[#{RUBY_PLATFORM}] / Tk#{$tk_patchlevel}#{(Tk::JAPANIZED_TK)? '-jp': ''}") end @@ -836,7 +836,7 @@ if no_launcher loop do count = 0 $root.winfo_children.each{|w| - count += 1 if w.kind_of?(TkToplevel) + count += 1 if w.kind_of?(TkToplevel) } $root.destroy if count == 0 end |