node/lib/metasm/metasm/gui/dasm_hex.rb
def focus_addr(addr)
		return if not addr = @parent_widget.normalize(addr)
		if addr.kind_of? Integer
			return if @addr_min and (addr < @addr_min or addr > @addr_max)
			addr &= -@line_size if @keep_aligned
			@view_addr = addr if addr < @view_addr or addr >= @view_addr+(@num_lines-2)*@line_size
		elsif s = @dasm.get_section_at(addr)
			@view_addr = Expression[s[1]]
		else return
		end
		@caret_x = (addr-@view_addr) % @line_size
		@caret_x_data = 0
		@caret_y = (addr-@view_addr) / @line_size
		@focus_zone = :ascii
		redraw
		update_caret
		true
	end
# focus on addr
# returns true on success (address exists)
focus on addr
returns true on success (address exists)
focus on addr returns true on success ( address exists )
def focus_addr(addr)
		return if not addr = @parent_widget.normalize(addr)
		if addr.kind_of? Integer
			return if @addr_min and (addr < @addr_min or addr > @addr_max)
			addr &= -@line_size if @keep_aligned
			@view_addr = addr if addr < @view_addr or addr >= @view_addr+(@num_lines-2)*@line_size
		elsif s = @dasm.get_section_at(addr)
			@view_addr = Expression[s[1]]
		else return
		end
		@caret_x = (addr-@view_addr) % @line_size
		@caret_x_data = 0
		@caret_y = (addr-@view_addr) / @line_size
		@focus_zone = :ascii
		redraw
		update_caret
		true
	end
def focus_addr ( addr ) return if not addr = @parent_widget . normalize ( addr ) if addr . kind_of? Integer return if @addr_min and ( addr < @addr_min or addr > @addr_max ) addr &= - @line_size if @keep_aligned @view_addr = addr if addr < @view_addr or addr >= @view_addr + ( @num_lines - 2 ) * @line_size elsif s = @dasm . get_section_at ( addr ) @view_addr = Expression [ s [ 1 ] ] else return end @caret_x = ( addr - @view_addr ) % @line_size @caret_x_data = 0 @caret_y = ( addr - @view_addr ) / @line_size @focus_zone = :ascii redraw update_caret true end
focus on addr
returns true on success (address exists)
focus on addr returns true on success ( address exists )
addr