Module: Rabbit::Element::TextContainerElement
- Includes:
- ContainerElement, TextRenderer
- Included in:
- ClassName, Code, Comment, CustomTag, DeletedText, Emphasis, FootText, Index, Keyboard, Keyword, MethodKind, MethodName, Note, PreformattedText, ReferText, Subscript, Superscript, TableCell, TableHeader, TextBlockElement, TextContainer, Variable, Verbatim
- Defined in:
- lib/rabbit/element/text-container-element.rb
Instance Attribute Summary collapse
Attributes included from TextRenderer
#first_line_height, #first_line_width, #indent, #layout, #original_height, #original_width, #spacing, #wrap_mode
Attributes included from Base
#base_h, #base_w, #base_x, #base_y, #default_margin_bottom, #default_margin_left, #default_margin_right, #default_margin_top, #default_padding_bottom, #default_padding_left, #default_padding_right, #default_padding_top, #default_visible, #h, #horizontal_centering, #margin_bottom, #margin_left, #margin_right, #margin_top, #padding_bottom, #padding_left, #padding_right, #padding_top, #parent, #ph, #pw, #px, #py, #real_simulation, #user_property, #vertical_centering, #w, #x, #y
#elements
Instance Method Summary
collapse
#align=, #as_large_as_possible, #dirty!, #do_horizontal_centering, #font_size, #height, #initialize, #justify=, #keep_in_size, #pixel_font_size, #text_clear_theme, #text_compile, #text_dirty?, #text_props, #text_renderer?, #text_to_html, #width
Methods included from Base
#[], #[]=, #add_default_prop, #adjust_x_centering, #adjust_y_margin, #adjust_y_padding, #available_w, #centering_adjusted_height, #centering_adjusted_width, #clear_margin, #clear_padding, #clone, #compile_for_horizontal_centering, #compile_horizontal, #default_prop, #dirty!, #do_horizontal_centering, #do_vertical_centering?, #draw, #font, #have_wait_tag?, #height, #hide, #if_dirty, #init_default_margin, #init_default_padding, #init_default_visible, #initialize, #inspect, #margin_set, #margin_with, #match?, #next_element, #padding_set, #padding_with, #previous_element, #prop_value, #restore_x_margin, #restore_x_padding, #setup_margin, #setup_padding, #show, #slide, #substitute_newline, #substitute_text, #text_renderer?, #visible?, #wait, #width
#clear_draw_procs, def_draw_hook, def_draw_hooks
Methods included from Utils
arg_list, collect_classes_under_module, collect_modules_under_module, collect_under_module, combination, compute_bottom_y, compute_left_x, compute_right_x, compute_top_y, corresponding_class_under_module, corresponding_module_under_module, corresponding_objects, drawable_to_pixbuf, ensure_time, events_pending_available?, extract_four_way, find_path_in_load_path, init_by_constants_as_default_value, move_to, move_to_bottom_left, move_to_bottom_right, move_to_top_left, move_to_top_right, parse_four_way, process_pending_events, process_pending_events_proc, quartz?, require_files_under_directory_in_load_path, require_safe, split_number_to_minute_and_second, stringify_hash_key, support_console_input?, support_console_output?, syntax_highlighting_debug?, time, to_class_name, unescape_title, windows?
#<<, #[], #[]=, #_width, #compile_elements, #compile_horizontal, #delete, #draw_element, #have_wait_tag?, #height, #initialize, #inspect, #replace_element, #substitute_text, #unshift, #width
Instance Attribute Details
#prop ⇒ Object
Returns the value of attribute prop.
10
11
12
|
# File 'lib/rabbit/element/text-container-element.rb', line 10
def prop
@prop
end
|
Instance Method Details
#clear_theme ⇒ Object
64
65
66
67
|
# File 'lib/rabbit/element/text-container-element.rb', line 64
def clear_theme
container_clear_theme
super
end
|
#compile(canvas, x, y, w, h) ⇒ Object
51
52
53
54
|
# File 'lib/rabbit/element/text-container-element.rb', line 51
def compile(canvas, x, y, w, h)
super
text_compile(canvas, @x, @y, @w, @h)
end
|
#dirty? ⇒ Boolean
56
57
58
|
# File 'lib/rabbit/element/text-container-element.rb', line 56
def dirty?
super or text_dirty?
end
|
#do_horizontal_centering? ⇒ Boolean
47
48
49
|
# File 'lib/rabbit/element/text-container-element.rb', line 47
def do_horizontal_centering?
super and not width.nil?
end
|
#draw_elements(canvas, x, y, w, h, simulation) ⇒ Object
16
17
18
19
20
21
|
# File 'lib/rabbit/element/text-container-element.rb', line 16
def draw_elements(canvas, x, y, w, h, simulation)
unless simulation
draw_layout(canvas, x, y)
end
[x, y + @height, w, h - @height]
end
|
#empty? ⇒ Boolean
60
61
62
|
# File 'lib/rabbit/element/text-container-element.rb', line 60
def empty?
/\A\s*\z/ =~ text
end
|
#have_numerical_font_size? ⇒ Boolean
69
70
71
|
# File 'lib/rabbit/element/text-container-element.rb', line 69
def have_numerical_font_size?
super or @elements.any? {|elem| elem.have_numerical_font_size?}
end
|
#inline_element? ⇒ Boolean
73
74
75
|
# File 'lib/rabbit/element/text-container-element.rb', line 73
def inline_element?
true
end
|
#markuped_text ⇒ Object
30
31
32
33
34
35
|
# File 'lib/rabbit/element/text-container-element.rb', line 30
def markuped_text
mt = @elements.collect do |elem|
elem.markuped_text
end.join("")
markup(mt)
end
|
#text ⇒ Object
37
38
39
40
41
|
# File 'lib/rabbit/element/text-container-element.rb', line 37
def text
@elements.collect do |elem|
elem.text
end.join("")
end
|
#to_html(generator) ⇒ Object
23
24
25
26
27
28
|
# File 'lib/rabbit/element/text-container-element.rb', line 23
def to_html(generator)
html = @elements.collect do |elem|
elem.to_html(generator)
end.join("")
markup_as_html(html)
end
|
#to_rd ⇒ Object
43
44
45
|
# File 'lib/rabbit/element/text-container-element.rb', line 43
def to_rd
text
end
|