Changeset 77:c18bb7548057
- Timestamp:
- 12/12/10 22:48:44 (5 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface.py
r76 r77 ˆà 95 95 self.draw()ˆà 96 96 ˆà 97 ˆà def slower(self, speed_rate=2, event=None):ˆàˆà 97 def slower(self, event=None, speed_rate=2):ˆà 98 98 self.stop()ˆà 99 99 self.delay = self.delay*speed_rateˆà 100 100 self.start()ˆà 101 101 ˆà 102 ˆà def faster(self, speed_rate=2, event=None):ˆàˆà 102 def faster(self, event=None, speed_rate=2):ˆà 103 103 self.stop()ˆà 104 104 self.delay = self.delay / speed_rateˆà òÀæ òÀæ ˆà 490 490 self.keys[state.key] = indexˆà 491 491 ˆà ˆà 492 def exit(self, event=None):ˆà ˆà 493 passˆà 492 494 ˆà 493 495 ˆà òÀæ òÀæ ˆà 673 675 ˆà 674 676 menu_file = Menu(menubar)ˆà 675 ˆà menu_file.add_command(label="New", command=handlers.new_file)ˆà 676 ˆà menu_file.add_command(label="Open...", command=handlers.open_file)ˆà ˆà 677 menu_file.add_command(label="New", command=handlers.new_file, accelerator="Ctrl+N")ˆà ˆà 678 menu_file.bind_all("<Control-n>", handlers.new_file)ˆà ˆà 679 menu_file.add_command(label="Open...", command=handlers.open_file, accelerator="Ctrl+O")ˆà ˆà 680 menu_file.bind_all("<Control-o>", handlers.open_file)ˆà 677 681 menu_file.add_command(label="Save...", command=handlers.save_file, accelerator="Ctrl+S")ˆà 678 682 menu_file.bind_all("<Control-s>", handlers.save_file)ˆà 679 683 menu_file.add_separator()ˆà 680 ˆà menu_file.add_command(label="Exit", command=root.destroy)ˆà ˆà 684 menu_file.add_command(label="Exit", command=handlers.exit, accelerator="Ctrl+Q")ˆà ˆà 685 menu_file.bind_all("<Control-q>", handlers.exit)ˆà 681 686 menubar.add_cascade(label="File", menu=menu_file)ˆà 682 687 ˆà 683 688 menu_action = Menu(menubar)ˆà 684 ˆà menu_action.add_command(label="Start", command=handlers.start)ˆà 685 ˆà menu_action.add_command(label="Stop", command=handlers.stop)ˆà 686 ˆà menu_action.add_command(label="Next Step", command=handlers.next_step)ˆà ˆà 689 menu_action.add_command(label="Start", command=handlers.start, accelerator="Ctrl+G")ˆà ˆà 690 menu_action.bind_all("<Control-g>", handlers.start)ˆà ˆà 691 menu_action.add_command(label="Stop", command=handlers.stop, accelerator="Ctrl+F")ˆà ˆà 692 menu_action.bind_all("<Control-f>", handlers.stop)ˆà ˆà 693 menu_action.add_command(label="Next Step", command=handlers.next_step, accelerator="Space")ˆà ˆà 694 menu_action.bind_all("<space>", handlers.next_step)ˆà 687 695 menu_action.add_separator()ˆà 688 ˆà menu_action.add_command(label="Increase speed", command=handlers.faster)ˆà 689 ˆà menu_action.add_command(label="Decrease speed", command=handlers.slower)ˆà ˆà 696 menu_action.add_command(label="Increase speed", command=handlers.faster, accelerator="Alt+F")ˆà ˆà 697 menu_action.bind_all("<Alt-f>", handlers.faster)ˆà ˆà 698 menu_action.add_command(label="Decrease speed", command=handlers.slower, accelerator="Alt+S")ˆà ˆà 699 menu_action.bind_all("<Alt-s>", handlers.slower)ˆà 690 700 menu_action.add_separator()ˆà 691 ˆà menu_action.add_command(label="Zoom In", command=handlers.zoom_in)ˆà 692 ˆà menu_action.add_command(label="Zoom Out", command=handlers.zoom_out)ˆà ˆà 701 menu_action.add_command(label="Zoom In", command=handlers.zoom_in, accelerator="Ctrl+Z")ˆà ˆà 702 menu_action.bind_all("<Control-z>", handlers.zoom_in)ˆà ˆà 703 menu_action.add_command(label="Zoom Out", command=handlers.zoom_out, accelerator="Ctrl+X")ˆà ˆà 704 menu_action.bind_all("<Control-x>", handlers.zoom_out)ˆà 693 705 menu_action.add_separator()ˆà 694 ˆà menu_action.add_command(label="Clean field", command=handlers.clean_field)ˆà 695 ˆà menu_action.add_command(label="Fill randomly", command=handlers.fill_randomly)ˆà ˆà 706 menu_action.add_command(label="Clean field", command=handlers.clean_field, accelerator="Ctrl+C")ˆà ˆà 707 menu_action.bind_all("<Control-c>", handlers.clean_field)ˆà ˆà 708 menu_action.add_command(label="Fill randomly", command=handlers.fill_randomly, accelerator="Ctrl+R")ˆà ˆà 709 menu_action.bind_all("<Control-r>", handlers.fill_randomly)ˆà 696 710 menu_action.add_separator()ˆà 697 ˆà menu_action.add_command(label="Change size",command=handlers.show_size_window)ˆà ˆà 711 menu_action.add_command(label="Change size",command=handlers.show_size_window, accelerator="Ctrl+D")ˆà ˆà 712 menu_action.bind_all("<Control-d>", handlers.show_size_window)ˆà 698 713 menubar.add_cascade(label="Action", menu=menu_action)ˆà 699 714 ˆà
Note: See TracChangeset
for help on using the changeset viewer.