Exemplo n.º 1
0
def build_panel(descr):
	#
	# Sanity check
	#
	if (not descr) or descr[0] <> 'panel':
		raise panel_error, 'panel description must start with "panel"'
	#
	if debug: show_panel('', descr)
	#
	# Create an empty panel
	#
	panel = pnl.mkpanel()
	#
	# Assign panel attributes
	#
	assign_members(panel, descr[1:], ['al'], '')
	#
	# Look for actuator list
	#
	al = getattrlist(descr, 'al')
	#
	# The order in which actuators are created is important
	# because of the endgroup() operator.
	# Unfortunately the Panel Editor outputs the actuator list
	# in reverse order, so we reverse it here.
	#
	al = reverse(al)
	#
	for a in al:
		act, name = build_actuator(a)
		act.addact(panel)
		if name:
			stmt = 'panel.' + name + ' = act'
			exec stmt + '\n'
		if is_endgroup(a):
			panel.endgroup()
		sub_al = getattrlist(a, 'al')
		if sub_al:
			build_subactuators(panel, act, sub_al)
	#
	return panel
Exemplo n.º 2
0
def build_panel(descr):
    if not descr or descr[0] != 'panel':
        raise panel_error, 'panel description must start with "panel"'
    if debug:
        show_panel('', descr)
    panel = pnl.mkpanel()
    assign_members(panel, descr[1:], ['al'], '')
    al = getattrlist(descr, 'al')
    al = reverse(al)
    for a in al:
        act, name = build_actuator(a)
        act.addact(panel)
        if name:
            stmt = 'panel.' + name + ' = act'
            exec stmt + '\n'
        if is_endgroup(a):
            panel.endgroup()
        sub_al = getattrlist(a, 'al')
        if sub_al:
            build_subactuators(panel, act, sub_al)

    return panel
Exemplo n.º 3
0
def build_panel(descr):
    if not descr or descr[0] != 'panel':
        raise panel_error, 'panel description must start with "panel"'
    if debug:
        show_panel('', descr)
    panel = pnl.mkpanel()
    assign_members(panel, descr[1:], ['al'], '')
    al = getattrlist(descr, 'al')
    al = reverse(al)
    for a in al:
        act, name = build_actuator(a)
        act.addact(panel)
        if name:
            stmt = 'panel.' + name + ' = act'
            exec stmt + '\n'
        if is_endgroup(a):
            panel.endgroup()
        sub_al = getattrlist(a, 'al')
        if sub_al:
            build_subactuators(panel, act, sub_al)

    return panel
Exemplo n.º 4
0
def build_panel(descr):
    if not descr or descr[0] != "panel":
        raise panel_error, 'panel description must start with "panel"'
    if debug:
        show_panel("", descr)
    panel = pnl.mkpanel()
    assign_members(panel, descr[1:], ["al"], "")
    al = getattrlist(descr, "al")
    al = reverse(al)
    for a in al:
        act, name = build_actuator(a)
        act.addact(panel)
        if name:
            stmt = "panel." + name + " = act"
            exec stmt + "\n"
        if is_endgroup(a):
            panel.endgroup()
        sub_al = getattrlist(a, "al")
        if sub_al:
            build_subactuators(panel, act, sub_al)

    return panel
Exemplo n.º 5
0
# Module 'panel'
Exemplo n.º 6
0
# Module 'panel'