Class: FooterLayout
- Inherits:
-
Object
- Object
- FooterLayout
- Defined in:
- lib/ListHolder/EditableList/ListPrintOperation/FooterLayout.rb
Overview
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])
Instance Attribute Summary collapse
-
#layout ⇒ Object
Returns the value of attribute layout.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #draw(cr, page_num) ⇒ Object
-
#initialize(cr, pop) ⇒ FooterLayout
constructor
A new instance of FooterLayout.
Constructor Details
#initialize(cr, pop) ⇒ FooterLayout
Returns a new instance of FooterLayout.
6 7 8 9 10 11 12 |
# File 'lib/ListHolder/EditableList/ListPrintOperation/FooterLayout.rb', line 6 def initialize(cr,pop) @pop=pop @layout=cr.create_pango_layout layout.set_text("00").set_width(@pop.pango_width).set_alignment(Pango::Layout::ALIGN_CENTER) @y = @pop.height-layout.size[1]/Pango::SCALE-cr.line_width-1 edebug("footer_position: #{@y}","printing","debug") end |
Instance Attribute Details
#layout ⇒ Object
Returns the value of attribute layout.
13 14 15 |
# File 'lib/ListHolder/EditableList/ListPrintOperation/FooterLayout.rb', line 13 def layout @layout end |
#y ⇒ Object
Returns the value of attribute y.
13 14 15 |
# File 'lib/ListHolder/EditableList/ListPrintOperation/FooterLayout.rb', line 13 def y @y end |
Instance Method Details
#draw(cr, page_num) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ListHolder/EditableList/ListPrintOperation/FooterLayout.rb', line 15 def draw(cr,page_num) layout.set_text((page_num+1).to_s + " / "+ @pop.n_pages.to_s).set_font_description(Pango::FontDescription.new(@pop.)) if @pop. cr.set_line_width(@pop.) cr.move_to(0,y) cr.line_to(@pop.width,y) end cr.move_to(0,y+cr.line_width+1) cr.show_pango_layout(layout) end |