Example #1
0
    def display(self,list_):
        self.displayFrame.destroy()
        self.displayFrame=ScrollableFrame(self.frame)
        self.displayFrame.grid(row=3,column=0,columnspan=2,sticky="nsew",padx=10,pady=10)
        # print(list_)
        Label(self.displayFrame.frame,text='Sl. no.',relief=GROOVE).grid(row=0,column=0,sticky=E+W,padx=2)
        Label(self.displayFrame.frame,text='Item Name',relief=GROOVE).grid(row=0,column=1,sticky=E+W,padx=2)
        Label(self.displayFrame.frame,text='Location',relief=GROOVE).grid(row=0,column=2,sticky=E+W,padx=2)
        Label(self.displayFrame.frame,text='Quanitity',relief=GROOVE).grid(row=0,column=3,sticky=E+W,padx=2)
        Label(self.displayFrame.frame,text='Type',relief=GROOVE).grid(row=0,column=4,sticky=E+W,padx=2)

        for i in range(len(list_)):
            itemSerial = Label(self.displayFrame.frame, anchor=W, text=i+1)
            itemName = Label(self.displayFrame.frame,wraplength=400, anchor=W, text=list_[i][0])
            itemLocation = Label(self.displayFrame.frame, anchor=W, text=list_[i][1])
            itemQuantity= Label(self.displayFrame.frame, anchor=W, text=list_[i][2])
            itemType= Label(self.displayFrame.frame, anchor=W, text=list_[i][3])
            
            itemSerial.grid(row=i+1, column=0, sticky=W+E,padx=2,pady=1)
            itemName.grid(row=i+1, column=1, sticky=W+E,padx=2,pady=1)
            itemLocation.grid(row=i+1,column=2,sticky=W+E,padx=2,pady=1)
            itemQuantity.grid(row=i+1,column=3,sticky=W+E,padx=2,pady=1)
            itemType.grid(row=i+1,column=4,sticky=W+E,padx=2,pady=1)
            # studentRollAndName.bind('<Button-1>', self.bindingAction)   
        self.displayFrame.frame.columnconfigure(1,weight=1)  
Example #2
0
    def __init__(self, parentFrame, width, height):
        Tkinter.Frame.__init__(self, parentFrame, width=width, height=height)

        optionsFrame = Tkinter.Frame(self, height=50)
        optionsFrame.grid(column=0, row=0)

        # Add a drop-down box to add more searches
        self.addSearchWidgetFrame = Tkinter.Frame(optionsFrame)
        Tkinter.Label(self.addSearchWidgetFrame,
                      text="Add search field:").grid(column=0, row=0)
        self.addSearchWidgetComboboxValue = Tkinter.StringVar()
        addSearchWidgetCombobox = ttk.Combobox(
            self.addSearchWidgetFrame,
            state='readonly',
            values=sorted(self.nameToType.keys()),
            textvariable=self.addSearchWidgetComboboxValue)
        addSearchWidgetCombobox.grid(column=1, row=0)
        self.addSearchWidgetFrame.grid(column=0, row=0, sticky=Tkinter.E)
        # React when an option is chosen
        addSearchWidgetCombobox.bind(
            '<<ComboboxSelected>>', lambda *args: self.addSearchWidget(
                self.addSearchWidgetComboboxValue.get()))

        self.searchParametersFrame = ScrollableFrame(self,
                                                     width=width,
                                                     height=height - 50)
        self.searchParametersFrame.grid(column=0, row=1)

        # Start out with the most common search fields already shown
        for field in ('Name', 'CMC', 'Text'):
            self.addSearchWidget(field, False)
        # Give the first widget created the focus, since that makes the most sense
        self.searchWidgets[0].takeFocus()
