Class: Demos::Spreadsheet::Cell
Instance Attribute Summary
#node, #provides, #publisher
Instance Method Summary
collapse
#children, #children?, compile, computed, computed!, #draw, #draw_with, #dump, #emit, #initialize, inject, inject!, #method_missing, mount, #on_resize, provide, provides, #render, style, styles_get, template, template_from_file, template_get, #update, use, uses
Constructor Details
This class inherits a constructor from Hokusai::Block
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Hokusai::Block
Instance Method Details
#cell_background ⇒ Object
43
44
45
|
# File 'ui/examples/spreadsheet/csv.rb', line 43
def cell_background
node.meta.focused ? Hokusai::Color.new(27, 31, 50,255) : nil
end
|
#cell_content ⇒ Object
39
40
41
|
# File 'ui/examples/spreadsheet/csv.rb', line 39
def cell_content
cell.nil? ? "" : cell
end
|
#emit_changed_cell(value) ⇒ Object
51
52
53
54
55
56
57
58
59
60
|
# File 'ui/examples/spreadsheet/csv.rb', line 51
def emit_changed_cell(value)
if value =~ /^=/
value = value.gsub('=', '')
positions = value.split("-")
emit("cell_forumla", index, *positions)
else
emit("cell_updated", index, value)
end
end
|
#emit_modified ⇒ Object
47
48
49
|
# File 'ui/examples/spreadsheet/csv.rb', line 47
def emit_modified
emit("cell_modified", index)
end
|
#height ⇒ Object
69
70
71
|
# File 'ui/examples/spreadsheet/csv.rb', line 69
def height
@height || 0.0
end
|
#update_height(height) ⇒ Object
62
63
64
65
66
67
|
# File 'ui/examples/spreadsheet/csv.rb', line 62
def update_height(height)
@height = height
node.meta.set_prop(:height, height)
emit("height_updated", height, index)
end
|