diff --git a/lib/class_view.rb b/lib/class_view.rb index e7dc45d..8220292 100644 --- a/lib/class_view.rb +++ b/lib/class_view.rb @@ -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 diff --git a/lib/object_view.rb b/lib/object_view.rb index 111f3be..fe56d80 100644 --- a/lib/object_view.rb +++ b/lib/object_view.rb @@ -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 diff --git a/lib/ref_view.rb b/lib/ref_view.rb index d7d2493..613d662 100644 --- a/lib/ref_view.rb +++ b/lib/ref_view.rb @@ -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 @@ -32,7 +34,7 @@ class RefView < ListView append ObjectView.new(@value) @element.off("hover") end - + def marker id var = Virtual.machine.objects[id] if var.is_a? String diff --git a/lib/registers_view.rb b/lib/registers_view.rb index 4fb5002..6e130e2 100644 --- a/lib/registers_view.rb +++ b/lib/registers_view.rb @@ -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