Example #3
0
    def __init__(self, parent):
        self.container = tk.Frame(parent)

        # Create four scrollable frames and add them to the container
        self.SF1 = ScrollableFrame(self.container)
        self.SF1.grid(row=0, column=0, sticky=tk.N + tk.E + tk.S + tk.W)

        self.SF2 = ScrollableFrame(self.container,
                                   direction='both',
                                   scroll_sensitivity=8,
                                   bg='green',
                                   cursor='heart')
        self.SF2.grid(row=1, column=0, sticky=tk.N + tk.E + tk.S + tk.W)

        self.SF3 = ScrollableFrame(self.container,
                                   direction='vertical',
                                   bg='red',
                                   cursor='circle')
        self.SF3.grid(row=0, column=1, sticky=tk.N + tk.E + tk.S + tk.W)

        self.SF4 = ScrollableFrame(self.container,
                                   direction='horizontal',
                                   bg='blue',
                                   cursor='cross')
        self.SF4.grid(row=1, column=1, sticky=tk.N + tk.E + tk.S + tk.W)

        # Configure all rows and columns present to have the same weight (so they expand with the window)
        tk.Grid.columnconfigure(parent, 0, weight=1)
        tk.Grid.rowconfigure(parent, 0, weight=1)
        tk.Grid.columnconfigure(self.container, 0, weight=1)
        tk.Grid.columnconfigure(self.container, 1, weight=1)
        tk.Grid.rowconfigure(self.container, 0, weight=1)
        tk.Grid.rowconfigure(self.container, 1, weight=1)

        # Fill each frame with a grid of labels
        self.lots_of_labels(self.SF1.frame, 'default SF', (20, 20))
        self.lots_of_labels(self.SF2.frame, 'green, fast scroll', (40, 10))
        self.lots_of_labels(self.SF3.frame, 'red vertical', (20, 4))
        self.lots_of_labels(self.SF4.frame, 'blue horizontal', (4, 20))

        # Add the frame
        self.container.grid(row=0, column=0, sticky=tk.N + tk.E + tk.S + tk.W)

        # Add a button to demonstrate the set_direction method and direction attribute of SF
        tk.Button(text='change directions',
                  font=('Times', 15, 'bold'),
                  command=self.change_dir).grid(row=2, column=0)
Example #4
0
    def bindingAction(self, event):
        popupCourse = Tk()
        popupCourse.eval('tk::PlaceWindow . center')
        popupCourse.config(bg='white')
        popupCourse.geometry("430x460")
        popupCourse.minsize(430, 460)
        popupCourse.maxsize(430, 460)
        rollAndName = event.widget.cget('text')
        roll = rollAndName.split(' ')
        popupCourse.title("Register courses for " + roll[0])
        roll = roll[0]

        courses = StudentCourses.getcourses(roll)

        entryframe = Frame(popupCourse)
        entryframe.grid(row=0, column=0)
        tex = Label(entryframe, text="Enter Semester", padx=5, bg='white', pady=20)
        tex.grid(row=0, column=0)
        sem = Entry(entryframe)
        entryframe.configure(bg='white')
        sem.grid(row=0, column=1)

        courseframe = ScrollableFrame(popupCourse)
        buttons = []
        Label(courseframe.frame, text="Code", padx=10, borderwidth=1, relief='solid').grid(row=0, column=0, sticky=W+E)
        Label(courseframe.frame, text="Course Name", anchor=W, padx=20, borderwidth=1, relief='solid').grid(row=0, column=1, sticky=W+E)
        Label(courseframe.frame, text="Credits", anchor=W, padx=10, borderwidth=1, relief='solid').grid(row=0, column=2, sticky=W+E)
        Label(courseframe.frame, text=" ", anchor=W, padx=10, borderwidth=1, relief='solid').grid(row=0, column=3, sticky=W+E)
        for i in range(len(courses)):
            Label(courseframe.frame, text=courses[i][0], padx=10).grid(row=i+1, column=0)
            Label(courseframe.frame, text=courses[i][1], anchor=W, padx=20).grid(row=i+1, column=1, sticky=W+E)
            Label(courseframe.frame, text=courses[i][3], padx=10).grid(row=i+1, column=2, sticky=W+E)
            buttons.append(ttk.Checkbutton(courseframe.frame,
                                           takefocus=0,
                                           var = IntVar(0)))
            buttons[i].grid(row=i+1, column=3, sticky=E+W)
            buttons[i].state(['!alternate'])

        courseframe.grid(row=1, column=0)

        submitbutton = ttk.Button(master=popupCourse,
                                  text='Submit',
                                  command= lambda : self.formsubmit(buttons,
                                                                    sem,
                                                                    courses,
                                                                    roll,
                                                                    popupCourse))
        submitbutton.config(padding = [5,5,5,5])
        submitbutton.grid(row=4, column=0, columnspan=1)


        popupCourse.columnconfigure(0, weight=1) # Serial Name of Course
        popupCourse.columnconfigure(1, weight=2) # Name of Course
        popupCourse.columnconfigure(2, weight=1) # Credits of the Course
        popupCourse.columnconfigure(3, weight=1)
