Exemplo n.º 1
0
def createwindow():
    global componentlist
    global intrinsiclist
    global intrinsicvaluelist
    global extrinsiclist
    global extrinsicvaluelist
    global affordanceformulalist

    clearall_button = Button(framer.Objframe, text="clear", command = lambda: clearlists(componentlist, intrinsiclist, intrinsicvaluelist,
                                                                              extrinsiclist, extrinsicvaluelist, affordanceformulalist))
    clearall_button.config(image = framer.cancelbtnpic, borderwidth = 0, bg = "#fa7878", activebackground= "#fa7878", compound = CENTER, foreground = "white", activeforeground = "#fa7878", font=(None, 13))
    clearall_button.place ( x = 560, y = 590 )
    tooltip.CreateToolTip(clearall_button, text = 'Tooltip:\n\n'
                 'Klick this button to discard your modifications\n'
                 'and clear all checkboxes, option menus and text fields')

    exec_button = Button(framer.Objframe, text="save", command = lambda: getvals(pred_entry, optionVar, optionVarHead, headgroup_entry,
                                                                      optionVarConc, concavitygroup_entry, rotvalx, rotvaly,
                                                                      rotvalz, reflvalxy, reflvalxz, reflvalyz, optionVarScale,
                                                                      optionVarMovable))
    exec_button.config(image = framer.smallbtnpic, borderwidth = 0, bg = "#a3ff8f", activebackground= "#a3ff8f", compound = CENTER, foreground = "white", activeforeground = "#a3ff8f", font=(None, 13))
    exec_button.place ( x = 560, y = 636 )
    tooltip.CreateToolTip(exec_button, text = 'Tooltip:\n\n'
                 'Klick this button to save your modifications\n'
                 'to a VoxML conform XML document')

    debug_textfield = tk.Text(framer.Objframe, height=4, width=48)
    debug_textfield.configure(relief = RIDGE, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    debug_textfield.place ( x = 100, y = 590 )

    group_label = Label(framer.Objframe, text = "Group:", foreground = "white", background = "#404040", font=(None, 14))
    group_label.place (x = 360, y = 50)
    tooltip.CreateToolTip(group_label, text = 'Tooltip:\n\n'
                 'Use Integers to refer to groups of parts,\n'
                 'habitats or affordance formulas')

    args_label = Label(framer.Objframe, text = "Arguments:", foreground = "white", background = "#404040", font=(None, 14))
    args_label.place (x = 440, y = 50)
    tooltip.CreateToolTip(args_label, text = 'Tooltip:\n\n'
                 'Insert functions arguments in entry fields\n'
                 'below')

    lex_label = Label(framer.Objframe, text = "<Lex>", foreground = "white", background = "#404040", font=(None, 14))
    lex_label.place (x = 50, y = 50)

    pred_label = Label(framer.Objframe, text = "Predicate:", foreground = "white", background = "#404040", font=(None, 12))
    pred_label.place (x = 100, y = 80)

    pred_entry = Entry(framer.Objframe)
    pred_entry.configure(relief = RIDGE, width = 17, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    pred_entry.place (x = 190, y = 80)
    
    typesub_label = Label(framer.Objframe, text = "Type:", foreground = "white", background = "#404040", font=(None, 12))
    typesub_label.place (x = 100, y = 110)

    optionVar = StringVar()
    optionVar.set("physobj")

    option = OptionMenu(framer.Objframe, optionVar, "physobj", "physobj", "physobj*artifact")
    option.place(x = 190, y = 110)
    option.config( width = 145, height = 14, image = framer.menutickpic, anchor = "w", bd = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#a3ff8f", font=(None, 12))

    type_label = Label(framer.Objframe, text = "<Type>", foreground = "white", background = "#404040", font=(None, 14))
    type_label.place (x = 50, y = 140)

    head_label = Label(framer.Objframe, text = "Head:", foreground = "white", background = "#404040", font=(None, 12))
    head_label.place (x = 100, y = 170)

    headgroup_entry = Entry(framer.Objframe, width = 4)
    headgroup_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    headgroup_entry.place (x = 370, y = 170)
    tooltip.CreateToolTip(headgroup_entry, text = 'Tooltip:\n\n'
                 '*OPTIONAL*')

    optionVarHead = StringVar()
    optionVarHead.set("ellipsoid")

    optionmenuhead = OptionMenu(framer.Objframe, optionVarHead, "ellipsoid", "ellipsoid", "bipyramid", "cylindroid", "cupola", "frustum",
                                "hemiellipsoid", "parallelepiped", "prismatoid", "pyramid", "rectangular_prism", "sheet",
                                "toroid", "wedge")
    optionmenuhead.place(x = 190, y = 170)
    optionmenuhead.config(width=145, height = 14, image = framer.menutickpic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#a3ff8f", font=(None, 11))

    component_label = Label(framer.Objframe, text = "Component:", foreground = "white", background = "#404040", font=(None, 12))
    component_label.place (x = 100, y = 200)

    component_entry = Entry(framer.Objframe)
    component_entry.configure(relief = RIDGE, width = 17, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    component_entry.place (x = 190, y = 200)

    componentgroup_entry = Entry(framer.Objframe, width = 4)
    componentgroup_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    componentgroup_entry.place (x = 370, y = 200)
    tooltip.CreateToolTip(componentgroup_entry, text = 'Tooltip:\n\n'
                 '*OPTIONAL*')

    duplicatevar = IntVar()
    duplicatevar.set(0)
    
    dupecheckbutton = Checkbutton(framer.Objframe, text="", variable=duplicatevar)
    dupecheckbutton.var = duplicatevar
    dupecheckbutton.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "#404040", font=(None, 12))
    dupecheckbutton.place ( x = 470, y = 200 )
    tooltip.CreateToolTip(dupecheckbutton, text = 'Tooltip:\n\n'
                 'Check this box if the Object has multiple instances\n'
                 'or copies of that same part\n\n *OPTIONAL*')

    add_component_button = Button(framer.Objframe, text="add", command = lambda: addcomponent(component_entry, componentgroup_entry, duplicatevar,
                                                                                   debug_textfield, componentlist_textfield,optionVarComponentlist, OptionMenuComponentlist))
    add_component_button.config(image = framer.smallbtnpic, borderwidth = 0, bg = "#a3ff8f", activebackground= "#a3ff8f", compound = CENTER, foreground = "white", activeforeground = "#a3ff8f", font=(None, 13))
    add_component_button.place ( x = 560, y = 198 )
    tooltip.CreateToolTip(add_component_button, text = 'Tooltip:\n\n'
                 'Klick this button to add a component\n'
                 'to the componentlist of the current object')

    concavity_label = Label(framer.Objframe, text = "Concavity:", foreground = "white", background = "#404040", font=(None, 12))
    concavity_label.place (x = 100, y = 230)

    optionVarConc = StringVar()
    optionVarConc.set("Flat")

    optionmenuconc = OptionMenu(framer.Objframe, optionVarConc, "Flat", "Flat", "Concave", "Convex")
    optionmenuconc.place(x = 190, y = 230)
    optionmenuconc.config(width=145, height = 14, image = framer.menutickpic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#a3ff8f", font=(None, 12))

    concavitygroup_entry = Entry(framer.Objframe, width = 4)
    concavitygroup_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    concavitygroup_entry.place (x = 370, y = 230)
    tooltip.CreateToolTip(concavitygroup_entry, text = 'Tooltip:\n\n'
                 '*OPTIONAL*')

    rotatsym_label = Label(framer.Objframe, text = "Rotatsym:", foreground = "white", background = "#404040", font=(None, 12))
    rotatsym_label.place (x = 100, y = 260)

    rotvalx = IntVar()
    rotvalx.set(0)
    rotvaly = IntVar()
    rotvaly.set(0)
    rotvalz = IntVar()
    rotvalz.set(0)

    rotxcheckbutton = Checkbutton(framer.Objframe, text="X", variable=rotvalx)
    rotxcheckbutton.var = rotvalx
    rotxcheckbutton.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "#404040", activeforeground = "#404040", font=(None, 12))
    rotxcheckbutton.place ( x = 190, y = 260 )

    rotxcheckbuttonlabel = Label(framer.Objframe, text="X")
    rotxcheckbuttonlabel.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "white", font=(None, 12))
    rotxcheckbuttonlabel.place ( x = 210, y = 262 )

    rotycheckbutton = Checkbutton(framer.Objframe, text="Y", variable=rotvaly)
    rotycheckbutton.var = rotvaly
    rotycheckbutton.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "#404040", activeforeground = "#404040", font=(None, 12))
    rotycheckbutton.place ( x = 230, y = 260 )

    rotycheckbuttonlabel = Label(framer.Objframe, text="Y")
    rotycheckbuttonlabel.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "white", font=(None, 12))
    rotycheckbuttonlabel.place ( x = 250, y = 262 )

    rotzcheckbutton = Checkbutton(framer.Objframe, text="Z", variable=rotvalz)
    rotzcheckbutton.var = rotvalz
    rotzcheckbutton.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "#404040", activeforeground = "#404040", font=(None, 12))
    rotzcheckbutton.place ( x = 270, y = 260 )

    rotzcheckbuttonlabel = Label(framer.Objframe, text="Z")
    rotzcheckbuttonlabel.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "white", font=(None, 12))
    rotzcheckbuttonlabel.place ( x = 290, y = 262 )

    reflsym_label = Label(framer.Objframe, text = "Reflsym:", foreground = "white", background = "#404040", font=(None, 12))
    reflsym_label.place (x = 100, y = 290)

    reflvalxy = IntVar()
    reflvalxy.set(0)
    reflvalxz = IntVar()
    reflvalxz.set(0)
    reflvalyz = IntVar()
    reflvalyz.set(0)

    reflxycheckbutton = Checkbutton(framer.Objframe, text="XY", variable=reflvalxy)
    reflxycheckbutton.var = reflvalxy
    reflxycheckbutton.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "#404040", activeforeground = "#404040", font=(None, 12))
    reflxycheckbutton.place ( x = 190, y = 290 )

    reflxycheckbuttonlabel = Label(framer.Objframe, text="XY")
    reflxycheckbuttonlabel.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "white", font=(None, 12))
    reflxycheckbuttonlabel.place ( x = 210, y = 292 )

    reflxzcheckbutton = Checkbutton(framer.Objframe, text="XZ", variable=reflvalxz)
    reflxzcheckbutton.var = reflvalxz
    reflxzcheckbutton.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "#404040", activeforeground = "#404040", font=(None, 12))
    reflxzcheckbutton.place ( x = 240, y = 290 )

    reflxzcheckbuttonlabel = Label(framer.Objframe, text="XZ")
    reflxzcheckbuttonlabel.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "white", font=(None, 12))
    reflxzcheckbuttonlabel.place ( x = 260, y = 292 )

    reflyzcheckbutton = Checkbutton(framer.Objframe, text="YZ", variable=reflvalyz)
    reflyzcheckbutton.var = reflvalyz
    reflyzcheckbutton.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "#404040", activeforeground = "#404040", font=(None, 12))
    reflyzcheckbutton.place ( x = 290, y = 290 )

    reflyzcheckbuttonlabel = Label(framer.Objframe, text="YZ")
    reflyzcheckbuttonlabel.config(borderwidth = 0, background = "#404040", activebackground= "#404040", foreground = "white", font=(None, 12))
    reflyzcheckbuttonlabel.place ( x = 310, y = 292 )

    habitat_label = Label(framer.Objframe, text = "<Habitat>", foreground = "white", background = "#404040", font=(None, 14))
    habitat_label.place (x = 50, y = 320)

    intrinsic_label = Label(framer.Objframe, text = "Intrinsic:", foreground = "white", background = "#404040", font=(None, 12))
    intrinsic_label.place (x = 100, y = 350)

    optionVarIntr = StringVar()
    optionVarIntr.set("UP")

    optionmenuint = OptionMenu(framer.Objframe, optionVarIntr, "UP", "UP", "TOP", "NEAR", "FRONT")
    optionmenuint.place(x = 190, y = 350)
    optionmenuint.config(width=145, height = 14, image = framer.menutickpic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#a3ff8f", font=(None, 12))

    intrinsicgroup_entry = Entry(framer.Objframe, width = 4)
    intrinsicgroup_entry.place (x = 370, y = 350)
    intrinsicgroup_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    tooltip.CreateToolTip(intrinsicgroup_entry, text = 'Tooltip:\n\n'
                 '*OPTIONAL*')

    intrinsicarg1_entry = Entry(framer.Objframe, width = 4)
    intrinsicarg1_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    intrinsicarg1_entry.place (x = 440, y = 350)

    intrinsicarg2_entry = Entry(framer.Objframe, width = 4)
    intrinsicarg2_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    intrinsicarg2_entry.place (x = 485, y = 350)
    
    add_intrinsic_button = Button(framer.Objframe, text="add", command = lambda: addhabitat(optionVarIntr, intrinsicgroup_entry, intrinsicarg1_entry,
                                                                                 intrinsicarg2_entry, intrinsiclist, intrinsicvaluelist,
                                                                                 "intr", debug_textfield, optionVarIntrinsiclist, OptionMenuIntrinsiclist, componentlist_textfield))
    add_intrinsic_button.config(image = framer.smallbtnpic, borderwidth = 0, bg = "#a3ff8f", activebackground= "#a3ff8f", compound = CENTER, foreground = "white", activeforeground = "#a3ff8f", font=(None, 13))
    add_intrinsic_button.place ( x = 560, y = 348 )

    tooltip.CreateToolTip(add_intrinsic_button, text = 'Tooltip:\n\n'
                 'Klick this button to add an intrinsic habitat\n'
                 'to the list of intrinsic habitats of the current object')

    extrinsic_label = Label(framer.Objframe, text = "Extrinsic:", foreground = "white", background = "#404040", font=(None, 12))
    extrinsic_label.place (x = 100, y = 380)

    optionVarExtr = StringVar()
    optionVarExtr.set("UP")

    optionmenuext = OptionMenu(framer.Objframe, optionVarExtr, "UP", "UP", "TOP", "NEAR", "FRONT")
    optionmenuext.place(x = 190, y = 380)
    optionmenuext.config(width=145, height = 14, image = framer.menutickpic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#a3ff8f", font=(None, 12))

    extrinsicgroup_entry = Entry(framer.Objframe, width = 4)
    extrinsicgroup_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    extrinsicgroup_entry.place (x = 370, y = 380)
    tooltip.CreateToolTip(extrinsicgroup_entry, text = 'Tooltip:\n\n'
                 '*OPTIONAL*')

    extrinsicarg1_entry = Entry(framer.Objframe, width = 4)
    extrinsicarg1_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    extrinsicarg1_entry.place (x = 440, y = 380)

    extrinsicarg2_entry = Entry(framer.Objframe, width = 4)
    extrinsicarg2_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    extrinsicarg2_entry.place (x = 485, y = 380)

    add_extrinsic_button = Button(framer.Objframe, text="add", command = lambda: addhabitat(optionVarExtr, extrinsicgroup_entry, extrinsicarg1_entry,
                                                                                 extrinsicarg2_entry, extrinsiclist, extrinsicvaluelist,
                                                                                 "extr", debug_textfield, optionVarExtrinsiclist, OptionMenuExtrinsiclist, componentlist_textfield))
    add_extrinsic_button.config(image = framer.smallbtnpic, borderwidth = 0, bg = "#a3ff8f", activebackground= "#a3ff8f", compound = CENTER, foreground = "white", activeforeground = "#a3ff8f", font=(None, 13))
    add_extrinsic_button.place ( x = 560, y = 378 )

    tooltip.CreateToolTip(add_extrinsic_button, text = 'Tooltip:\n\n'
                 'Klick this button to add an extrinsic habitat\n'
                 'to the list of extrinsic habitats of the current object')

    affordance_label = Label(framer.Objframe, text = "<Affordances>", foreground = "white", background = "#404040", font=(None, 14))
    affordance_label.place (x = 50, y = 410)

    affordanceformula_label = Label(framer.Objframe, text = "Formula:", foreground = "white", background = "#404040", font=(None, 12))
    affordanceformula_label.place (x = 100, y = 440)

    optionVarAfford = StringVar()
    optionVarAfford.set("grasp")

    optionmenuafford = OptionMenu(framer.Objframe, optionVarAfford, "grasp", "grasp", "lift", "roll", "slide", "put_on", "put_in")
    optionmenuafford.place(x = 190, y = 440)
    optionmenuafford.config(width=145, height = 14, image = framer.menutickpic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#a3ff8f", font=(None, 12))

    affordanceformulagroup_entry = Entry(framer.Objframe, width = 4)
    affordanceformulagroup_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    affordanceformulagroup_entry.place (x = 370, y = 440)

    affordarg1_entry = Entry(framer.Objframe, width = 4)
    affordarg1_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    affordarg1_entry.place (x = 440, y = 440)

    affordarg2_entry = Entry(framer.Objframe, width = 4)
    affordarg2_entry.configure(relief = RIDGE, width = 3, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    affordarg2_entry.place (x = 485, y = 440)

    add_affordanceformula_button = Button(framer.Objframe, text="add", command = lambda: addformula(optionVarAfford, affordanceformulagroup_entry,
                                                                                         affordarg1_entry, affordarg2_entry, debug_textfield,
                                                                                         optionVarAffordancelist, OptionMenuAffordancelist, componentlist_textfield))
    add_affordanceformula_button.config(image = framer.smallbtnpic, borderwidth = 0, bg = "#a3ff8f", activebackground= "#a3ff8f", compound = CENTER, foreground = "white", activeforeground = "#a3ff8f", font=(None, 13))
    add_affordanceformula_button.place ( x = 560, y = 438 )

    tooltip.CreateToolTip(add_affordanceformula_button, text = 'Tooltip:\n\n'
                 'Klick this button to add an affordance formula\n'
                 'to the list of affordance formulas of the current object')

    embodiement_label = Label(framer.Objframe, text="<Embodiement>", foreground = "white", background = "#404040", font=(None, 14))
    embodiement_label.place (x = 50, y = 470)

    scale_label = Label(framer.Objframe, text = "Scale:", foreground = "white", background = "#404040", font=(None, 12))
    scale_label.place (x = 100, y = 500)

    optionVarScale = StringVar()
    optionVarScale.set("agent")

    OptionMenuScale = OptionMenu(framer.Objframe, optionVarScale, "< agent", "< agent", "agent", "> agent")
    OptionMenuScale.place(x = 190, y = 500)
    OptionMenuScale.config(width=145, height = 14, image = framer.menutickpic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#a3ff8f", font=(None, 12))

    movable_label = Label(framer.Objframe, text = "Movable:", foreground = "white", background = "#404040", font=(None, 12))
    movable_label.place (x = 100, y = 530)

    optionVarMovable = StringVar()
    optionVarMovable.set("True")

    OptionMenuMovable = OptionMenu(framer.Objframe, optionVarMovable, "True", "True", "False")
    OptionMenuMovable.place(x = 190, y = 530)
    OptionMenuMovable.config(width=145, height = 14, image = framer.menutickpic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#a3ff8f", font=(None, 12))
    

    componentlist_label = Label(framer.Objframe, text = "File Preview:", foreground = "white", background = "#404040", font=(None, 14))
    componentlist_label.place (x = 670, y = 50)

    componentlist_textfield = tk.Text(framer.Objframe, height=10, width=40)
    componentlist_textfield.configure(relief = RIDGE, bd = 2, foreground = "white", insertbackground = "white", background = "#505050", font=(None, 12))
    componentlist_textfield.place ( x = 670, y = 80 )

    optionVarComponentlist = StringVar()
    optionVarComponentlist.set("Select Component")

    OptionMenuComponentlist = OptionMenu(framer.Objframe, optionVarComponentlist, "Select Component")
    OptionMenuComponentlist.place(x = 670, y = 300)
    OptionMenuComponentlist.config(width=250, height = 16, image = framer.cancelmenupic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#fa7878", font=(None, 12))
    OptionMenuComponentlist['menu'].entryconfig(1, background = "#404040" ,activebackground = "#404040", foreground = "white", activeforeground = "#fa7878")

    removecompo_button = Button(framer.Objframe, text="remove", command = lambda: removefromlist(componentlist, componentlist_textfield, OptionMenuComponentlist, optionVarComponentlist, debug_textfield))
    removecompo_button.config(image = framer.cancelbtnpic, borderwidth = 0, bg = "#fa7878", activebackground= "#fa7878", compound = CENTER, foreground = "white", activeforeground = "#fa7878", font=(None, 13))
    removecompo_button.place ( x = 960, y = 300 )


    optionVarIntrinsiclist = StringVar()
    optionVarIntrinsiclist.set("Select Intrinsic Habitat")
    
    OptionMenuIntrinsiclist = OptionMenu(framer.Objframe, optionVarIntrinsiclist, "Select Intrinsic Habitat")
    OptionMenuIntrinsiclist.place(x = 670, y = 348)
    OptionMenuIntrinsiclist.config(width=250, height = 16, image = framer.cancelmenupic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#fa7878", font=(None, 12))

    removeintr_button = Button(framer.Objframe, text="remove", command = lambda: removefromlist(intrinsiclist, componentlist_textfield, OptionMenuIntrinsiclist, optionVarIntrinsiclist, debug_textfield))
    removeintr_button.config(image = framer.cancelbtnpic, borderwidth = 0, bg = "#fa7878", activebackground= "#fa7878", compound = CENTER, foreground = "white", activeforeground = "#fa7878", font=(None, 13))
    removeintr_button.place ( x = 960, y = 348 )

    optionVarExtrinsiclist = StringVar()
    optionVarExtrinsiclist.set("Select Extrinsic Habitat")
    
    OptionMenuExtrinsiclist = OptionMenu(framer.Objframe, optionVarExtrinsiclist, "Select Extrinsic Habitat")
    OptionMenuExtrinsiclist.place(x = 670, y = 380)
    OptionMenuExtrinsiclist.config(width=250, height = 16, image = framer.cancelmenupic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#fa7878", font=(None, 12))

    removeextr_button = Button(framer.Objframe, text="remove", command = lambda: removefromlist(extrinsiclist, componentlist_textfield, OptionMenuExtrinsiclist, optionVarExtrinsiclist, debug_textfield))
    removeextr_button.config(image = framer.cancelbtnpic, borderwidth = 0, bg = "#fa7878", activebackground= "#fa7878", compound = CENTER, foreground = "white", activeforeground = "#fa7878", font=(None, 13))
    removeextr_button.place ( x = 960, y = 380 )


    optionVarAffordancelist = StringVar()
    optionVarAffordancelist.set("Select Affordance Formula")
    
    OptionMenuAffordancelist = OptionMenu(framer.Objframe, optionVarAffordancelist, "Select Affordance Formula")
    OptionMenuAffordancelist.place(x = 670, y = 440)
    OptionMenuAffordancelist.config(width=250, height = 16, image = framer.cancelmenupic, anchor = "w", borderwidth = 0,  indicatoron=0, compound = LEFT, bg = "#404040", activebackground= "#404040", foreground = "white", activeforeground = "#fa7878", font=(None, 12))

    removeAffordance_button = Button(framer.Objframe, text="remove", command = lambda: removefromlist(affordanceformulalist, componentlist_textfield, OptionMenuAffordancelist, optionVarAffordancelist, debug_textfield))
    removeAffordance_button.config(image = framer.cancelbtnpic, borderwidth = 0, bg = "#fa7878", activebackground= "#fa7878", compound = CENTER, foreground = "white", activeforeground = "#fa7878", font=(None, 13))
    removeAffordance_button.place ( x = 960, y = 440 )

    drdwnlistgrn = [option, optionmenuhead, optionmenuconc, optionmenuint, optionmenuext, optionmenuafford, OptionMenuScale, OptionMenuMovable]
    drdwnlistred = [OptionMenuComponentlist, OptionMenuIntrinsiclist, OptionMenuExtrinsiclist, OptionMenuAffordancelist]
    for drdwn in drdwnlistgrn:
        i = 0
        while i < drdwn['menu'].index('end') + 1:
            drdwn['menu'].entryconfig(i, background = "#404040" ,activebackground = "#505050", foreground = "white", activeforeground = "#a3ff8f")
            i += 1

    
    for drdwn in drdwnlistred:
        i = 0
        while i < drdwn['menu'].index('end') + 1:
            drdwn['menu'].entryconfig(i, background = "#404040" ,activebackground = "#505050", foreground = "white", activeforeground = "#fa7878")
            i += 1
        drdwn['menu'].add_command(label = "                                                                       ", command=tk._setit(optionVarComponentlist, "Select Component"))
        drdwn['menu'].entryconfig(1, background = "#404040" ,activebackground = "#404040", foreground = "white", activeforeground = "#fa7878")
Exemplo n.º 2
0
def createwindow():
    global arglist

    clearall_button = Button(framer.Attrframe,
                             text="clear",
                             command=lambda: clearlists(arglist))
    clearall_button.config(image=framer.cancelbtnpic,
                           borderwidth=0,
                           bg="#fa7878",
                           activebackground="#fa7878",
                           compound=CENTER,
                           foreground="white",
                           activeforeground="#fa7878",
                           font=(None, 13))
    clearall_button.place(x=560, y=590)
    tooltip.CreateToolTip(
        clearall_button,
        text='Tooltip:\n\n'
        'Klick this button to discard your modifications\n'
        'and clear all checkboxes, option menus and text fields')

    exec_button = Button(
        framer.Attrframe,
        text="save",
        command=lambda: getvals(pred_entry, optionVarArgtype, argvar_entry,
                                optionVarScale, optionVarArity))
    exec_button.config(image=framer.smallbtnpic,
                       borderwidth=0,
                       bg="#a3ff8f",
                       activebackground="#a3ff8f",
                       compound=CENTER,
                       foreground="white",
                       activeforeground="#a3ff8f",
                       font=(None, 13))
    exec_button.place(x=560, y=636)
    tooltip.CreateToolTip(exec_button,
                          text='Tooltip:\n\n'
                          'Klick this button to save your modifications\n'
                          'to a VoxML conform XML document')

    debug_textfield = tk.Text(framer.Attrframe, height=4, width=48)
    debug_textfield.configure(relief=RIDGE,
                              bd=2,
                              foreground="white",
                              insertbackground="white",
                              background="#505050",
                              font=(None, 12))
    debug_textfield.place(x=100, y=590)

    lex_label = Label(framer.Attrframe,
                      text="<Lex>",
                      foreground="white",
                      background="#404040",
                      font=(None, 14))
    lex_label.place(x=50, y=50)

    pred_label = Label(framer.Attrframe,
                       text="Predicate:",
                       foreground="white",
                       background="#404040",
                       font=(None, 12))
    pred_label.place(x=100, y=80)

    pred_entry = Entry(framer.Attrframe)
    pred_entry.configure(relief=RIDGE,
                         width=17,
                         bd=2,
                         foreground="white",
                         insertbackground="white",
                         background="#505050",
                         font=(None, 12))
    pred_entry.place(x=190, y=80)

    type_label = Label(framer.Attrframe,
                       text="<Type>",
                       foreground="white",
                       background="#404040",
                       font=(None, 14))
    type_label.place(x=50, y=140)

    arguments_label = Label(framer.Attrframe,
                            text="Argument:",
                            foreground="white",
                            background="#404040",
                            font=(None, 12))
    arguments_label.place(x=100, y=200)

    optionVarArgtype = StringVar()
    optionVarArgtype.set("agent")

    optionmenuargtype = OptionMenu(framer.Attrframe, optionVarArgtype, "agent",
                                   "agent", "location", "physobj")
    optionmenuargtype.place(x=190, y=200)
    optionmenuargtype.config(width=145,
                             height=14,
                             image=framer.menutickpic,
                             anchor="w",
                             bd=0,
                             indicatoron=0,
                             compound=LEFT,
                             bg="#404040",
                             activebackground="#404040",
                             foreground="white",
                             activeforeground="#a3ff8f",
                             font=(None, 12))

    argvar_entry = Entry(framer.Attrframe, width=4)
    argvar_entry.configure(relief=RIDGE,
                           width=3,
                           bd=2,
                           foreground="white",
                           insertbackground="white",
                           background="#505050",
                           font=(None, 12))
    argvar_entry.place(x=370, y=200)

    add_argument_button = Button(
        framer.Attrframe,
        text="add",
        command=lambda: addargument(optionVarArgtype, argvar_entry,
                                    debug_textfield))
    add_argument_button.config(image=framer.smallbtnpic,
                               borderwidth=0,
                               bg="#a3ff8f",
                               activebackground="#a3ff8f",
                               compound=CENTER,
                               foreground="white",
                               activeforeground="#a3ff8f",
                               font=(None, 13))
    add_argument_button.place(x=480, y=198)
    tooltip.CreateToolTip(add_argument_button,
                          text='Tooltip:\n\n'
                          'Klick this button to add a component\n'
                          'to the componentlist of the current object')

    scale_label = Label(framer.Attrframe,
                        text="Scale:",
                        foreground="white",
                        background="#404040",
                        font=(None, 12))
    scale_label.place(x=100, y=230)

    optionVarScale = StringVar()
    optionVarScale.set("binary")

    optionmenuscale = OptionMenu(framer.Attrframe, optionVarScale, "binary",
                                 "binary", "nominal", "ordinal", "intervall",
                                 "rational")
    optionmenuscale.place(x=190, y=230)
    optionmenuscale.config(width=145,
                           height=14,
                           image=framer.menutickpic,
                           anchor="w",
                           bd=0,
                           indicatoron=0,
                           compound=LEFT,
                           bg="#404040",
                           activebackground="#404040",
                           foreground="white",
                           activeforeground="#a3ff8f",
                           font=(None, 12))

    arity_label = Label(framer.Attrframe,
                        text="Arity:",
                        foreground="white",
                        background="#404040",
                        font=(None, 12))
    arity_label.place(x=100, y=260)

    optionVarArity = StringVar()
    optionVarArity.set("intransitive")

    optionmenuarity = OptionMenu(framer.Attrframe, optionVarArity,
                                 "intransitive", "intransitive", "transitive")
    optionmenuarity.place(x=190, y=260)
    optionmenuarity.config(width=145,
                           height=14,
                           image=framer.menutickpic,
                           anchor="w",
                           bd=0,
                           indicatoron=0,
                           compound=LEFT,
                           bg="#404040",
                           activebackground="#404040",
                           foreground="white",
                           activeforeground="#a3ff8f",
                           font=(None, 12))

    drdwnlist = [optionmenuargtype, optionmenuscale, optionmenuarity]
    for drdwn in drdwnlist:
        i = 0
        while i < drdwn['menu'].index('end') + 1:
            drdwn['menu'].entryconfig(i,
                                      background="#404040",
                                      activebackground="#505050",
                                      foreground="white",
                                      activeforeground="#a3ff8f")
            i += 1
Exemplo n.º 3
0
 frame.pack()
 #Se define el frame en el que irán el cuadro de texto del codigo y el que mostrará la variables
 textframe = tkinter.Frame(root)
 textframe.pack()
 #Se define el frame en el que irá el cuadro de texto
 consoleframe = tkinter.Frame(root)
 consoleframe.pack()
 #se genera el boton "nuevo"
 newbutton = tkinter.Button(frame,
                            text="Nuevo",
                            command=nuevo,
                            image=iconnew,
                            width=30,
                            height=30)
 newbutton.pack(side=tkinter.LEFT)
 newbutton_ttp = ttp.CreateToolTip(newbutton, "Nuevo")
 #se genera el botón "abrir"
 openbutton = tkinter.Button(frame,
                             text="Abrir",
                             command=abrir,
                             image=iconopen,
                             width=30,
                             height=30)
 openbutton.pack(side=tkinter.LEFT)
 openbutton_ttp = ttp.CreateToolTip(openbutton, "Abrir")
 #se genera el botón "guardar"
 savebutton = tkinter.Button(frame,
                             text="Guardar",
                             command=guardar,
                             image=iconsave,
                             width=30,
Exemplo n.º 4
0
def createwindow():
    global arglist

    clearall_button = Button(framer.Funcframe,
                             text="clear",
                             command=lambda: clearlists(arglist, root))
    clearall_button.config(image=framer.cancelbtnpic,
                           borderwidth=0,
                           bg="#fa7878",
                           activebackground="#fa7878",
                           compound=CENTER,
                           foreground="white",
                           activeforeground="#fa7878",
                           font=(None, 13))
    clearall_button.place(x=560, y=590)
    tooltip.CreateToolTip(
        clearall_button,
        text='Tooltip:\n\n'
        'Klick this button to discard your modifications\n'
        'and clear all checkboxes, option menus and text fields')

    exec_button = Button(
        framer.Funcframe,
        text="save",
        command=lambda: getvals(pred_entry, optionVarArgtype, argvar_entry,
                                referent_entry, mapping_entry, optionVarSpace,
                                axis_entry, arity_entry))
    exec_button.config(image=framer.smallbtnpic,
                       borderwidth=0,
                       bg="#a3ff8f",
                       activebackground="#a3ff8f",
                       compound=CENTER,
                       foreground="white",
                       activeforeground="#a3ff8f",
                       font=(None, 13))
    exec_button.place(x=560, y=636)
    tooltip.CreateToolTip(exec_button,
                          text='Tooltip:\n\n'
                          'Klick this button to save your modifications\n'
                          'to a VoxML conform XML document')

    debug_textfield = tk.Text(framer.Funcframe, height=4, width=48)
    debug_textfield.configure(relief=RIDGE,
                              bd=2,
                              foreground="white",
                              insertbackground="white",
                              background="#505050",
                              font=(None, 12))
    debug_textfield.place(x=100, y=590)

    lex_label = Label(framer.Funcframe,
                      text="<Lex>",
                      foreground="white",
                      background="#404040",
                      font=(None, 14))
    lex_label.place(x=50, y=50)

    pred_label = Label(framer.Funcframe,
                       text="Predicate:",
                       foreground="white",
                       background="#404040",
                       font=(None, 12))
    pred_label.place(x=100, y=80)

    pred_entry = Entry(framer.Funcframe)
    pred_entry.configure(relief=RIDGE,
                         width=17,
                         bd=2,
                         foreground="white",
                         insertbackground="white",
                         background="#505050",
                         font=(None, 12))
    pred_entry.place(x=190, y=80)

    type_label = Label(framer.Funcframe,
                       text="<Type>",
                       foreground="white",
                       background="#404040",
                       font=(None, 14))
    type_label.place(x=50, y=140)

    arguments_label = Label(framer.Funcframe,
                            text="Argument:",
                            foreground="white",
                            background="#404040",
                            font=(None, 12))
    arguments_label.place(x=100, y=170)

    optionVarArgtype = StringVar()
    optionVarArgtype.set("agent")

    optionmenuargtype = OptionMenu(framer.Funcframe, optionVarArgtype, "agent",
                                   "agent", "location", "physobj")
    optionmenuargtype.place(x=190, y=170)
    optionmenuargtype.config(width=145,
                             height=14,
                             image=framer.menutickpic,
                             anchor="w",
                             bd=0,
                             indicatoron=0,
                             compound=LEFT,
                             bg="#404040",
                             activebackground="#404040",
                             foreground="white",
                             activeforeground="#a3ff8f",
                             font=(None, 12))

    argvar_entry = Entry(framer.Funcframe, width=4)
    argvar_entry.configure(relief=RIDGE,
                           width=3,
                           bd=2,
                           foreground="white",
                           insertbackground="white",
                           background="#505050",
                           font=(None, 12))
    argvar_entry.place(x=370, y=170)

    add_argument_button = Button(
        framer.Funcframe,
        text="add",
        command=lambda: addargument(optionVarArgtype, argvar_entry,
                                    debug_textfield))
    add_argument_button.config(image=framer.smallbtnpic,
                               borderwidth=0,
                               bg="#a3ff8f",
                               activebackground="#a3ff8f",
                               compound=CENTER,
                               foreground="white",
                               activeforeground="#a3ff8f",
                               font=(None, 13))
    add_argument_button.place(x=560, y=168)
    tooltip.CreateToolTip(add_argument_button,
                          text='Tooltip:\n\n'
                          'Klick this button to add an argument\n'
                          'to the current function.')

    referent_label = Label(framer.Funcframe,
                           text="Referent:",
                           foreground="white",
                           background="#404040",
                           font=(None, 12))
    referent_label.place(x=100, y=200)

    referent_entry = Entry(framer.Funcframe)
    referent_entry.place(x=190, y=200)
    referent_entry.configure(relief=RIDGE,
                             width=17,
                             bd=2,
                             foreground="white",
                             insertbackground="white",
                             background="#505050",
                             font=(None, 12))

    mapping_label = Label(framer.Funcframe,
                          text="Mapping:",
                          foreground="white",
                          background="#404040",
                          font=(None, 12))
    mapping_label.place(x=100, y=230)

    mapping_entry = Entry(framer.Funcframe)
    mapping_entry.place(x=190, y=230)
    mapping_entry.configure(relief=RIDGE,
                            width=17,
                            bd=2,
                            foreground="white",
                            insertbackground="white",
                            background="#505050",
                            font=(None, 12))

    orientation_label = Label(framer.Funcframe,
                              text="<Orientation>",
                              foreground="white",
                              background="#404040",
                              font=(None, 14))
    orientation_label.place(x=50, y=290)

    space_label = Label(framer.Funcframe,
                        text="Space:",
                        foreground="white",
                        background="#404040",
                        font=(None, 12))
    space_label.place(x=100, y=320)

    optionVarSpace = StringVar()
    optionVarSpace.set("world")

    optionmenuspace = OptionMenu(framer.Funcframe, optionVarSpace, "world",
                                 "world", "object")
    optionmenuspace.place(x=190, y=320)
    optionmenuspace.config(width=145,
                           height=14,
                           image=framer.menutickpic,
                           anchor="w",
                           bd=0,
                           indicatoron=0,
                           compound=LEFT,
                           bg="#404040",
                           activebackground="#404040",
                           foreground="white",
                           activeforeground="#a3ff8f",
                           font=(None, 12))

    axis_label = Label(framer.Funcframe,
                       text="Axis:",
                       foreground="white",
                       background="#404040",
                       font=(None, 12))
    axis_label.place(x=100, y=350)
    tooltip.CreateToolTip(add_argument_button,
                          text='Tooltip:\n\n'
                          'add a + or - to the axis to specify\n'
                          'a direction')

    axis_entry = Entry(framer.Funcframe)
    axis_entry.place(x=190, y=350)
    axis_entry.configure(relief=RIDGE,
                         width=17,
                         bd=2,
                         foreground="white",
                         insertbackground="white",
                         background="#505050",
                         font=(None, 12))

    arity_label = Label(framer.Funcframe,
                        text="Arity:",
                        foreground="white",
                        background="#404040",
                        font=(None, 12))
    arity_label.place(x=100, y=380)

    arity_entry = Entry(framer.Funcframe)
    arity_entry.place(x=190, y=380)
    arity_entry.configure(relief=RIDGE,
                          width=17,
                          bd=2,
                          foreground="white",
                          insertbackground="white",
                          background="#505050",
                          font=(None, 12))

    drdwnlist = [optionmenuargtype, optionmenuspace]
    for drdwn in drdwnlist:
        i = 0
        while i < drdwn['menu'].index('end') + 1:
            drdwn['menu'].entryconfig(i,
                                      background="#404040",
                                      activebackground="#505050",
                                      foreground="white",
                                      activeforeground="#a3ff8f")
            i += 1
Exemplo n.º 5
0
def createwindow():
    global arglist
    global constraintlist
    global corresplist

    clearall_button = Button(
        framer.Relatframe,
        text="clear",
        command=lambda: clearlists(arglist, constraintlist, corresplist))
    clearall_button.config(image=framer.cancelbtnpic,
                           borderwidth=0,
                           bg="#fa7878",
                           activebackground="#fa7878",
                           compound=CENTER,
                           foreground="white",
                           activeforeground="#fa7878",
                           font=(None, 13))
    clearall_button.place(x=560, y=590)
    tooltip.CreateToolTip(
        clearall_button,
        text='Tooltip:\n\n'
        'Klick this button to discard your modifications\n'
        'and clear all checkboxes, option menus and text fields')

    exec_button = Button(
        framer.Relatframe,
        text="save",
        command=lambda: getvals(pred_entry, optionVarClass, optionVarValue,
                                optionVarArgtype, argvar_entry, constr_entry,
                                corresps_entry))
    exec_button.config(image=framer.smallbtnpic,
                       borderwidth=0,
                       bg="#a3ff8f",
                       activebackground="#a3ff8f",
                       compound=CENTER,
                       foreground="white",
                       activeforeground="#a3ff8f",
                       font=(None, 13))
    exec_button.place(x=560, y=636)
    tooltip.CreateToolTip(exec_button,
                          text='Tooltip:\n\n'
                          'Klick this button to save your modifications\n'
                          'to a VoxML conform XML document')

    debug_textfield = tk.Text(framer.Relatframe, height=4, width=48)
    debug_textfield.configure(relief=RIDGE,
                              bd=2,
                              foreground="white",
                              insertbackground="white",
                              background="#505050",
                              font=(None, 12))
    debug_textfield.place(x=100, y=590)

    lex_label = Label(framer.Relatframe,
                      text="<Lex>",
                      foreground="white",
                      background="#404040",
                      font=(None, 14))
    lex_label.place(x=50, y=50)

    pred_label = Label(framer.Relatframe,
                       text="Predicate:",
                       foreground="white",
                       background="#404040",
                       font=(None, 12))
    pred_label.place(x=100, y=80)

    pred_entry = Entry(framer.Relatframe)
    pred_entry.configure(relief=RIDGE,
                         width=17,
                         bd=2,
                         foreground="white",
                         insertbackground="white",
                         background="#505050",
                         font=(None, 12))
    pred_entry.place(x=190, y=80)

    type_label = Label(framer.Relatframe,
                       text="<Type>",
                       foreground="white",
                       background="#404040",
                       font=(None, 14))
    type_label.place(x=50, y=140)

    class_label = Label(framer.Relatframe,
                        text="Class:",
                        foreground="white",
                        background="#404040",
                        font=(None, 12))
    class_label.place(x=100, y=170)

    optionVarClass = StringVar()
    optionVarClass.set("config")

    optionmenuclass = OptionMenu(framer.Relatframe, optionVarClass, "config",
                                 "config", "force_dynamic")
    optionmenuclass.place(x=190, y=170)
    optionmenuclass.config(width=145,
                           height=14,
                           image=framer.menutickpic,
                           anchor="w",
                           bd=0,
                           indicatoron=0,
                           compound=LEFT,
                           bg="#404040",
                           activebackground="#404040",
                           foreground="white",
                           activeforeground="#a3ff8f",
                           font=(None, 12))

    arguments_label = Label(framer.Relatframe,
                            text="Value:",
                            foreground="white",
                            background="#404040",
                            font=(None, 12))
    arguments_label.place(x=100, y=200)

    optionVarValue = StringVar()
    optionVarValue.set("RCC8.EC")

    optionmenuvalue = OptionMenu(framer.Relatframe, optionVarValue, "RCC8.EC",
                                 "RCC8.EC")
    optionmenuvalue.place(x=190, y=200)
    optionmenuvalue.config(width=145,
                           height=14,
                           image=framer.menutickpic,
                           anchor="w",
                           bd=0,
                           indicatoron=0,
                           compound=LEFT,
                           bg="#404040",
                           activebackground="#404040",
                           foreground="white",
                           activeforeground="#a3ff8f",
                           font=(None, 12))

    arguments_label = Label(framer.Relatframe,
                            text="Argument:",
                            foreground="white",
                            background="#404040",
                            font=(None, 12))
    arguments_label.place(x=100, y=230)

    optionVarArgtype = StringVar()
    optionVarArgtype.set("agent")

    optionmenuargtype = OptionMenu(framer.Relatframe, optionVarArgtype,
                                   "agent", "agent", "location", "physobj")
    optionmenuargtype.place(x=190, y=230)
    optionmenuargtype.config(width=145,
                             height=14,
                             image=framer.menutickpic,
                             anchor="w",
                             bd=0,
                             indicatoron=0,
                             compound=LEFT,
                             bg="#404040",
                             activebackground="#404040",
                             foreground="white",
                             activeforeground="#a3ff8f",
                             font=(None, 12))

    argvar_entry = Entry(framer.Relatframe, width=4)
    argvar_entry.configure(relief=RIDGE,
                           width=3,
                           bd=2,
                           foreground="white",
                           insertbackground="white",
                           background="#505050",
                           font=(None, 12))
    argvar_entry.place(x=370, y=230)

    add_argument_button = Button(
        framer.Relatframe,
        text="add",
        command=lambda: addargument(optionVarArgtype, argvar_entry,
                                    debug_textfield))
    add_argument_button.config(image=framer.smallbtnpic,
                               borderwidth=0,
                               bg="#a3ff8f",
                               activebackground="#a3ff8f",
                               compound=CENTER,
                               foreground="white",
                               activeforeground="#a3ff8f",
                               font=(None, 13))
    add_argument_button.place(x=560, y=228)
    tooltip.CreateToolTip(add_argument_button,
                          text='Tooltip:\n\n'
                          'Klick this button to add a component\n'
                          'to the componentlist of the current object')

    constr_label = Label(framer.Relatframe,
                         text="Constraint:",
                         foreground="white",
                         background="#404040",
                         font=(None, 12))
    constr_label.place(x=100, y=260)

    constr_entry = Entry(framer.Relatframe)
    constr_entry.configure(relief=RIDGE,
                           width=17,
                           bd=2,
                           foreground="white",
                           insertbackground="white",
                           background="#505050",
                           font=(None, 12))
    constr_entry.place(x=190, y=260)

    add_constr_button = Button(
        framer.Relatframe,
        text="add",
        command=lambda: addconstr(constr_entry, debug_textfield))
    add_constr_button.config(image=framer.smallbtnpic,
                             borderwidth=0,
                             bg="#a3ff8f",
                             activebackground="#a3ff8f",
                             compound=CENTER,
                             foreground="white",
                             activeforeground="#a3ff8f",
                             font=(None, 13))
    add_constr_button.place(x=560, y=258)

    corresps_label = Label(framer.Relatframe,
                           text="Corresps.:",
                           foreground="white",
                           background="#404040",
                           font=(None, 12))
    corresps_label.place(x=100, y=290)

    corresps_entry = Entry(framer.Relatframe)
    corresps_entry.configure(relief=RIDGE,
                             width=17,
                             bd=2,
                             foreground="white",
                             insertbackground="white",
                             background="#505050",
                             font=(None, 12))
    corresps_entry.place(x=190, y=290)

    add_corresps_button = Button(
        framer.Relatframe,
        text="add",
        command=lambda: addcorresp(corresps_entry, debug_textfield))
    add_corresps_button.config(image=framer.smallbtnpic,
                               borderwidth=0,
                               bg="#a3ff8f",
                               activebackground="#a3ff8f",
                               compound=CENTER,
                               foreground="white",
                               activeforeground="#a3ff8f",
                               font=(None, 13))
    add_corresps_button.place(x=560, y=288)

    drdwnlist = [optionmenuclass, optionmenuvalue, optionmenuargtype]
    for drdwn in drdwnlist:
        i = 0
        while i < drdwn['menu'].index('end') + 1:
            drdwn['menu'].entryconfig(i,
                                      background="#404040",
                                      activebackground="#505050",
                                      foreground="white",
                                      activeforeground="#a3ff8f")
            i += 1
Exemplo n.º 6
0
    def __init__(self, parent):
        tk.Frame.__init__(self, parent.video_miner, FRAME_SETTINGS)
        self.parent = parent
        self.video_frame = parent.video_frame

        self.scale_drag = False
        tk.Grid.rowconfigure(self, 0, weight=1, minsize=15)
        tk.Grid.columnconfigure(self, 0, weight=1)

        # button images:
        self.decrease_photo = tk.PhotoImage(file="bitmaps/rewind.png")
        self.increase_photo = tk.PhotoImage(file="bitmaps/fast_forward.png")
        self.pause_photo = tk.PhotoImage(file="bitmaps/pause.png")
        self.play_photo = tk.PhotoImage(file="bitmaps/play.png")
        self.stop_photo = tk.PhotoImage(file="bitmaps/stop.png")
        self.track_photo = tk.PhotoImage(file="bitmaps/track.png")
        self.play_cycle = it.cycle([self.pause_photo, self.play_photo])

        # using a tkinter scale to control current location in video
        self.scale = tk.Scale(self,
                              from_=0,
                              to=self.parent.frame_count,
                              resolution=1,
                              width=15,
                              border=0,
                              highlightbackground=GUI_BG,
                              showvalue=False,
                              orient=tk.HORIZONTAL,
                              cursor="hand2",
                              troughcolor=WINDOWS_GRAYL,
                              sliderrelief=tk.FLAT,
                              bg=GUI_BLUE,
                              activebackground=GUI_BLUE)
        self.scale.grid(row=0, column=0, sticky=tk.NSEW, pady=10)
        self.scale.bind("<Button-1>", self.drag_switch)
        self.scale.bind("<ButtonRelease-1>", self.update_video_location)

        # the frame that holds the control buttons
        self.button_panel = tk.Frame(self, bg=GUI_BG)
        self.button_panel.grid(columnspan=2, row=1)
        tk.Grid.rowconfigure(self.button_panel, 0, weight=1, minsize=40)

        # tracking button
        self.trackbut = tk.Button(self.button_panel,
                                  BUTTON_SETTINGS,
                                  command=self.video_frame.get_rect,
                                  image=self.track_photo)
        self.trackbut.grid(button_config, column=0)
        tooltip.CreateToolTip(self.trackbut, "Toggle tracking")

        # play pause button
        self.playbut = tk.Button(self.button_panel,
                                 BUTTON_SETTINGS,
                                 command=self.playpause,
                                 image=self.play_photo)
        self.playbut.grid(button_config, column=1)
        tooltip.CreateToolTip(self.playbut, "Play/pause")

        # playing speed decrease button
        decreasebut = tk.Button(self.button_panel,
                                BUTTON_SETTINGS,
                                command=self.decrease_speed,
                                image=self.decrease_photo)
        decreasebut.grid(button_config, column=2)
        tooltip.CreateToolTip(decreasebut, "Decrease speed")

        # stop button
        stopbut = tk.Button(self.button_panel,
                            BUTTON_SETTINGS,
                            command=self.stop)
        stopbut.config(image=self.stop_photo, height=24, width=24)
        stopbut.grid(button_config, column=3)
        tooltip.CreateToolTip(stopbut, "Stop playing")

        # playing speed increase button
        increasebut = tk.Button(self.button_panel,
                                BUTTON_SETTINGS,
                                command=self.increase_speed,
                                image=self.increase_photo)
        increasebut.grid(button_config, column=4)
        tooltip.CreateToolTip(increasebut, "Increase speed")
Exemplo n.º 7
0
subMenu.add_command(label="Exit",command = quitfunc)

helpMenu = Menu(menu, tearoff=False)
menu.add_cascade(label="Help", menu = helpMenu)
helpMenu.add_command(label="About", command = lambda: MsgBox("About Hex-Manipulator", "Hex-Manipulator v1.0\n contact: [email protected]"))
#-------------------- Toolbar --------------------#
Ssett = PhotoImage(file=resource_path("saveSett.png"))
Dsett = PhotoImage(file=resource_path("delSett.png"))
CFields = PhotoImage(file=resource_path("clear.png"))
Loadsett = PhotoImage(file=resource_path("load.png"))

toolbar = Frame(root, width="500", pady=4, bg="#6bb2c6")
# toolbar.configure(pady=(0,10))
saveSett = Button(toolbar, image=Ssett, command=saveSetting)
saveSett.grid(row=0, padx=5)
SaveConfigTooltip = tooltip.CreateToolTip(saveSett, "Save current settings")

reloadSett = Button(toolbar, image=Loadsett, command=reloadSetting)
reloadSett.grid(row=0, column=1, padx=5)
reloadConfigTooltip = tooltip.CreateToolTip(reloadSett, "Load/reload settings")

delSett = Button(toolbar, image=Dsett, command=deleteSetting)
delSett.grid(row=0, column=2, padx=5)
DeleteConfigTooltip = tooltip.CreateToolTip(delSett, "Delete current settings")

SeparatorSettField = ttk.Separator(toolbar, orient=VERTICAL)
SeparatorSettField.grid(row=0, column=3, padx=5, sticky=N+S)

ClearFields = Button(toolbar, image=CFields, command=ClearAllFields)
ClearFields.grid(row=0, column=4, padx=5)
ClearFieldsTooltip = tooltip.CreateToolTip(ClearFields, "Clear Fields")
Exemplo n.º 8
0
def createwindow():
    global arglist
    global subeventlist

    clearall_button = Button(framer.Progrframe,
                             text="clear",
                             command=lambda: clearlists(arglist, subeventlist))
    clearall_button.config(image=framer.cancelbtnpic,
                           borderwidth=0,
                           bg="#fa7878",
                           activebackground="#fa7878",
                           compound=CENTER,
                           foreground="white",
                           activeforeground="#fa7878",
                           font=(None, 13))
    clearall_button.place(x=560, y=590)
    tooltip.CreateToolTip(
        clearall_button,
        text='Tooltip:\n\n'
        'Klick this button to discard your modifications\n'
        'and clear all checkboxes, option menus and text fields')

    exec_button = Button(framer.Progrframe,
                         text="save",
                         command=lambda: getvals(
                             pred_entry,
                             optionVar,
                             optionVarArgtype,
                             argvar_entry,
                         ))
    exec_button.config(image=framer.smallbtnpic,
                       borderwidth=0,
                       bg="#a3ff8f",
                       activebackground="#a3ff8f",
                       compound=CENTER,
                       foreground="white",
                       activeforeground="#a3ff8f",
                       font=(None, 13))
    exec_button.place(x=560, y=636)
    tooltip.CreateToolTip(exec_button,
                          text='Tooltip:\n\n'
                          'Klick this button to save your modifications\n'
                          'to a VoxML conform XML document')

    debug_textfield = tk.Text(framer.Progrframe, height=4, width=48)
    debug_textfield.configure(relief=RIDGE,
                              bd=2,
                              foreground="white",
                              insertbackground="white",
                              background="#505050",
                              font=(None, 12))
    debug_textfield.place(x=100, y=590)

    group_label = Label(framer.Progrframe,
                        text="Group:",
                        foreground="white",
                        background="#404040",
                        font=(None, 14))
    group_label.place(x=360, y=50)
    tooltip.CreateToolTip(group_label,
                          text='Tooltip:\n\n'
                          'Use Integers to refer to groups of parts,\n'
                          'habitats or affordance formulas')

    lex_label = Label(framer.Progrframe,
                      text="<Lex>",
                      foreground="white",
                      background="#404040",
                      font=(None, 14))
    lex_label.place(x=50, y=50)

    pred_label = Label(framer.Progrframe,
                       text="Predicate:",
                       foreground="white",
                       background="#404040",
                       font=(None, 12))
    pred_label.place(x=100, y=80)

    pred_entry = Entry(framer.Progrframe)
    pred_entry.configure(relief=RIDGE,
                         width=17,
                         bd=2,
                         foreground="white",
                         insertbackground="white",
                         background="#505050",
                         font=(None, 12))
    pred_entry.place(x=190, y=80)

    typesub_label = Label(framer.Progrframe,
                          text="Type:",
                          foreground="white",
                          background="#404040",
                          font=(None, 12))
    typesub_label.place(x=100, y=110)

    optionVar = StringVar()
    optionVar.set("process")

    option = OptionMenu(framer.Progrframe, optionVar, "process", "process",
                        "state", "transition_event")
    option.place(x=190, y=110)
    option.config(width=145,
                  height=14,
                  image=framer.menutickpic,
                  anchor="w",
                  bd=0,
                  indicatoron=0,
                  compound=LEFT,
                  bg="#404040",
                  activebackground="#404040",
                  foreground="white",
                  activeforeground="#a3ff8f",
                  font=(None, 12))

    type_label = Label(framer.Progrframe,
                       text="<Type>",
                       foreground="white",
                       background="#404040",
                       font=(None, 14))
    type_label.place(x=50, y=140)

    head_label = Label(framer.Progrframe,
                       text="Head:",
                       foreground="white",
                       background="#404040",
                       font=(None, 12))
    head_label.place(x=100, y=170)

    optionmenuhead = OptionMenu(framer.Progrframe, optionVar, "process",
                                "process", "state", "transition_event")
    optionmenuhead.place(x=190, y=170)
    optionmenuhead.config(width=145,
                          height=14,
                          image=framer.menutickpic,
                          anchor="w",
                          borderwidth=0,
                          indicatoron=0,
                          compound=LEFT,
                          bg="#404040",
                          activebackground="#404040",
                          foreground="white",
                          activeforeground="#a3ff8f",
                          font=(None, 11))

    arguments_label = Label(framer.Progrframe,
                            text="Argument:",
                            foreground="white",
                            background="#404040",
                            font=(None, 12))
    arguments_label.place(x=100, y=200)

    optionVarArgtype = StringVar()
    optionVarArgtype.set("agent")

    optionmenuargtype = OptionMenu(framer.Progrframe, optionVarArgtype,
                                   "agent", "agent", "location", "physobj")
    optionmenuargtype.place(x=190, y=200)
    optionmenuargtype.config(width=145,
                             height=14,
                             image=framer.menutickpic,
                             anchor="w",
                             borderwidth=0,
                             indicatoron=0,
                             compound=LEFT,
                             bg="#404040",
                             activebackground="#404040",
                             foreground="white",
                             activeforeground="#a3ff8f",
                             font=(None, 11))

    argvar_entry = Entry(framer.Progrframe, width=4)
    argvar_entry.configure(relief=RIDGE,
                           width=3,
                           bd=2,
                           foreground="white",
                           insertbackground="white",
                           background="#505050",
                           font=(None, 12))
    argvar_entry.place(x=370, y=200)

    add_argument_button = Button(
        framer.Progrframe,
        text="add",
        command=lambda: addargument(optionVarArgtype, argvar_entry,
                                    debug_textfield))
    add_argument_button.config(image=framer.smallbtnpic,
                               borderwidth=0,
                               bg="#a3ff8f",
                               activebackground="#a3ff8f",
                               compound=CENTER,
                               foreground="white",
                               activeforeground="#a3ff8f",
                               font=(None, 13))
    add_argument_button.place(x=560, y=198)
    tooltip.CreateToolTip(add_argument_button,
                          text='Tooltip:\n\n'
                          'Klick this button to add a component\n'
                          'to the componentlist of the current object')

    body_label = Label(framer.Progrframe,
                       text="<Body>",
                       foreground="white",
                       background="#404040",
                       font=(None, 14))
    body_label.place(x=50, y=230)

    subevent_label = Label(framer.Progrframe,
                           text="Subevent:",
                           foreground="white",
                           background="#404040",
                           font=(None, 12))
    subevent_label.place(x=100, y=260)

    subevent_entry = Entry(framer.Progrframe)
    subevent_entry.configure(relief=RIDGE,
                             width=17,
                             bd=2,
                             foreground="white",
                             insertbackground="white",
                             background="#505050",
                             font=(None, 12))
    subevent_entry.place(x=190, y=260)

    add_subevent_button = Button(framer.Progrframe,
                                 text="add",
                                 command=lambda: addsubevent(debug_textfield))
    add_subevent_button.config(image=framer.smallbtnpic,
                               borderwidth=0,
                               bg="#a3ff8f",
                               activebackground="#a3ff8f",
                               compound=CENTER,
                               foreground="white",
                               activeforeground="#a3ff8f",
                               font=(None, 13))
    add_subevent_button.place(x=560, y=258)

    drdwnlist = [option, optionmenuhead, optionmenuargtype]
    for drdwn in drdwnlist:
        i = 0
        while i < drdwn['menu'].index('end') + 1:
            drdwn['menu'].entryconfig(i,
                                      background="#404040",
                                      activebackground="#505050",
                                      foreground="white",
                                      activeforeground="#a3ff8f")
            i += 1