add space to left view
show integer and word values
This commit is contained in:
parent
509aff9552
commit
73643e4882
@ -14,7 +14,7 @@ require "risc/interpreter"
|
|||||||
# the base, our own litle framework, allows for child and parent views and handles updates
|
# the base, our own litle framework, allows for child and parent views and handles updates
|
||||||
require "base/list_view"
|
require "base/list_view"
|
||||||
# each seperate view is in it's own class.
|
# each seperate view is in it's own class.
|
||||||
require "views/switch_view"
|
require "views/left_view"
|
||||||
require "views/status_view"
|
require "views/status_view"
|
||||||
require "views/source_view"
|
require "views/source_view"
|
||||||
require "views/instruction_view"
|
require "views/instruction_view"
|
||||||
@ -42,7 +42,7 @@ class MainView < ListView
|
|||||||
def initialize
|
def initialize
|
||||||
Risc.machine.boot
|
Risc.machine.boot
|
||||||
@interpreter = Risc::Interpreter.new
|
@interpreter = Risc::Interpreter.new
|
||||||
super( [SwitchView.new(@interpreter) ,
|
super( [LeftView.new(@interpreter) ,
|
||||||
SourceView.new(@interpreter) ,
|
SourceView.new(@interpreter) ,
|
||||||
InstructionView.new(@interpreter) ,
|
InstructionView.new(@interpreter) ,
|
||||||
StatusView.new(@interpreter) ,
|
StatusView.new(@interpreter) ,
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
require_relative "classes_view"
|
require_relative "classes_view"
|
||||||
|
|
||||||
class SwitchView < ListView
|
class LeftView < ListView
|
||||||
def initialize interpreter
|
def initialize interpreter
|
||||||
super([ SelectView.new(interpreter) , ClassesView.new(interpreter) ])
|
super([ SelectView.new(interpreter) ,
|
||||||
|
ObjectView.new( Parfait.object_space , interpreter , 16),
|
||||||
|
ClassesView.new(interpreter) ])
|
||||||
end
|
end
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
super(".classes")
|
super(".classes")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# opal eval seems to get the scope wrong and evals in object (not where its called)
|
|
||||||
include AST::Sexp
|
|
||||||
|
|
||||||
class SelectView < ElementView
|
class SelectView < ElementView
|
||||||
|
|
@ -59,6 +59,12 @@ class ObjectView < ListView
|
|||||||
index += 1
|
index += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if( object.is_a?(Parfait::Integer) )
|
||||||
|
fields << RefView.new( 3.to_s , object.value , @z )
|
||||||
|
end
|
||||||
|
if( object.is_a?(Parfait::Word) )
|
||||||
|
fields << RefView.new( 3.to_s , object.to_string , @z )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
fields
|
fields
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user