Example #5
0
    def __init__(self,root):
        root.title("Department Inventory")
        root.geometry('800x600')
        root.minsize(800, 600)
        root.maxsize(800, 600)
        self.frame=Frame(root)
        self.frame.grid(row=0, column=0, sticky='nsew')
        self.itemnameLabel=Label(self.frame,text="Item Name: ",anchor=E)
        self.itemnameEntry=Entry(self.frame,borderwidth=0,width=27)
        self.itemtypeLabel=Label(self.frame,text="Type: ",anchor=E)

        self.combostyle=ttk.Style()
        self.combostyle.map('TCombobox', fieldbackground=[('readonly', 'white')])
        self.combostyle.map('TCombobox', selectbackground=[('readonly', 'white')])
        # self.combostyle.

        self.var=StringVar(self.frame)
        self.var.set("All")
        self.typeDropdown = ttk.Combobox(self.frame,foreground="black",width=27,takefocus=False,textvariable=self.var,state='readonly')
        self.typeDropdown['value']=('All',
                                        'Miscellaneous',
                                        'Computers',
                                        'Furniture',
                                        'Stationery')
        self.typeDropdown.bind("<FocusIn>", dropdown_defocus)

        self.submitButton=Button(self.frame,text='Search',command=lambda:self.search())
        self.addButton=Button(self.frame,text='Purchase New Item',command=lambda:self.add(root))
        self.displayFrame=ScrollableFrame(self.frame)

        self.backButton=Button(self.frame,text="Back",command=lambda: self.back(root))
        self.exitButton=Button(self.frame,text="Exit",command=exit)

        self.itemnameLabel.grid(row=0,column=0,sticky=E+W,pady=10,padx=10)
        self.itemnameEntry.grid(row=0,column=1,sticky=W,pady=10)
        self.itemtypeLabel.grid(row=1,column=0,sticky=E+W,pady=10,padx=10)
        self.typeDropdown.grid(row=1,column=1,sticky=W,pady=10)
        self.submitButton.grid(row=2,column=0,sticky=E,pady=10,padx=10)
        self.addButton.grid(row=2,column=1,sticky=W,pady=10,padx=10)
        self.displayFrame.grid(row=3,column=0,columnspan=2,sticky="nsew",padx=10,pady=10)
        self.exitButton.grid(row=4,column=0,columnspan=2,sticky=W,padx=50,pady=20)
        self.backButton.grid(row=4,column=1,columnspan=2,sticky=E,padx=50,pady=20)

        for i in range(2):
            self.frame.columnconfigure(i,weight=1)
        self.frame.rowconfigure(3,weight=1)
Example #6
0
def show_pictures(images_paths, title):
    win = tk.Toplevel()
    win.wm_title("Pictures")
    win.configure(bg=BACKGROUND_COLOR)
    win.attributes("-fullscreen", True)
    frame = tk.Frame(win, bg=BACKGROUND_COLOR)
    new_title(frame, title)
    frame.pack()

    # Menu bar
    menu_bar = tk.Menu(win)
    menu_bar.add_command(label="Close", command=win.destroy)
    win.configure(menu=menu_bar)

    # 80% of the screen's height
    scale = 0.8
    scrollable_frame = ScrollableFrame(win, win.winfo_screenheight()*scale, IMAGE_MAX_SIZE, 3, 30, 30, BACKGROUND_COLOR)
    scrollable_frame.fill_data(images_paths, command_bind_on_click=show_full_picture)
