Ejemplo n.º 1
0
    def __init__(self,
                 master=None,
                 authors=[],
                 caption=None,
                 is_new_image=None,
                 **kw):
        super().__init__(master, **kw)
        self._author = None
        self.author_changed = core.EventHook()

        self.lable = ttk.Label(self, anchor=tkinter.CENTER)
        self.lable.pack(side=tkinter.TOP, fill=tkinter.X)
        self.caption = caption

        self.is_new_image = is_new_image

        v_scroll_bar = ttk.Scrollbar(self)
        v_scroll_bar.pack(side=tkinter.RIGHT, fill=tkinter.Y)
        self.tree = ttk.Treeview(self,
                                 columns=('id'),
                                 displaycolumns=(),
                                 selectmode=tkinter.BROWSE,
                                 show='tree')
        self.tree.pack(side=tkinter.LEFT, fill=tkinter.BOTH, expand=True)
        v_scroll_bar.config(command=self.tree.yview)
        self.tree.config(yscrollcommand=v_scroll_bar.set)
        self.authors = authors
        self.tree.bind('<<TreeviewSelect>>', self.selected)
        self.tree.bind('<Double-Button-1>', self.open_author)
Ejemplo n.º 2
0
    def __init__(self, master=None, check_button_image=None,
        del_button_image=None, add_button_image=None, **kw
    ):
        super().__init__(master, **kw)
        self.authors_updated = core.EventHook()

        self.progress = ttk.Progressbar(self, orient=tkinter.HORIZONTAL,
            mode='determinate')  # indeterminate
        self.progress.pack(side=tkinter.BOTTOM, fill=tkinter.X, expand=True)

        self.check_button = ttk.Button(self, text='Проверить',
            image=check_button_image, compound=tkinter.LEFT)
        self.check_button.pack(side=tkinter.LEFT, fill=tkinter.Y)
        self.check_button.bind('<Button-1>', self.check_authors)
        url_lable = ttk.Label(self, text='Адрес автора:')
        url_lable.pack(side=tkinter.LEFT, fill=tkinter.Y)

        self.del_button = ttk.Button(self, text='Удалить',
            image=del_button_image, compound=tkinter.LEFT)
        self.del_button.pack(side=tkinter.RIGHT, fill=tkinter.Y)
        self.del_button.bind('<Button-1>', self.del_author)

        self.add_button = ttk.Button(self, text='Добавить',
            image=add_button_image, compound=tkinter.LEFT)
        self.add_button.pack(side=tkinter.RIGHT, fill=tkinter.Y)
        self.add_button.bind('<Button-1>', self.add_author)

        self.url = tkinter.StringVar()
        author_entry = ttk.Entry(self, textvariable=self.url)
        author_entry.pack(fill=tkinter.BOTH, expand=True)
        author_entry.bind('<Return>', self.add_author)
        self._authors_iter = None
Ejemplo n.º 3
0
    def __init__(self,
                 master=None,
                 caption=None,
                 is_new_image=None,
                 exclude_image=None,
                 **kw):
        super().__init__(master, **kw)
        self.book_changed = core.EventHook()
        self._books = None
        self.label = ttk.Label(self, anchor=tkinter.CENTER)
        self.label.pack(side=tkinter.TOP, fill=tkinter.X)
        self.caption = caption

        self.manage = ttk.Frame(self)
        self.manage.pack(side=tkinter.TOP, fill=tkinter.X)

        all_readed_button = ttk.Button(self.manage,
                                       text='Все прочитанные',
                                       compound=tkinter.LEFT)
        all_readed_button.pack(side=tkinter.LEFT, fill=tkinter.Y)
        all_readed_button.bind('<Button-1>', self.all_readed)

        all_exclude_button = ttk.Button(self.manage,
                                        text='Все исключить',
                                        compound=tkinter.LEFT)
        all_exclude_button.pack(side=tkinter.RIGHT, fill=tkinter.Y)
        all_exclude_button.bind('<Button-1>', self.all_exclude)

        exclude_button = ttk.Button(self.manage,
                                    text='Исключить/Вернуть',
                                    compound=tkinter.LEFT)
        exclude_button.pack(side=tkinter.RIGHT, fill=tkinter.Y)
        exclude_button.bind('<Button-1>', self.exclude_book)

        self.is_new_image = is_new_image
        self.exclude_image = exclude_image

        self.tree = ttk.Treeview(
            self,
            columns=('id'),
            displaycolumns=(),
            selectmode=tkinter.BROWSE,
            show='tree',
        )
        v_scroll_bar = ttk.Scrollbar(self,
                                     orient=tkinter.VERTICAL,
                                     command=self.tree.yview)
        v_scroll_bar.pack(side=tkinter.RIGHT, fill=tkinter.Y)
        self.tree.config(yscrollcommand=v_scroll_bar.set)
        self.tree.pack(fill=tkinter.BOTH, expand=True)

        self.tree.bind('<<TreeviewSelect>>', self.selected)
        self.tree.bind('<Double-Button-1>', self.open_book)
Ejemplo n.º 4
0
 def __init__(self):
     self.on_change = core.EventHook()