本文整理汇总了Python中pyasm.web.DivWdg.set_z_start方法的典型用法代码示例。如果您正苦于以下问题:Python DivWdg.set_z_start方法的具体用法?Python DivWdg.set_z_start怎么用?Python DivWdg.set_z_start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.DivWdg
的用法示例。
在下文中一共展示了DivWdg.set_z_start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_z_start [as 别名]
def get_display(my):
smenu_div = DivWdg()
smenu_div.add_class( "SPT_SMENU" )
smenu_div.add_class( "SPT_SMENU_%s" % my.menu_tag_suffix )
smenu_div.set_box_shadow()
smenu_div.add_border()
smenu_div.add_color("background", "background")
smenu_div.add_color("color", "color")
smenu_div.add_behavior( {
'type': 'load',
'cbjs_action': '''
spt.dom.load_js( ["ctx_menu.js"], function() {
spt.dom.load_js( ["smart_menu.js"], function() {
} )
} );
'''
} )
if my.setup_cbfn:
smenu_div.set_attr( "SPT_SMENU_SETUP_CBFN", my.setup_cbfn )
smenu_div.set_z_start( 300 )
#smenu_div.add_looks( "smenu border curs_default" )
# smenu_div.add_styles( "padding-top: 3px; padding-bottom: 5px;" )
m_width = my.width - 2
smenu_div.add_style( ("width: %spx" % m_width) )
smenu_div.add_style("overflow-x: hidden")
icon_width = 16
icon_col_width = 0
if my.allow_icons:
icon_col_width = icon_width + 2
label_width = m_width - icon_col_width - icon_width
menu_table = Table()
menu_table.add_styles( "text-align: left; text-indent: 3px; border-collapse: collapse;" )
#menu_table.add_color("background", "background")
menu_table.add_color("color", "color")
options = my.opt_spec_list
opt_count = 0
if options[0].get('type') != 'title':
my._add_spacer_row(menu_table, 3, icon_width, icon_col_width, label_width)
"""
menu_table.add_relay_behavior( {
'type': 'mouseenter',
'bvr_match_class': 'SPT_SMENU_ENTRY',
'bgcolor': menu_table.get_color("side_bar_title", -15, default="background3"),
'cbjs_action': '''
bvr.src_el.setStyle("background-color", bvr.bgcolor);
bvr.src_el.setStyle("color", bvr.bgcolor);
spt.smenu.entry_over( evt, bvr );
'''
} )
menu_table.add_relay_behavior( {
'type': 'mouseleave',
'bvr_match_class': 'SPT_SMENU_ENTRY',
'cbjs_action': '''
bvr.src_el.setStyle("background-color", "");
spt.smenu.entry_out( evt, bvr );
'''
} )
"""
for opt in options:
# if entry is a title, then add a spacer before
if opt.get('type') == 'title' and opt_count:
my._add_spacer_row(menu_table, 6, icon_width, icon_col_width, label_width)
tbody = menu_table.add_tbody()
tbody.add_style("display","table-row-group")
tr = menu_table.add_row()
#tr.add_looks( "smenu" )
tr.add_class( "SPT_SMENU_ENTRY" )
tr.add_class( "SPT_SMENU_ENTRY_%s" % opt['type'].upper() )
if opt.has_key('enabled_check_setup_key'):
tr.set_attr( "SPT_ENABLED_CHECK_SETUP_KEY", opt.get('enabled_check_setup_key') )
if opt.has_key('hide_when_disabled') and opt.get('hide_when_disabled'):
tr.set_attr( "SPT_HIDE_WHEN_DISABLED", "true" )
if opt['type'] in [ 'action', 'toggle' ]:
hover_bvr = {'type':'hover', 'add_looks': 'smenu_hilite',
'cbjs_action_over': 'spt.smenu.entry_over( evt, bvr );',
'cbjs_action_out': 'spt.smenu.entry_out( evt, bvr );' }
if opt.has_key('hover_bvr_cb'):
#.........这里部分代码省略.........
示例2: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_z_start [as 别名]
def get_display(my):
is_IE = WebContainer.get_web().is_IE()
cw = my.content_width
ch = my.content_height
title_h = 20 # title bar height
shd_w = 8 # drop shadow width
shd_h = 8 # drop shadow height
full_w = cw + (2 * shd_w)
full_h = ch + title_h + (2 * shd_h)
border_sz = 1 # border size for inside content area
# top DIV element for this widget ...
popwin_div = DivWdg()
if my.top_id:
popwin_div.set_id( my.top_id )
popwin_div.add_class("SPT_PWIN_TOP_DIV SPT_RSW_OUTER_TOP SPT_PUW spt_popup spt_pwin_DX spt_pwin_DY")
popwin_div.set_z_start( my.z_start )
popwin_div.add_styles( my.set_style( "display: none; position: absolute; top: 200px; left: 300px; " \
"width: %spx; height: %spx;" % (full_w, full_h)) )
left_div = DivWdg()
left_div.add_class("spt_pwin_A spt_pwin_DY")
left_div.add_styles( my.set_style("float: left; width: %spx; height: %spx;" % (shd_w, full_h)) )
center_div = DivWdg()
center_div.add_class("spt_pwin_B spt_pwin_DX spt_pwin_DY")
center_div.add_styles( my.set_style("float: left; width: %spx; height: %spx;" % (cw, full_h)) )
right_div = DivWdg()
right_div.add_class("spt_pwin_C spt_pwin_DY")
right_div.add_styles( my.set_style("float: left; width: %spx; height: %spx;" % (shd_w, full_h)) )
popwin_div.add( left_div )
popwin_div.add( center_div )
popwin_div.add( right_div )
# Do LEFT side ...
#
lt_div = DivWdg()
lm_div = DivWdg()
lb_div = DivWdg()
lt_div.add_styles( my.set_style("width: %spx; height: %spx;" % (shd_w, shd_h)) )
lt_div.add_class("css_shadow_top_left spt_pwin_A_1")
adj_h = ch + title_h
if not is_IE:
adj_h = adj_h + (2 * border_sz)
lm_div.add_styles( my.set_style("width: %spx; height: %spx;" % (shd_w, adj_h)) )
lm_div.add_class("css_shadow_left spt_pwin_A_2 spt_pwin_DY")
lb_div.add_styles( my.set_style("width: %spx; height: %spx;" % (shd_w, shd_h)) )
lb_div.add_class("css_shadow_bottom_left spt_pwin_A_3")
left_div.add( lt_div )
left_div.add( lm_div )
left_div.add( lb_div )
# Do Center/Middle bit ...
#
center_top_div = DivWdg()
center_resize_scroll_wdg = ResizeScrollWdg( width=cw, height=ch, scroll_bar_size_str='thick',
scroll_expansion='outside', affects_outside_flag=True,
exclude_top_border=True )
for wdg in my.added_widgets:
center_resize_scroll_wdg.add( wdg )
center_bottom_div = DivWdg()
center_top_div.add_styles( my.set_style("width: %spx; height: %spx;" % (cw, shd_h)) )
center_top_div.add_class("css_shadow_top spt_pwin_B_1 spt_pwin_DX")
center_title_div = DivWdg()
center_title_div.add_class("spt_pwin_B_title SPT_PWIN_TITLE_BAR spt_pwin_DX")
center_title_div.add_behavior( { 'type':'drag', 'drag_el': 'spt.popup.get_popup(@);',
'options': {'z_sort': 'bring_forward'} } )
border_adj_cw = cw
if not is_IE:
border_adj_cw = cw - (2 * border_sz)
center_title_div.add_styles( my.set_style("cursor: move; border: %spx solid black; " \
"background-color: #202020; color: white; width: %spx; " \
"height: %spx;" % \
(border_sz, border_adj_cw, title_h)) )
title_div = DivWdg()
title_div.add_styles( "width: 100%; height: 100%; padding: 4px;" )
title_div.add( my.title )
center_title_div.add( title_div )
#.........这里部分代码省略.........