Пример #1
0
    dlg.ShowModal();
    printData=wx.PrintData(dlg.GetPrintDialogData().GetPrintData())
    dlg.Destroy()


def printsong(song):
    import format

    pars=format.SongFormatPars()
    pars.fonts['label']=format.SongFont(**config.font.printsong_label)
    pars.fonts['text']=format.SongFont(**config.font.printsong_text)
    pars.fonts['chord']=format.SongFont(**config.font.printsong_chord)

    dc=wx.PrinterDC(printData)
    pars.transformfonts(dc)

    w,h=dc.GetSize()

    fmt=format.SongFormatter(dc,pars,song.text,w)
    fmt.run()

    dc.StartDoc(song.title)
    fmt.panegrp.draw(format.DCCanvas(dc))
    dc.EndDoc()

def _create_menu(obj):
    obj.create_menu_command('options/printer_settings',u'Nastavení tiskárny',lambda ev:print_setup(),config.hotkey.printer_settings)

desktop.register_menu(_create_menu)

Пример #2
0
 def __init__(self):
     desktop.register_menu(self.create_toolbar)
     desktop.register_menu(self.create_menu)
     desktop.show_content(self.get_name())
     interop.define_flag('reloaddb',self.reloaddb)