本文整理汇总了Python中pyasm.web.HtmlElement.div方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.div方法的具体用法?Python HtmlElement.div怎么用?Python HtmlElement.div使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.div方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import div [as 别名]
def __init__(my, tab_key="tab", css=REG):
super(DynTabWdg,my).__init__(True, tab_key, css)
my.inputs = []
my.options = {}
my.preload_script = None
my.tab_group_name = my.generate_unique_id(tab_key)
my.content_div_id = "%s|tab_content" % my.tab_group_name
my.content_div = HtmlElement.div()
示例2: __init__
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import div [as 别名]
def __init__(self, tab_key="tab", css=REG):
super(DynTabWdg,self).__init__(True, tab_key, css)
self.inputs = []
self.options = {}
self.preload_script = None
self.tab_group_name = self.generate_unique_id(tab_key)
self.content_div_id = "%s|tab_content" % self.tab_group_name
self.content_div = HtmlElement.div()
示例3: init
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import div [as 别名]
def init(my):
from pyasm.web import HtmlElement
my.text_area = HtmlElement.div()
my.text_area.add_class("spt_ace_editor")
my.unique_id = my.text_area.set_unique_id("ace_editor")
示例4: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import div [as 别名]
def get_display(my):
new_tab_names = my.tab_names
app_css = app_style = None
if WebContainer.get_web().get_app_name_by_uri() != 'Browser':
app_css = 'smaller'
app_style = 'padding: 0px 2px 3px 2px'
div = my.div
div.set_style("margin-top: 10px; margin-bottom: 20px")
# add some spacing
span = SpanWdg(css='tab_front')
div.add(span)
selected_widget = None
# figure out which is the selected one
selected_index = 0
for i in range(0, len(new_tab_names)):
tab_name = new_tab_names[i]
if tab_name == my.tab_value:
selected_index = i
break
for i in range(0, len(new_tab_names)):
tab_name = new_tab_names[i]
widget = my.get_widget(tab_name)
tab = SpanWdg()
if i == selected_index:
# selected tab
tab.set_class("%s_selected" %my.get_style_prefix())
if app_style:
tab.add_style(app_style)
selected_widget = widget
else:
# unselected tab
tab.set_class("%s_unselected" %my.get_style_prefix())
if app_style:
tab.add_style(app_style)
tab.add( my.get_header(tab_name, selected_index, app_css))
div.add(tab)
# FIXME: hide this for now
#div.add( my.get_add_tab_wdg() )
tab_hidden = HiddenWdg(my.tab_key)
tab_hidden.set_persistence()
# explicitly records this value for init-type submit
tab_hidden._set_persistent_values([my.tab_value])
# TODO: not sure if this is legal ... This is rather redundant,
# but set_value is a pretty complex function. In the end this
# forces it to be set to a value even though widget settings is disabled
value = tab_hidden.get_value()
if value:
tab_hidden.set_value(value)
div.add(tab_hidden)
# if an error occured, draw the error
if my.error_wdg:
div.add(my.error_wdg)
else:
# display the content
content_div = HtmlElement.div()
if my.content_height:
content_div.add_style("height: %spx" % my.content_height)
content_div.add_style("padding: 10px 0 10px 0")
content_div.add_style("overflow: auto")
content_div.add_style("border-style: solid")
content_div.set_class("%s_content" %my.get_style_prefix())
content_div.add_style("display: block")
try:
content = my.get_content(selected_widget)
if isinstance( content, Widget):
content = content.get_buffer_display()
except Exception, e:
my.handle_exception(e)
# TODO: need some way to make this automatic in Widget.
#if my.tab_path:
# last_buffer = len(my.tab_path)+1
# buffer = my.get_buffer_on_exception(last_buffer)
#else:
buffer = my.get_buffer_on_exception()
div.add(buffer)
content = my.error_wdg
content_div.add( content )
#.........这里部分代码省略.........