Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/cca/rev/d316cee094dc
Дата изменения: Unknown
Дата индексирования: Mon Oct 1 23:08:31 2012
Кодировка:
cca: d316cee094dc

cca

changeset 12:d316cee094dc

added size_window
author Ilia
date Sat, 04 Dec 2010 21:47:22 +0300
parents a40cbd127d39
children 556e04a9a417
files Interface.py
diffstat 1 files changed, 55 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/Interface.py	Sat Dec 04 21:22:08 2010 +0300
     1.2 +++ b/Interface.py	Sat Dec 04 21:47:22 2010 +0300
     1.3 @@ -176,7 +176,7 @@
     1.4  to_top.config(bg="yellow")
     1.5  to_bottom = Button(automata_frame, text="To Bottom", state="DISABLED")
     1.6  to_bottom.config(bg="green")
     1.7 -delete = Button(automata_frame, text="Delete", command=callback, state="disabled")
     1.8 +delete = Button(automata_frame, text="Delete", state="DISABLED")
     1.9  delete.config(bg="cyan")
    1.10  up.pack(side="top", fill="x")
    1.11  down.pack(side="top", fill="x")
    1.12 @@ -236,9 +236,9 @@
    1.13  condition_frame.pack(side="top")
    1.14  
    1.15  
    1.16 -add_state = Button(automata_frame, text="ADD", command=callback, state="disabled")
    1.17 +add_state = Button(automata_frame, text="ADD", state="DISABLED")
    1.18  add_state.config(bg="blue")
    1.19 -change_state = Button(automata_frame, text="Change", command=callback, state="disabled")
    1.20 +change_state = Button(automata_frame, text="Change", state="DISABLED")
    1.21  change_state.config(bg="violet")
    1.22  add_state.pack(side="top", fill="x")
    1.23  change_state.pack(side="top", fill="x")
    1.24 @@ -247,6 +247,53 @@
    1.25  error.pack(side="top", fill="x")
    1.26  
    1.27  
    1.28 +side = 0
    1.29 +
    1.30 +size_window = Toplevel(root)
    1.31 +size_window.title("")
    1.32 +size_window.protocol("WM_DELETE_WINDOW", handlers.hide_size_window)
    1.33 +Label(size_window, text= "Current size of window:").pack(side="top", fill="x")
    1.34 +Label(size_window, text= "X x Y").pack(side="top", fill="x")
    1.35 +Label(size_window, text= "New size:").pack(side="top", fill="x")
    1.36 +new_size = Frame(size_window)
    1.37 +size_x = Entry(new_size, width=5)
    1.38 +size_x.grid(row=0, column=0)
    1.39 +Label(new_size, text=" x ").grid(row=0, column=1)
    1.40 +size_y = Entry(new_size, width=5)
    1.41 +size_y.grid(row=0, column=2)
    1.42 +new_size.pack(side="top")
    1.43 +Label(size_window, text= "Expansion of window:").pack(side="top", fill="x")
    1.44 +expansion = Frame(size_window)
    1.45 +r0 = Radiobutton(expansion, variable=side, value = 0, indicatoron=0, width=2, height=1)
    1.46 +r0.select()
    1.47 +r0.grid(row=0, column=0)    
    1.48 +r1 = Radiobutton(expansion, variable=side, value = 1, indicatoron=0, width=2, height=1)
    1.49 +r1.grid(row=0, column=1)    
    1.50 +r2 = Radiobutton(expansion, variable=side, value = 2, indicatoron=0, width=2, height=1)
    1.51 +r2.grid(row=0, column=2)    
    1.52 +r3 = Radiobutton(expansion, variable=side, value = 3, indicatoron=0, width=2, height=1)
    1.53 +r3.grid(row=1, column=0)    
    1.54 +r4 = Radiobutton(expansion, variable=side, value = 4, indicatoron=0, width=2, height=1)
    1.55 +r4.grid(row=1, column=1)    
    1.56 +r5 = Radiobutton(expansion, variable=side, value = 5, indicatoron=0, width=2, height=1)
    1.57 +r5.grid(row=1, column=2)    
    1.58 +r6 = Radiobutton(expansion, variable=side, value = 6, indicatoron=0, width=2, height=1)
    1.59 +r6.grid(row=2, column=0)    
    1.60 +r7 = Radiobutton(expansion, variable=side, value = 7, indicatoron=0, width=2, height=1)
    1.61 +r7.grid(row=2, column=1)    
    1.62 +r8 = Radiobutton(expansion, variable=side, value = 8, indicatoron=0, width=2, height=1)
    1.63 +r8.grid(row=2, column=2)
    1.64 +expansion.pack(side="top")
    1.65 +Label(size_window).pack(side="top", fill="x")
    1.66 +apply_frame = Frame(size_window, padx=10, pady=5)
    1.67 +apply_size = Button(apply_frame, text="Apply")
    1.68 +apply_size.config(bg="yellow")
    1.69 +apply_size.pack(side="left", fill="x")
    1.70 +close_size = Button(apply_frame, text="Close", command=handlers.hide_size_window)
    1.71 +close_size.config(bg="green")
    1.72 +close_size.pack(side="right", fill="x")
    1.73 +apply_frame.pack(side="top", fill="x")
    1.74 +
    1.75  menubar = Menu(root)
    1.76  root.config(menu=menubar)
    1.77  
    1.78 @@ -262,17 +309,21 @@
    1.79  menu_action.add_command(label="Start", command=handlers.start)
    1.80  menu_action.add_command(label="Stop", command=handlers.stop)
    1.81  menu_action.add_command(label="Next Step", command=handlers.next_step)
    1.82 +menu_action.add_separator()
    1.83  menu_action.add_command(label="Increase speed", command=handlers.faster)
    1.84  menu_action.add_command(label="Decrease speed", command=handlers.slower)
    1.85 +menu_action.add_separator()
    1.86  menu_action.add_command(label="Zoom In", command=handlers.zoom_in)
    1.87  menu_action.add_command(label="Zoom Out", command=handlers.zoom_out)
    1.88 +menu_action.add_separator()
    1.89  menu_action.add_command(label="Clean field")
    1.90  menu_action.add_command(label="Fill randomly")
    1.91 +menu_action.add_command(label="Change size",command=handlers.show_size_window)
    1.92  menubar.add_cascade(label="Action", menu=menu_action)
    1.93  
    1.94  menubar.add_command(label="Automata", command=handlers.automata_frame)
    1.95  
    1.96 -menubar.add_command(label="Help")
    1.97 +menubar.add_command(label="Help", command=handlers.help)
    1.98  
    1.99  root.mainloop()
   1.100