fix the z index
This commit is contained in:
parent
7820c5eff0
commit
3319b0cd98
@ -4,11 +4,11 @@ class ClassView < ElementView
|
|||||||
end
|
end
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
@element = div("li")
|
@element = div("li") << div( "a" , @clazz.name ) << (ul = div("ul"))
|
||||||
add( "a" , @clazz.name ) << (ul = div("ul"))
|
|
||||||
@clazz.object_layout.object_instance_names.each do |name|
|
@clazz.object_layout.object_instance_names.each do |name|
|
||||||
ul << (div("li") << div("a", name ))
|
ul << (div("li") << div("a", name ))
|
||||||
end
|
end
|
||||||
|
@element.style["z-index"] = 10
|
||||||
@element
|
@element
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2,8 +2,9 @@ require_relative "ref_view"
|
|||||||
|
|
||||||
class ObjectView < ListView
|
class ObjectView < ListView
|
||||||
|
|
||||||
def initialize object_id , interpreter = nil
|
def initialize object_id , interpreter = nil , z = nil
|
||||||
@object_id = object_id
|
@object_id = object_id
|
||||||
|
@z = z
|
||||||
@interpreter = interpreter
|
@interpreter = interpreter
|
||||||
@interpreter.register_event(:object_changed, self) if interpreter
|
@interpreter.register_event(:object_changed, self) if interpreter
|
||||||
super( content_elements )
|
super( content_elements )
|
||||||
@ -36,7 +37,7 @@ class ObjectView < ListView
|
|||||||
if object and ! object.is_a?(String)
|
if object and ! object.is_a?(String)
|
||||||
object.get_instance_variables.each do |variable|
|
object.get_instance_variables.each do |variable|
|
||||||
f = object.get_instance_variable(variable)
|
f = object.get_instance_variable(variable)
|
||||||
fields << RefView.new( variable , f.object_id )
|
fields << RefView.new( variable , f.object_id , @z )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
fields
|
fields
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
class RefView < ListView
|
class RefView < ListView
|
||||||
|
|
||||||
def initialize name , value
|
def initialize name , value , z = nil
|
||||||
@name = name
|
@name = name
|
||||||
@value = value
|
@value = value
|
||||||
|
@z = z
|
||||||
super []
|
super []
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -16,6 +17,7 @@ class RefView < ListView
|
|||||||
def draw
|
def draw
|
||||||
@element = div("li") << div("a" , "#{@name} : #{marker(@value)}" )
|
@element = div("li") << div("a" , "#{@name} : #{marker(@value)}" )
|
||||||
add_hover
|
add_hover
|
||||||
|
@element.style["z-index"] = @z if @z
|
||||||
@element
|
@element
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class RegistersView < ListView
|
|||||||
|
|
||||||
def draw
|
def draw
|
||||||
super( "div.registers_view" )
|
super( "div.registers_view" )
|
||||||
@element.children.each do |reg|
|
@element.children.each_with_index do |reg, index|
|
||||||
elem = div("div.register_view")
|
elem = div("div.register_view")
|
||||||
wrap_node_with reg , elem
|
wrap_node_with reg , elem
|
||||||
end
|
end
|
||||||
@ -26,31 +26,16 @@ class RegistersView < ListView
|
|||||||
reg = reg.symbol unless reg.is_a? Symbol
|
reg = reg.symbol unless reg.is_a? Symbol
|
||||||
index = reg.to_s[1 .. -1 ].to_i
|
index = reg.to_s[1 .. -1 ].to_i
|
||||||
if( is_object? value )
|
if( is_object? value )
|
||||||
swap = ObjectView.new( value , @interpreter )
|
swap = ObjectView.new( value , @interpreter , 16 - index )
|
||||||
else
|
else
|
||||||
swap = ValueView.new value
|
swap = ValueView.new value
|
||||||
end
|
end
|
||||||
replace_at index , swap
|
replace_at index , swap
|
||||||
|
# @elements[index].style["z-index"] = -index
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_object?( id )
|
def is_object?( id )
|
||||||
Virtual.machine.objects[id] != nil
|
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user