Example #1
0
    def do_page_setup(self, win):
        if PuzzlePrinter.settings is None:
            PuzzlePrinter.settings = gtk.PrintSettings()

        r = gtk.print_run_page_setup_dialog(win, PuzzlePrinter.page_setup,
                                            PuzzlePrinter.settings)
        PuzzlePrinter.page_setup = r
Example #2
0
    def do_page_setup(self, win):
        if PuzzlePrinter.settings is None:
            PuzzlePrinter.settings = gtk.PrintSettings()

        r = gtk.print_run_page_setup_dialog(win,
                                            PuzzlePrinter.page_setup,
                                            PuzzlePrinter.settings)
        PuzzlePrinter.page_setup = r
Example #3
0
	def show_page_setup(self, parent):
		"""
		Show page setup dialog

		@parent - gtk.Widget - Parent widget
		"""
		self.page_setup = gtk.print_run_page_setup_dialog(parent, 
														self.page_setup, 
														self.print_settings)
Example #4
0
def present_page_setup_dialog(page_setup):
    old_setup = page_setup._gtk_page_setup
    ps = gtk.PrintSettings()
    new_setup = gtk.print_run_page_setup_dialog(None, old_setup, ps)
    if get_gtk_state(old_setup) <> get_gtk_state(new_setup):
        page_setup._gtk_page_setup = new_setup
        return True
    else:
        return False
Example #5
0
    def page_setup(self, widget, data):
        self.setup.settings = self.settings
        self.setup = gtk.print_run_page_setup_dialog(self, self.setup,
                                                     self.settings)

        size = self.setup.get_paper_size()
        orientation = self.setup.get_orientation()

        # TODO canvas->margins
        for page in self.editor.canvas.pages:
            page.top = self.setup.get_top_margin(gtk.UNIT_POINTS)
            page.left = self.setup.get_left_margin(gtk.UNIT_POINTS)
            page.bottom = self.setup.get_bottom_margin(gtk.UNIT_POINTS)
            page.right = self.setup.get_right_margin(gtk.UNIT_POINTS)

        width = size.get_width(gtk.UNIT_POINTS)
        height = size.get_height(gtk.UNIT_POINTS)

        # no int
        if orientation in (gtk.PAGE_ORIENTATION_PORTRAIT,
                           gtk.PAGE_ORIENTATION_REVERSE_PORTRAIT):
            orientation = _("Vertical")
            width = int(width)
            height = int(height)
        else:
            orientation = _("Landscape")
            saved_height = height
            height = int(width)
            width = int(saved_height)

        # TODO: canvas->page_size
        for page in self.editor.canvas.pages:
            page.width = width
            page.height = height

        name = size.get_display_name()
        text = "%s %s (%d dots x %d dots)" % (name, orientation, width, height)
        self.status.push(self.id, text)
        self.editor.canvas.queue_draw()
Example #6
0
    def page_setup(self, widget, data):
        self.setup.settings = self.settings
        self.setup = gtk.print_run_page_setup_dialog(self, self.setup, self.settings)

        size = self.setup.get_paper_size()
        orientation = self.setup.get_orientation()

        # TODO canvas->margins
        for page in self.editor.canvas.pages:
            page.top = self.setup.get_top_margin(gtk.UNIT_POINTS)
            page.left = self.setup.get_left_margin(gtk.UNIT_POINTS)
            page.bottom = self.setup.get_bottom_margin(gtk.UNIT_POINTS)
            page.right = self.setup.get_right_margin(gtk.UNIT_POINTS)

        width = size.get_width(gtk.UNIT_POINTS)
        height = size.get_height(gtk.UNIT_POINTS)

        # no int
        if orientation in (gtk.PAGE_ORIENTATION_PORTRAIT, gtk.PAGE_ORIENTATION_REVERSE_PORTRAIT):
            orientation = _("Vertical")
            width = int(width)
            height = int(height)
        else:
            orientation = _("Landscape")
            saved_height = height
            height = int(width)
            width = int(saved_height)

        # TODO: canvas->page_size
        for page in self.editor.canvas.pages:
            page.width = width
            page.height = height

        name = size.get_display_name()
        text = "%s %s (%d dots x %d dots)" % (name, orientation, width, height)
        self.status.push(self.id, text)
        self.editor.canvas.queue_draw()
Example #7
0
 def reportPaperSetup(self, sender):
     settings = gtk.PrintSettings()
     self.page_setup = gtk.print_run_page_setup_dialog(None, self.page_setup, settings)
     self.builder.get_object("papersize").set_text(self.page_setup.get_paper_size().get_display_name())
Example #8
0
 def reportPaperSetup(self, sender):
     settings = gtk.PrintSettings()
     self.page_setup = gtk.print_run_page_setup_dialog(None, self.page_setup, settings)
     self.builder.get_object("papersize").set_text(self.page_setup.get_paper_size().get_display_name())
Example #9
0
def do_page_setup(action):
    global settings, page_setup
    if settings is None:
        settings = gtk.PrintSettings()
    page_setup = gtk.print_run_page_setup_dialog(main_window,
                                                 page_setup, settings)
Example #10
0
def do_page_setup(action):
    global settings, page_setup
    if settings is None:
        settings = gtk.PrintSettings()
    page_setup = gtk.print_run_page_setup_dialog(main_window,
                                                 page_setup, settings)
Example #11
0
 def on_FilePageSetupMenuItem_activate(self, widget):
     """File > Page setup menmu item"""
     self.page_setup = gtk.print_run_page_setup_dialog(
         self.main_window, self.page_setup, self.print_settings)
     self.update_results_area_aspect_frame()
Example #12
0
 def page_setup(self):
     page_setup = gtk.print_run_page_setup_dialog(self.widget.get_toplevel(),
                                                  self._get_page_setup(),
                                                  self._get_print_settings())
     self._save_page_setup(page_setup)
Example #13
0
 def page_setup(self):
     page_setup = gtk.print_run_page_setup_dialog(
         self.widget.get_toplevel(), self._get_page_setup(),
         self._get_print_settings())
     self._save_page_setup(page_setup)