summaryrefslogtreecommitdiff
path: root/ext/tk/sample/demos-en/ruler.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-11 04:51:21 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-11 04:51:21 +0000
commit3514110b89bee5c37e308b4ca887e66dfe841456 (patch)
treed280d8542cc44d1cd1a75e8ec87b1f9d231561b7 /ext/tk/sample/demos-en/ruler.rb
parent05f5928c9d0f094d1e7e21a9bd9d8a8fc2f1a805 (diff)
* ext/tk/lib/tk/*: untabify
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/demos-en/ruler.rb')
-rw-r--r--ext/tk/sample/demos-en/ruler.rb50
1 files changed, 25 insertions, 25 deletions
diff --git a/ext/tk/sample/demos-en/ruler.rb b/ext/tk/sample/demos-en/ruler.rb
index 03a00b75b6..4299d57b4f 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