Example #7
0
    def display_courses(self, root, list_):

        self.displayFrame.destroy()
        self.displayFrame = Frame(self.frame)
        self.displayScrollframe = ScrollableFrame(self.displayFrame)
        self.displayScrollframe.grid(column=0, row=0, sticky="nsew")
        self.displayFrame.grid(row=5, column=0, columnspan=2)

        self.displayScrollframe.frame.columnconfigure(1, weight=1)
        for i in range(len(list_)):
            courseserialLabel = Label(self.displayScrollframe.frame,
                                      anchor=W,
                                      text=i + 1)
            courserollnameLabel = Label(self.displayScrollframe.frame,
                                        anchor=W,
                                        text=list_[i][0] + '    ' +
                                        list_[i][1])
            courseserialLabel.grid(row=i, column=0, sticky=W + E, padx=5)
            courserollnameLabel.grid(row=i, column=1, sticky=W + E)
Example #8
0
    def display(self, root, list_):
        self.searchResults.destroy()
        self.searchResults = ScrollableFrame(self.frame)
        self.searchResults.grid(row=5,
                                column=0,
                                padx=30,
                                sticky="nsew",
                                columnspan=2)
        self.searchResults.frame.columnconfigure(1, weight=1)

        for i in range(len(list_)):
            studentSerial = Label(self.searchResults.frame,
                                  anchor=W,
                                  text=i + 1)
            studentRollAndName = Label(self.searchResults.frame,
                                       anchor=W,
                                       text=list_[i][0] + '    ' + list_[i][1])
            studentSerial.grid(row=i, column=0, sticky=W + E, padx=5)
            studentRollAndName.grid(row=i, column=1, sticky=W + E)
            studentRollAndName.bind('<Button-1>', self.bindingAction)
Example #9
0
    def __init__(self, root):

        root.title('Academics - Courses')

        root.geometry('800x600')
        root.maxsize(800, 600)
        root.minsize(800, 600)

        self.frame = Frame(root)
        self.frame.grid(row=0, column=0, sticky='nsew')

        self.courseLabel = Label(self.frame, text='Course Name', fg="black")
        self.courseEntry = Entry(self.frame, borderwidth=0)

        self.submitButton = Button(self.frame,
                                   text='Search',
                                   command=lambda: self.search(root))
        self.addcoursesButton = Button(self.frame,
                                       text='Add Courses',
                                       command=lambda: self.add(root))
        self.displayFrame = ScrollableFrame(self.frame)
        self.courseLabel.grid(row=2, column=0, padx=5, pady=3)
        self.courseEntry.grid(row=2, column=1)

        self.exitButton = Button(self.frame, text="Exit", command=exit)
        self.backButton = Button(self.frame,
                                 text="Back",
                                 command=lambda: self.back(root))

        self.submitButton.grid(row=3, column=0, columnspan=2, pady=20)
        self.addcoursesButton.grid(row=6, column=0, columnspan=2, pady=20)
        self.displayFrame.grid(row=4, column=0, columnspan=2)

        self.exitButton.grid(row=8, column=0, pady=10, padx=50, sticky=S + W)
        self.backButton.grid(row=8, column=1, pady=10, padx=50, sticky=S + E)

        self.frame.rowconfigure(8, weight=1)
        self.frame.columnconfigure(0, weight=1)
        self.frame.columnconfigure(1, weight=1)

        root.mainloop()
Example #10
0
    def __init__(self, root):

        self.frame = Frame(root)
        self.frame.grid(row=0, column=0, sticky='nsew')

        self.newButton = Button(self.frame,
                                text="Add...",
                                command=lambda: self.new(root))
        self.displayAll = ScrollableFrame(self.frame)

        self.exitButton = Button(self.frame, text="Exit", command=exit)
        self.backButton = Button(self.frame,
                                 text="Back",
                                 command=lambda: self.back(root))

        self.newButton.grid(row=1, column=0, padx=50, pady=50, columnspan=2)
        self.displayAll.grid(row=2, column=0, columnspan=2)
        self.exitButton.grid(row=3, column=0, padx=50, pady=50, sticky=S + W)
        self.backButton.grid(row=3, column=0, padx=50, pady=50, sticky=S + E)

        self.frame.columnconfigure(0, weight=1)
    def display(self):
        self.displayAll.destroy()
        self.displayAll = ScrollableFrame(self.frame)
        self.displayAll.grid(row=0, column=0, padx=30, sticky=N+S+E+W)
        connect_, cursor_ = ES.get_student_db_ES()
        cursor_.execute('SELECT * FROM publications')
        allPublications = cursor_.fetchall()
        Label(self.displayAll.frame, text='Sr. No.', relief=GROOVE).grid(row=0, column=0, sticky=E+W)
        Label(self.displayAll.frame, text='Author', relief=GROOVE).grid(row=0, column=1, sticky=E+W)
        Label(self.displayAll.frame, text='Name', relief=GROOVE).grid(row=0, column=2, sticky=E+W)
        Label(self.displayAll.frame, text='Date', relief=GROOVE).grid(row=0, column=3, sticky=E+W)

        for i in range(len(allPublications)):
            Label(self.displayAll.frame, anchor=W, text=i+1).grid(row=i+1, column=0, sticky=E+W, padx=2, pady=2)
            Label(self.displayAll.frame, anchor=W, text=allPublications[i][0]).grid(row=i+1, column=1, sticky=E+W, padx=2, pady=2)
            publicationName = Label(self.displayAll.frame, anchor=W, text=allPublications[i][1])
            publicationName.grid(row=i+1, column=2, sticky=E+W, padx=2, pady=2)
            Label(self.displayAll.frame, anchor=W, text=allPublications[i][2]).grid(row=i+1, column=3, sticky=E+W, padx=2, pady=2)
            publicationName.bind('<Button-1>', self.bindingAction)

        self.displayAll.frame.columnconfigure(2, weight=2)
        self.displayAll.frame.columnconfigure(1, weight=1)
Example #12
0
    def __init__(self, root):
        self.frame = Frame(root)
        self.frame.grid(row=0, column=0, sticky='nsew')
        self.nameLabel = Label(self.frame, text='Name', fg="black")
        self.nameEntry = Entry(self.frame, borderwidth=0)
        self.rollLabel = Label(self.frame, text='Roll No', fg="black")
        self.rollEntry = Entry(self.frame, borderwidth=0)

        self.searchButton = Button(self.frame,
                                   text='Search',
                                   command=lambda: self.search(root))
        self.searchResults = ScrollableFrame(self.frame)

        self.nameLabel.grid(row=2, column=0, padx=5, pady=3)
        self.nameEntry.grid(row=2, column=1)
        self.rollLabel.grid(row=3, column=0, padx=5, pady=3)
        self.rollEntry.grid(row=3, column=1)

        self.exitButton = Button(self.frame, text="Exit", command=exit)
        self.backButton = Button(self.frame,
                                 text="Back",
                                 command=lambda: self.back(root))

        self.searchButton.grid(row=4, column=0, columnspan=2, pady=20)
        self.searchResults.grid(row=5,
                                column=0,
                                padx=30,
                                sticky="nsew",
                                columnspan=2)

        self.exitButton.grid(row=8, column=0, padx=50, pady=50, sticky=S + W)
        self.backButton.grid(row=8, column=1, padx=50, pady=50, sticky=S + E)

        self.frame.rowconfigure(8, weight=1)
        self.frame.columnconfigure(0, weight=1)
        self.frame.columnconfigure(1, weight=1)

        root.mainloop()
