fix the z index

This commit is contained in:
Torsten Ruger 2015-08-23 02:16:32 +02:00
parent 7820c5eff0
commit 3319b0cd98
4 changed files with 13 additions and 25 deletions

View File

@ -4,11 +4,11 @@ class ClassView < ElementView
end
def draw
@element = div("li")
add( "a" , @clazz.name ) << (ul = div("ul"))
@element = div("li") << div( "a" , @clazz.name ) << (ul = div("ul"))
@clazz.object_layout.object_instance_names.each do |name|
ul << (div("li") << div("a", name ))
end
@element.style["z-index"] = 10
@element
end
end

View File

@ -2,8 +2,9 @@ require_relative "ref_view"
class ObjectView < ListView
def initialize object_id , interpreter = nil
def initialize object_id , interpreter = nil , z = nil
@object_id = object_id
@z = z
@interpreter = interpreter
@interpreter.register_event(:object_changed, self) if interpreter
super( content_elements )
@ -36,7 +37,7 @@ class ObjectView < ListView
if object and ! object.is_a?(String)
object.get_instance_variables.each do |variable|
f = object.get_instance_variable(variable)
fields << RefView.new( variable , f.object_id )
fields << RefView.new( variable , f.object_id , @z )
end
end
fields

View File

@ -1,8 +1,9 @@
class RefView < ListView
def initialize name , value
def initialize name , value , z = nil
@name = name
@value = value
@z = z
super []
end
@ -16,6 +17,7 @@ class RefView < ListView
def draw
@element = div("li") << div("a" , "#{@name} : #{marker(@value)}" )
add_hover
@element.style["z-index"] = @z if @z
@element
end

View File

@ -15,7 +15,7 @@ class RegistersView < ListView
def draw
super( "div.registers_view" )
@element.children.each do |reg|
@element.children.each_with_index do |reg, index|
elem = div("div.register_view")
wrap_node_with reg , elem
end
@ -26,31 +26,16 @@ class RegistersView < ListView
reg = reg.symbol unless reg.is_a? Symbol
index = reg.to_s[1 .. -1 ].to_i
if( is_object? value )
swap = ObjectView.new( value , @interpreter )
swap = ObjectView.new( value , @interpreter , 16 - index )
else
swap = ValueView.new value
end
replace_at index , swap
# @elements[index].style["z-index"] = -index
end
def is_object?( id )
Virtual.machine.objects[id] != nil
end
def calc_fields
#puts "My id #{objects_id} , #{objects_id.class}"
object = Virtual.machine.objects[value]
self.fields.clear
if object and ! object.is_a?(String)
clazz = object.class.name.split("::").last
#puts "found #{clazz}"
self.fields << "#{clazz}:#{object.internal_object_length}"
self.fields << object.get_layout
object.get_instance_variables.each do |variable|
f = object.get_instance_variable(variable)
self.fields << f
end
end
Virtual.machine.objects[id] != nil
end
end