Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- import bbmod
- class window_1():
- def __init__(self, master):
- #το παράθυρο
- self.master = master
- self.master.option_add("*Font", 'helvetica 10')
- self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
- self.master = master
- self.master.configure(background = 'white')
- self.master.resizable(False, False)
- self.masterback = tk.Frame(height = 500, width = 500)
- self.masterback.pack()
- self.masterback.configure(background = 'white')
- #ένα Message
- self.Message = tk.Label(master, text='Καλώς ήρθατε στο σύστημα\nκρατήσεων θέσεων λεωφορείου της «ΚΤΕΛ Αχαΐας ΑΕ».')
- self.Message.place(relx= 0.5, rely = 0.6, anchor = 'center')
- self.Message.configure(background = 'white')
- #η εικόνα
- img = tk.PhotoImage(file = 'ktel_picture.png')
- self.master.label= tk.Label(self.master, image = img)
- self.master.label.image = img
- self.master.label.place(relx = 0.5, rely= 0.5, anchor="s")
- self.master.label.configure(background = 'white')
- #κουμπί εισόδου
- self.login_button = tk.Button(master, text = 'Είσοδος στο σύστημα', command = self.page_1)
- self.login_button.place(relx= 0.5, rely = 0.8, anchor = 'center')
- self.login_button.configure(background = 'white')
- #κουμπί βοήθειας
- self.help_button = tk.Button(master, text = 'Help', command = open_help_win)
- self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
- self.help_button.configure(background = 'white')
- #κουμπί εξόδου
- self.quit_button = tk.Button(master, text = 'Έξοδος', command = self.master.quit)
- self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
- self.quit_button.configure(background = 'white')
- def page_1(self):
- #το παράθυρο
- self.masterback.pack_forget()
- self.master.option_add("*Font", 'helvetica 10')
- self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
- self.master.configure(background = 'white')
- self.master.resizable(False, False)
- self.masterback = tk.Frame(height = 500, width = 500)
- self.masterback.pack()
- self.masterback.configure(background = 'white')
- #ένα Message
- self.Message = tk.Label(self.master, text='Από:')
- self.Message.place(relx= 0.1, rely = 0.4, anchor = 'center')
- self.Message.configure(background = 'white')
- #ένα Message
- self.Message = tk.Label(self.master, text='Προς:')
- self.Message.place(relx= 0.1, rely = 0.5, anchor = 'center')
- self.Message.configure(background = 'white')
- #dropdown μενού 1
- variable = tk.StringVar(self.master)
- variable.set("Πάτρα") # default τιμή
- w = tk.OptionMenu(self.master, variable, *bus.destinations)
- w.place(relx = 0.2, rely = 0.4, anchor = 'w', width = 200)
- #dropdown μενού 2
- i = 0
- dest2 = bus.destinations[:]
- variable2 = tk.StringVar(self.master)
- variable2.set(" ") # default τιμή
- w2 = tk.OptionMenu(self.master, variable2, *dest2)
- w2.place(relx = 0.2, rely = 0.5, anchor = 'w', width = 200)
- print(variable.get())
- #κουμπί βοήθειας
- self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
- self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
- self.help_button.configure(background = 'white')
- #κουμπί επόμενο
- self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_2)
- self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
- self.quit_button.configure(background = 'white')
- #κουμπί προηγούμενο
- self.quit_button = tk.Button(self.master, text = 'Προηγούμενο')
- self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
- self.quit_button.configure(background = 'white')
- def page_2(self):
- #το παράθυρο
- self.masterback.pack_forget()
- self.master.option_add("*Font", 'helvetica 10')
- self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
- self.master.configure(background = 'white')
- self.master.resizable(False, False)
- self.masterback = tk.Frame(height = 500, width = 500)
- self.masterback.pack()
- self.masterback.configure(background = 'white')
- #κουμπί βοήθειας
- self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
- self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
- self.help_button.configure(background = 'white')
- #κουμπί επόμενο
- self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_3)
- self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
- self.quit_button.configure(background = 'white')
- #κουμπί προηγούμενο
- self.quit_button = tk.Button(self.master, text = 'Προηγούμενο', command = self.page_1)
- self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
- self.quit_button.configure(background = 'white')
- def page_3(self):
- #το παράθυρο
- self.masterback.pack_forget()
- self.master.option_add("*Font", 'helvetica 10')
- self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
- self.master.configure(background = 'white')
- self.master.resizable(False, False)
- self.masterback = tk.Frame(height = 500, width = 500)
- self.masterback.pack()
- self.masterback.configure(background = 'white')
- #κουμπί βοήθειας
- self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
- self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
- self.help_button.configure(background = 'white')
- #κουμπί επόμενο
- self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_4)
- self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
- self.quit_button.configure(background = 'white')
- #κουμπί προηγούμενο
- self.quit_button = tk.Button(self.master, text = 'Προηγούμενο', command = self.page_2)
- self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
- self.quit_button.configure(background = 'white')
- def page_4(self):
- #το παράθυρο
- self.masterback.pack_forget()
- self.master.option_add("*Font", 'helvetica 10')
- self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
- self.master.configure(background = 'white')
- self.master.resizable(False, False)
- self.masterback = tk.Frame(height = 500, width = 500)
- self.masterback.pack()
- self.masterback.configure(background = 'white')
- #κουμπί βοήθειας
- self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
- self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
- self.help_button.configure(background = 'white')
- #κουμπί επόμενο
- self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_5)
- self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
- self.quit_button.configure(background = 'white')
- #κουμπί προηγούμενο
- self.quit_button = tk.Button(self.master, text = 'Προηγούμενο', command = self.page_3)
- self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
- self.quit_button.configure(background = 'white')
- def page_5(self):
- #το παράθυρο
- self.masterback.pack_forget()
- self.master.option_add("*Font", 'helvetica 10')
- self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
- self.master.configure(background = 'white')
- self.master.resizable(False, False)
- self.masterback = tk.Frame(height = 500, width = 500)
- self.masterback.pack()
- self.masterback.configure(background = 'white')
- #κουμπί βοήθειας
- self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
- self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
- self.help_button.configure(background = 'white')
- #κουμπί επόμενο
- self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_6)
- self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
- self.quit_button.configure(background = 'white')
- #κουμπί προηγούμενο
- self.quit_button = tk.Button(self.master, text = 'Προηγούμενο', command = self.page_4)
- self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
- self.quit_button.configure(background = 'white')
- class help_window():
- def __init__(self):
- winmaster = tk.Tk()
- self.master = winmaster
- self.master.geometry('500x500')
- self.master.option_add("*Font", 'helvetica 10')
- self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ -- Οδηγίες Χρήσης')
- self.master.configure(background = 'white')
- self.master.resizable(False, False)
- self.masterback = tk.Frame()
- self.masterback.pack()
- self.masterback.configure(background = 'white')
- #το μήνυμα
- self.Message = tk.Label(self.master, text='Καλώς ήρθατε στο σύστημα\nκρατήσεων θέσεων λεωφορείου της «ΚΤΕΛ Αχαΐας ΑΕ».', font = ('Helvetica', 10))
- self.Message.configure(background = 'white')
- self.Message.place(relx= 0.5, rely = 0.1, anchor = 's')
- self.Message2 = tk.Label(self.master, text="""Καλώς ήρθατε στο σύστημα κρατήσεων θέσεων λεωφορείων.\n\n\nΓια να εισέλθετε στο σύστημα, πατήστε 'Είσοδος'.\nΓια να κλείσετε τα εισιτήριά σας, \
- ακολουθήστε τα παρακάτω βήματα:\n1. Ξεκινήστε επιλέγοντας αφετηρία \
- και προορισμό.\nΕπιλέξτε ημερομηνία και ώρα \
- αναχώρησης. Επιλέξτε το πλήθος των εισιτηρίων \
- που\nθέλετε να κρατήσετε.Ενεργοποιήστε το πεδίο επιλογής, \
- εάν κάποιος από τους κατόχους\nτων εισιτηρίων που πρόκειται να κρατήσετε, \
- δικαιούται μειωμένο κόμιστρο.\nΕάν ενεργοποιήσετε την επιλογή, θα εμφανιστεί \
- μία λίστα, από την οποία\nθα πρέπει να επιλέξετε το είδος του μειωμένου \
- κομίστρου που ο κάτοχος δικαιούται.\nΕισάγετε τα στοιχεία που απαιτούνται\
- για την κράτηση των θέσεων,\nγια καθέναν από τους\nκατόχους που επιλέξατε \
- προηγουμένως.\Με τη βοήθεια του πλάνου ελεύθερων \
- θέσεων, επιλέξτε τις θέσεις που επιθυμείτε.\nΟι ελεύθερες θέσεις \
- απεικονίζονται με γκρι, ενώ οι κατειλημμένες με κόκκινο χρώμα.\nΕπιβεβαιώστε τα στοιχεία που \
- υποβάλατε και εφόσον σιγουρευτείτε\nγια την ορθότητά τουςnπατήστε το \
- κουμπί 'Τελική Υποβολή'.""", justify = 'left', wraplength = 400)
- self.Message2.configure(background = 'white')
- self.Message2.pack()
- self.master.mainloop()
- #δημιουργεί το παράθυρο βοήθειας
- def open_help_win():
- h = help_window()
- if __name__ == '__main__':
- bus = bbmod.bus()
- a = tk.Tk()
- win1 = window_1(a)
- a.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement