Advertisement
tsounakis

peo

Dec 1st, 2019
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 13.07 KB | None | 0 0
  1. import tkinter as tk
  2. import bbmod
  3.  
  4. class window_1():
  5.     def __init__(self, master):
  6.         #το παράθυρο
  7.         self.master = master
  8.         self.master.option_add("*Font", 'helvetica 10')
  9.         self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
  10.         self.master = master
  11.         self.master.configure(background = 'white')
  12.         self.master.resizable(False, False)
  13.         self.masterback = tk.Frame(height = 500, width = 500)
  14.         self.masterback.pack()
  15.         self.masterback.configure(background = 'white')
  16.  
  17.         #ένα Message
  18.         self.Message = tk.Label(master, text='Καλώς ήρθατε στο σύστημα\nκρατήσεων θέσεων λεωφορείου της «ΚΤΕΛ Αχαΐας ΑΕ».')
  19.         self.Message.place(relx= 0.5, rely = 0.6, anchor = 'center')
  20.         self.Message.configure(background = 'white')
  21.  
  22.         #η εικόνα
  23.         img = tk.PhotoImage(file = 'ktel_picture.png')
  24.         self.master.label= tk.Label(self.master, image = img)
  25.         self.master.label.image = img
  26.         self.master.label.place(relx = 0.5, rely= 0.5, anchor="s")
  27.         self.master.label.configure(background = 'white')
  28.  
  29.         #κουμπί εισόδου
  30.         self.login_button = tk.Button(master, text = 'Είσοδος στο σύστημα', command = self.page_1)
  31.         self.login_button.place(relx= 0.5, rely = 0.8, anchor = 'center')
  32.         self.login_button.configure(background = 'white')
  33.                                      
  34.         #κουμπί βοήθειας
  35.         self.help_button = tk.Button(master, text = 'Help', command = open_help_win)
  36.         self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
  37.         self.help_button.configure(background = 'white')
  38.  
  39.         #κουμπί εξόδου
  40.         self.quit_button = tk.Button(master, text = 'Έξοδος', command = self.master.quit)
  41.         self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
  42.         self.quit_button.configure(background = 'white')
  43.        
  44.     def page_1(self):
  45.         #το παράθυρο
  46.         self.masterback.pack_forget()
  47.         self.master.option_add("*Font", 'helvetica 10')
  48.         self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
  49.         self.master.configure(background = 'white')
  50.         self.master.resizable(False, False)
  51.         self.masterback = tk.Frame(height = 500, width = 500)
  52.         self.masterback.pack()
  53.         self.masterback.configure(background = 'white')
  54.        
  55.         #ένα Message
  56.         self.Message = tk.Label(self.master, text='Από:')
  57.         self.Message.place(relx= 0.1, rely = 0.4, anchor = 'center')
  58.         self.Message.configure(background = 'white')
  59.        
  60.         #ένα Message
  61.         self.Message = tk.Label(self.master, text='Προς:')
  62.         self.Message.place(relx= 0.1, rely = 0.5, anchor = 'center')
  63.         self.Message.configure(background = 'white')
  64.        
  65.         #dropdown μενού 1
  66.         variable = tk.StringVar(self.master)
  67.         variable.set("Πάτρα") # default τιμή
  68.         w = tk.OptionMenu(self.master, variable, *bus.destinations)
  69.         w.place(relx = 0.2, rely = 0.4, anchor = 'w', width = 200)
  70.        
  71.         #dropdown μενού 2
  72.         i = 0
  73.         dest2 = bus.destinations[:]
  74.         variable2 = tk.StringVar(self.master)
  75.         variable2.set(" ") # default τιμή
  76.         w2 = tk.OptionMenu(self.master, variable2, *dest2)
  77.         w2.place(relx = 0.2, rely = 0.5, anchor = 'w', width = 200)
  78.         print(variable.get())
  79.                                
  80.         #κουμπί βοήθειας
  81.         self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
  82.         self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
  83.         self.help_button.configure(background = 'white')
  84.  
  85.         #κουμπί επόμενο
  86.         self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_2)
  87.         self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
  88.         self.quit_button.configure(background = 'white')
  89.  
  90.         #κουμπί προηγούμενο
  91.         self.quit_button = tk.Button(self.master, text = 'Προηγούμενο')
  92.         self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
  93.         self.quit_button.configure(background = 'white')
  94.          
  95.     def page_2(self):
  96.         #το παράθυρο
  97.         self.masterback.pack_forget()
  98.         self.master.option_add("*Font", 'helvetica 10')
  99.         self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
  100.         self.master.configure(background = 'white')
  101.         self.master.resizable(False, False)
  102.         self.masterback = tk.Frame(height = 500, width = 500)
  103.         self.masterback.pack()
  104.         self.masterback.configure(background = 'white')
  105.                                
  106.         #κουμπί βοήθειας
  107.         self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
  108.         self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
  109.         self.help_button.configure(background = 'white')
  110.  
  111.         #κουμπί επόμενο
  112.         self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_3)
  113.         self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
  114.         self.quit_button.configure(background = 'white')
  115.  
  116.         #κουμπί προηγούμενο
  117.         self.quit_button = tk.Button(self.master, text = 'Προηγούμενο', command = self.page_1)
  118.         self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
  119.         self.quit_button.configure(background = 'white')
  120.          
  121.     def page_3(self):
  122.         #το παράθυρο
  123.         self.masterback.pack_forget()
  124.         self.master.option_add("*Font", 'helvetica 10')
  125.         self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
  126.         self.master.configure(background = 'white')
  127.         self.master.resizable(False, False)
  128.         self.masterback = tk.Frame(height = 500, width = 500)
  129.         self.masterback.pack()
  130.         self.masterback.configure(background = 'white')
  131.                                
  132.         #κουμπί βοήθειας
  133.         self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
  134.         self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
  135.         self.help_button.configure(background = 'white')
  136.  
  137.         #κουμπί επόμενο
  138.         self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_4)
  139.         self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
  140.         self.quit_button.configure(background = 'white')
  141.  
  142.         #κουμπί προηγούμενο
  143.         self.quit_button = tk.Button(self.master, text = 'Προηγούμενο', command = self.page_2)
  144.         self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
  145.         self.quit_button.configure(background = 'white')
  146.          
  147.     def page_4(self):
  148.         #το παράθυρο
  149.         self.masterback.pack_forget()
  150.         self.master.option_add("*Font", 'helvetica 10')
  151.         self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
  152.         self.master.configure(background = 'white')
  153.         self.master.resizable(False, False)
  154.         self.masterback = tk.Frame(height = 500, width = 500)
  155.         self.masterback.pack()
  156.         self.masterback.configure(background = 'white')
  157.                                
  158.         #κουμπί βοήθειας
  159.         self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
  160.         self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
  161.         self.help_button.configure(background = 'white')
  162.  
  163.         #κουμπί επόμενο
  164.         self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_5)
  165.         self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
  166.         self.quit_button.configure(background = 'white')
  167.  
  168.         #κουμπί προηγούμενο
  169.         self.quit_button = tk.Button(self.master, text = 'Προηγούμενο', command = self.page_3)
  170.         self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
  171.         self.quit_button.configure(background = 'white')
  172.          
  173.     def page_5(self):
  174.         #το παράθυρο
  175.         self.masterback.pack_forget()
  176.         self.master.option_add("*Font", 'helvetica 10')
  177.         self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ')
  178.         self.master.configure(background = 'white')
  179.         self.master.resizable(False, False)
  180.         self.masterback = tk.Frame(height = 500, width = 500)
  181.         self.masterback.pack()
  182.         self.masterback.configure(background = 'white')
  183.                                
  184.         #κουμπί βοήθειας
  185.         self.help_button = tk.Button(self.master, text = 'Help', command = open_help_win)
  186.         self.help_button.place(relx= 0.1, rely = 0.9, anchor = 'center')
  187.         self.help_button.configure(background = 'white')
  188.  
  189.         #κουμπί επόμενο
  190.         self.quit_button = tk.Button(self.master, text = 'Επόμενο', command = self.page_6)
  191.         self.quit_button.place(relx = 0.9, rely = 0.9, anchor = 'center')
  192.         self.quit_button.configure(background = 'white')
  193.  
  194.         #κουμπί προηγούμενο
  195.         self.quit_button = tk.Button(self.master, text = 'Προηγούμενο', command = self.page_4)
  196.         self.quit_button.place(relx = 0.9, rely = 0.8, anchor = 'center')
  197.         self.quit_button.configure(background = 'white')
  198.  
  199. class help_window():
  200.     def __init__(self):
  201.         winmaster = tk.Tk()
  202.         self.master = winmaster
  203.         self.master.geometry('500x500')
  204.         self.master.option_add("*Font", 'helvetica 10')
  205.         self.master.title('Εφαρμογή Κράτησης Θέσης ΚΤΕΛ ΑΧΑΪΑΣ -- Οδηγίες Χρήσης')
  206.         self.master.configure(background = 'white')
  207.         self.master.resizable(False, False)
  208.  
  209.         self.masterback = tk.Frame()
  210.         self.masterback.pack()
  211.         self.masterback.configure(background = 'white')
  212.  
  213.         #το μήνυμα
  214.         self.Message = tk.Label(self.master, text='Καλώς ήρθατε στο σύστημα\nκρατήσεων θέσεων λεωφορείου της «ΚΤΕΛ Αχαΐας ΑΕ».', font = ('Helvetica', 10))
  215.         self.Message.configure(background = 'white')
  216.         self.Message.place(relx= 0.5, rely = 0.1, anchor = 's')
  217.  
  218.         self.Message2 = tk.Label(self.master, text="""Καλώς ήρθατε στο σύστημα κρατήσεων θέσεων λεωφορείων.\n\n\nΓια να εισέλθετε στο σύστημα, πατήστε 'Είσοδος'.\nΓια να κλείσετε τα εισιτήριά σας, \
  219.        ακολουθήστε τα παρακάτω βήματα:\n1. Ξεκινήστε επιλέγοντας αφετηρία \
  220.        και προορισμό.\nΕπιλέξτε ημερομηνία και ώρα \
  221.        αναχώρησης. Επιλέξτε το πλήθος των εισιτηρίων \
  222.        που\nθέλετε να κρατήσετε.Ενεργοποιήστε το πεδίο επιλογής, \
  223.        εάν κάποιος από τους κατόχους\nτων εισιτηρίων που πρόκειται να κρατήσετε, \
  224.        δικαιούται μειωμένο κόμιστρο.\nΕάν ενεργοποιήσετε την επιλογή, θα εμφανιστεί \
  225.        μία λίστα, από την οποία\nθα πρέπει να επιλέξετε το είδος του μειωμένου \
  226.        κομίστρου που ο κάτοχος δικαιούται.\nΕισάγετε τα στοιχεία που απαιτούνται\
  227.        για την κράτηση των θέσεων,\nγια καθέναν από τους\nκατόχους που επιλέξατε \
  228.        προηγουμένως.ε τη βοήθεια του πλάνου ελεύθερων \
  229.        θέσεων, επιλέξτε τις θέσεις που επιθυμείτε.\nΟι ελεύθερες θέσεις \
  230.        απεικονίζονται με γκρι, ενώ οι κατειλημμένες με κόκκινο χρώμα.\nΕπιβεβαιώστε τα στοιχεία που \
  231.        υποβάλατε και εφόσον σιγουρευτείτε\nγια την ορθότητά τουςnπατήστε το \
  232.        κουμπί 'Τελική Υποβολή'.""", justify = 'left', wraplength = 400)
  233.         self.Message2.configure(background = 'white')
  234.         self.Message2.pack()
  235.  
  236.         self.master.mainloop()
  237.  
  238. #δημιουργεί το παράθυρο βοήθειας
  239. def open_help_win():
  240.     h = help_window()
  241.    
  242. if __name__ == '__main__':
  243.     bus = bbmod.bus()
  244.     a = tk.Tk()
  245.     win1 = window_1(a)
  246.     a.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement