diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
commit | 287a34ae0dfc23e4158f67cb7783d239f202c368 (patch) | |
tree | 5e35d5b41aae961b37cf6632f60c42f51c7aa775 /ext/tk/sample/tkextlib/vu | |
parent | 9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff) | |
download | ruby-287a34ae0dfc23e4158f67cb7783d239f202c368.tar.gz |
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/tkextlib/vu')
-rw-r--r-- | ext/tk/sample/tkextlib/vu/canvItems.rb | 68 | ||||
-rw-r--r-- | ext/tk/sample/tkextlib/vu/canvSticker.rb | 4 | ||||
-rw-r--r-- | ext/tk/sample/tkextlib/vu/canvSticker2.rb | 4 | ||||
-rw-r--r-- | ext/tk/sample/tkextlib/vu/dial_demo.rb | 62 | ||||
-rw-r--r-- | ext/tk/sample/tkextlib/vu/oscilloscope.rb | 16 | ||||
-rw-r--r-- | ext/tk/sample/tkextlib/vu/pie.rb | 10 | ||||
-rw-r--r-- | ext/tk/sample/tkextlib/vu/vu_demo.rb | 14 |
7 files changed, 89 insertions, 89 deletions
diff --git a/ext/tk/sample/tkextlib/vu/canvItems.rb b/ext/tk/sample/tkextlib/vu/canvItems.rb index 33acf4f7e7..364f87613b 100644 --- a/ext/tk/sample/tkextlib/vu/canvItems.rb +++ b/ext/tk/sample/tkextlib/vu/canvItems.rb @@ -9,63 +9,63 @@ xbm = File.join(File.dirname(File.expand_path(__FILE__)), 'm128_000.xbm') sval = [ 11, 22, 33, 44, 55, 66, 77, 88, 99 ] -l0 = TkLabel.new(:width=>128, :height=>128, +l0 = TkLabel.new(:width=>128, :height=>128, :bitmap=>"@#{xbm}", :relief=>:groove).pack(:side=>:left) -c0 = TkCanvas.new(:width=>80, :height=>80, - :insertwidth=>0, :highlightthickness=>0, - :selectborderwidth=>0, :borderwidth=>2, - :relief=>:ridge).place(:in=>l0, :relx=>0.5, :rely=>0.5, +c0 = TkCanvas.new(:width=>80, :height=>80, + :insertwidth=>0, :highlightthickness=>0, + :selectborderwidth=>0, :borderwidth=>2, + :relief=>:ridge).place(:in=>l0, :relx=>0.5, :rely=>0.5, :anchor=>:c) -st = Tk::Vu::TkcStripchart.new(c0, 3, 3, 80, 80, - :background=>"#b7c0d7", :fill=>'slategray3', - :jumpscroll=>1, :outline=>'black', - :scaleline=>'blue', :stripline=>'red', +st = Tk::Vu::TkcStripchart.new(c0, 3, 3, 80, 80, + :background=>"#b7c0d7", :fill=>'slategray3', + :jumpscroll=>1, :outline=>'black', + :scaleline=>'blue', :stripline=>'red', :selected=>1, :values=>sval) -TkcText.create(c0, 40, 40, +TkcText.create(c0, 40, 40, :text=>Tk::TCL_PATCHLEVEL, :fill=>'cyan', :tags=>'text') -l1 = TkLabel.new(:width=>128, :height=>128, +l1 = TkLabel.new(:width=>128, :height=>128, :bitmap=>"@#{xbm}", :relief=>:groove).pack(:side=>:left) -c1 = TkCanvas.new(:width=>80, :height=>80, - :insertwidth=>0, :highlightthickness=>0, - :selectborderwidth=>0, :borderwidth=>2, - :relief=>:ridge).place(:in=>l1, :relx=>0.5, :rely=>0.5, +c1 = TkCanvas.new(:width=>80, :height=>80, + :insertwidth=>0, :highlightthickness=>0, + :selectborderwidth=>0, :borderwidth=>2, + :relief=>:ridge).place(:in=>l1, :relx=>0.5, :rely=>0.5, :anchor=>:c) -bar1 = Tk::Vu::TkcBarchart.new(c1, 3, 3, 80, 80, - :background=>"#b7c0d7", :scalevalue=>10.0, - :autocolor=>true, :selected=>1, - :outline=>'black', :barline=>'yellow', +bar1 = Tk::Vu::TkcBarchart.new(c1, 3, 3, 80, 80, + :background=>"#b7c0d7", :scalevalue=>10.0, + :autocolor=>true, :selected=>1, + :outline=>'black', :barline=>'yellow', :scalelinestyle=>0) -bar2 = Tk::Vu::TkcBarchart.new(c1, 53, 3, 80, 80, - :background=>"#b7c0d7", :scalevalue=>10.0, - :autocolor=>true, :selected=>1, - :outline=>'black', :fill=>"#b7c0d7", +bar2 = Tk::Vu::TkcBarchart.new(c1, 53, 3, 80, 80, + :background=>"#b7c0d7", :scalevalue=>10.0, + :autocolor=>true, :selected=>1, + :outline=>'black', :fill=>"#b7c0d7", :barline=>'red', :scalelinestyle=>22) -l2 = TkLabel.new(:width=>128, :height=>128, +l2 = TkLabel.new(:width=>128, :height=>128, :bitmap=>"@#{xbm}", :relief=>:groove).pack(:side=>:left) -c2 = TkCanvas.new(:width=>80, :height=>80, - :insertwidth=>0, :highlightthickness=>0, - :selectborderwidth=>0, :borderwidth=>2, - :relief=>:ridge).place(:in=>l2, :relx=>0.5, :rely=>0.5, +c2 = TkCanvas.new(:width=>80, :height=>80, + :insertwidth=>0, :highlightthickness=>0, + :selectborderwidth=>0, :borderwidth=>2, + :relief=>:ridge).place(:in=>l2, :relx=>0.5, :rely=>0.5, :anchor=>:c) begin - stick = Tk::Vu::TkcSticker.new(c2, 3, 3, 80, 80, - :text=>"Tcl/Tk", :space=>0, :color=>'red', - :outline=>'red', :font=>'Helvetica 14 bold', - :fill=>'', :stipple=>'', :bar=>'blue', - :orient=>:vertical, :anchor=>:s, - :relheight=>1.0, :relwidth=>0.15, + stick = Tk::Vu::TkcSticker.new(c2, 3, 3, 80, 80, + :text=>"Tcl/Tk", :space=>0, :color=>'red', + :outline=>'red', :font=>'Helvetica 14 bold', + :fill=>'', :stipple=>'', :bar=>'blue', + :orient=>:vertical, :anchor=>:s, + :relheight=>1.0, :relwidth=>0.15, :relx=>0.1, :rely=>0.0) rescue stick = nil diff --git a/ext/tk/sample/tkextlib/vu/canvSticker.rb b/ext/tk/sample/tkextlib/vu/canvSticker.rb index e2cd604975..85713ebcf3 100644 --- a/ext/tk/sample/tkextlib/vu/canvSticker.rb +++ b/ext/tk/sample/tkextlib/vu/canvSticker.rb @@ -14,7 +14,7 @@ c = TkCanvas.new.pack begin st = Tk::Vu::TkcSticker.new(c, 0, 0, 10, 10) rescue - Tk.messageBox(:type=>'ok', :title=>"No sticker Item", + Tk.messageBox(:type=>'ok', :title=>"No sticker Item", :message=>"This build of vu does not include the sticker item") exit end @@ -56,7 +56,7 @@ steps << proc{ steps << proc{ puts 'A vertical bar appears in the lower right region and text jumps to the left.' - st.configure(:anchor=>:n, :relw=>0.3, :relh=>0.7, + st.configure(:anchor=>:n, :relw=>0.3, :relh=>0.7, :relx=>0.6, :rely=>0.3, :bar=>'red') } diff --git a/ext/tk/sample/tkextlib/vu/canvSticker2.rb b/ext/tk/sample/tkextlib/vu/canvSticker2.rb index 548a72c2cb..3d9495ffb0 100644 --- a/ext/tk/sample/tkextlib/vu/canvSticker2.rb +++ b/ext/tk/sample/tkextlib/vu/canvSticker2.rb @@ -10,7 +10,7 @@ c = TkCanvas.new.pack begin st = Tk::Vu::TkcSticker.new(c, 0, 0, 10, 10) rescue - Tk.messageBox(:type=>'ok', :title=>"No sticker Item", + Tk.messageBox(:type=>'ok', :title=>"No sticker Item", :message=>"This build of vu does not include the sticker item") exit end @@ -22,7 +22,7 @@ c.destroy #sti_conf = [ [10, 10, 180, 180], "Sticker äöüß@²³¼½¾", :center ] #txt_conf = [ [210, 210], "Text äöüß@²³¼½¾", :center ] -sti_conf = [ [10, 10, 350, 350], +sti_conf = [ [10, 10, 350, 350], Tk::UTF8_String('Sticker \u00E4\u00F6\u00FC\u00DF\u0040\u00B2\u00B3\u00BC\u00BD\u00BE'), :center ] txt_conf = [ [250, 250], diff --git a/ext/tk/sample/tkextlib/vu/dial_demo.rb b/ext/tk/sample/tkextlib/vu/dial_demo.rb index 09bd3e9186..f1f2f110b1 100644 --- a/ext/tk/sample/tkextlib/vu/dial_demo.rb +++ b/ext/tk/sample/tkextlib/vu/dial_demo.rb @@ -12,61 +12,61 @@ v_rot = TkVariable.new v_linked = TkVariable.new v_needle = TkVariable.new -volume = Tk::Vu::Dial.new(:label=>"Volume", :from=>-0.1, :to=>0.1, - :resolution=>0.001, :minortickinterval=>0.01, - :tickinterval=>0.1, :beginangle=>-20, +volume = Tk::Vu::Dial.new(:label=>"Volume", :from=>-0.1, :to=>0.1, + :resolution=>0.001, :minortickinterval=>0.01, + :tickinterval=>0.1, :beginangle=>-20, :endangle=>260, :variable=>v_volume) -speed = Tk::Vu::Dial.new(:label=>"Speed", :from=>2000, :to=>100, - :resolution=>10, :tickinterval=>100, - :minortickinterval=>0, :variable=>v_speed, +speed = Tk::Vu::Dial.new(:label=>"Speed", :from=>2000, :to=>100, + :resolution=>10, :tickinterval=>100, + :minortickinterval=>0, :variable=>v_speed, :showtags=>:label, :showvalue=>false) speed.set_tag_constrain(100, 'Fast', 2000, 'Slow') -fwd = Tk::Vu::Dial.new(:from=>-10.0, :to=>-20.0, :resolution=>0.1, - :tickinterval=>5.0, :minortickinterval=>1.0, +fwd = Tk::Vu::Dial.new(:from=>-10.0, :to=>-20.0, :resolution=>0.1, + :tickinterval=>5.0, :minortickinterval=>1.0, :variable=>v_dir) -rev = Tk::Vu::Dial.new(:from=>-20.0, :to=>-10.0, :resolution=>0.1, - :tickinterval=>5.0, :minortickinterval=>1.0, +rev = Tk::Vu::Dial.new(:from=>-20.0, :to=>-10.0, :resolution=>0.1, + :tickinterval=>5.0, :minortickinterval=>1.0, :variable=>v_dir) -small = Tk::Vu::Dial.new(:font=>"Helvetica -10", :from=>0, :to=>10, +small = Tk::Vu::Dial.new(:font=>"Helvetica -10", :from=>0, :to=>10, :resolution=>0.05, :tickinterval=>2, - :minortickinterval=>0.5, :radius=>20, - :dialcolor=>'red2', :activebackground=>'red', + :minortickinterval=>0.5, :radius=>20, + :dialcolor=>'red2', :activebackground=>'red', :variable=>v_rot) -large = Tk::Vu::Dial.new(:font=>"Helvetica -8", :from=>0, :to=>10, +large = Tk::Vu::Dial.new(:font=>"Helvetica -8", :from=>0, :to=>10, :resolution=>0.05, :tickinterval=>1, - :minortickinterval=>0.25, :radius=>40, - :dialcolor=>'red2', :activebackground=>'red', + :minortickinterval=>0.25, :radius=>40, + :dialcolor=>'red2', :activebackground=>'red', :variable=>v_rot) -turn = Tk::Vu::Dial.new(:needlecolor=>'red', :label=>"Linked", +turn = Tk::Vu::Dial.new(:needlecolor=>'red', :label=>"Linked", :variable=>v_linked) scale = TkScale.new(:label=>"Linked", :variable=>v_linked) -d1 = Tk::Vu::Dial.new(:resolution=>0.0001, :from=>-0.1, :to=>0.1, - :showvalue=>true, :minortickinterval=>0.01, - :tickinterval=>0.1, :radius=>30, :label=>"Dial", - :beginangle=>-20, :endangle=>260, :variable=>v_needle, +d1 = Tk::Vu::Dial.new(:resolution=>0.0001, :from=>-0.1, :to=>0.1, + :showvalue=>true, :minortickinterval=>0.01, + :tickinterval=>0.1, :radius=>30, :label=>"Dial", + :beginangle=>-20, :endangle=>260, :variable=>v_needle, :relief=>:raised) -d2 = Tk::Vu::Dial.new(:resolution=>0.01, :from=>-0.1, :to=>0.1, - :showvalue=>true, :minortickinterval=>0.01, - :tickinterval=>0.1, :radius=>30, :label=>"Dial 2", - :beginangle=>-20, :endangle=>260, :variable=>v_needle, - :dialrelief=>:flat, :needlecolor=>'red', +d2 = Tk::Vu::Dial.new(:resolution=>0.01, :from=>-0.1, :to=>0.1, + :showvalue=>true, :minortickinterval=>0.01, + :tickinterval=>0.1, :radius=>30, :label=>"Dial 2", + :beginangle=>-20, :endangle=>260, :variable=>v_needle, + :dialrelief=>:flat, :needlecolor=>'red', :needletype=>:triangle, :relief=>:sunken) -d3 = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1, - :showvalue=>true, :minortickinterval=>0.01, - :tickinterval=>0.1, :radius=>30, :label=>"Dial 3", - :beginangle=>-20, :endangle=>260, :variable=>v_needle, - :dialrelief=>:flat, :needlecolor=>'blue', +d3 = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1, + :showvalue=>true, :minortickinterval=>0.01, + :tickinterval=>0.1, :radius=>30, :label=>"Dial 3", + :beginangle=>-20, :endangle=>260, :variable=>v_needle, + :dialrelief=>:flat, :needlecolor=>'blue', :needletype=>:arc, :relief=>:ridge) f_btns = TkFrame.new diff --git a/ext/tk/sample/tkextlib/vu/oscilloscope.rb b/ext/tk/sample/tkextlib/vu/oscilloscope.rb index 2015e46645..1efe13ce01 100644 --- a/ext/tk/sample/tkextlib/vu/oscilloscope.rb +++ b/ext/tk/sample/tkextlib/vu/oscilloscope.rb @@ -22,26 +22,26 @@ geo_t1 = [15, 88] c = TkCanvas.new(:width=>220, :height=>190).pack(:fill=>:both, :expand=>true) #---background -TkcRectangle.new(c, geo_fr, :width=>4, :fill=>'aquamarine3', +TkcRectangle.new(c, geo_fr, :width=>4, :fill=>'aquamarine3', :tags=>['osc', 'frbg']) #---channel 0 -ch0 = Tk::Vu::TkcStripchart.new(c, geo_ch0, - :fill=>'', :jumpscroll=>false, - :outline=>'', :scaleline=>'', +ch0 = Tk::Vu::TkcStripchart.new(c, geo_ch0, + :fill=>'', :jumpscroll=>false, + :outline=>'', :scaleline=>'', :stripline=>'cyan', :tags=>['osc', 'ch0']) #---channel 1 -ch1 = Tk::Vu::TkcStripchart.new(c, geo_ch1, - :fill=>'', :jumpscroll=>0, - :outline=>'', :scaleline=>'', +ch1 = Tk::Vu::TkcStripchart.new(c, geo_ch1, + :fill=>'', :jumpscroll=>0, + :outline=>'', :scaleline=>'', :stripline=>'red', :tags=>['osc', 'ch1']) #---frame TkcRectangle.new(c, geo_fr, :width=>4, :tags=>['osc', 'frfg']) #---position -txt1 = TkcText.new(c, geo_t1, :text=>"B1-Motion: X:%X\tY:%Y", +txt1 = TkcText.new(c, geo_t1, :text=>"B1-Motion: X:%X\tY:%Y", :anchor=>:nw, :tags=>['osc', 'txt1']) #---BINDINGS diff --git a/ext/tk/sample/tkextlib/vu/pie.rb b/ext/tk/sample/tkextlib/vu/pie.rb index ed598d6233..c8f9276e4e 100644 --- a/ext/tk/sample/tkextlib/vu/pie.rb +++ b/ext/tk/sample/tkextlib/vu/pie.rb @@ -26,13 +26,13 @@ quit_btn = TkButton.new(f, :text=>"Exit", :command=>proc{exit}) Tk.grid(pie, :sticky=>:news) Tk.grid(f, :sticky=>:ew) -Tk.pack(fast_btn, slow_btn, quit_btn, +Tk.pack(fast_btn, slow_btn, quit_btn, :in=>f, :side=>:left, :fill=>:both, :expand=>true, :padx=>6, :pady=>4) Tk.root.grid_columnconfigure(0, :weight=>1) Tk.root.grid_rowconfigure(0, :weight=>1) -priv = { +priv = { :x=>0, :y=>0, :pie_in=>false, :angle=>pie[:angle], :origin=>pie[:origin] } @@ -46,9 +46,9 @@ pie.bind('ButtonPress-1', proc{|w, x, y| pie.bind('B1-Motion', proc{|w, x, y| if priv[:pie_in] - w.configure(:angle=>priv[:angle] + (priv[:y] - y)/3, - :origin=>(priv[:origin] + - ((w.winfo_height/2.2 > y)? -1: 1) * + w.configure(:angle=>priv[:angle] + (priv[:y] - y)/3, + :origin=>(priv[:origin] + + ((w.winfo_height/2.2 > y)? -1: 1) * (priv[:x] - x)/3) % 360) end }, '%W %x %y') diff --git a/ext/tk/sample/tkextlib/vu/vu_demo.rb b/ext/tk/sample/tkextlib/vu/vu_demo.rb index d078ae16f2..358d32495f 100644 --- a/ext/tk/sample/tkextlib/vu/vu_demo.rb +++ b/ext/tk/sample/tkextlib/vu/vu_demo.rb @@ -9,13 +9,13 @@ puts "Show off barchart and dial widgets" speed = TkVariable.new(0) -dial = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1, - :showvalue=>true, :minortickinterval=>0.01, - :tickinterval=>0.1, :radius=>50, :label=>"Dial", - :beginangle=>-20, :endangle=>260, :dialcolor=>'red3', +dial = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1, + :showvalue=>true, :minortickinterval=>0.01, + :tickinterval=>0.1, :radius=>50, :label=>"Dial", + :beginangle=>-20, :endangle=>260, :dialcolor=>'red3', :active=>'red2', :variable=>speed) -bar = Tk::Vu::Bargraph.new(:from=>0, :to=>100, :relief=>:groove, +bar = Tk::Vu::Bargraph.new(:from=>0, :to=>100, :relief=>:groove, :border=>2, :label=>"Bar Chart") ####################################### @@ -26,7 +26,7 @@ purple = 75 current = 50 def rand_bool - + end update = TkTimer.new(200, -1, proc{ @@ -61,7 +61,7 @@ Tk.grid('x', nobar, :sticky=>:ew, :padx=>4, :pady=>4) Tk.grid(quit, '-', '-', :sticky=>:ew, :padx=>4, :pady=>4) Tk.root.grid_columnconfigure(2, :weight=>1) Tk.root.grid_rowconfigure(1, :weight=>1) - + ####################################### Tk.mainloop |