class FooterLayout
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint(dpblnt@gmail.com)
Attributes
layout[RW]
y[RW]
Public Class Methods
new(cr,pop)
click to toggle source
# 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
Public Instance Methods
draw(cr,page_num)
click to toggle source
# 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.footer_font)) if @pop.draw_footer_line cr.set_line_width(@pop.footer_line_width) 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