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

# HG changeset patch
# User Ilia
# Date 1291488442 -10800
# Node ID d316cee094dc6441c66b4b357b423ee265f593e6
# Parent a40cbd127d3960c30fba294537a622ac24b2faa9
added size_window

diff -r a40cbd127d39 -r d316cee094dc Interface.py
--- a/Interface.py Sat Dec 04 21:22:08 2010 +0300
+++ b/Interface.py Sat Dec 04 21:47:22 2010 +0300
@@ -176,7 +176,7 @@
to_top.config(bg="yellow")
to_bottom = Button(automata_frame, text="To Bottom", state="DISABLED")
to_bottom.config(bg="green")
-delete = Button(automata_frame, text="Delete", command=callback, state="disabled")
+delete = Button(automata_frame, text="Delete", state="DISABLED")
delete.config(bg="cyan")
up.pack(side="top", fill="x")
down.pack(side="top", fill="x")
@@ -236,9 +236,9 @@
condition_frame.pack(side="top")


-add_state = Button(automata_frame, text="ADD", command=callback, state="disabled")
+add_state = Button(automata_frame, text="ADD", state="DISABLED")
add_state.config(bg="blue")
-change_state = Button(automata_frame, text="Change", command=callback, state="disabled")
+change_state = Button(automata_frame, text="Change", state="DISABLED")
change_state.config(bg="violet")
add_state.pack(side="top", fill="x")
change_state.pack(side="top", fill="x")
@@ -247,6 +247,53 @@
error.pack(side="top", fill="x")


+side = 0
+
+size_window = Toplevel(root)
+size_window.title("")
+size_window.protocol("WM_DELETE_WINDOW", handlers.hide_size_window)
+Label(size_window, text= "Current size of window:").pack(side="top", fill="x")
+Label(size_window, text= "X x Y").pack(side="top", fill="x")
+Label(size_window, text= "New size:").pack(side="top", fill="x")
+new_size = Frame(size_window)
+size_x = Entry(new_size, width=5)
+size_x.grid(row=0, column=0)
+Label(new_size, text=" x ").grid(row=0, column=1)
+size_y = Entry(new_size, width=5)
+size_y.grid(row=0, column=2)
+new_size.pack(side="top")
+Label(size_window, text= "Expansion of window:").pack(side="top", fill="x")
+expansion = Frame(size_window)
+r0 = Radiobutton(expansion, variable=side, value = 0, indicatoron=0, width=2, height=1)
+r0.select()
+r0.grid(row=0, column=0)
+r1 = Radiobutton(expansion, variable=side, value = 1, indicatoron=0, width=2, height=1)
+r1.grid(row=0, column=1)
+r2 = Radiobutton(expansion, variable=side, value = 2, indicatoron=0, width=2, height=1)
+r2.grid(row=0, column=2)
+r3 = Radiobutton(expansion, variable=side, value = 3, indicatoron=0, width=2, height=1)
+r3.grid(row=1, column=0)
+r4 = Radiobutton(expansion, variable=side, value = 4, indicatoron=0, width=2, height=1)
+r4.grid(row=1, column=1)
+r5 = Radiobutton(expansion, variable=side, value = 5, indicatoron=0, width=2, height=1)
+r5.grid(row=1, column=2)
+r6 = Radiobutton(expansion, variable=side, value = 6, indicatoron=0, width=2, height=1)
+r6.grid(row=2, column=0)
+r7 = Radiobutton(expansion, variable=side, value = 7, indicatoron=0, width=2, height=1)
+r7.grid(row=2, column=1)
+r8 = Radiobutton(expansion, variable=side, value = 8, indicatoron=0, width=2, height=1)
+r8.grid(row=2, column=2)
+expansion.pack(side="top")
+Label(size_window).pack(side="top", fill="x")
+apply_frame = Frame(size_window, padx=10, pady=5)
+apply_size = Button(apply_frame, text="Apply")
+apply_size.config(bg="yellow")
+apply_size.pack(side="left", fill="x")
+close_size = Button(apply_frame, text="Close", command=handlers.hide_size_window)
+close_size.config(bg="green")
+close_size.pack(side="right", fill="x")
+apply_frame.pack(side="top", fill="x")
+
menubar = Menu(root)
root.config(menu=menubar)

@@ -262,17 +309,21 @@
menu_action.add_command(label="Start", command=handlers.start)
menu_action.add_command(label="Stop", command=handlers.stop)
menu_action.add_command(label="Next Step", command=handlers.next_step)
+menu_action.add_separator()
menu_action.add_command(label="Increase speed", command=handlers.faster)
menu_action.add_command(label="Decrease speed", command=handlers.slower)
+menu_action.add_separator()
menu_action.add_command(label="Zoom In", command=handlers.zoom_in)
menu_action.add_command(label="Zoom Out", command=handlers.zoom_out)
+menu_action.add_separator()
menu_action.add_command(label="Clean field")
menu_action.add_command(label="Fill randomly")
+menu_action.add_command(label="Change size",command=handlers.show_size_window)
menubar.add_cascade(label="Action", menu=menu_action)

menubar.add_command(label="Automata", command=handlers.automata_frame)

-menubar.add_command(label="Help")
+menubar.add_command(label="Help", command=handlers.help)

root.mainloop()