|
@@ -22,6 +22,7 @@ if MAIN.IS_GUI:
|
|
|
|
|
|
import tkinter.simpledialog
|
|
|
from idlelib.tooltip import Hovertip
|
|
|
+ #myTip = Hovertip(b,'Strg + S ')
|
|
|
|
|
|
|
|
|
|
|
@@ -42,11 +43,12 @@ def draw_command(gui,xframe,data):
|
|
|
r+=1
|
|
|
continue
|
|
|
v=0
|
|
|
- print(dir(MAIN.meta.commands))
|
|
|
+ #print(dir(MAIN.meta.commands))
|
|
|
b = tk.Button(frame,bg="lightgrey", text=str(comm),width=6,height=2)
|
|
|
- if 1:#comm not in MAIN.meta.commands.elem:
|
|
|
- MAIN.meta.commands.elem[comm] = b
|
|
|
- MAIN.meta.commands.val[comm] = 0
|
|
|
+
|
|
|
+ MAIN.meta.commands.elem[comm] = b
|
|
|
+ MAIN.meta.commands.val[comm] = 0
|
|
|
+
|
|
|
if comm == "BLIND":
|
|
|
b["bg"] = "grey"
|
|
|
myTip = Hovertip(b,'BLIND MODE\nNO CHANGE on DMX-OUTPUT')
|
|
@@ -643,21 +645,22 @@ def draw_fx(gui,xframe,data=[]):
|
|
|
|
|
|
def draw_setup(gui,xframe,data):
|
|
|
frame_cmd=xframe
|
|
|
- i=0
|
|
|
- c=0
|
|
|
- r=0
|
|
|
|
|
|
frame = tk.Frame(frame_cmd,bg="black")
|
|
|
frame.pack(fill=tk.X, side=tk.LEFT)
|
|
|
|
|
|
- c+=1
|
|
|
+ i=0
|
|
|
+ c=0
|
|
|
+ r=0
|
|
|
|
|
|
pro_mode=1
|
|
|
if "--easy" in sys.argv:
|
|
|
pro_mode=0
|
|
|
+
|
|
|
+ print("draw_setup") #,[txt,bg,comm])
|
|
|
|
|
|
MAIN.meta.setup.elem = {}
|
|
|
- comms = MAIN.meta.setup.labels # = Elem_Container()
|
|
|
+ comms = MAIN.meta.setup.labels
|
|
|
for comm in comms:
|
|
|
if comm == "\n":
|
|
|
c=0
|
|
@@ -665,52 +668,47 @@ def draw_setup(gui,xframe,data):
|
|
|
continue
|
|
|
v=0
|
|
|
ok = 0
|
|
|
-
|
|
|
- if comm == "SAVE\nSHOW":
|
|
|
- b = tk.Button(frame,bg="lightgrey", text=str(comm),width=6,height=2)
|
|
|
- myTip = Hovertip(b,'Strg + S ')
|
|
|
- ok = 1
|
|
|
- elif comm == "LOAD\nSHOW" and pro_mode:
|
|
|
- b = tk.Button(frame,bg="lightgrey", text=str(comm),width=6,height=2)
|
|
|
- ok = 1
|
|
|
- elif comm == "SAVE\nSHOW AS" and pro_mode:
|
|
|
- b = tk.Button(frame,bg="lightgrey", text=str(comm),width=6,height=2)
|
|
|
- ok = 1
|
|
|
- elif comm == "SAVE &\nRESTART":
|
|
|
- b = tk.Button(frame,bg="lightgrey", text=str(comm),width=6,height=2)
|
|
|
- ok = 1
|
|
|
- elif comm == "NEW\nSHOW" and pro_mode:
|
|
|
- b = tk.Button(frame,bg="lightgreen", text=str(comm),width=6,height=2)
|
|
|
- ok = 1
|
|
|
- elif comm == "DRAW\nGUI" and pro_mode:
|
|
|
- b = tk.Button(frame,bg="lightgrey", text=str(comm),width=6,height=2)
|
|
|
+ bg="lightgrey"
|
|
|
+ tip=""
|
|
|
+ txt=str(comm)
|
|
|
+ if pro_mode:
|
|
|
ok = 1
|
|
|
- elif comm == "PRO\nMODE":
|
|
|
- bg="lightgrey"
|
|
|
+
|
|
|
+ if comm == "PRO\nMODE":
|
|
|
bg="yellow"
|
|
|
+ ok = 1
|
|
|
if pro_mode:
|
|
|
bg="green"
|
|
|
- comm = "EASY\nMODE"
|
|
|
- b = tk.Button(frame,bg=bg, text=str(comm),width=6,height=2)
|
|
|
+ txt = "EASY\nMODE"
|
|
|
+
|
|
|
+ if comm in ["NEW\nSHOW"]:
|
|
|
+ bg="lightgreen"
|
|
|
+
|
|
|
+ if comm in ["SAVE\nSHOW"]:
|
|
|
+ ok=1
|
|
|
+ tip ='Strg + S '
|
|
|
+
|
|
|
+ if comm in ["SAVE &\nRESTART"]:
|
|
|
ok = 1
|
|
|
|
|
|
- elif pro_mode:
|
|
|
- b = tk.Button(frame,bg="grey", text=str(comm),width=6,height=2)
|
|
|
+ if comm in ["NEW\nSHOW"] and pro_mode:
|
|
|
ok = 1
|
|
|
- else: #empty
|
|
|
- b = tk.Button(frame,bg="grey", text="",width=6,height=2)
|
|
|
|
|
|
- if 1:# comm not in MAIN.meta.commands.elem:
|
|
|
- MAIN.meta.setup.elem[comm] = b
|
|
|
- #gui.setup.elem.val[comm] = 0
|
|
|
+ if not ok:
|
|
|
+ txt=""
|
|
|
+ bg="lightgrey"
|
|
|
+
|
|
|
+ print(" ",[txt,bg,comm])
|
|
|
+ b = tk.Button(frame,bg=bg, text=str(txt),width=6,height=2)
|
|
|
+ MAIN.meta.setup.elem[str(txt)] = b
|
|
|
|
|
|
+ if tip:
|
|
|
+ myTip = Hovertip(b,tip)
|
|
|
if ok:
|
|
|
- b.bind("<Button>",tkevent.tk_event(fix=0,elem=b,attr=comm,data=gui,mode="SETUP").cb)
|
|
|
+ b.bind("<Button>",tkevent.tk_event(fix=0,elem=b,attr=txt,data=gui,mode="SETUP").cb)
|
|
|
+
|
|
|
+ b.grid(row=r, column=c, sticky=tk.W+tk.E)
|
|
|
|
|
|
- if comm == "BASE:":
|
|
|
- b["text"] = "BASE:{}".format(prm["BASE"])
|
|
|
- if comm:
|
|
|
- b.grid(row=r, column=c, sticky=tk.W+tk.E)
|
|
|
c+=1
|
|
|
if c >=17:
|
|
|
c=0
|
|
@@ -740,7 +738,8 @@ def draw_live(gui,xframe,data):
|
|
|
frame = tk.Frame(frame_cmd,bg="black")
|
|
|
frame.pack(fill="both",expand=1, side="left")#tk.TOP)
|
|
|
|
|
|
- comms=["FADE","DELAY","PAN/TILT\nFADE","PAN/TILT\nDELAY","-","-"]
|
|
|
+ MAIN.meta.live_prm.elem = {}
|
|
|
+ comms = MAIN.meta.live_prm.labels
|
|
|
|
|
|
for comm in comms:
|
|
|
if comm == "\n":
|
|
@@ -748,11 +747,10 @@ def draw_live(gui,xframe,data):
|
|
|
r+=1
|
|
|
continue
|
|
|
v=0
|
|
|
-
|
|
|
b = tk.Button(frame,bg="lightgrey", text=str(comm),width=6,height=2)
|
|
|
- if 1:#comm not in MAIN.meta.commands.elem:
|
|
|
- MAIN.meta.commands.elem[comm] = b
|
|
|
- MAIN.meta.commands.val[comm] = 0
|
|
|
+ MAIN.meta.live_prm.elem[comm] = b
|
|
|
+ print("live draw elem",[comm])
|
|
|
+
|
|
|
b.bind("<Button>",tkevent.tk_event(fix=0,elem=b,attr=comm,data=gui,mode="LIVE").cb)
|
|
|
|
|
|
if "FADE" == comm:
|
|
@@ -761,14 +759,25 @@ def draw_live(gui,xframe,data):
|
|
|
b["text"] = "DELAY:\n{:0.2}".format(MAIN.meta.DELAY.val())
|
|
|
if "PAN/TILT\nFADE" == comm:
|
|
|
b["text"] = "PAN/TILT\nFADE:{:0.2}".format(MAIN.meta.FADE_move.val())
|
|
|
+ if "PAN/TILT\nDELAY" == comm:
|
|
|
+ b["text"] = "PAN/TILT\nD:{:0.2}".format(MAIN.meta.FADE_move_delay.val())
|
|
|
+ myTip = Hovertip(b,comm)
|
|
|
+
|
|
|
|
|
|
if "FADE" in comm:
|
|
|
b["bg"] = "green"
|
|
|
b.config(activebackground="lightgreen")
|
|
|
if comm:
|
|
|
b.grid(row=r, column=c, sticky=tk.W+tk.E)
|
|
|
+
|
|
|
+
|
|
|
c+=1
|
|
|
if c >=7:
|
|
|
c=0
|
|
|
r+=1
|
|
|
|
|
|
+ #for b in MAIN.meta.live_prm.elem:
|
|
|
+ for label in MAIN.meta.live_prm.labels:
|
|
|
+ print("live draw elem",label)
|
|
|
+ b= MAIN.meta.live_prm.elem[label]
|
|
|
+ print("live draw elem",label,b)
|