Example #13
0
    def display(self):
        self.displayAll.destroy()
        self.displayAll = ScrollableFrame(self.frame)
        self.displayAll.grid(row=0, column=0, padx=30, sticky=N + S + E + W)
        connect_, cursor_ = ES.get_student_db_ES()
        cursor_.execute('SELECT * FROM projects')
        allProjects = cursor_.fetchall()
        Label(self.displayAll.frame, text='Sr. No.',
              relief=GROOVE).grid(row=0, column=0, sticky=E + W)
        Label(self.displayAll.frame, text='Organisation',
              relief=GROOVE).grid(row=0, column=1, sticky=E + W)
        Label(self.displayAll.frame, text='Incharge',
              relief=GROOVE).grid(row=0, column=2, sticky=E + W)
        Label(self.displayAll.frame, text='Duration',
              relief=GROOVE).grid(row=0, column=3, sticky=E + W)
        Label(self.displayAll.frame, text='Status',
              relief=GROOVE).grid(row=0, column=4, sticky=E + W)
        Label(self.displayAll.frame, text='Name',
              relief=GROOVE).grid(row=0, column=5, sticky=E + W)

        for i in range(len(allProjects)):
            Label(self.displayAll.frame, anchor=W,
                  text=i + 1).grid(row=i + 1,
                                   column=0,
                                   sticky=E + W,
                                   padx=2,
                                   pady=2)
            Label(self.displayAll.frame, anchor=W,
                  text=allProjects[i][0]).grid(row=i + 1,
                                               column=1,
                                               sticky=E + W,
                                               padx=2,
                                               pady=2)
            Label(self.displayAll.frame, anchor=W,
                  text=allProjects[i][1]).grid(row=i + 1,
                                               column=2,
                                               sticky=E + W,
                                               padx=2,
                                               pady=2)
            Label(self.displayAll.frame, anchor=W,
                  text=allProjects[i][2]).grid(row=i + 1,
                                               column=3,
                                               sticky=E + W,
                                               padx=2,
                                               pady=2)
            Label(self.displayAll.frame, anchor=W,
                  text=allProjects[i][3]).grid(row=i + 1,
                                               column=4,
                                               sticky=E + W,
                                               padx=2,
                                               pady=2)
            projectName = Label(self.displayAll.frame,
                                anchor=W,
                                text=allProjects[i][4],
                                wraplength=300)
            projectName.grid(row=i + 1, column=5, sticky=W + E)
            projectName.bind('<Button-1>', self.bindingAction)

        self.displayAll.frame.columnconfigure(1, weight=1)
        self.displayAll.frame.columnconfigure(2, weight=1)
        self.displayAll.frame.columnconfigure(5, weight=3)
Example #14
0
    def viewPerformance(self, roll_no, popupStudent, student):
        popupStudent.destroy()
        backlogsDict, semDict = self.fetchPerformance(roll_no)
        viewWindow = Tk()
        viewWindow.title(student[0])
        viewWindow.maxsize(700, 550)
        viewWindow.minsize(690, 500)
        viewWindow.title(student[0])

        connect_, cursor_ = ES.get_student_db_ES()

        perfView = ScrollableFrame(viewWindow)
        perfView.grid(row=1, column=0, sticky="nsew")

        detailsFrame = Frame(perfView.frame)
        detailsFrame.grid(row=0, column=0, sticky=E + W)

        Label(detailsFrame,
              text='Name: ' + student[1],
              anchor=W,
              relief=GROOVE).grid(row=0, column=0, columnspan=2, sticky=W + E)
        Label(detailsFrame,
              text='Roll no.: ' + student[0],
              anchor=W,
              relief=GROOVE).grid(row=1, column=0, sticky=W + E)
        Label(detailsFrame,
              text='Degree: ' + student[3],
              anchor=W,
              relief=GROOVE).grid(row=1, column=1, sticky=W + E)

        detailsFrame.columnconfigure(0, weight=3)
        detailsFrame.columnconfigure(1, weight=2)

        backlogsFrame = Frame(perfView.frame)
        backlogsFrame.grid(row=1, column=0, sticky=E + W, pady=10)
        Label(backlogsFrame, text="Backlogs", anchor=W,
              relief=GROOVE).grid(row=0, column=0, columnspan=4, sticky=E + W)

        if len(backlogsDict) != 0:
            Label(backlogsFrame, text="Course Code", relief=GROOVE,
                  width=12).grid(row=1, column=0, sticky=E + W)
            Label(backlogsFrame, text="Course Name",
                  relief=GROOVE).grid(row=1, column=1, sticky=E + W)
            Label(backlogsFrame, text="Credits", relief=GROOVE,
                  width=12).grid(row=1, column=2, sticky=E + W)
            Label(backlogsFrame,
                  text="Most Recent semester taken in",
                  relief=GROOVE).grid(row=1, column=3, sticky=E + W)

            ind = 0
            for i in backlogsDict:
                cursor_.execute(
                    'SELECT course_name,credits FROM all_courses WHERE sub_code=(:code)',
                    {'code': i})
                info = cursor_.fetchone()
                Label(backlogsFrame, text=str(i),
                      relief=FLAT).grid(row=2 + ind, column=0, sticky=E + W)
                Label(backlogsFrame, text=str(info[0]),
                      relief=FLAT).grid(row=2 + ind, column=1, sticky=E + W)
                Label(backlogsFrame, text=str(info[1]),
                      relief=FLAT).grid(row=2 + ind, column=2, sticky=E + W)
                Label(backlogsFrame, text=str(backlogsDict[i]),
                      relief=FLAT).grid(row=2 + ind, column=3, sticky=E + W)
                ind = ind + 1
            backlogsFrame.columnconfigure(3, weight=1)
        else:
            Label(backlogsFrame, text="None", anchor=W,
                  relief=GROOVE).grid(row=1,
                                      column=0,
                                      columnspan=4,
                                      sticky=E + W)
        backlogsFrame.columnconfigure(1, weight=1)
        ind = 3
        for i in semDict:
            self.semPerformance(perfView, ind, i, semDict[i])
            ind = ind + 1

        self.ongoingSemester(student[0], perfView, ind)

        perfView.frame.columnconfigure(0, weight=1)

        viewWindow.rowconfigure(1, weight=1)
        viewWindow.columnconfigure(0, weight=1)

        Button(viewWindow,
               text="Save as PDF",
               command=lambda: self.savePDF(perfView)).grid(row=2, column=0)
