本文整理汇总了Python中pyasm.web.DivWdg.set_class方法的典型用法代码示例。如果您正苦于以下问题:Python DivWdg.set_class方法的具体用法?Python DivWdg.set_class怎么用?Python DivWdg.set_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.DivWdg
的用法示例。
在下文中一共展示了DivWdg.set_class方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_class [as 别名]
def init(my):
my.layer = LayerWdg(my.xpos, my.ypos, my.display)
if not my.width:
my.shadowbox = ShadowBoxWdg(my.shad_name)
else:
my.shadowbox = ShadowBoxWdg(my.shad_name, my.width)
# do not enable it for the Login page
web = WebContainer.get_web()
if my.shad_name and not web.is_IE():
BaseAppServer.add_onload_script("Move.drag('%s','%s')" \
%(my.shadowbox.get_name(), my.iframe_name))
div = DivWdg()
from pyasm.widget import IconButtonWdg
move_button = IconWdg(name='move me', icon=IconWdg.NAV)
move_button.set_id("%s_handle" % (my.shad_name))
move_button.add_class('move')
move_button.add_style('float: left')
move_button.add_style('padding: 2px 0 0 6px')
if not web.is_IE():
div.add(move_button)
mbutton = IconButtonWdg(name='close window', icon=IconWdg.KILL)
mbutton.set_class("moduleKillBtn")
mbutton.add_event("onclick", my.layer.get_off_script() )
div.add(mbutton)
if my.nav_links:
back_link = HtmlElement.href("<<", "javascript:history.back()")
back_link.add_style("font-size", "1.4em")
for_link = HtmlElement.href(">>", "javascript:history.forward()")
for_link.add_style("font-size", "1.4em")
div.add(SpanWdg(back_link, css='med'))
div.add(SpanWdg(for_link, css='med'))
my.shadowbox.set_header(div)
# add button and title_wdg to shadow box
if my.title_wdg:
title_wdg = DivWdg()
title_wdg.set_class("moduleTitle")
title_wdg.add(my.title_wdg)
my.shadowbox.set_title_wdg(title_wdg)
my.layer.add(my.shadowbox)
my._add_widget(my.layer)
示例2: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_class [as 别名]
def get_display(self):
top = self.top
top.set_id("spt_notify_top")
inner = DivWdg()
top.add(inner)
inner.set_class("spt_notify_el")
inner.add_style("position: fixed")
inner.add_style("top: 60px")
inner.add_style("z-index: 10000")
inner.add_style("width: auto")
inner.add_style("text-align: center")
inner.add_style("margin-top: -100px")
inner.add_color("background", "background", -3)
inner.add_style("height: auto")
inner.add_style("padding: 10px 20px")
inner.add_border()
msg_div = DivWdg()
inner.add(msg_div)
msg_div.add_class("spt_notify_message")
top.add_behavior( {
'type': 'load',
'cbjs_action': r'''
spt.notify = {};
spt.notify.last_settings = {};
spt.notify.top = bvr.src_el;
spt.notify.clone_el = null;
spt.notify.clone = function() {
var template = spt.notify.top.getElement(".spt_notify_el");
var clone = spt.behavior.clone( template );
spt.notify.top.appendChild(clone);
spt.notify.clone_el = clone;
return clone;
}
spt.notify.show = function(el) {
new Fx.Tween(el).start('opacity', 1);
new Fx.Tween(el).start('marginTop', 0);
}
spt.notify.hide = function(el) {
new Fx.Tween(el).start('opacity', 0);
new Fx.Tween(el).start('marginTop', -50);
}
spt.notify.set_message = function(message, settings, el) {
message = message.replace(/\n/g, "<br/>");
var msg_el = el.getElement(".spt_notify_message");
spt.behavior.replace_inner_html(msg_el, message);
spt.notify.last_settings = {};
for (var key in settings) {
spt.notify.last_settings[key] = el.getStyle(key);
el.setStyle(key, settings[key]);
}
}
spt.notify.show_message = function(message, duration, kwargs) {
if (!duration) {
duration = 5000;
}
var el = spt.notify.clone();
spt.notify.show(el);
spt.notify.set_message(message, kwargs, el);
setTimeout( function() {
spt.notify.hide(el);
setTimeout( function() {
spt.behavior.destroy_element(el);
}, 500 )
}, duration );
#.........这里部分代码省略.........