src/jwm_draw_framing/draw_framing_main_v0.56.rb
#-----------------------------------------------------------
# The onMouseMove method is called whenever the user moves the mouse.
# because it is called so often, it is important to try to make it efficient.
# In a lot of tools, your main interaction will occur in this method.
The onMouseMove method is called whenever the user moves the mouse.
because it is called so often, it is important to try to make it efficient.
In a lot of tools, your main interaction will occur in this method.
The onMouseMove method is called whenever the user moves the mouse . because it is called so often it is important to try to make it efficient . In a lot of tools your main interaction will occur in this method .
def onMouseMove(flags, x, y, view)
		if( @state == 0 )
		@ip.pick view, x, y
			if( @ip != @ip1 )
				view.invalidate if( @ip.display? or @ip1.display? )
				@ip1.copy! @ip
				view.tooltip = @ip1.tooltip
		view.draw_text view.screen_coords(@ip1), @cursor_text 
			end
		elsif @state == 1
			@ip2.pick view, x, y, @ip1
			view.tooltip = @ip2.tooltip if( @ip2.valid? )
			if( @ip2.valid? )
				length = @ip1.position.distance(@ip2.position)
				Sketchup::set_status_text length.to_s, SB_VCB_VALUE
			end
			if( (x-@xdown).abs > 10 || (y-@ydown).abs > 10 )
				@dragging = true
			end
			view.invalidate
		elsif @state == 2 
			@ip.pick view, x, y
			if( @ip != @ip1 )
				view.invalidate if( @ip.display? or @ip1.display? )
				@ip1.copy! @ip
				view.tooltip = @ip1.tooltip
			end
		end
	end
def onMouseMove ( flags , x , y , view ) if ( @state == 0 ) @ip . pick view , x , y if ( @ip != @ip1 ) view . invalidate if ( @ip . display? or @ip1 . display? ) @ip1 . copy! @ip view . tooltip = @ip1 . tooltip view . draw_text view . screen_coords ( @ip1 ) , @cursor_text end elsif @state == 1 @ip2 . pick view , x , y , @ip1 view . tooltip = @ip2 . tooltip if ( @ip2 . valid? ) if ( @ip2 . valid? ) length = @ip1 . position . distance ( @ip2 . position ) Sketchup :: set_status_text length . to_s , SB_VCB_VALUE end if ( ( x - @xdown ) . abs > 10 || ( y - @ydown ) . abs > 10 ) @dragging = true end view . invalidate elsif @state == 2 @ip . pick view , x , y if ( @ip != @ip1 ) view . invalidate if ( @ip . display? or @ip1 . display? ) @ip1 . copy! @ip view . tooltip = @ip1 . tooltip end end end
The onMouseMove method is called whenever the user moves the mouse.
The onMouseMove method is called whenever the user moves the mouse .
# We are getting the first end of the line.	Call the pick method # on the InputPoint to get a 3D position from the 2D screen position # that is passed as an argument to this method. # if the point has changed from the last one we got, then # see if we need to display the point.	We need to display it # if it has a display representation or if the previous point # was displayed.	The invalidate method on the view is used # to tell the view that something has changed so that you need # to refresh the view. # set the tooltip that should be displayed to this point ## Display cursor text to show size being drawn now # Give feedback at cursor # Getting the second pick point which defines the orientation of the timber cross-section # If you pass in another InputPoint on the pick method of InputPoint # it uses that second point to do additional inferencing such as # parallel to an axis. # Update the length displayed in the VCB # Check to see if the mouse was moved far enough to confirm the orientation of the chosen cross-section # This is used so that you can create a cross-section by either dragging # or doing click-move-click # Waiting for third pick to define length of component # puts "In onMouseMove method @state == 2"  # if the point has changed from the first one we got, then # see if we need to display the point.	We need to display it # if it has a display representation or if the previous point # was displayed.	The invalidate method on the view is used # to tell the view that something has changed so that you need # to refresh the view. # set the tooltip that should be displayed to this point
flags
<not_specific>
x
<not_specific>
y
<not_specific>
view
<not_specific>