Example #15
0
    def __init__(self, parentFrame, width, height):
        Tkinter.Frame.__init__(self, parentFrame, width=width, height=height)

        # Show the message here instead of at the import statement, to give the Statusbar time to initialize
        if PILerrorMessage:
            GlobalValues.statusbar.addMessage(PILerrorMessage)

        # TODO: Maybe move the 'add card to deck/sideboard' buttons to the SearchResultsFrame? And the '+/-/x' buttons to the ChosenCardsFrame?
        #  They kind of make more sense there, since they interact with those fields
        #  Or maybe even move the 'add card' buttons to the ChosenCardsFrame too, since that's where they'd be added anyway

        # TODO: Occasional update checks to see if images got updated
        #  This could be done by storing the version number of mtgimage.com, and when that changes, retrieve the changelog
        #  Then, search the latest change(s) for setnames, and deleting the whole folder, forcing the images to be redownloaded

        # TODO: Display variation art of cards in same set
        # Some sets have multiple of the same card but with different art (Mostly lands, most sets have 4 different land arts per land type)
        #  The multiverseIDs of the other cards is stored in the 'variations' set field

        self.cardDataFrame = ScrollableFrame(self, width=width, height=height)
        self.cardDataFrame.grid(column=0,
                                row=1,
                                columnspan=2,
                                rowspan=2,
                                sticky=Tkinter.N)

        for rowcount, field in enumerate(self.fieldOrder):
            displayname = self.fieldDisplayname[
                field] if field in self.fieldDisplayname else "{}:".format(
                    field.capitalize())
            namelabel = Tkinter.Label(self.cardDataFrame.innerFrame,
                                      text=displayname,
                                      anchor=Tkinter.NE)
            # Add and remove the label, so the 'sticky' part stays set
            #namelabel.grid(column=0, row=rowcount, sticky=Tkinter.NE)
            #namelabel.grid_remove()
            valuelabel = Tkinter.Label(self.cardDataFrame.innerFrame,
                                       text='',
                                       width=70,
                                       wraplength=375,
                                       justify=Tkinter.LEFT,
                                       anchor=Tkinter.W)
            self.fieldToLabel[field] = namelabel, valuelabel

        self.setSelectionCombobox = ttk.Combobox(self.cardDataFrame.innerFrame,
                                                 state='readonly',
                                                 width=50)
        self.setSelectionCombobox.bind(
            '<<ComboboxSelected>>',
            lambda arg: self.setDisplayedSet(self.setSelectionCombobox.get()))
        self.setSelectionCombobox.label = Tkinter.Label(
            self.cardDataFrame.innerFrame,
            anchor=Tkinter.NE,
            text="Display Set:")

        self.cardImageLabel = Tkinter.Label(self.cardDataFrame.innerFrame)
        self.cardImageLabel.grid(column=0,
                                 row=100,
                                 columnspan=2,
                                 sticky=Tkinter.NW,
                                 padx=width / 10)
Example #16
0
from ScrollableFrame import ScrollableFrame
import tkinter as tk
from tkinter import ttk


root = tk.Tk()
frame = ScrollableFrame(root)
for i in range(50):
    ttk.Label(frame.scrollable_frame,
              text="Sample scrolling label").pack()
frame.place(x=0, y=0, w=500, h=500)
root.geometry("500x500")
root.mainloop()