Class: EideticRML::Widgets::Span

Inherits:
Widget
  • Object
show all
Includes:
Text
Defined in:
lib/erml_widgets.rb

Direct Known Subclasses

PageNo

Instance Attribute Summary

Attributes inherited from Widget

#disabled, #height_pct, #max_height_pct, #max_width_pct, #parent, #visible, #width_pct

Instance Method Summary collapse

Methods included from Text

#has_height?, #has_width?, #layout_widget, #line_height, #strikeout, #underline

Methods inherited from Widget

#after_layout, #align, #attributes, #before_layout, #border, #border_bottom, #border_left, #border_right, #border_top, #bottom, #clone, #colspan, #content_bottom, #content_height, #content_left, #content_right, #content_top, #content_width, #default_padding_bottom, #default_padding_left, #default_padding_right, #default_padding_top, #display, #display_for_page, #fill, #font, #font_color, #font_size, #font_style, #font_weight, #has_height?, #has_width?, #height, #id, #initialize_copy, #klass, #layout_widget, #leaf?, #leaves, #left, #margin, #margin_bottom, #margin_left, #margin_right, #margin_top, #max_content_height, #max_height, #max_height_avail, #max_width, #non_content_height, #non_content_width, #origin_x, #origin_y, #padding, #padding_bottom, #padding_left, #padding_right, #padding_top, #path, #position, #preferred_height, #preferred_width, #print, #right, #root, #root_page, #rotate, #rowspan, #selector_tag, #shift, #tag, #top, #units, #width, #z_index

Methods included from Support

#from_units, parse_measurement, parse_measurement_pts, #to_units

Constructor Details

#initialize(parent, attrs = {}) ⇒ Span

Returns a new instance of Span.

Raises:

  • (ArgumentError)


1000
1001
1002
1003
# File 'lib/erml_widgets.rb', line 1000

def initialize(parent, attrs={})
  raise ArgumentError, "Span must be child of Paragraph, Label or another Span." unless valid_parent?(parent)
  super(parent, attrs)
end

Instance Method Details

#printedObject



1005
1006
1007
# File 'lib/erml_widgets.rb', line 1005

def printed
  true
end

#text(value = nil, font = nil) ⇒ Object



1009
1010
1011
1012
# File 'lib/erml_widgets.rb', line 1009

def text(value=nil, font=nil)
  return super if value.nil?
  parent.text(value, font || self.font)
end