diff options
Diffstat (limited to 'ext/tk/sample/demos-en')
38 files changed, 1594 insertions, 1594 deletions
diff --git a/ext/tk/sample/demos-en/arrow.rb b/ext/tk/sample/demos-en/arrow.rb index 3f07b8e66..b62e1966e 100644 --- a/ext/tk/sample/demos-en/arrow.rb +++ b/ext/tk/sample/demos-en/arrow.rb @@ -13,7 +13,7 @@ # interactively. # # Arguments: -# c - Name of the canvas widget. +# c - Name of the canvas widget. def arrowSetup(c) v = $demo_arrowInfo @@ -29,59 +29,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 @@ -101,7 +101,7 @@ $arrow_demo = TkToplevel.new {|w| # label TkLabel.new($arrow_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"This widget allows you to experiment with different widths and arrowhead shapes for lines in canvases. To change the line width or the shape of the arrowhead, drag any of the three boxes attached to the oversized arrow. The arrows on the right give examples at normal scale. The text at the bottom shows the configuration options as you'd enter them for a canvas line item."){ + 'text'=>"This widget allows you to experiment with different widths and arrowhead shapes for lines in canvases. To change the line width or the shape of the arrowhead, drag any of the three boxes attached to the oversized arrow. The arrows on the right give examples at normal scale. The text at the bottom shows the configuration options as you'd enter them for a canvas line item."){ pack('side'=>'top') } @@ -125,14 +125,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 @@ -161,16 +161,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 -- @@ -179,8 +179,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 @@ -199,8 +199,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 @@ -223,8 +223,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-en/bind.rb b/ext/tk/sample/demos-en/bind.rb index ab2a32de8..0bd1f0ca6 100644 --- a/ext/tk/sample/demos-en/bind.rb +++ b/ext/tk/sample/demos-en/bind.rb @@ -76,34 +76,34 @@ TkText.new($bind_demo){|t| insert('end', '2. A simple two-dimensional plot that allows you to adjust the positions of the data points.', (d2 = TkTextTag.new(t)) ) insert('end', "\n\n") insert('end', '3. Anchoring and justification modes for text items.', - (d3 = TkTextTag.new(t)) ) + (d3 = TkTextTag.new(t)) ) insert('end', "\n\n") insert('end', '4. An editor for arrow-head shapes for line items.', - (d4 = TkTextTag.new(t)) ) + (d4 = TkTextTag.new(t)) ) insert('end', "\n\n") insert('end', '5. A ruler with facilities for editing tab stops.', - (d5 = TkTextTag.new(t)) ) + (d5 = TkTextTag.new(t)) ) insert('end', "\n\n") insert('end', - '6. A grid that demonstrates how canvases can be scrolled.', - (d6 = TkTextTag.new(t)) ) + '6. A grid that demonstrates how canvases can be scrolled.', + (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-en/bitmap.rb b/ext/tk/sample/demos-en/bitmap.rb index c81e4ac59..7fd551c7a 100644 --- a/ext/tk/sample/demos-en/bitmap.rb +++ b/ext/tk/sample/demos-en/bitmap.rb @@ -9,19 +9,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 } @@ -42,7 +42,7 @@ $bitmap_demo = TkToplevel.new {|w| # label TkLabel.new($bitmap_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"This window displays all of Tk's built-in bitmaps, along with the names you can use for them in Tcl scripts."){ + 'text'=>"This window displays all of Tk's built-in bitmaps, along with the names you can use for them in Tcl scripts."){ pack('side'=>'top') } diff --git a/ext/tk/sample/demos-en/check.rb b/ext/tk/sample/demos-en/check.rb index b5def6a89..971a8fea7 100644 --- a/ext/tk/sample/demos-en/check.rb +++ b/ext/tk/sample/demos-en/check.rb @@ -55,7 +55,7 @@ TkFrame.new($check_demo) {|frame| text 'See Variables' 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-en/check2.rb b/ext/tk/sample/demos-en/check2.rb index b01e3ffc9..e2d5982d2 100644 --- a/ext/tk/sample/demos-en/check2.rb +++ b/ext/tk/sample/demos-en/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=>'See Variables', - :image=>$image['view'], :compound=>:left, - :command=>proc{ - showVars($check2_demo, - ['safety', safety], ['wipers', wipers], - ['brakes', brakes], ['sober', sober]) - }), - TkButton.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'check2'}), - TkButton.new(frame, :text=>'Dismiss', - :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=>'See Variables', + :image=>$image['view'], :compound=>:left, + :command=>proc{ + showVars($check2_demo, + ['safety', safety], ['wipers', wipers], + ['brakes', brakes], ['sober', sober]) + }), + TkButton.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'check2'}), + TkButton.new(frame, :text=>'Dismiss', + :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=>'Safety Check', :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-en/clrpick.rb b/ext/tk/sample/demos-en/clrpick.rb index 72c52a439..9486fde31 100644 --- a/ext/tk/sample/demos-en/clrpick.rb +++ b/ext/tk/sample/demos-en/clrpick.rb @@ -20,7 +20,7 @@ $clrpick_demo = TkToplevel.new {|w| # label TkLabel.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"Press the buttons below to choose the foreground and background colors for the widgets in this window.").pack('side'=>'top') + 'text'=>"Press the buttons below to choose the foreground and background colors for the widgets in this window.").pack('side'=>'top') # frame TkFrame.new($clrpick_demo) {|frame| @@ -42,7 +42,7 @@ TkFrame.new($clrpick_demo) {|frame| # button TkButton.new($clrpick_demo, 'text'=>'Set background color ...') {|b| command(proc{setColor $clrpick_demo, b, 'background', - ['background', 'highlightbackground']}) + ['background', 'highlightbackground']}) pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') } @@ -55,7 +55,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-en/cscroll.rb b/ext/tk/sample/demos-en/cscroll.rb index 8250c6e5e..0838dfbe0 100644 --- a/ext/tk/sample/demos-en/cscroll.rb +++ b/ext/tk/sample/demos-en/cscroll.rb @@ -21,7 +21,7 @@ $cscroll_demo = TkToplevel.new {|w| # label TkLabel.new($cscroll_demo, 'font'=>$font, 'wraplength'=>'4i', - 'justify'=>'left', 'text'=>"This window displays a canvas widget that can be scrolled either using the scrollbars or by dragging with button 2 in the canvas. If you click button 1 on one of the rectangles, its indices will be printed on stdout."){ + 'justify'=>'left', 'text'=>"This window displays a canvas widget that can be scrolled either using the scrollbars or by dragging with button 2 in the canvas. If you click button 1 on one of the rectangles, its indices will be printed on stdout."){ pack('side'=>'top') } @@ -54,14 +54,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| @@ -70,18 +70,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 } } @@ -92,9 +92,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 } } @@ -105,7 +105,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-en/ctext.rb b/ext/tk/sample/demos-en/ctext.rb index 13f8de721..dbb5e3263 100644 --- a/ext/tk/sample/demos-en/ctext.rb +++ b/ext/tk/sample/demos-en/ctext.rb @@ -21,7 +21,7 @@ $ctext_demo = TkToplevel.new {|w| # label TkLabel.new($ctext_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"This window displays a string of text to demonstrate the text facilities of canvas widgets. You can click in the boxes to adjust the position of the text relative to its positioning point or change its justification. The text also supports the following simple bindings for editing: + 'text'=>"This window displays a string of text to demonstrate the text facilities of canvas widgets. You can click in the boxes to adjust the position of the text relative to its positioning point or change its justification. The text also supports the following simple bindings for editing: 1. You can point, click, and type. 2. You can also select with button 1. 3. You can copy the selection to the mouse position with button 2. @@ -52,7 +52,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 @@ -60,37 +60,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'=>"This is just a string of text to demonstrate the text facilities of canvas widgets. Bindings have been been defined to support editing (see above).", - 'width'=>440, 'anchor'=>'n', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*', - 'kanjifont'=>'-*--24-*-jisx0208.1983-0', - 'justify'=>'left') ) + 'text'=>"This is just a string of text to demonstrate the text facilities of canvas widgets. Bindings have been been defined to support editing (see above).", + 'width'=>440, 'anchor'=>'n', + 'font'=>'-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*', + 'kanjifont'=>'-*--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 @@ -108,11 +108,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. @@ -124,14 +124,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-en/dialog2.rb b/ext/tk/sample/demos-en/dialog2.rb index 21bf25c88..efc4b714d 100644 --- a/ext/tk/sample/demos-en/dialog2.rb +++ b/ext/tk/sample/demos-en/dialog2.rb @@ -27,9 +27,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 "\You pressed OK\n" diff --git a/ext/tk/sample/demos-en/entry3.rb b/ext/tk/sample/demos-en/entry3.rb index 3ec162e48..415b45f86 100644 --- a/ext/tk/sample/demos-en/entry3.rb +++ b/ext/tk/sample/demos-en/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) Four different entries are displayed below. You can add characters \ by pointing, clicking and typing, though each is constrained in what \ it will accept. The first only accepts integers or the empty string \ @@ -38,13 +38,13 @@ TkFrame.new($entry3_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'Dismiss', :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=>'See Code', :width=>15, :command=>proc{ - showCode 'entry3' - }).pack(:side=>:left, :expand=>true) + showCode 'entry3' + }).pack(:side=>:left, :expand=>true) } # focusAndFlash -- @@ -54,32 +54,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(200, 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=>"Integer Entry") 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=>"Length-Constrained Entry") 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 @@ -101,7 +101,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 @@ -121,7 +121,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') @@ -145,14 +145,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) @@ -167,17 +167,17 @@ end l3 = TkLabelFrame.new($entry3_demo, :text=>"US Phone-Number Entry") 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') @@ -186,10 +186,10 @@ TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, l4 = TkLabelFrame.new($entry3_demo, :text=>"Password Entry") 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-en/filebox.rb b/ext/tk/sample/demos-en/filebox.rb index 7caaaf0ed..36b19de55 100644 --- a/ext/tk/sample/demos-en/filebox.rb +++ b/ext/tk/sample/demos-en/filebox.rb @@ -19,7 +19,7 @@ $filebox_demo = TkToplevel.new {|w| # label TkLabel.new($filebox_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"Enter a file name in the entry box or click on the \"Browse\" buttons to select a file name using the file selection dialog.").pack('side'=>'top') + 'text'=>"Enter a file name in the entry box or click on the \"Browse\" buttons to select a file name using the file selection dialog.").pack('side'=>'top') # frame TkFrame.new($filebox_demo) {|frame| @@ -48,7 +48,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') } @@ -59,9 +59,9 @@ TkFrame.new($filebox_demo) {|frame| $tk_strictMotif = TkVarAccess.new('tk_strictMotif') if ($tk_platform['platform'] == 'unix') TkCheckButton.new($filebox_demo, - 'text'=>'Use Motif Style Dialog', - 'variable'=>$tk_strictMotif, - 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c') + 'text'=>'Use Motif Style Dialog', + 'variable'=>$tk_strictMotif, + 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c') end def fileDialog(w,ent,operation) @@ -85,8 +85,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-en/floor.rb b/ext/tk/sample/demos-en/floor.rb index db4d59fe7..15c56a154 100644 --- a/ext/tk/sample/demos-en/floor.rb +++ b/ext/tk/sample/demos-en/floor.rb @@ -12,8 +12,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 @@ -63,7 +63,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] @@ -76,8 +76,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') @@ -94,24 +94,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']) @@ -218,17 +218,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']) @@ -273,17 +273,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']) @@ -303,7 +303,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 -- @@ -312,321 +312,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']) @@ -793,327 +793,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']) @@ -1275,215 +1275,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']) @@ -1592,7 +1592,7 @@ $floor_demo = TkToplevel.new {|w| # label TkLabel.new($floor_demo, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', - 'text'=>"This window contains a canvas widget showing the floorplan of Digital Equipment Corporation's Western Research Laboratory. It has three levels. At any given time one of the levels is active, meaning that you can see its room structure. To activate a level, click the left mouse button anywhere on it. As the mouse moves over the active level, the room under the mouse lights up and its room number appears in the \"Room:\" entry. You can also type a room number in the entry and the room will light up."){ + 'text'=>"This window contains a canvas widget showing the floorplan of Digital Equipment Corporation's Western Research Laboratory. It has three levels. At any given time one of the levels is active, meaning that you can see its room structure. To activate a level, click the left mouse button anywhere on it. As the mouse moves over the active level, the room under the mouse lights up and its room number appears in the \"Room:\" entry. You can also type a room number in the entry and the room will light up."){ pack('side'=>'top') } @@ -1621,12 +1621,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') } @@ -1647,20 +1647,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) @@ -1677,7 +1677,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. @@ -1714,7 +1714,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-en/floor2.rb b/ext/tk/sample/demos-en/floor2.rb index 7e418066d..ab8659a62 100644 --- a/ext/tk/sample/demos-en/floor2.rb +++ b/ext/tk/sample/demos-en/floor2.rb @@ -12,8 +12,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 @@ -63,7 +63,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] @@ -76,8 +76,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') @@ -94,24 +94,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']) @@ -218,17 +218,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']) @@ -273,17 +273,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']) @@ -303,7 +303,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 -- @@ -312,321 +312,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']) @@ -793,327 +793,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']) @@ -1275,215 +1275,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']) @@ -1592,7 +1592,7 @@ $floor2_demo = TkToplevel.new {|w| # label TkLabel.new($floor2_demo, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', - 'text'=>"This window contains a canvas widget showing the floorplan of Digital Equipment Corporation's Western Research Laboratory. It has three levels. At any given time one of the levels is active, meaning that you can see its room structure. To activate a level, click the left mouse button anywhere on it. As the mouse moves over the active level, the room under the mouse lights up and its room number appears in the \"Room:\" entry. You can also type a room number in the entry and the room will light up."){ + 'text'=>"This window contains a canvas widget showing the floorplan of Digital Equipment Corporation's Western Research Laboratory. It has three levels. At any given time one of the levels is active, meaning that you can see its room structure. To activate a level, click the left mouse button anywhere on it. As the mouse moves over the active level, the room under the mouse lights up and its room number appears in the \"Room:\" entry. You can also type a room number in the entry and the room will light up."){ pack('side'=>'top') } @@ -1621,12 +1621,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') } @@ -1647,20 +1647,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) @@ -1677,7 +1677,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. @@ -1714,7 +1714,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-en/icon.rb b/ext/tk/sample/demos-en/icon.rb index 0acf8c041..58aca2df0 100644 --- a/ext/tk/sample/demos-en/icon.rb +++ b/ext/tk/sample/demos-en/icon.rb @@ -50,14 +50,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)) # create variable letters = TkVariable.new @@ -67,14 +67,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-en/image3.rb b/ext/tk/sample/demos-en/image3.rb index d7d823ccf..d77cc0f99 100644 --- a/ext/tk/sample/demos-en/image3.rb +++ b/ext/tk/sample/demos-en/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 selectAndLoadDir(w, lbox) dir = Tk.chooseDirectory(:initialdir=>$dirName, :parent=>w, :mustexist=>true) if dir.length > 0 @@ -90,11 +90,11 @@ image3_f = TkFrame.new($image3_demo).pack(:fill=>:both, :expand=>true) image3_df = TkLabelFrame.new($image3_demo, :text=>'Directory:') image3_ff = TkLabelFrame.new($image3_demo, :text=>'File:', - :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| loadImage(self, x, y)}, '%x %y') } @@ -105,7 +105,7 @@ image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){ } TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"Select Dir.", - :command=>proc{selectAndLoadDir(image3_ent, image3_lbx)}) { + :command=>proc{selectAndLoadDir(image3_ent, image3_lbx)}) { pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m') } @@ -114,8 +114,8 @@ image3_if = TkLabelFrame.new($image3_demo, :text=>'Image:') {|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-en/items.rb b/ext/tk/sample/demos-en/items.rb index 81b447878..8ab7668a0 100644 --- a/ext/tk/sample/demos-en/items.rb +++ b/ext/tk/sample/demos-en/items.rb @@ -74,11 +74,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) @@ -114,126 +114,126 @@ $tag_item = TkcGroup.new(cvs) # Set up demos within each of the areas of the grid. TkcText.new(cvs, '5c', '.2c', 'text'=>'Lines', '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'=>'Curves (smoothed lines)', 'anchor'=>'n') + 'text'=>'Curves (smoothed lines)', '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'=>'Polygons', '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'=>'Rectangles', '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'=>'Ovals', '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'=>'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'=>'A short string of text, word-wrapped, justified left, and anchored north (at the top). The rectangles show the anchor points for each piece of text.', 'tags'=>$tag_item ) + 'text'=>'A short string of text, word-wrapped, justified left, and anchored north (at the top). The rectangles show the anchor points for each piece of 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'=>"Several lines,\n each centered\nindividually,\nand all anchored\nat the left edge.", 'justify'=>'center', 'tags'=>$tag_item ) + 'text'=>"Several lines,\n each centered\nindividually,\nand all anchored\nat the left edge.", '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'=>'Arcs', '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'=>'Bitmaps', '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) @@ -249,17 +249,17 @@ TkButton.new(cvs) {|b| text 'Press Me' 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', 'Edit this text' 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'=>'Button:', 'anchor'=>'sw') TkcText.new(cvs, '21c', '20.9c', 'text'=>'Entry:', 'anchor'=>'sw') @@ -324,7 +324,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 @@ -369,6 +369,6 @@ end def butPress(w,color) i = TkcText.new(w, '25c', '18.1c', - 'text'=>'Ouch!!', 'fill'=>color, 'anchor'=>'n') + 'text'=>'Ouch!!', 'fill'=>color, 'anchor'=>'n') Tk.after(500, proc{w.delete i}) end diff --git a/ext/tk/sample/demos-en/label.rb b/ext/tk/sample/demos-en/label.rb index 96f76d35f..55e07a5eb 100644 --- a/ext/tk/sample/demos-en/label.rb +++ b/ext/tk/sample/demos-en/label.rb @@ -50,12 +50,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'=>'First label'), TkLabel.new(f_left, 'text'=>'Second label, raised', - 'relief'=>'raised'), + 'relief'=>'raised'), TkLabel.new(f_left, 'text'=>'Third label, sunken', 'relief'=>'sunken') ].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')} diff --git a/ext/tk/sample/demos-en/labelframe.rb b/ext/tk/sample/demos-en/labelframe.rb index 8636a4a9b..842a4f6c0 100644 --- a/ext/tk/sample/demos-en/labelframe.rb +++ b/ext/tk/sample/demos-en/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) Labelframes are used to group related widgets together. \ The label may be either plain text or another widget. \ If your Tk library linked to Ruby doesn't include a 'labelframe' widget, \ @@ -33,28 +33,28 @@ TkFrame.new($labelframe_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'Dismiss', :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=>'See Code', :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=>'Value', - :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) } } @@ -77,7 +77,7 @@ end TkLabelFrame.new(w, :pady=>2, :padx=>2){|f| TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy, - :text=>"Use this option.", :padx=>0) {|cb| + :text=>"Use this option.", :padx=>0) {|cb| command proc{lfEnableButtons(f)} f.labelwidget(cb) } diff --git a/ext/tk/sample/demos-en/menu.rb b/ext/tk/sample/demos-en/menu.rb index c29f6e90d..d835d145e 100644 --- a/ext/tk/sample/demos-en/menu.rb +++ b/ext/tk/sample/demos-en/menu.rb @@ -77,8 +77,8 @@ TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|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}") $menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } } @@ -89,17 +89,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'=>'Oil checked', 'variable'=>oil) trans = TkVariable.new(0) @@ -110,18 +110,18 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m| add('check', 'label'=>'Lights checked', 'variable'=>lights) add('separator') add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu_demo, - ['oil', oil], - ['trans', trans], - ['brakes', brakes], - ['lights', lights])} ) + 'command'=>proc{showVars($menu_demo, + ['oil', oil], + ['trans', trans], + ['brakes', brakes], + ['lights', 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 point', 'variable'=>pointSize, 'value'=>10) add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14) @@ -135,9 +135,9 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m| add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') add('separator') add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu_demo, - ['pointSize', pointSize], - ['style', style])} ) + 'command'=>proc{showVars($menu_demo, + ['pointSize', pointSize], + ['style', style])} ) invoke 1 invoke 7 } @@ -149,15 +149,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'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'Dismiss')} ) + 'bitmap'=>'@'+[$demo_dir,'..', + 'images','pattern.xbm'].join(File::Separator), + 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', + 'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.', + 'bitmap'=>'', 'default'=>0, + 'buttons'=>'Dismiss')} ) ['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"}) } } } @@ -169,7 +169,7 @@ TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|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"}) } } } @@ -180,7 +180,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-en/menu84.rb b/ext/tk/sample/demos-en/menu84.rb index 8f7be9770..cb616d846 100644 --- a/ext/tk/sample/demos-en/menu84.rb +++ b/ext/tk/sample/demos-en/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) } @@ -91,8 +91,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"}) } } @@ -110,7 +110,7 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| TkMenu.new(m, 'tearoff'=>false) {|cascade_check| m.add('cascade', 'label'=>'Check buttons', - 'menu'=>cascade_check, 'underline'=>0) + 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'Oil checked', 'variable'=>oil) trans = TkVariable.new(0) @@ -121,18 +121,18 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| add('check', 'label'=>'Lights checked', 'variable'=>lights) add('separator') add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['oil', oil], - ['trans', trans], - ['brakes', brakes], - ['lights', lights])} ) + 'command'=>proc{showVars($menu84_demo, + ['oil', oil], + ['trans', trans], + ['brakes', brakes], + ['lights', 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) @@ -146,9 +146,9 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') add('separator') add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['pointSize', pointSize], - ['style', style])} ) + 'command'=>proc{showVars($menu84_demo, + ['pointSize', pointSize], + ['style', style])} ) invoke 1 invoke 7 } @@ -158,14 +158,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'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'Dismiss')} ) + 'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.', + 'bitmap'=>'', 'default'=>0, + 'buttons'=>'Dismiss')} ) ['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) @@ -176,38 +176,38 @@ 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'=>'The menu entry you invoked'+ - 'displays both a bitmap and '+ - 'a text string. Other than '+ - 'this, it isjust like any '+ - 'other menu entry.', - 'buttons'=>['OK'], 'bitmap'=>'') - }) + 'bitmap'=>'questhead', 'compound'=>'left', + 'command'=>proc{ + TkDialog.new('title'=>'Compound Menu Entry', + 'message'=>'The menu entry you invoked'+ + 'displays both a bitmap and '+ + 'a text string. Other than '+ + 'this, it isjust like any '+ + 'other menu entry.', + 'buttons'=>['OK'], '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-en/menubu.rb b/ext/tk/sample/demos-en/menubu.rb index cc1ccafa7..e2ddd07bc 100644 --- a/ext/tk/sample/demos-en/menubu.rb +++ b/ext/tk/sample/demos-en/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-en/msgbox.rb b/ext/tk/sample/demos-en/msgbox.rb index 4152477e6..aab1b619c 100644 --- a/ext/tk/sample/demos-en/msgbox.rb +++ b/ext/tk/sample/demos-en/msgbox.rb @@ -20,7 +20,7 @@ $msgbox_demo = TkToplevel.new {|w| # label TkLabel.new($msgbox_demo, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"Choose the icon and type option of the message box. Then press the \"Message Box\" button to see the message box.").pack('side'=>'top') + 'text'=>"Choose the icon and type option of the message box. Then press the \"Message Box\" button to see the message box.").pack('side'=>'top') # frame TkFrame.new($msgbox_demo) {|frame| @@ -48,9 +48,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'=>'Icon').pack('side'=>'top') TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ @@ -59,9 +59,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'=>'Type').pack('side'=>'top') @@ -72,17 +72,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'=>"This is a \"#{$msgboxType.value}\" type messagebox with the \"#{$msgboxIcon.value}\" icon") + 'title'=>'Message', 'parent'=>w, + 'message'=>"This is a \"#{$msgboxType.value}\" type messagebox with the \"#{$msgboxIcon.value}\" icon") Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, - 'message'=>"You have selected \"#{button}\"") + 'message'=>"You have selected \"#{button}\"") end diff --git a/ext/tk/sample/demos-en/paned1.rb b/ext/tk/sample/demos-en/paned1.rb index 8c25de0ef..48ba86de0 100644 --- a/ext/tk/sample/demos-en/paned1.rb +++ b/ext/tk/sample/demos-en/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) The sash between the two coloured windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.) If your Tk library linked to Ruby doesn't include a 'panedwindow', this demo doesn't work. Please use later version of Tk which supports a 'panedwindow'. EOL @@ -28,13 +28,13 @@ TkFrame.new($paned1_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'Dismiss', :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=>'See Code', :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-en/paned2.rb b/ext/tk/sample/demos-en/paned2.rb index 53c19c0ff..5911cadab 100644 --- a/ext/tk/sample/demos-en/paned2.rb +++ b/ext/tk/sample/demos-en/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) The sash between the two scrolled windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.) If your Tk library linked to Ruby doesn't include a 'panedwindow', this demo doesn't work. Please use later version of Tk which supports a 'panedwindow'. EOL @@ -28,13 +28,13 @@ TkFrame.new($paned2_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'Dismiss', :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=>'See Code', :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) @@ -65,28 +65,28 @@ 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', "This is just a normal text widget") - 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', "This is just a normal text widget") + 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-en/plot.rb b/ext/tk/sample/demos-en/plot.rb index fb887011a..6d01deeef 100644 --- a/ext/tk/sample/demos-en/plot.rb +++ b/ext/tk/sample/demos-en/plot.rb @@ -21,7 +21,7 @@ $plot_demo = TkToplevel.new {|w| # label TkLabel.new($plot_demo, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"This window displays a canvas widget containing a simple 2-dimensional plot. You can doctor the data by dragging any of the points with mouse button 1."){ + 'text'=>"This window displays a canvas widget containing a simple 2-dimensional plot. You can doctor the data by dragging any of the points with mouse button 1."){ pack('side'=>'top') } @@ -54,39 +54,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'=>"A Simple Plot", 'font'=>plotFont, 'fill'=>'brown') + 'text'=>"A Simple Plot", '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} @@ -95,8 +95,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' @@ -111,8 +111,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-en/puzzle.rb b/ext/tk/sample/demos-en/puzzle.rb index d206efe34..0885cf297 100644 --- a/ext/tk/sample/demos-en/puzzle.rb +++ b/ext/tk/sample/demos-en/puzzle.rb @@ -88,7 +88,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 @@ -105,9 +105,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-en/radio2.rb b/ext/tk/sample/demos-en/radio2.rb index 090e75c2c..2b56ccc9b 100644 --- a/ext/tk/sample/demos-en/radio2.rb +++ b/ext/tk/sample/demos-en/radio2.rb @@ -54,18 +54,18 @@ TkFrame.new($radio2_demo) {|frame| text 'See Variables' 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'=>'Point Size', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_mid = TkLabelFrame.new($radio2_demo, 'text'=>'Color', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_right = TkLabelFrame.new($radio2_demo, 'text'=>'Alignment', - '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') @@ -91,14 +91,14 @@ f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') } label = TkLabel.new(f_right, 'text'=>'Label', '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-en/radio3.rb b/ext/tk/sample/demos-en/radio3.rb index ca0453416..70c4abb3b 100644 --- a/ext/tk/sample/demos-en/radio3.rb +++ b/ext/tk/sample/demos-en/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=>'See Variables', - :image=>$image['view'], :compound=>:left, - :command=>proc{ - showVars($radio3_demo, ['size', size], - ['color', color], ['compound', align]) - }), - TkButton.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'radio3'}), - TkButton.new(frame, :text=>'Dismiss', - :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=>'See Variables', + :image=>$image['view'], :compound=>:left, + :command=>proc{ + showVars($radio3_demo, ['size', size], + ['color', color], ['compound', align]) + }), + TkButton.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'radio3'}), + TkButton.new(frame, :text=>'Dismiss', + :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'=>'Point Size', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_mid = TkLabelFrame.new($radio3_demo, 'text'=>'Color', - 'pady'=>2, 'padx'=>2) + 'pady'=>2, 'padx'=>2) f_right = TkLabelFrame.new($radio3_demo, 'text'=>'Alignment', - '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'=>'Tristate', - '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'=>'Tristate', } label = TkLabel.new(f_right, 'text'=>'Label', '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-en/ruler.rb b/ext/tk/sample/demos-en/ruler.rb index 03a00b75b..4299d57b4 100644 --- a/ext/tk/sample/demos-en/ruler.rb +++ b/ext/tk/sample/demos-en/ruler.rb @@ -11,8 +11,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 @@ -34,7 +34,7 @@ $ruler_demo = TkToplevel.new {|w| # label TkLabel.new($ruler_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"This canvas widget shows a mock-up of a ruler. You can create tab stops by dragging them out of the well to the right of the ruler. You can also drag existing tab stops. If you drag a tab stop far enough up or down so that it turns dim, it will be deleted when you release the mouse button."){ + 'text'=>"This canvas widget shows a mock-up of a ruler. You can create tab stops by dragging them out of the well to the right of the ruler. You can also drag existing tab stops. If you drag a tab stop far enough up or down so that it turns dim, it will be deleted when you release the mouse button."){ pack('side'=>'top') } @@ -63,8 +63,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') @@ -86,7 +86,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) @@ -99,22 +99,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 -- @@ -122,8 +122,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 @@ -140,9 +140,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 @@ -159,8 +159,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 @@ -187,8 +187,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-en/sayings.rb b/ext/tk/sample/demos-en/sayings.rb index 4ba3097be..cef0f4ecf 100644 --- a/ext/tk/sample/demos-en/sayings.rb +++ b/ext/tk/sample/demos-en/sayings.rb @@ -69,11 +69,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-en/search.rb b/ext/tk/sample/demos-en/search.rb index 59a8117bb..3d3b4aecc 100644 --- a/ext/tk/sample/demos-en/search.rb +++ b/ext/tk/sample/demos-en/search.rb @@ -13,9 +13,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') @@ -31,10 +31,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') @@ -55,15 +55,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 @@ -100,35 +100,35 @@ $search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # frame TkFrame.new($search_demo) {|f| TkLabel.new(f, 'text'=>'File name:', - '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'=>'Load File', - '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'=>'Search string:', - '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'=>'Highlight', - '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') @@ -146,24 +146,24 @@ $search_text = TkText.new($search_demo, 'setgrid'=>true, 'wrap'=>'word') {|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', "\ This window demonstrates how to use the tagging facilities in text \ diff --git a/ext/tk/sample/demos-en/spin.rb b/ext/tk/sample/demos-en/spin.rb index 5d3245417..58616b1e0 100644 --- a/ext/tk/sample/demos-en/spin.rb +++ b/ext/tk/sample/demos-en/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) Three different spin-boxes are displayed below. \ You can add characters by pointing, clicking and typing. \ The normal Motif editing characters are supported, along with \ @@ -38,13 +38,13 @@ TkFrame.new($spin_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'Dismiss', :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=>'See Code', :width=>15, :command=>proc{ - showCode 'spin' - }).pack(:side=>:left, :expand=>true) + showCode 'spin' + }).pack(:side=>:left, :expand=>true) } australianCities = [ @@ -54,10 +54,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-en/style.rb b/ext/tk/sample/demos-en/style.rb index def83d1a2..5ed11aa45 100644 --- a/ext/tk/sample/demos-en/style.rb +++ b/ext/tk/sample/demos-en/style.rb @@ -65,13 +65,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') @@ -85,24 +85,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') @@ -112,10 +112,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', 'Text widgets like this one allow you to display information in a diff --git a/ext/tk/sample/demos-en/text.rb b/ext/tk/sample/demos-en/text.rb index 2ed53e693..4bb4b6bc7 100644 --- a/ext/tk/sample/demos-en/text.rb +++ b/ext/tk/sample/demos-en/text.rb @@ -102,16 +102,16 @@ a new line by inserting a newline character to the right of the insertion cursor. Control-t transposes the two characters on either side of the insertion cursor. #{ if undo_support - undo_text = "Control-z undoes the last editing action performed,\nand " - case $tk_platform['platform'] - when "unix", "macintosh" - undo_text << "Control-Shift-z" - else # 'windows' - undo_text << "Control-y" - end - undo_text << "redoes undone edits." + undo_text = "Control-z undoes the last editing action performed,\nand " + case $tk_platform['platform'] + when "unix", "macintosh" + undo_text << "Control-Shift-z" + else # 'windows' + undo_text << "Control-y" + end + undo_text << "redoes undone edits." else - "" + "" end } diff --git a/ext/tk/sample/demos-en/twind.rb b/ext/tk/sample/demos-en/twind.rb index c841b7c31..24a4bcf70 100644 --- a/ext/tk/sample/demos-en/twind.rb +++ b/ext/tk/sample/demos-en/twind.rb @@ -40,10 +40,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} @@ -53,16 +53,16 @@ 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', "A text widget can contain other widgets embedded ") $twind_text.insert('end', "it. These are called \"embedded windows\", ") @@ -70,42 +70,42 @@ $twind_text.insert('end', "and they can consist of arbitrary widgets. ") $twind_text.insert('end', "For example, here are two embedded button ") $twind_text.insert('end', "widgets. You can click on the first button to ") TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - #text 'ON' - text 'Turn On' - command proc{textWindOn $twind_text,$twind_buttons} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind_text) { + #text 'ON' + text 'Turn On' + command proc{textWindOn $twind_text,$twind_buttons} + cursor 'top_left_arrow' + }) $twind_text.insert('end', " horizontal scrolling, which also turns off ") $twind_text.insert('end', "word wrapping. Or, you can click on the second ") $twind_text.insert('end', "button to\n") TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - #text 'OFF' - text 'Turn Off' - command proc{textWindOff $twind_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind_text) { + #text 'OFF' + text 'Turn Off' + command proc{textWindOff $twind_text} + cursor 'top_left_arrow' + }) $twind_text.insert('end', " horizontal scrolling and turn back on word wrapping.\n\n") $twind_text.insert('end', "Or, here is another example. If you ") TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text 'Click Here' - command proc{textWindPlot $twind_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind_text) { + text 'Click Here' + command proc{textWindPlot $twind_text} + cursor 'top_left_arrow' + }) $twind_text.insert('end', " a canvas displaying an x-y plot will appear right here.") $mark_plot = TkTextMark.new($twind_text, 'insert') $mark_plot.gravity='left' $twind_text.insert('end', " You can drag the data points around with the mouse, ") $twind_text.insert('end', "or you can click here to ") TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text 'Delete' - command proc{textWindDel $twind_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind_text) { + text 'Delete' + command proc{textWindDel $twind_text} + cursor 'top_left_arrow' + }) $twind_text.insert('end', " the plot again.\n\n") $twind_text.insert('end', "You may also find it useful to put embedded windows in ") @@ -123,27 +123,27 @@ $twind_text.insert('end', "to restore the short string.\n") TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) {|b| - text 'Default' - command proc{embDefBg $twind_text} - cursor 'top_left_arrow' - $tag_buttons.add('end') - }, - 'padx'=>3 ) + 'window'=>TkButton.new($twind_text) {|b| + text 'Default' + 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-en/twind2.rb b/ext/tk/sample/demos-en/twind2.rb index 95b11a799..c42e0999d 100644 --- a/ext/tk/sample/demos-en/twind2.rb +++ b/ext/tk/sample/demos-en/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=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'twind2'}), - TkButton.new(frame, :text=>'Dismiss', - :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=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'twind2'}), + TkButton.new(frame, :text=>'Dismiss', + :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,26 +53,26 @@ TkFrame.new($twind2_demo, 'highlightthickness'=>2, 'borderwidth'=>2, # text tags $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 ) # insert text $twind2_text.insert('end', - 'A text widget can contain many different kinds of items, ') + 'A text widget can contain many different kinds of items, ') $twind2_text.insert('end', - "both active and passive. It can lay these out in various ") + "both active and passive. It can lay these out in various ") $twind2_text.insert('end', - "ways, with wrapping, tabs, centering, etc. In addition, ") + "ways, with wrapping, tabs, centering, etc. In addition, ") $twind2_text.insert('end', - "when the contents are too big for the window, smooth ") + "when the contents are too big for the window, smooth ") $twind2_text.insert('end', "scrolling in all directions is provided.\n\n") $twind2_text.insert('end', "A text widget can contain other widgets embedded ") @@ -81,59 +81,59 @@ $twind2_text.insert('end', "and they can consist of arbitrary widgets. ") $twind2_text.insert('end', "For example, here are two embedded button ") $twind2_text.insert('end', "widgets. You can click on the first button to ") TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text) { - text 'ON' - command proc{textWindOn2 $twind2_text,$twind2_buttons} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind2_text) { + text 'ON' + command proc{textWindOn2 $twind2_text,$twind2_buttons} + cursor 'top_left_arrow' + }) $twind2_text.insert('end', " horizontal scrolling, which also turns off ") $twind2_text.insert('end', "word wrapping. Or, you can click on the second ") $twind2_text.insert('end', "button to\n") TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text) { - text 'OFF' - command proc{textWindOff2 $twind2_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind2_text) { + text 'OFF' + command proc{textWindOff2 $twind2_text} + cursor 'top_left_arrow' + }) $twind2_text.insert('end', - " horizontal scrolling and turn back on word wrapping.\n\n") + " horizontal scrolling and turn back on word wrapping.\n\n") $twind2_text.insert('end', "Or, here is another example. If you ") TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text) { - text 'Click Here' - command proc{textWindPlot2 $twind2_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind2_text) { + text 'Click Here' + command proc{textWindPlot2 $twind2_text} + cursor 'top_left_arrow' + }) $twind2_text.insert('end', - " a canvas displaying an x-y plot will appear right here.") + " a canvas displaying an x-y plot will appear right here.") $mark2_plot = TkTextMark.new($twind2_text, 'insert') $mark2_plot.gravity='left' $twind2_text.insert('end', - " You can drag the data points around with the mouse, ") + " You can drag the data points around with the mouse, ") $twind2_text.insert('end', "or you can click here to ") TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text) { - text 'Delete' - command proc{textWindDel2 $twind2_text} - cursor 'top_left_arrow' - }) + 'window'=>TkButton.new($twind2_text) { + text 'Delete' + command proc{textWindDel2 $twind2_text} + cursor 'top_left_arrow' + }) $twind2_text.insert('end', " the plot again.\n\n") $twind2_text.insert('end', - "You may also find it useful to put embedded windows in ") + "You may also find it useful to put embedded windows in ") $twind2_text.insert('end', - "a text without any actual text. In this case the ") + "a text without any actual text. In this case the ") $twind2_text.insert('end', "text widget acts like a geometry manager. For ") $twind2_text.insert('end', - "example, here is a collection of buttons laid out ") + "example, here is a collection of buttons laid out ") $twind2_text.insert('end', - "neatly into rows by the text widget. These buttons ") + "neatly into rows by the text widget. These buttons ") $twind2_text.insert('end', - "can be used to change the background color of the ") + "can be used to change the background color of the ") $twind2_text.insert('end', "text widget (\"Default\" restores the color to ") $twind2_text.insert('end', - "its default). If you click on the button labeled ") + "its default). If you click on the button labeled ") $twind2_text.insert('end', "\"Short\", it changes to a longer string so that ") $twind2_text.insert('end', "you can see how the text widget automatically ") $twind2_text.insert('end', "changes the layout. Click on the button again ") @@ -147,18 +147,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', @@ -166,13 +166,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') @@ -186,55 +186,55 @@ $twind2_text.insert('end', "\nYou can also change the usual border width and ") $twind2_text.insert('end', "highlightthickness and 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\nFinally, images fit comfortably in text widgets too:") + "\n\nFinally, images fit comfortably in text widgets too:") 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))) # methods def textWinBigB2(w) @@ -308,39 +308,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-en/unicodeout.rb b/ext/tk/sample/demos-en/unicodeout.rb index 7bb951c93..07e3bf52b 100644 --- a/ext/tk/sample/demos-en/unicodeout.rb +++ b/ext/tk/sample/demos-en/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) This is a sample of Tk's support for languages that use non-Western \ character sets. However, what you will actually see below depends \ largely on what character sets you have installed, and what you see \ @@ -40,18 +40,18 @@ TkFrame.new($unicodeout_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'Dismiss', :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=>'See Code', :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=>"Please wait while loading fonts...", - :font=>"Helvetica 12 italic").pack + :text=>"Please wait while loading fonts...", + :font=>"Helvetica 12 italic").pack class Unicodeout_SampleFrame < TkFrame @@font = $font @@ -71,10 +71,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 @@ -90,23 +90,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-en/widget b/ext/tk/sample/demos-en/widget index f529792e7..133d151d4 100644 --- a/ext/tk/sample/demos-en/widget +++ b/ext/tk/sample/demos-en/widget @@ -103,11 +103,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}) @@ -141,7 +141,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) { @@ -166,11 +166,11 @@ else statusBar = TkFrame.new($root) {|f| $statusBarLabel = \ TkLabel.new(f, 'text'=>" ", 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ - .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both') + '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-*-*-*-*-*-*') \ - .pack('side'=>'left', 'padx'=>2) + 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ + .pack('side'=>'left', 'padx'=>2) }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) end @@ -188,53 +188,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') # Create the text for the text widget. @@ -308,8 +308,8 @@ txt.insert('end', " \n ", tag_demospace) txt.insert('end', "2. With scrollbars.\n", tag_demo, "demo-entry2") txt.insert('end', " \n ", tag_demospace) txt.insert('end', - "3. Validated entries and password fields. (if supported)\n", - tag_demo, "demo-entry3") + "3. Validated entries and password fields. (if supported)\n", + tag_demo, "demo-entry3") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "4. Spin-boxes. (if supported)\n", tag_demo, "demo-spin") txt.insert('end', " \n ", tag_demospace) @@ -406,7 +406,7 @@ scr.focus # new demo window. # # Arguments: -# w - The name of the window to position. +# w - The name of the window to position. def positionWindow(w) w.geometry('+300+300') @@ -417,8 +417,8 @@ end # updates the display whenever any of the variables changes. # # Arguments: -# w - Name of new window to create for display. -# args - Any number of names of variables. +# w - Name of new window to create for display. +# args - Any number of names of variables. $showVarsWin = {} def showVars1(parent, *args) @@ -442,10 +442,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) { @@ -467,11 +467,11 @@ def showVars2(parent, *args) title "Variable values" TkLabelFrame.new(w, :text=>"Variable values:", - :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) @@ -479,7 +479,7 @@ def showVars2(parent, *args) f.grid_rowconfig(100, :weight=>1) } TkButton.new(w, :text=>"OK", :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}) @@ -503,8 +503,8 @@ end # It is responsible for invoking the demonstration. # # Arguments: -# txt - Name of text widget -# index - The index of the character that the user clicked on. +# txt - Name of text widget +# index - The index of the character that the user clicked on. def invoke (txt, index) tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/} @@ -524,8 +524,8 @@ end # showStatus -- # -# Show the name of the demo program in the status bar. This procedure -# is called when the user moves the cursor over a demo description. +# Show the name of the demo program in the status bar. This procedure +# is called when the user moves the cursor over a demo description. # def showStatus (txt, index) @@ -537,7 +537,7 @@ def showStatus (txt, index) else demoname = tag[5..-1] $statusBarLabel.configure('text', - "Run the \"#{demoname}\" sample program") + "Run the \"#{demoname}\" sample program") newcursor = 'hand2' end txt.configure('cursor'=>newcursor) if cursor != newcursor @@ -548,8 +548,8 @@ end # a demonstration and allows it to be edited and reinvoked. # # Arguments: -# demo - The name of the demonstration's window, which can be -# used to derive the name of the file containing its code. +# demo - The name of the demonstration's window, which can be +# used to derive the name of the file containing its code. def showCode1(demo) file = "#{demo}.rb" @@ -560,8 +560,8 @@ def showCode1(demo) TkButton.new(f) { text "Dismiss" command proc{ - $code_window.destroy - $code_window = nil + $code_window.destroy + $code_window = nil } }.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2) TkButton.new(f) { @@ -574,44 +574,44 @@ 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' - 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') + 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' + 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') # JKC 2001-07-26: segfaults under 1.7.1 (2001-06-19) [i686-linux] - TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) + TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) + TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) } end else @@ -638,8 +638,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') @@ -650,17 +650,17 @@ def showCode2(demo) bf = TkFrame.new($code_window) b_dis = TkButton.new(bf, :text=>'Dismiss', :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=>'Print Code', - :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=>'Rerun Demo', - :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) @@ -671,8 +671,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) } @@ -704,8 +704,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') @@ -721,24 +721,24 @@ def printCode(txt, file) when 'unix' msg = `lp -c #{fname}` unless $?.exitstatus == 0 - Tk.messageBox(:title=>'Print spooling failure', - :message=>'Print spooling probably failed: ' + msg) + Tk.messageBox(:title=>'Print spooling failure', + :message=>'Print spooling probably failed: ' + msg) end when 'windows' begin - printTextWin32(fname) + printTextWin32(fname) rescue => e - Tk.messageBox(:title=>'Print spooling failure', - :message=>'Print spooling probably failed: ' + - e.message) + Tk.messageBox(:title=>'Print spooling failure', + :message=>'Print spooling probably failed: ' + + e.message) end when 'macintosh' Tk.messageBox(:title=>'Operation not Implemented', - :message=>'Oops, sorry: not implemented yet!') + :message=>'Oops, sorry: not implemented yet!') else Tk.messageBox(:title=>'Operation not Implemented', - :message=>'Wow! Unknown platform: ' + - Tk::TCL_PLATFORM('platform')) + :message=>'Wow! Unknown platform: ' + + Tk::TCL_PLATFORM('platform')) end ensure File.delete(fname) @@ -749,7 +749,7 @@ end # Print a file under Windows # # Arguments: -# filename - Name of the file +# filename - Name of the file # def printTextWin32(fname) require 'win32/registry' @@ -780,12 +780,12 @@ end # def aboutBox Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo', - 'message'=>"Ruby/Tk widget demonstration Ver.1.4.3-en\n\n" + + 'message'=>"Ruby/Tk widget demonstration Ver.1.4.3-en\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 @@ -809,7 +809,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 |