Elements.py 6.42 KB
Newer Older
1 2 3 4 5
import Tkinter as tk
from Edict import *
from PTE import *
from Eprop import *
    
6
def elemw(elewindow, window):
7 8 9 10 11

    ####################################################
    # Button building on received frame

    co1 = lambda: PTable(SLOT['ELEa'], bu1)
12
    co1a = lambda: atomsubmenu(SLOT['ELEa'], bu1, window)
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
    bu1 = tk.Menubutton(elewindow, text=SLOT['ELEa']['symbol'], width=3, height=1, relief='raised')    
    m1 = tk.Menu(bu1)               
    bu1.config(menu=m1)
    m1.add_command(label='Choose by PTE', command=co1)
    m1.add_command(label='Properties', command=co1a)

    co2 = lambda: PTable(SLOT['ELEb'], bu2)
    co2a = lambda: atomsubmenu(SLOT['ELEb'], bu2)
    bu2 = tk.Menubutton(elewindow, text=SLOT['ELEb']['symbol'], width=3, height=1, relief='raised')
    m2 = tk.Menu(bu2)               
    bu2.config(menu=m2)
    m2.add_command(label='Choose by PTE', command=co2)
    m2.add_command(label='Properties', command=co2a)

    co3 = lambda: PTable(SLOT['ELEc'], bu3)
    co3a = lambda: atomsubmenu(SLOT['ELEc'], bu3)
    bu3 = tk.Menubutton(elewindow, text=SLOT['ELEc']['symbol'], width=3, height=1, relief='raised')
    m3 = tk.Menu(bu3)               
    bu3.config(menu=m3)
    m3.add_command(label='Choose by PTE', command=co3)
    m3.add_command(label='Properties', command=co3a)

    co4 = lambda: PTable(SLOT['ELEd'], bu4)
    co4a = lambda: atomsubmenu(SLOT['ELEd'], bu4)
    bu4 = tk.Menubutton(elewindow, text=SLOT['ELEd']['symbol'], width=3, height=1, relief='raised')
    m4 = tk.Menu(bu4)               
    bu4.config(menu=m4)
    m4.add_command(label='Choose by PTE', command=co4)
    m4.add_command(label='Properties', command=co4a)

    co5 = lambda: PTable(SLOT['ELEe'], bu5)
    co5a = lambda: atomsubmenu(SLOT['ELEe'], bu5)
    bu5 = tk.Menubutton(elewindow, text=SLOT['ELEe']['symbol'], width=3, height=1, relief='raised')
    m5 = tk.Menu(bu5)               
    bu5.config(menu=m5)
    m5.add_command(label='Choose by PTE', command=co5)
    m5.add_command(label='Properties', command=co5a)

    co6 = lambda: PTable(SLOT['ELEf'], bu6)
    co6a = lambda: atomsubmenu(SLOT['ELEf'], bu6)
    bu6 = tk.Menubutton(elewindow, text=SLOT['ELEf']['symbol'], width=3, height=1, relief='raised')
    m6 = tk.Menu(bu6)               
    bu6.config(menu=m6)
    m6.add_command(label='Choose by PTE', command=co6)
    m6.add_command(label='Properties', command=co6a)

    co7 = lambda: PTable(SLOT['ELEg'], bu7)
    co7a = lambda: atomsubmenu(SLOT['ELEg'], bu7)
    bu7 = tk.Menubutton(elewindow, text=SLOT['ELEg']['symbol'], width=3, height=1, relief='raised')
    m7 = tk.Menu(bu7)               
    bu7.config(menu=m7)
    m7.add_command(label='Choose by PTE', command=co7)
    m7.add_command(label='Properties', command=co7a)

    co8 = lambda: PTable(SLOT['ELEh'], bu8)
    co8a = lambda: atomsubmenu(SLOT['ELEh'], bu8)
    bu8 = tk.Menubutton(elewindow, text=SLOT['ELEh']['symbol'], width=3, height=1, relief='raised')
    m8 = tk.Menu(bu8)               
    bu8.config(menu=m8)
    m8.add_command(label='Choose by PTE', command=co8)
    m8.add_command(label='Properties', command=co8a)

    co9 = lambda: PTable(SLOT['ELEi'], bu9)
    co9a = lambda: atomsubmenu(SLOT['ELEi'], bu9)
    bu9 = tk.Menubutton(elewindow, text=SLOT['ELEi']['symbol'], width=3, height=1, relief='raised')
    m9 = tk.Menu(bu9)               
    bu9.config(menu=m9)
    m9.add_command(label='Choose by PTE', command=co9)
    m9.add_command(label='Properties', command=co9a)

    co10 = lambda: PTable(SLOT['ELEj'], bu10)
    co10a = lambda: atomsubmenu(SLOT['ELEj'], bu10)
    bu10= tk.Menubutton(elewindow, text=SLOT['ELEj']['symbol'], width=3, height=1, relief='raised')
    m10 = tk.Menu(bu10)               
    bu10.config(menu=m10)
    m10.add_command(label='Choose by PTE', command=co10)
    m10.add_command(label='Properties', command=co10a)

    co11 = lambda: PTable(SLOT['ELEk'], bu11)
    co11a = lambda: atomsubmenu(SLOT['ELEk'], bu11)
    bu11 = tk.Menubutton(elewindow, text=SLOT['ELEk']['symbol'], width=3, height=1, relief='raised')
    m11 = tk.Menu(bu11)               
    bu11.config(menu=m11)
    m11.add_command(label='Choose by PTE', command=co11)
    m11.add_command(label='Properties', command=co11a)

    co12 = lambda: PTable(SLOT['ELEl'], bu12)
    co12a = lambda: atomsubmenu(SLOT['ELEl'], bu12)
    bu12 = tk.Menubutton(elewindow, text=SLOT['ELEl']['symbol'], width=3, height=1, relief='raised')
    m12 = tk.Menu(bu12)               
    bu12.config(menu=m12)
    m12.add_command(label='Choose by PTE', command=co12)
    m12.add_command(label='Properties', command=co12a)

    co13 = lambda: PTable(SLOT['ELEm'], bu13)
    co13a = lambda: atomsubmenu(SLOT['ELEm'], bu13)
    bu13 = tk.Menubutton(elewindow, text=SLOT['ELEm']['symbol'], width=3, height=1, relief='raised')
    m13 = tk.Menu(bu13)               
    bu13.config(menu=m13)
    m13.add_command(label='Choose by PTE', command=co13)
    m13.add_command(label='Properties', command=co13a)

    co14 = lambda: PTable(SLOT['ELEn'], bu14)
    co14a = lambda: atomsubmenu(SLOT['ELEn'], bu14)
    bu14 = tk.Menubutton(elewindow, text=SLOT['ELEn']['symbol'], width=3, height=1, relief='raised')
    m14 = tk.Menu(bu14)               
    bu14.config(menu=m14)
    m14.add_command(label='Choose by PTE', command=co14)
    m14.add_command(label='Properties', command=co14a)

    co15 = lambda: PTable(SLOT['ELEo'], bu15)
    co15a = lambda: atomsubmenu(SLOT['ELEo'], bu15)
    bu15 = tk.Menubutton(elewindow, text=SLOT['ELEo']['symbol'], width=3, height=1, relief='raised')
    m15 = tk.Menu(bu15)               
    bu15.config(menu=m15)
    m15.add_command(label='Choose by PTE', command=co15)
    m15.add_command(label='Properties', command=co15a)

    ####################################################

    bu1.grid(row=0, column=0, padx=1, pady=1)
    bu2.grid(row=0, column=1, padx=1, pady=1)
    bu3.grid(row=0, column=2, padx=1, pady=1)
    bu4.grid(row=0, column=3, padx=1, pady=1)
    bu5.grid(row=0, column=4, padx=1, pady=1)
    bu6.grid(row=1, column=0, padx=1, pady=1)
    bu7.grid(row=1, column=1, padx=1, pady=1)
    bu8.grid(row=1, column=2, padx=1, pady=1)
    bu9.grid(row=1, column=3, padx=1, pady=1)
    bu10.grid(row=1, column=4, padx=1, pady=1)
    bu11.grid(row=2, column=0, padx=1, pady=1)
    bu12.grid(row=2, column=1, padx=1, pady=1)
    bu13.grid(row=2, column=2, padx=1, pady=1)
    bu14.grid(row=2, column=3, padx=1, pady=1)
    bu15.grid(row=2, column=4, padx=1, pady=1)

    ####################################################