Beispiel #1
0
    def make_hud(self):
        """ Creates heads up display """
        # Button positioning
        nToggle = len(self.toggleable_kws)

        # horizontal left, horizonal right
        hl_slot, hr_slot = df2.make_bbox_positioners(y=.02, w=.08, h=.04,
                                                     xpad=.05, startx=0, stopx=1)
        prev_rect = hl_slot(0)  # left button
        next_rect = hr_slot(0)  # right button

        tw = df2.width_from(nToggle, pad=.05, start=.13, stop=.87)
        hlt_slot, hrt_slot = df2.make_bbox_positioners(y=.02, w=tw, h=.04,
                                                       xpad=.05, startx=.13,
                                                       stopx=.87)

        # Create buttons
        if self.current_pagenum != 0:
            self.append_button('prev', callback=self.prev_page, rect=prev_rect)
        if self.current_pagenum != self.nPages - 1:
            self.append_button('next', callback=self.next_page, rect=next_rect)
        for count, (text, keyword) in enumerate(six.iteritems(self.toggleable_kws)):
            callback = functools.partial(self.toggle_kw, keyword=keyword)
            rect = hlt_slot(count)
            self.append_button(text, callback=callback, rect=rect)

        figtitle_fmt = '''
        Match Candidates ({start_index}-{stop_index}) / {nCands}
        page {current_pagenum} / {nPages}
        '''
        # sexy: using object dict as format keywords
        figtitle = figtitle_fmt.format(**self.__dict__)
        df2.set_figtitle(figtitle)
Beispiel #2
0
    def make_hud(self):
        """ Creates heads up display """
        # Button positioning
        nToggle = len(self.toggleable_kws)

        # horizontal left, horizonal right
        hl_slot, hr_slot = df2.make_bbox_positioners(y=.02,
                                                     w=.08,
                                                     h=.04,
                                                     xpad=.05,
                                                     startx=0,
                                                     stopx=1)
        prev_rect = hl_slot(0)  # left button
        next_rect = hr_slot(0)  # right button

        tw = df2.width_from(nToggle, pad=.05, start=.13, stop=.87)
        hlt_slot, hrt_slot = df2.make_bbox_positioners(y=.02,
                                                       w=tw,
                                                       h=.04,
                                                       xpad=.05,
                                                       startx=.13,
                                                       stopx=.87)

        # Create buttons
        if self.current_pagenum != 0:
            self.append_button('prev', callback=self.prev_page, rect=prev_rect)
        if self.current_pagenum != self.nPages - 1:
            self.append_button('next', callback=self.next_page, rect=next_rect)
        for count, (text,
                    keyword) in enumerate(six.iteritems(self.toggleable_kws)):
            callback = functools.partial(self.toggle_kw, keyword=keyword)
            rect = hlt_slot(count)
            self.append_button(text, callback=callback, rect=rect)

        figtitle_fmt = '''
        Match Candidates ({start_index}-{stop_index}) / {nCands}
        page {current_pagenum} / {nPages}
        '''
        # sexy: using object dict as format keywords
        figtitle = figtitle_fmt.format(**self.__dict__)
        df2.set_figtitle(figtitle)
    def make_hud(self):
        """ Creates heads up display """
        # Button positioning
        hl_slot, hr_slot = df2.make_bbox_positioners(y=.02, w=.08, h=.04,
                                                     xpad=.05, startx=0,
                                                     stopx=1)
        prev_rect = hl_slot(0)
        next_rect = hr_slot(0)

        # Create buttons
        if self.current_pagenum != 0:
            self.append_button('prev', callback=self.prev_page, rect=prev_rect)
        if self.current_pagenum != self.nPages - 1:
            self.append_button('next', callback=self.next_page, rect=next_rect)
    def make_hud(self):
        """ Creates heads up display """
        # Button positioning
        hl_slot, hr_slot = df2.make_bbox_positioners(y=.02,
                                                     w=.08,
                                                     h=.04,
                                                     xpad=.05,
                                                     startx=0,
                                                     stopx=1)
        prev_rect = hl_slot(0)
        next_rect = hr_slot(0)

        # Create buttons
        if self.current_pagenum != 0:
            self.append_button('prev', callback=self.prev_page, rect=prev_rect)
        if self.current_pagenum != self.nPages - 1:
            self.append_button('next', callback=self.next_page, rect=next_rect)