本文整理汇总了Python中pyasm.web.DivWdg.add_gradient方法的典型用法代码示例。如果您正苦于以下问题:Python DivWdg.add_gradient方法的具体用法?Python DivWdg.add_gradient怎么用?Python DivWdg.add_gradient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.DivWdg
的用法示例。
在下文中一共展示了DivWdg.add_gradient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ProgressWdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [as 别名]
class ProgressWdg(BaseRefreshWdg):
'''A simple widget which displays the progress and an upload'''
def init(self):
self.progress_div = DivWdg()
self.progress_id = self.progress_div.set_unique_id()
def get_progress_id(self):
return self.progress_id
def get_display(self):
top = self.top
top.add_class("spt_progress_top")
top.add_style("height: 10px")
top.add_style("width: 200px")
top.add_style("overflow: hidden")
top.add_border()
top.add(self.progress_div)
self.progress_div.add_style("width: 0%")
self.progress_div.add_gradient("background", "background2", 20)
self.progress_div.add_style("height: 100%")
self.progress_div.add(" ")
self.progress_div.add('<img height="10px" src="/context/icons/common/indicator_snake.gif" border="0"/>')
return top
示例2: get_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [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
示例3: get_elements_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [as 别名]
def get_elements_wdg(my):
div = DivWdg()
div.add_style("min-width: 200px")
div.add_style("min-height: 500px")
title_wdg = DivWdg()
div.add(title_wdg)
title_wdg.add("Elements")
title_wdg.add_style("padding: 5px")
title_wdg.add_gradient("background", "background", -10)
#element_names = ['Checkin', 'Checkout']
element_names = my.config.get_element_names()
elements_wdg = DivWdg()
div.add(elements_wdg)
elements_wdg.add_style("padding: 5px")
view = 'tab_config_whatever'
hover = div.get_color("background", -10)
for element_name in element_names:
element_div = DivWdg()
elements_wdg.add(element_div)
element_div.add(element_name)
element_div.add_style("padding: 3px")
element_div.add_behavior( {
'type': 'hover',
'hover': hover,
'cbjs_action_over': '''bvr.src_el.setStyle("background", bvr.hover)''',
'cbjs_action_out': '''bvr.src_el.setStyle("background", "")'''
} )
element_div.add_class("hand")
element_div.add_behavior( {
'type': 'click_up',
'view': view,
'element_name': element_name,
'cbjs_action': '''
var top = bvr.src_el.getParent(".spt_tab_edit_top");
var content = top.getElement(".spt_tab_edit_content");
var class_name = 'tactic.ui.tools.tab_edit_wdg.TabElementDefinitionWdg';
var kwargs = {
view: bvr.view,
element_name: bvr.element_name
};
spt.panel.load(content, class_name, kwargs);
'''
} )
return div
示例4: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [as 别名]
def get_display(my):
# set the sobjects to all the widgets then preprocess
for widget in my.widgets:
widget.set_sobjects(my.sobjects)
widget.set_parent_wdg(my)
# preprocess the elements
widget.preprocess()
top = my.top
my.set_as_panel(top)
inner = DivWdg()
top.add(inner)
inner.add_color("background", "background")
inner.add_color("color", "color")
inner.add_class("spt_dashboard_top")
title = DivWdg()
inner.add(title)
title.add(my.get_title())
title.add_style("font-size: 18px")
title.add_style("font-weight: bold")
title.add_style("text-align: center")
title.add_style("padding: 10px")
#title.add_style("margin: -10px -10px 10px -10px")
title.add_gradient("background", "background3", 5, -10)
#table = Table()
from tactic.ui.container import ResizableTableWdg
table = ResizableTableWdg()
inner.add(table)
table.set_max_width()
panels = my.get_panels()
for panel in panels:
title = panel.get('title')
#if title in ['Data', None]:
# tr, td = table.add_row_cell()
#else:
# td = table.add_cell()
tr = table.add_row()
td = table.add_cell(resize=False)
td.add_style("min-height: 100px")
td.add_style("vertical-align: top")
panel = my.get_panel_wdg(td, panel)
td.add(panel)
return top
示例5: get_error_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [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
示例6: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [as 别名]
def get_display(my):
top = my.top
top.add_class("spt_share_top")
my.set_as_panel(top)
top.add_color("background", "background")
title = DivWdg()
top.add(title)
title.add_style("font-size: 18px")
title.add_style("font-weight: bold")
title.add_style("text-align: center")
title.add_style("padding: 10px")
#title.add_style("margin: -10px -10px 10px -10px")
title.add_gradient("background", "background3", 5, -10)
title.add("Share Project")
# add the main layout
#table = ResizableTableWdg()
table = Table()
table.add_color("color", "color")
top.add(table)
table.add_row()
left = table.add_cell()
left.add_border()
left.add_style("vertical-align: top")
left.add_style("min-width: 250px")
left.add_style("height: 400px")
left.add_color("background", "background3")
left.add(my.get_share_wdg() )
right = table.add_cell()
right.add_border()
right.add_style("vertical-align: top")
right.add_style("min-width: 400px")
right.add_style("width: 100%")
right.add_style("height: 400px")
right.add_style("padding: 5px")
right.add_class("spt_share_content")
share_item_wdg = ShareItemWdg()
right.add(share_item_wdg)
return top
示例7: get_section_wdg2
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [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
示例8: get_row_wdgXX
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [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
示例9: get_small_section_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [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
示例10: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [as 别名]
def get_display(my):
paths = my.get_files()
top = my.top
top.add_style("padding: 10px")
top.add_color("background", "background", -5)
top.add_style("min-width: 500px")
top.add_style("font-size: 12px")
top.add_class("spt_sobject_dir_list_top")
my.set_as_panel(top)
inner = DivWdg()
top.add(inner)
show_title = my.kwargs.get("show_title")
if show_title not in [False, 'false']:
title_wdg = DivWdg()
inner.add(title_wdg)
title_wdg.add("File Browser [%s]" % my.sobject.get_code())
title_wdg.add_gradient("background", "background3")
title_wdg.add_style("padding: 5px")
title_wdg.add_style("margin: -10px -10px 10px -10px")
title_wdg.add_style("font-weight: bold")
show_shelf = my.kwargs.get("show_shelf")
if show_shelf not in [False, 'false']:
shelf_wdg = DivWdg()
inner.add(shelf_wdg)
shelf_wdg.add(my.get_shelf_wdg())
shelf_wdg.add_style("padding: 5px")
shelf_wdg.add_style("margin: -5px -5px 15px -5px")
shelf_wdg.add_style("font-weight: bold")
base_dir = Environment.get_asset_dir()
dir_list = SnapshotDirListWdg(base_dir=base_dir, location="server", show_base_dir=True,paths=paths, all_open=True, files=my.files, snapshots=my.snapshots)
inner.add(dir_list)
if my.kwargs.get("is_refresh"):
return inner
else:
return top
示例11: get_panel_wdg
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [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: -7px -7px 5px -7px")
title_wdg.add_style("font-weight: bold")
title_wdg.add_style("font-size: 14px")
if title:
title_wdg.add_gradient("background", "background", -10)
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
示例12: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [as 别名]
def get_display(my):
top = my.top
title = my.kwargs.get("title")
title_wdg = DivWdg()
top.add(title_wdg)
title_wdg.add(title)
title_wdg.add_style("font-size: 18px")
title_wdg.add_style("font-weight: bold")
title_wdg.add_style("text-align: center")
title_wdg.add_style("padding: 10px")
title_wdg.add_style("margin: -10px -10px 10px -10px")
title_wdg.add_gradient("background", "background3", 5, -10)
return top
示例13: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [as 别名]
def get_display(my):
top = my.top
my.set_as_panel(top)
top.add_color("background", "background")
top.add_border()
top.add_class("spt_tab_edit_top")
my.config = my.get_config()
table = ResizableTableWdg()
top.add(table)
table.add_color("color", "color")
table.add_row()
left = table.add_cell()
left.add(my.get_elements_wdg() )
left.add_style("width: 200px")
left.add_border()
left.add_color("background", "background3")
left.add_color("color", "color3")
right = table.add_cell()
right.add_border()
title_wdg = DivWdg()
right.add(title_wdg)
title_wdg.add("Definition")
title_wdg.add_style("padding: 5px")
title_wdg.add_gradient("background", "background", -10)
right_div = DivWdg()
right.add(right_div)
right_div.add_style("width: 500px")
right_div.add_class("spt_tab_edit_content")
return top
示例14: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [as 别名]
def get_display(my):
title = DivWdg()
title.add(my.name_of_title)
title.add_style("padding: 5px")
title.add_style("margin: -10px -10px 10px -10px")
title.add_style("font-weight: bold")
title.add_style("font-size: 14px")
title.add_gradient("background", "background", -10)
title.add_color("color", "color", -10)
title.add_border()
from tactic.ui.app import HelpButtonWdg
help_wdg = HelpButtonWdg(alias=my.help_alias)
help_wdg.add_style("float: right")
help_wdg.add_style("margin-top: -5px")
title.add(help_wdg)
return title
示例15: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add_gradient [as 别名]
def get_display(self):
top = self.top
top.add_style("position: absolute")
top.add_style("top: 300")
top.add_style("left: 600")
top.add_style("display: none")
top.set_id("spt_hot_box")
top.add_style("margin: 0 auto")
top.add_behavior( {
'type': 'listen',
'event_name': 'hotbox|toggle',
'cbjs_action': '''
var size = $(window).getSize();
bvr.src_el.setStyle("left", size.x/2-300);
bvr.src_el.setStyle("top", size.y/2-200);
if (bvr.src_el.getStyle("display") == "none") {
spt.show(bvr.src_el);
spt.body.add_focus_element(bvr.src_el);
spt.popup.show_background();
}
else {
spt.hide(bvr.src_el);
spt.popup.hide_background();
}
'''
} )
top.add_behavior( {
'type': 'listen',
'event_name': 'hotbox|close',
'cbjs_action': '''
spt.hide(bvr.src_el);
spt.popup.hide_background();
'''
} )
div = DivWdg()
top.add(div)
div.add_style("width: 630px")
div.add_style("height: 400px")
div.add_style("opacity: 0.8")
div.add_gradient("background", "background3", 10)
div.add_style("position: fixed")
div.add_style("z-index: 1000")
#div.set_box_shadow("2px 2px 4px 4px")
div.set_box_shadow(color="#000")
div.set_round_corners(25)
div.add_border()
content_top_wdg = DivWdg()
content_top_wdg.add_style("position: fixed")
top.add(content_top_wdg)
content_top_wdg.add_style("padding: 20px 50px 50px 50px")
content_top_wdg.add_style("z-index: 1001")
content_top_wdg.add_style("width: 550px")
content_top_wdg.add_style("height: 400px")
close_wdg = DivWdg()
content_top_wdg.add(close_wdg)
icon = IconWdg('Close Quick Links', "BS_REMOVE")
close_wdg.add(icon)
#close_wdg.add_style("position: fixed")
#close_wdg.add_style("float: right")
close_wdg.add_style("position: absolute")
close_wdg.add_style("top: 10px")
close_wdg.add_style("right: 30px")
close_wdg.add_behavior( {
'type': 'click_up',
'cbjs_action': '''
spt.named_events.fire_event("hotbox|close");
'''
} )
close_wdg.add_class("hand")
content_wdg = self.get_content_wdg()
content_top_wdg.add(content_wdg)
return top