本文整理汇总了Python中pyasm.web.DivWdg.add_border方法的典型用法代码示例。如果您正苦于以下问题:Python DivWdg.add_border方法的具体用法?Python DivWdg.add_border怎么用?Python DivWdg.add_border使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.DivWdg
的用法示例。
在下文中一共展示了DivWdg.add_border方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_section_wdg(my, title, description, image, behavior):
section_wdg = DivWdg()
section_wdg.set_round_corners()
section_wdg.add_border()
section_wdg.add_class("spt_report_top")
section_wdg.add_style("width: 200px")
section_wdg.add_style("height: 100px")
section_wdg.add_style("overflow: hidden")
section_wdg.add_style("margin: 10px")
section_wdg.set_box_shadow("0px 0px 10px")
title_wdg = DivWdg()
section_wdg.add(title_wdg)
title_wdg.add(title)
title_wdg.add_style("height: 20px")
title_wdg.add_style("padding: 3px")
title_wdg.add_style("margin-top: 3px")
title_wdg.add_style("font-weight: bold")
title_wdg.add_gradient("background", "background")
button = IconButtonWdg(title="Options", icon=IconWdg.ARROWHEAD_DARK_DOWN)
title_wdg.add(button)
button.add_style("float: right")
# set up menus
menu = my.get_menu()
SmartMenu.add_smart_menu_set( button, { 'MENU_ITEM': menu } )
SmartMenu.assign_as_local_activator( button, "MENU_ITEM", True )
section_wdg.add_color("background", "background")
#section_wdg.add_gradient("background", "background", 0, -3)
section_wdg.add_behavior( {
'type': 'hover',
'add_color_modifier': -5,
'cb_set_prefix': 'spt.mouse.table_layout_hover',
} )
desc_div = DivWdg()
desc_div.add(description)
desc_div.add_style("padding: 5px 10px 10px 5px")
div = DivWdg()
section_wdg.add(div)
div.add_style("padding: 3px")
div.add_style("margin: 5px")
div.add_style("width: 65px")
div.add_style("height: 50px")
div.add_style("float: left")
div.add(image)
section_wdg.add(desc_div)
div.add_style("overflow: hidden")
section_wdg.add_behavior( behavior )
section_wdg.add_class("hand")
return section_wdg
示例2: get_header_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_header_wdg(my):
outer = DivWdg()
div = DivWdg()
outer.add(div)
div.add_color("background", "background3")
div.add_style("padding: 5px")
div.add_border()
table = Table()
table.add_style("margin-left: auto")
table.add_style("margin-right: auto")
table.add_color("color", "color")
table.add_style("font-size: 1.5em")
table.add_style("font-weight: bold")
table.add_row()
# add the month navigators
date_str = "%s, %s" % (my.MONTHS[my.month - 1], my.year)
month_wdg = DivWdg()
month_wdg.add_style("width: 150px")
month_wdg.add(date_str)
prev_month_wdg = my.get_prev_month_wdg()
next_month_wdg = my.get_next_month_wdg()
table.add_cell(prev_month_wdg)
td = table.add_cell(month_wdg)
td.add_style("text-align: center")
table.add_cell(next_month_wdg)
div.add(table)
return outer
示例3: get_advanced_definition_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_advanced_definition_wdg(self):
# add the advanced entry
advanced = DivWdg()
advanced.add_style("margin-top: 10px")
advanced.add_style("padding: 10px")
advanced.add_border()
title = DivWdg()
title.add_style("color: black")
title.add("Advanced - XML Column Definition")
title.add_style("margin-top: -23")
advanced.add(title)
advanced.add("<br/>")
input = TextAreaWdg("config_xml")
input.set_id("config_xml")
input.set_option("rows", "10")
input.set_option("cols", "70")
input.set_value(self.config_string)
advanced.add(input)
advanced.add(HtmlElement.br(2))
button_div = DivWdg()
button_div.add_style("text-align: center")
button = ActionButtonWdg(title="Save Definition")
#button = ProdIconButtonWdg("Save Definition")
button.add_event("onclick", "spt.custom_project.save_definition_cbk()")
button_div.add(button)
button_div.add_style("margin-left: 130px")
advanced.add(button_div)
return advanced
示例4: get_tile_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_tile_wdg(my, sobject):
div = DivWdg()
div.add_class("spt_tile_top")
div.add_class("spt_table_row")
top_view = my.kwargs.get("top_view")
if top_view:
title_wdg = my.get_view_wdg(sobject, top_view)
else:
title_wdg = my.get_title(sobject)
div.add( title_wdg )
div.add_attr("spt_search_key", sobject.get_search_key())
div.add_attr("spt_name", sobject.get_name())
div.add_attr("spt_search_code", sobject.get_code())
SmartMenu.assign_as_local_activator( div, 'DG_DROW_SMENU_CTX' )
div.add_border()
div.set_box_shadow()
div.add_color("background", "background", -3)
div.add_style("margin: 10px")
div.add_style("overflow: hidden")
div.add_style("float: left")
thumb_div = DivWdg()
thumb_div.add_class("spt_tile_content")
#thumb_div.add_class("spt_tile_detail")
div.add(thumb_div)
width = 240
height = 160
thumb_div.add_style("width: %s" % width)
thumb_div.add_style("height: %s" % height)
thumb_div.add_style("overflow: hidden")
thumb = ThumbWdg2()
thumb.set_sobject(sobject)
thumb_div.add(thumb)
bottom_view = my.kwargs.get("bottom_view")
if bottom_view:
div.add( my.get_view_wdg(sobject, bottom_view) )
div.add_attr("ondragenter", "return false")
div.add_attr("ondragover", "return false")
div.add_attr("ondrop", "spt.thumb.noop(event, this)")
return div
示例5: get_content_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_content_wdg(my):
div = DivWdg()
div.add_class("spt_tool_top")
table = Table()
div.add(table)
table.add_row()
td = table.add_cell()
from table_layout_wdg import FastTableLayoutWdg
kwargs = my.kwargs.copy()
td.add_style("width: 1%")
td.add_style("vertical-align: top")
layout_div = DivWdg()
layout_div.add_style("min-height: 500px")
td.add(layout_div)
my.kwargs['element_names'] = ['name','description','detail', 'file_list','general_checkin']
my.kwargs['show_shelf'] = False
layout = FastTableLayoutWdg(**my.kwargs)
layout_div.add(layout)
#from tactic.ui.panel import TileLayoutWdg
#layout = TileLayoutWdg(**my.kwargs)
#layout_div.add(layout)
td = table.add_cell()
td.add_border(color="#EEE")
td.add_style("vertical-align: top")
content = DivWdg()
td.add(content)
content.add_class("spt_tool_content")
#content.add_style("margin: -1px")
no_content_wdg = DivWdg()
content.add(no_content_wdg)
no_content_wdg.add("<br/>"*3)
no_content_wdg.add("<i>-- No Content --</i>")
#no_content_wdg.add_style("opacity: 0.5")
no_content_wdg.add_style("margin: 30px auto")
no_content_wdg.add_color("color", "color3")
no_content_wdg.add_color("background", "background3")
no_content_wdg.add_style("text-align", "center")
no_content_wdg.add_style("padding-top: 20px")
no_content_wdg.add_style("padding-bottom: 20px")
no_content_wdg.add_style("width: 350px")
no_content_wdg.add_style("height: 110px")
no_content_wdg.add_border()
return div
示例6: get_error_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_error_wdg(my):
div = DivWdg()
error_div = DivWdg()
error_div.add("Error %s" % my.status)
div.add(error_div)
error_div.add_style("font-size: 18px")
error_div.add_style("font-weight: bold")
error_div.add_style("padding: 10px")
error_div.add_style("width: auto")
error_div.add_gradient("background", "background")
error_div.add_border()
error_div.add_style("margin-left: 5px")
error_div.add_style("margin-right: 5px")
error_div.add_style("margin-top: -10px")
div.add("<br/>")
span = DivWdg()
#span.add_color("color", "color")
span.add_style("color", "#FFF")
if my.status == 404:
span.add(HtmlElement.b("You have tried to access a url that is not recognized."))
else:
span.add(HtmlElement.b(my.message))
span.add(HtmlElement.br(2))
web = WebContainer.get_web()
root = web.get_site_root()
if my.message.startswith('No project ['):
label = 'You may need to correct the default_project setting in the TACTIC config.'
else:
label = "Go to the Main page for a list of valid projects"
span.add(label)
div.add(span)
div.add(HtmlElement.br())
from tactic.ui.widget import ActionButtonWdg
button_div = DivWdg()
button_div.add_style("width: 90px")
button_div.add_style("margin: 0px auto")
div.add(button_div)
button = ActionButtonWdg(title="Go to Main", tip='Click to go to main page')
button_div.add(button)
button.add_behavior( {
'type': 'click_up',
'cbjs_action': '''
document.location = '/';
'''
} )
button.add_event("onmouseup", "document.location='/'")
return div
示例7: get_info_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_info_wdg(my, sobject):
div = DivWdg()
div.add_style("margin: 10px 20px 20px 20px")
div.add_style("padding: 20px")
div.add_color("background", "background", -3)
div.add_border()
div.add_color("color", "color3")
div.set_round_corners(5)
div.add_style("height", "100%")
div.add_style("position: relative")
element_names = my.kwargs.get("element_names")
if not element_names:
element_names = ["code","name","description",]
else:
element_names = element_names.split(",")
view = "table"
from pyasm.widget import WidgetConfigView
search_type = sobject.get_search_type()
config = WidgetConfigView.get_by_search_type(search_type, view)
table = Table()
table.add_style("height", "100%")
div.add(table)
for element_name in element_names:
table.add_row()
title = Common.get_display_title(element_name)
td = table.add_cell("%s: " % title)
td.add_style("width: 200px")
td.add_style("padding: 5px")
element = config.get_display_widget(element_name)
element.set_sobject(sobject)
element.preprocess()
td = table.add_cell(element)
td.add_style("padding: 5px")
#value = sobject.get_value(element_name, no_exception=True) or "N/A"
#table.add_cell(value)
div.add("<br/>")
from tactic.ui.widget import DiscussionWdg
search_key = sobject.get_search_key()
notes_wdg = DiscussionWdg(search_key=search_key)
notes_wdg.set_sobject(sobject)
div.add(notes_wdg)
return div
示例8: get_section_wdg2
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_section_wdg2(self, title, description, image, behavior):
section_wdg = DivWdg()
section_wdg.set_round_corners()
section_wdg.add_border()
section_wdg.add_style("width: 200px")
section_wdg.add_style("height: 175px")
section_wdg.add_style("overflow: hidden")
section_wdg.add_style("margin: 10px")
section_wdg.set_box_shadow("1px 1px 1px 1px")
title_wdg = DivWdg()
section_wdg.add(title_wdg)
title_wdg.add(title)
title_wdg.add_style("height: 20px")
title_wdg.add_style("padding: 3px")
title_wdg.add_style("margin-top: 3px")
title_wdg.add_style("font-weight: bold")
title_wdg.add_gradient("background", "background")
section_wdg.add_color("background", "background")
section_wdg.add_behavior( {
'type': 'hover',
'add_color_modifier': -5,
'cb_set_prefix': 'spt.mouse.table_layout_hover',
} )
desc_div = DivWdg()
desc_div.add(description)
desc_div.add_style("padding: 0px 10px 10px 5px")
div = DivWdg()
section_wdg.add(div)
div.add_style("padding: 3px")
div.add_style("margin: 5px")
#div.add_style("width: 210px")
#div.add_style("height: 170px")
div.add_style("width: 105px")
div.add_style("height: 85px")
div.add(image)
section_wdg.add(desc_div)
div.add_style("overflow: hidden")
section_wdg.add_behavior( behavior )
section_wdg.add_class("hand")
return section_wdg
示例9: get_attr_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_attr_wdg(my):
div = DivWdg()
div.add_border()
# div.add_style("padding: 10px")
div.add_color("color", "color")
div.add_color("background", "background")
div.add_style("height: 100%")
div.add_style("min-height: 500px")
div.add_style("min-width: 500px")
div.add(" ")
div.add_class("spt_freeform_attr_top")
return div
示例10: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_display(my):
top = my.top
my.set_as_panel(top)
top.add_class("spt_subscription_top")
interval = my.kwargs.get("interval")
if not interval:
interval = 30 * 1000
else:
interval = int(interval) * 1000
inner = DivWdg()
top.add(inner)
my.set_refresh(inner,interval)
inner.add_style("min-width: %spx"%SubscriptionBarWdg.WIDTH)
inner.add_style("min-height: 300px")
#mode = "all"
mode = "new"
categories = ['chat','sobject','script','progress']
categories = [None]
has_entries = False
for category in categories:
category_wdg = my.get_category_wdg(category, mode)
if category_wdg:
inner.add(category_wdg)
has_entries = True
if not has_entries:
no_entries = DivWdg()
inner.add(no_entries)
no_entries.add_style("padding: 50px")
no_entries.add_style("width: %spx"%(SubscriptionBarWdg.WIDTH-50))
no_entries.add_style("height: 100px")
no_entries.add_style("margin: 100px auto")
no_entries.add_style("text-align: center")
no_entries.add_border()
no_entries.add_color("background", "background3")
no_entries.add("No messages")
if my.kwargs.get("is_refresh") == 'true':
return inner
else:
return top
示例11: get_row_wdgXX
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_row_wdgXX(my, buttons, show_title=False):
top = DivWdg()
#top.add_style("-moz-transform: scale(1.0)")
top.add_style("float: left")
top.add_style("margin-left: 3px")
top.add_style("margin-right: 3px")
if show_title:
top.add_style("height: 29px")
else:
top.add_style("height: 23px")
top.add_style("height: 33px")
left = DivWdg()
left.set_round_corners(20)
#left.add_style("-moz-border-radius-topleft: 20px")
#left.add_style("-moz-border-radius-bottomleft: 20px")
left.add_border()
left.add_gradient("background", "background", 20, -35)
#left.add_style("background: black")
left.add_style("float: left")
left.add_style("height: 100%")
left.add_style("width: 5px")
left.add_style("z-index: 0")
left.add_style("margin-right: -1")
top.add(left)
for button in buttons:
button.add_style("float: left")
top.add(button)
right = DivWdg()
right.add_style("-moz-border-radius-topright: 20px")
right.add_style("-moz-border-radius-bottomright: 20px")
right.add_gradient("background", "background", 20, -35)
#right.add_style("background: black")
right.add_style("float: left")
right.add_style("height: 100%")
right.add_style("width: 5px")
#right.add_style("margin-left: -1px")
right.add_style("z-index: 0")
right.add_style("border-style: solid")
right.add_style("border-color: %s" % right.get_color("border") )
right.add_style("border-width: 1 1 1 0")
top.add(right)
return top
示例12: get_small_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_small_section_wdg(my, title, description, image, behavior):
section_wdg = DivWdg()
section_wdg.set_round_corners()
section_wdg.add_border()
section_wdg.add_style("width: 225px")
section_wdg.add_style("height: 100px")
section_wdg.add_style("overflow: hidden")
section_wdg.add_style("margin: 10px")
section_wdg.set_box_shadow("0px 0px 5px")
title_wdg = DivWdg()
section_wdg.add(title_wdg)
title_wdg.add(title)
title_wdg.add_style("height: 20px")
title_wdg.add_style("padding: 3px")
title_wdg.add_style("margin-top: 3px")
title_wdg.add_style("font-weight: bold")
title_wdg.add_gradient("background", "background")
section_wdg.add_color("background", "background")
#section_wdg.add_gradient("background", "background", 0, -3)
section_wdg.add_behavior( {
'type': 'hover',
'add_color_modifier': -5,
'cb_set_prefix': 'spt.mouse.table_layout_hover',
} )
desc_div = DivWdg()
desc_div.add(description)
desc_div.add_style("padding: 5px 10px 10px 5px")
div = DivWdg()
section_wdg.add(div)
div.add_style("padding: 5px")
div.add_style("margin: 5px")
div.add_style("width: 65px")
div.add_style("height: 50px")
div.add_style("float: left")
div.add_style("text-align: center")
div.add(image)
section_wdg.add(desc_div)
div.add_style("overflow: hidden")
section_wdg.add_behavior( behavior )
section_wdg.add_class("hand")
return section_wdg
示例13: get_title_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_title_wdg(my):
if my.parent:
code = my.parent.get_value("code", no_exception=True)
name = my.parent.get_value("name", no_exception=True)
search_type_obj = my.parent.get_search_type_obj()
else:
code = my.sobject.get_value("code", no_exception=True)
name = my.sobject.get_value("name", no_exception=True)
search_type_obj = my.sobject.get_search_type_obj()
title = DivWdg()
search = Search("sthpw/snapshot")
search.add_filter("search_type", "sthpw/search_type")
search.add_filter("search_code", search_type_obj.get_value("code"))
if search.get_sobject():
thumb = ThumbWdg()
title.add(thumb)
thumb.set_icon_size(30)
thumb.set_sobject(search_type_obj)
thumb.add_style("float: left")
title.add_color("background", "background3")
title.add_style("height: 20px")
title.add_style("padding: 6px")
title.add_style("font-weight: bold")
title.add_style("font-size: 1.4em")
title.add_border()
stype_title = search_type_obj.get_value("title")
if stype_title:
title.add("%s: " % stype_title)
if name:
title.add("%s" % name)
if code:
title.add(" <i style='font-size: 0.8; opacity: 0.7'>(%s)</i>" % code)
elif code:
title.add("%s" % code)
else:
title.add("(No name)")
return title
示例14: get_panel_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_panel_wdg(my, td, panel):
title = panel.get("title")
widget = panel.get("widget")
width = panel.get("width")
#height = panel.get("height")
#if not height:
# height = "250px"
#td.add_style("height: %s" % height)
if width:
td.add_style("width: %s" % width)
td.add_border()
div = DivWdg()
div.add_style("padding: 5px")
#div.add_style("padding: 10px")
title_wdg = DivWdg()
div.add(title_wdg)
title_wdg.add_style("padding: 5px")
#title_wdg.add_style("margin: -12px -12px 10px -12px")
title_wdg.add_style("margin: -6px -7px 5px -7px")
title_wdg.add_style("font-weight: bold")
title_wdg.add_style("font-size: 14px")
if title:
title_wdg.add_color("background", "background", -5)
title_wdg.add_color("color", "color", -10)
title_wdg.add_border()
title_wdg.add(title)
from tactic.ui.app import HelpButtonWdg
help_wdg = HelpButtonWdg(alias=my.get_help_alias())
help_wdg.add_style("float: right")
help_wdg.add_style("margin-top: -5px")
title_wdg.add(help_wdg)
else:
title_wdg.add_style("height: 10px")
if widget:
div.add(widget)
return div
示例15: get_item_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_border [as 别名]
def get_item_wdg(my, sobject):
div = DivWdg()
div.add_class("spt_item_top")
div.add_style("padding: 10px")
SmartMenu.assign_as_local_activator( div, 'DG_DROW_SMENU_CTX' )
div.add_class("spt_table_row")
div.add_attr("spt_search_key", sobject.get_search_key(use_id=True))
div.add_attr("spt_search_code", sobject.get_code())
name = sobject.get_value("name", no_exception=True)
if not name:
name = sobject.get_code()
div.add_attr("spt_name", name)
table = Table()
div.add(table)
table.set_max_width()
tr = table.add_row()
width = my.kwargs.get("preview_width")
if not width:
width = "240px"
td = table.add_cell()
td.add_style("width: %s" % width);
td.add_style("vertical-align: top")
from tile_layout_wdg import ThumbWdg2
thumb_div = DivWdg()
td.add(thumb_div)
thumb_div.add_border()
thumb_div.set_box_shadow("0px 0px 5px")
thumb_div.add_color("background", "background", -5)
thumb_div.add_class("spt_item_content")
thumb_div.add_style("min-height: 120px")
thumb = ThumbWdg2()
thumb_div.add(thumb)
thumb.set_sobject(sobject)
info_div = my.get_info_wdg(sobject)
td = table.add_cell(info_div)
td.add_style("vertical-align: top")
return div