Exemple #1
0
 def __init__(self, presenter):
     self.presenter = presenter
     self.eventloop = presenter.eventloop
     self.dc = self.presenter.app.mw.mdi.corner
     Painter.__init__(self)
     self.eventloop.connect(self.eventloop.DOC_MODIFIED, self.changes)
     self.changes()
Exemple #2
0
 def __init__(self, presenter):
     self.presenter = presenter
     self.eventloop = presenter.eventloop
     self.dc = self.presenter.app.mw.mdi.corner
     Painter.__init__(self)
     if not BITMAPS:
         BITMAPS[sk2const.DOC_ORIGIN_CENTER] = get_icon(icons.ORIGIN_CENTER)
         BITMAPS[sk2const.DOC_ORIGIN_LL] = get_icon(icons.ORIGIN_LL)
         BITMAPS[sk2const.DOC_ORIGIN_LU] = get_icon(icons.ORIGIN_LU)
     self.eventloop.connect(self.eventloop.DOC_MODIFIED, self.changes)
     self.changes()
Exemple #3
0
    def __init__(self, presenter, vertical=True):
        self.presenter = presenter
        self.eventloop = presenter.eventloop
        self.vertical = vertical
        Painter.__init__(self)
        mdi = self.presenter.app.mw.mdi
        self.dc = mdi.vruler if vertical else mdi.hruler

        if not VFONT:
            load_font(config.ruler_fg)
        self.default_cursor = self.dc.get_cursor()
        if not self.vertical:
            self.guide_cursor = self.presenter.app.cursors[modes.HGUIDE_MODE]
        else:
            self.guide_cursor = self.presenter.app.cursors[modes.VGUIDE_MODE]
        self.eventloop.connect(self.eventloop.VIEW_CHANGED, self.dc.refresh)
        events.connect(events.CONFIG_MODIFIED, self.check_config)
Exemple #4
0
    def __init__(self, presenter):
        self.presenter = presenter
        self.eventloop = self.presenter.eventloop
        self.app = presenter.app
        self.doc = self.presenter.model
        self.renderer = PDRenderer(self)
        self.dc = self.app.mw.mdi.canvas
        self.timer = self.dc.timer
        Painter.__init__(self)
        self.hit_surface = HitSurface(self)
        self.zoom_stack = []

        self.ctrls = self.init_controllers()
        # ----- Application eventloop bindings
        self.eventloop.connect(self.eventloop.DOC_MODIFIED, self.doc_modified)
        self.eventloop.connect(self.eventloop.PAGE_CHANGED, self.doc_modified)
        self.eventloop.connect(self.eventloop.SELECTION_CHANGED,
                               self.selection_redraw)