[Gridflow-cvs] [svn] commit: r3237 - /trunk/base/flow_objects.rb

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Mar 19 12:14:14 EDT 2008


Author: matju
Date: Wed Mar 19 12:14:14 2008
New Revision: 3237

Log:
removing [#edit], same as for [peephole]

Modified:
    trunk/base/flow_objects.rb

Modified: trunk/base/flow_objects.rb
==============================================================================
--- trunk/base/flow_objects.rb (original)
+++ trunk/base/flow_objects.rb Wed Mar 19 12:14:14 2008
@@ -609,120 +609,6 @@
 	gui_enable
 end
 end # respond to gui_enable
-
-=begin
-class GridEdit < GridObject; include Gooey
-	def initialize(grid)
-		super
-		@store = GridStore.new
-		@store.connect 0,self,2
-		@fin = GridFinished.new
-		@fin.connect 0,self,3
-		@bg, at bgs, at fg = "#609068","#0080ff","#ff80ff"
-		@bghi = highlight(@bg,1.25) # "#80C891"   # highlighted @bg
-		#@bghihi = highlight(@bghi,1.5) # very highlighted @bg
-		@cellsy, at cellsx = 16,48
-		@i, at j = nil,nil # highlighted cell dex
-		send_in 0, grid
-	end
-	def _0_cell_size(sy,sx) @cellsy, at cellsx=sy,sx; update end
-	def _0_float(*a) @store.send_in 1,:float,*a; @store.send_in 0; update end
-	def _0_list (*a) @store.send_in 1, :list,*a; @store.send_in 0; update end
-	def _0_grid (*a) @store.send_in 1, :grid,*a;   @fin.send_in 0, :grid,*a end
-	def _3_bang; @store.send_in 0; update end
-	def edit_start(i,j)
-		edit_end if @i
-		@i, at j=i,j
-		GridFlow.gui %{
-			set canvas #{canvas}
-			$canvas itemconfigure #{@rsym}CELL_#{@i}_#{@j} -fill #{@bghi}
-		}
-	end
-	def edit_end
-		GridFlow.gui %{
-			set canvas #{canvas}
-			$canvas itemconfigure #{@rsym}CELL_#{@i}_#{@j} -fill #{@bg}
-		}
-		unfocus @can
-	end
-	def _2_rgrid_begin
-		@data = []
-		@dim = inlet_dim 2
-		@nt = inlet_nt 2
-		post "_2_rgrid_begin: dim=#{@dim.inspect} nt=#{@nt.inspect}"
-		send_out_grid_begin 0, @dim, @nt
-	end
-	def _2_rgrid_flow data
-		ps = GridFlow.packstring_for_nt @nt
-		@data[@data.length,0] = data.unpack(ps)		
-		post "_2_rgrid_flow: data=#{@data.inspect}"
-		send_out_grid_flow 0, data
-	end
-	def _2_rgrid_end
-		post "_2_rgrid_end"
-	end
-	def pd_click(can,x,y,shift,alt,dbl,doit)
-		post "pd_click: %s", [can,x,y,shift,alt,dbl,doit].inspect
-		return 0 if not doit!=0
-		i = (y- at y-1)/@cellsy
-		j = (x- at x-1)/@cellsx
-		post "%d,%d", i,j
-		ny = @dim[0] || 1
-		nx = @dim[1] || 1
-		if (0...ny)===i and (0...nx)===j then
-			focus @can,x,y
-			edit_start i,j
-		end
-		return 0
-	end
-	def pd_key(key)
-		post "pd_key: %s", [key].inspect
-		if key==0 then unfocus @can; return end
-	end
-	def pd_motion(dx,dy)
-		post "pd_motion: %s", [dx,dy].inspect
-		ny = @dim[0] || 1
-		nx = @dim[1] || 1
-		k = @i*nx+ at j
-		post "@data[#{k}]=#{@data[k]} before"
-		@data[k]-=dy
-		@store.send_in 1, :put_at, [@i, at j]
-		@store.send_in 1, @data[k]
-		@store.send_in 0
-		post "@data[#{k}]=#{@data[k]} after"
-		update
-	end
-	def pd_show(can)
-		super
-		return if not can
-		ny = @dim[0] || 1
-		nx = @dim[1] || 1
-		@sy = 2+ at cellsy*ny
-		@sx = 2+ at cellsx*nx
-		g = %{
-			set canvas #{canvas}
-			$canvas delete #{@rsym} #{@rsym}CELL
-			$canvas create rectangle #{@x} #{@y} #{@x+ at sx} #{@y+ at sy} \
-				-fill #{@bg} -tags #{@rsym} -outline #{outline}
-		}
-		ny.times {|i|
-		  nx.times {|j|
-		    y1 = @y+1+i*@cellsy; y2 = y1+ at cellsy
-		    x1 = @x+1+j*@cellsx; x2 = x1+ at cellsx
-		    v = @data[i*nx+j]
-		    g << %{
-			$canvas create rectangle #{x1} #{y1} #{x2} #{y2} -fill #{@bg} \
-				-tags {#{@rsym}CELL #{@rsym}CELL_#{i}_#{j}} -outline #{outline}
-			$canvas create text #{x2-4} #{y1+2} -text "#{v}" -anchor ne -fill #ffffff \
-				-tags {#{@rsym}CELL_#{i}_#{j}_T}
-		    }
-		  }
-		}
-		GridFlow.gui g
-	end
-	install "#edit", 2, 1
-	install_rgrid 2, true
-end
 
 #-------- fClasses for: Hardware
 



More information about the Gridflow-cvs mailing list