本文整理汇总了Python中pyasm.web.DivWdg.set_attr方法的典型用法代码示例。如果您正苦于以下问题:Python DivWdg.set_attr方法的具体用法?Python DivWdg.set_attr怎么用?Python DivWdg.set_attr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.DivWdg
的用法示例。
在下文中一共展示了DivWdg.set_attr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_section_wdg(self, view, title='', editable=True, default=False):
'''editable really means draggable'''
if not title:
title = view
target_id = "sobject_relation"
if editable:
edit_mode = 'edit'
else:
edit_mode = 'read'
kwargs = {
'title': title,
'view': view,
'target_id': target_id,
'width': '300',
'prefix': 'manage_side_bar',
'mode': edit_mode,
'default': str(default),
'config_search_type': self.search_type
}
if view == "database_definition":
kwargs['recurse'] = "false"
id = "ManageSearchTypeMenuWdg_" + view
section_div = DivWdg(id=id, css='spt_panel')
section_div.add_style("display: block")
section_div.set_attr('spt_class_name', "tactic.ui.panel.ManageSearchTypeMenuWdg")
for name, value in kwargs.items():
if name == "config":
continue
section_div.set_attr("spt_%s" % name, value)
section_wdg = ManageSearchTypeMenuWdg(**kwargs)
section_div.add(section_wdg)
return section_div
示例2: get_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_section_wdg(my, view, editable=True, default=False):
title = ""
if editable:
edit_mode = 'edit'
else:
edit_mode = 'read'
kwargs = {
'title': title,
'config_search_type': my.search_type,
'view': view,
'width': '300',
'mode': edit_mode,
'default': str(default)
}
if view in ["definition", "custom_definition"]:
kwargs['recurse'] = "false"
from view_section_wdg import ViewSectionWdg
section_wdg = ViewSectionWdg(**kwargs)
class_path = Common.get_full_class_name(section_wdg)
section_div = DivWdg(css='spt_panel')
section_div.add_style("display: block")
section_div.set_attr('spt_class_name', class_path)
for name, value in kwargs.items():
if name == "config":
continue
section_div.set_attr("spt_%s" % name, value)
section_div.add(section_wdg)
return section_div
示例3: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_display(my):
dd_activator = DivWdg()
if my.style:
dd_activator.add_styles( my.style )
dd_activator.add_style( "width: %spx" % my.width )
dd_activator.add_class("SPT_DTS");
if my.nudge_menu_horiz != 0:
dd_activator.set_attr("spt_nudge_menu_horiz", my.nudge_menu_horiz)
if my.nudge_menu_vert != 0:
dd_activator.set_attr("spt_nudge_menu_vert", my.nudge_menu_vert)
# Generate button ...
#
table = Table()
table.add_row()
table.add_styles("width: 100%; padding: 0px; margin: 0px;")
td = table.add_cell()
td.add_looks("menu border curs_default")
td.add_styles( "padding: 0px; width: 100%; overflow: hidden; height: 12px; max-height: 12px;" )
title_div = DivWdg()
title_div.add_styles( "padding: 0px; margin-left: 4px; margin-top: 1px;" )
if my.icon_path:
img = HtmlElement.img()
img.set_attr("src", my.icon_path)
img.set_attr("title", my.title)
img.add_styles("padding: 0px; padding-bottom: 1px; margin: 0px; text-decoration: none;")
title_div.add(img)
title_div.add_looks("menu")
else:
title_div.add(my.title)
title_div.add_looks("menu fnt_text")
td.add( title_div )
td = table.add_cell()
# -- Example of setting only some of the borders with dotted style ...
# td.add_looks( "menu_btn_icon clear_borders border_bottom border_right dotted" )
td.add_looks( "menu_btn_icon border curs_default" )
td.add_styles( "padding: 0px; text-align: center; overflow: hidden; " \
"width: 15px; min-width: 15px;" \
"height: 12px; max-height: 12px;" )
arrow_img = HtmlElement.img("/context/icons/silk/_spt_bullet_arrow_down_dark_8x8.png")
arrow_img.add_styles( "border: 0px; margin-left: 1px; margin-top: 0px;" )
td.add( arrow_img )
dd_activator.add(table)
dd_activator.add( my.kwargs.get("smart_menu_set") )
dd_activator.add_class("SPT_SMENU_ACTIVATOR")
dd_activator.add_behavior( { 'type': 'click_up', 'activator_type' : 'smart_menu',
'cbjs_action': 'spt.smenu.show_on_dropdown_click_cbk( evt, bvr )' } )
return dd_activator
示例4: get_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_section_wdg(my, view, title="", editable=True, default=False):
"""editable really means draggable"""
if not title:
title = view
target_id = "sobject_relation"
if editable:
edit_mode = "edit"
else:
edit_mode = "read"
kwargs = {
"title": title,
"view": view,
"target_id": target_id,
"width": "300",
"prefix": "manage_side_bar",
"mode": edit_mode,
"default": str(default),
"config_search_type": my.search_type,
}
if view == "database_definition":
kwargs["recurse"] = "false"
id = "ManageSearchTypeMenuWdg_" + view
section_div = DivWdg(id=id, css="spt_panel")
section_div.add_style("display: block")
section_div.set_attr("spt_class_name", "tactic.ui.panel.ManageSearchTypeMenuWdg")
for name, value in kwargs.items():
if name == "config":
continue
section_div.set_attr("spt_%s" % name, value)
section_wdg = ManageSearchTypeMenuWdg(**kwargs)
section_div.add(section_wdg)
return section_div
示例5: get_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_section_wdg(self, view, editable=True, default=False):
title = ""
target_id = "sobject_relation"
if editable:
edit_mode = 'edit'
else:
edit_mode = 'read'
kwargs = {
'title': title,
'config_search_type': self.search_type,
'view': view,
'target_id': target_id,
'width': '300',
'prefix': 'manage_side_bar',
'mode': edit_mode,
'default': str(default)
}
if view in ["definition", "custom_definition"]:
kwargs['recurse'] = "false"
section_wdg = ViewSectionWdg(**kwargs)
class_path = Common.get_full_class_name(section_wdg)
section_div = DivWdg()
section_div.add_style("display: block")
section_div.set_attr('spt_class_name', class_path)
for name, value in kwargs.items():
if name == "config":
continue
section_div.set_attr("spt_%s" % name, value)
section_div.add(section_wdg)
return section_div
示例6: add_header
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def add_header(my, table, sobj_title):
title_str = my.kwargs.get("title")
if not title_str:
if my.mode == 'insert':
action = 'Add New Item'
elif my.mode == 'edit':
action = 'Save Changes'
else:
action = my.mode
title_str = action.capitalize() + " to " + sobj_title
if my.mode == 'edit':
title_str = '%s (%s)' %(title_str, my.sobjects[0].get_code())
th = table.add_header()
title_div = DivWdg()
title_div.set_attr('title', my.view)
th.add(title_div)
title_div.add(title_str)
th.add_color("background", "background3")
if my.color_mode == "default":
th.add_color("border-color", "table_border", default="border")
th.add_style("border-width: 1px")
th.add_style("border-style: solid")
th.set_attr("colspan", "2")
th.add_style("height: 30px")
示例7: get_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_section_wdg(my, sobject):
parent_key = SearchKey.get_by_sobject(sobject)
section_id = "wow"
title = ""
view = "children"
target_id = "sobject_relation"
kwargs = {
'section_id': section_id,
'title': title,
'view': view,
'target_id': target_id,
'width': '125',
'parent_key': parent_key
}
section_div = DivWdg()
section_div.add_style("display: block")
section_div.set_id(section_id)
section_div.set_attr('spt_class_name', "tactic.ui.panel.ChildrenBookmarkMenuWdg")
for name, value in kwargs.items():
if name == "config":
continue
section_div.set_attr("spt_%s" % name, value)
section_wdg = SObjectChildrenMenuWdg(**kwargs)
section_div.add(section_wdg)
return section_div
示例8: get_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_section_wdg(my, view, editable=True, default=False):
title = ""
if editable:
edit_mode = "edit"
else:
edit_mode = "read"
kwargs = {
"title": title,
"config_search_type": my.search_type,
"view": view,
"width": "300",
"mode": edit_mode,
"default": str(default),
}
if view in ["definition", "custom_definition"]:
kwargs["recurse"] = "false"
from view_section_wdg import ViewSectionWdg
section_wdg = ViewSectionWdg(**kwargs)
class_path = Common.get_full_class_name(section_wdg)
section_div = DivWdg(css="spt_panel")
section_div.add_style("display: block")
section_div.set_attr("spt_class_name", class_path)
for name, value in kwargs.items():
if name == "config":
continue
section_div.set_attr("spt_%s" % name, value)
section_div.add(section_wdg)
return section_div
示例9: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_display(my):
smenu_set_div = DivWdg()
smenu_set_div.add_class("SPT_SMENU_SET")
smenu_set_div.add_class("SPT_PUW")
if my.match_subset:
smenu_set_div.set_attr("SPT_SMENU_MATCH_SUBSET","true")
# ??? div.set_attr("SPT_CONTEXT_CLASS_TAG", "spt_dg_row")
# create default subset first ...
subset_div = DivWdg()
subset_div.add_class("SPT_SMENU_SUBSET SPT_SMENU_SUBSET__DEFAULT")
# -- this needs to be added to activator element ...
# subset_div.set_attr("SPT_SMENU_SUBSET_TAG", "SPT_SMENU_SUBSET__DEFAULT")
menu_spec_list = my.menu_specs_map.get('SPT_SMENU_SUBSET__DEFAULT')
if menu_spec_list:
for menu_spec in menu_spec_list:
smenu_wdg = SmartMenuWdg( menu_tag_suffix = menu_spec.get('menu_tag_suffix'),
width = menu_spec.get('width'),
opt_spec_list = menu_spec.get('opt_spec_list'),
allow_icons = menu_spec.get('allow_icons'),
setup_cbfn = menu_spec.get('setup_cbfn') )
subset_div.add( smenu_wdg )
smenu_set_div.add( subset_div )
if my.match_subset:
#{
for subset_tag, menu_spec_list in my.menu_specs_map.iteritems():
if subset_tag != 'SPT_SMENU_SUBSET__DEFAULT':
subset_div = DivWdg()
subset_div.add_class("SPT_SMENU_SUBSET %s" % subset_tag)
subset_div.set_attr("SPT_SMENU_SUBSET_TAG", subset_tag)
for menu_spec in menu_spec_list:
smenu_wdg = SmartMenuWdg( menu_tag_suffix = menu_spec.get('menu_tag_suffix'),
width = menu_spec.get('width'),
opt_spec_list = menu_spec.get('opt_spec_list'),
allow_icons = menu_spec.get('allow_icons'),
setup_cbfn = menu_spec.get('setup_cbfn') )
subset_div.add( smenu_wdg )
smenu_set_div.add( subset_div )
#}
return smenu_set_div
示例10: get_drop_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_drop_wdg(my):
if my.mode == 'view':
return SpanWdg()
hr = DivWdg()
hr.set_attr("SPT_ACCEPT_DROP", "manageSideBar")
hr.add_style("height: 5px")
hr.add_style("width: 150px")
#hr.add_style("border: solid 1px black")
hr.add_style("position: absolute")
hr.add_event("onmouseover", "this.getChildren()[0].style.display=''")
hr.add_event("onmouseout", "this.getChildren()[0].style.display='none'")
hr.add("<hr style='margin-top: 2px; size: 1px; color: #222; display: none'/>")
return hr
示例11: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_display(my):
sbox_popup_id = 'SearchBoxPopupWdg'
search_container = DivWdg()
search_container.set_id( "%s_search" % sbox_popup_id)
search_container.add_style("display", "block")
search_container.set_attr("spt_search_type", my.search_type)
search_container.set_attr("spt_search_view", my.search_view)
search_container.add(my.search_wdg)
sbox_popup = PopupWdg(id=sbox_popup_id, allow_page_activity=True, width="720px")
sbox_popup.add("TACTIC Search Box Window", "title")
sbox_popup.add( search_container, 'content' )
return sbox_popup
示例12: add_header
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def add_header(my, inner, sobj_title):
header_div = DivWdg()
title_str = my.kwargs.get("title")
if not title_str:
if my.mode == 'insert':
action = 'Add New Item'
elif my.mode == 'edit':
action = 'Save Changes'
else:
action = my.mode
title_str = action.capitalize() + " to " + sobj_title
if my.mode == 'edit':
title_str = '%s (%s)' %(title_str, my.sobjects[0].get_code())
#header div text
title_div = DivWdg()
title_div.add_style("font-weight: bold")
title_div.add_style("padding: 7px")
title_div.add_style("text-align: center")
title_div.set_attr('title', my.view)
title_div.add(title_str)
#actual header div
header_div.add(title_div)
header_div.add_class("spt_popup_header")
header_div.add_color("background", "background3", 10)
if my.color_mode == "default":
header_div.add_color("border-color", "table_border", default="border")
header_div.add_style("border-width: 1px")
header_div.add_style("border-style: solid")
header_div.set_attr("colspan", "2")
header_div.add_style("height: 30px")
header_div.add_style("padding: 3px 10px")
inner.add(header_div)
示例13: get_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
def get_section_wdg(my, view, editable=True, default=False):
from panel_wdg import SideBarBookmarkMenuWdg
title = ""
target_id = "sobject_relation"
if editable:
edit_mode = 'edit'
else:
edit_mode = 'read'
kwargs = {
'title': title,
'config_search_type': my.search_type,
'view': view,
'target_id': target_id,
'width': '300',
'prefix': 'manage_side_bar',
'mode': edit_mode,
'default': str(default)
}
if view in ["definition", "custom_definition"]:
kwargs['recurse'] = "false"
kwargs['sortable'] = "true"
section_wdg = SectionListWdg(**kwargs)
class_path = Common.get_full_class_name(section_wdg)
# FIXME: get rid of this id
id = "ManageSideBarBookmark_" + view
section_div = DivWdg(id=id)
section_div.add_style("display: block")
section_div.set_attr('spt_class_name', class_path)
for name, value in kwargs.items():
if name == "config":
continue
section_div.set_attr("spt_%s" % name, value)
section_div.add(section_wdg)
return section_div
示例14: ButtonWdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
#.........这里部分代码省略.........
'cbjs_action': '''
var top = bvr.src_el.getParent(".spt_button_top")
var over = top.getElement(".spt_button_over");
var click = top.getElement(".spt_button_click");
over.setStyle("display", "");
click.setStyle("display", "none");
''',
} )
bvr_wdg.add_relay_behavior( {
'type': 'mouseleave',
'bvr_match_class': 'spt_button_hit_wdg',
'cbjs_action': '''
var top = bvr.src_el.getParent(".spt_button_top")
var over = top.getElement(".spt_button_over");
var click = top.getElement(".spt_button_click");
over.setStyle("display", "none");
click.setStyle("display", "none");
'''
} )
def add_style(self, name, value=None):
self.top.add_style(name, value)
def add_behavior(self, behavior):
self.hit_wdg.add_behavior(behavior)
def add_class(self, class_name):
self.hit_wdg.add_class(class_name)
def set_attr(self, attr, name):
self.hit_wdg.set_attr(attr, name)
def add_arrow_behavior(self, behavior):
self.arrow_menu.add_behavior(behavior)
self.show_arrow_menu = True
def set_show_arrow_menu(self, flag):
self.show_arrow_menu = flag
def get_arrow_wdg(self):
return self.arrow_menu
def get_show_arrow_menu(self):
return self.show_arrow_menu
def set_show_title(self, flag):
self.kwargs['show_title' ] = flag
def add_dialog(self, dialog):
self.dialog = dialog
def get_button_wdg(self):
return self.hit_wdg
def get_icon_wdg(self):
return self.icon_div
示例15: IconWdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_attr [as 别名]
div.add_class("hand")
my.add_icon_behavior(div, sobject)
# add an optional source/original file icon
if my.show_orig_icon:
# make sure main is first
link_order = ['main', 'web']
link_path = ThumbWdg.get_link_path(my.info, link_order)
img = IconWdg("source file", icon= IconWdg.IMAGE)
href = HtmlElement.href(img, link_path)
href.add_style('float: left')
href.set_attr("spt_href", link_path)
href.add_class("spt_thumb_href")
div.add(HtmlElement.br(clear="all"))
div.add(href)
# add an optional text link
if my.show_filename_flag:
text_link = ThumbWdg.get_link_path(my.info, my.image_link_order)
my.set_text_link(div, div, text_link)
if my.show_file_type:
links_list = ThumbWdg.get_file_info_list(xml, file_objects, sobject, snapshot, my.show_versionless)
my.set_type_link(div, links_list)
return div