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

# HG changeset patch
# User Ilia
# Date 1291476080 -10800
# Node ID 2b99826c4d292ee036791586048c4616654e9f05
# Parent cda6324b8518da50fec1d656b40d3e938a37ccc7
+continue with automata_panel

diff -r cda6324b8518 -r 2b99826c4d29 Interface.py
--- a/Interface.py Sat Dec 04 16:26:02 2010 +0300
+++ b/Interface.py Sat Dec 04 18:21:20 2010 +0300
@@ -101,7 +101,7 @@
pass

def automata_frame(self):# show automata_frame
- frame1.pack(side="right", fill="y", expand="no", before=canvas)
+ automata_frame.pack(side="right", fill="y", expand="no", before=canvas)

def to_top(self):# replace choosen state to top
index = symbols.get(state_list.get("active").split()[1])
@@ -153,26 +153,99 @@
symboles = dict()

#infoPanel=Frame
-frame1=Frame(root, background="grey")
-state_list=Listbox(frame1, selectmode="extended")
+automata_frame=Frame(root, background="grey")
+
+headline_frame=Frame(automata_frame, background="white")
+head = Label(headline_frame, text= "Automata Panel", font=16)
+head.pack(side="left", expand="yes")
+hide = Button(headline_frame, text="X", command=automata_frame.forget)
+hide.config(bg="grey")
+hide.pack(side="right")
+headline_frame.pack(side="top",fill="both", expand="no")
+
+Label(automata_frame, text= "State Box:").pack(side="top", fill="x")
+statelist=Listbox(automata_frame, selectmode = "extended")
+state_list=Listbox(automata_frame, selectmode="extended")
for state in states:
state_list.insert("end", state)
state_list.pack(side="top", fill="y")
-up = Button(frame1, text="Up", state="disable")
+up = Button(automata_frame, text="Up", state="DISABLED")
up.config(bg="red")
-down = Button(frame1, text="Down", state="disable")
+down = Button(automata_frame, text="Down", state="DISABLED")
down.config(bg="orange")
-to_top = Button(frame1, text="To Top", state="disable")
+to_top = Button(automata_frame, text="To Top", state="DISABLED")
to_top.config(bg="yellow")
-to_bottom = Button(frame1, text="To Bottom", state="disable")
+to_bottom = Button(automata_frame, text="To Bottom", state="DISABLED")
to_bottom.config(bg="green")
-hide = Button(frame1, text="hide", command=frame1.forget)
-hide.config(bg="cyan")
+delete = Button(automata_frame, text="Delete", command=callback, state="disabled")
+delete.config(bg="cyan")
up.pack(side="top", fill="x")
down.pack(side="top", fill="x")
to_top.pack(side="top", fill="x")
to_bottom.pack(side="top", fill="x")
-hide.pack(side="bottom", fill="x")
+delete.pack(side="top", fill="x")
+
+
+information = Label(automata_frame, text= "Information of State")
+information.pack(side="top", fill="x")
+info_frame=Frame(automata_frame, background="white")
+Label(info_frame, text="Name").grid(row=0, column=0)
+state_name = Entry(info_frame)
+state_name.grid(row=0, column=1)
+Label(info_frame, text="Symbol").grid(row=1, column=0)
+state_symbol = Entry(info_frame)
+state_symbol.grid(row=1, column=1)
+Label(info_frame, text="Color").grid(row=2, column=0)
+state_color = Entry(info_frame)
+state_color.grid(row=2, column=1)
+Label(info_frame, text="Key").grid(row=3, column=0)
+state_key = Entry(info_frame)
+state_key.grid(row=3, column=1)
+info_frame.pack(side="top")
+
+
+condition = Label(automata_frame, text= "Condition of conversion")
+condition.pack(side="top", fill="x")
+condition_frame=Frame(automata_frame, background="white")
+Label(condition_frame, text="0: ").grid(row=0, column=0)
+check_box_0 = Checkbutton(condition_frame)
+check_box_0.grid(row=0, column=1)
+Label(condition_frame, text="1: ").grid(row=0, column=2)
+check_box_1 = Checkbutton(condition_frame)
+check_box_1.grid(row=0, column=3)
+Label(condition_frame, text="2: ").grid(row=0, column=4)
+check_box_2 = Checkbutton(condition_frame)
+check_box_2.grid(row=0, column=5)
+Label(condition_frame, text="3: ").grid(row=1, column=0)
+check_box_0 = Checkbutton(condition_frame)
+check_box_0.grid(row=1, column=1)
+Label(condition_frame, text="4: ").grid(row=1, column=2)
+check_box_1 = Checkbutton(condition_frame)
+check_box_1.grid(row=1, column=3)
+Label(condition_frame, text="5: ").grid(row=1, column=4)
+check_box_2 = Checkbutton(condition_frame)
+check_box_2.grid(row=1, column=5)
+Label(condition_frame, text="6: ").grid(row=2, column=0)
+check_box_0 = Checkbutton(condition_frame)
+check_box_0.grid(row=2, column=1)
+Label(condition_frame, text="7: ").grid(row=2, column=2)
+check_box_1 = Checkbutton(condition_frame)
+check_box_1.grid(row=2, column=3)
+Label(condition_frame, text="8: ").grid(row=2, column=4)
+check_box_2 = Checkbutton(condition_frame)
+check_box_2.grid(row=2, column=5)
+condition_frame.pack(side="top")
+
+
+add_state = Button(automata_frame, text="ADD", command=callback, state="disabled")
+add_state.config(bg="blue")
+change_state = Button(automata_frame, text="Change", command=callback, state="disabled")
+change_state.config(bg="violet")
+add_state.pack(side="top", fill="x")
+change_state.pack(side="top", fill="x")
+
+error=Label(automata_frame)
+error.pack(side="top", fill="x")


menubar = Menu(root)
@@ -180,20 +253,20 @@

menu_file = Menu(menubar)
menu_file.add_command(label="New")
-menu_file.add_command(label="Open...")
-menu_file.add_command(label="Save...")
+menu_file.add_command(label="Open...", command=handlers.open_file)
+menu_file.add_command(label="Save...", command=handlers.save_file)
menu_file.add_separator()
-menu_file.add_command(label="Exit")
+menu_file.add_command(label="Exit", command=root.destroy)
menubar.add_cascade(label="File", menu=menu_file)

menu_action = Menu(menubar)
-menu_action.add_command(label="Start")
-menu_action.add_command(label="Stop")
-menu_action.add_command(label="Next Step")
-menu_action.add_command(label="Increase speed")
-menu_action.add_command(label="Decrease speed")
-menu_action.add_command(label="Zoom In")
-menu_action.add_command(label="Zoom Out")
+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_command(label="Increase speed", command=handlers.faster)
+menu_action.add_command(label="Decrease speed", command=handlers.slower)
+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_command(label="Clean field")
menu_action.add_command(label="Fill randomly")
menubar.add_cascade(label="Action", menu=menu_action)