Class: RubyPoint::TextField
- Defined in:
- lib/rubypoint/textfield.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#text ⇒ Object
Returns the value of attribute text.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Attributes inherited from Element
#objects, #parent, #presentation
Instance Method Summary collapse
-
#initialize(text = "", x = 3200400, y = 4572000, w = 3200400, h = 572000) ⇒ TextField
constructor
A new instance of TextField.
- #raw ⇒ Object
- #write ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(text = "", x = 3200400, y = 4572000, w = 3200400, h = 572000) ⇒ TextField
Returns a new instance of TextField.
4 5 6 7 8 |
# File 'lib/rubypoint/textfield.rb', line 4 def initialize(text="",x=3200400, y=4572000, w=3200400, h=572000) @dirty = true @text = text @x, @y, @width, @height = x, y, w, h end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
2 3 4 |
# File 'lib/rubypoint/textfield.rb', line 2 def height @height end |
#text ⇒ Object
Returns the value of attribute text.
2 3 4 |
# File 'lib/rubypoint/textfield.rb', line 2 def text @text end |
#width ⇒ Object
Returns the value of attribute width.
2 3 4 |
# File 'lib/rubypoint/textfield.rb', line 2 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
2 3 4 |
# File 'lib/rubypoint/textfield.rb', line 2 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
2 3 4 |
# File 'lib/rubypoint/textfield.rb', line 2 def y @y end |
Instance Method Details
#raw ⇒ Object
14 15 16 17 18 |
# File 'lib/rubypoint/textfield.rb', line 14 def raw raw = <<EOF <p:sp><p:nvSpPr><p:cNvPr id="#{self.object_id}" name="TextBox #{self.object_id}"/><p:cNvSpPr txBox="1"/><p:nvPr/></p:nvSpPr><p:spPr><a:xfrm><a:off x="#{self.x}" y="#{self.y}"/><a:ext cx="#{self.width}" cy="#{self.height}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></p:spPr><p:txBody><a:bodyPr wrap="square" rtlCol="0"><a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0" smtClean="0"/><a:t>#{self.text}</a:t></a:r></a:p></p:txBody></p:sp> EOF end |
#write ⇒ Object
10 11 12 |
# File 'lib/rubypoint/textfield.rb', line 10 def write @parent.doc.search('//p:spTree').append(self.raw) end |