本文整理汇总了Python中pyasm.web.WebContainer.get_iframe方法的典型用法代码示例。如果您正苦于以下问题:Python WebContainer.get_iframe方法的具体用法?Python WebContainer.get_iframe怎么用?Python WebContainer.get_iframe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.WebContainer
的用法示例。
在下文中一共展示了WebContainer.get_iframe方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import WebContainer [as 别名]
# 或者: from pyasm.web.WebContainer import get_iframe [as 别名]
def get_display(my):
widget = Widget()
thumb = super(ThumbPublishWdg, my).get_display()
widget.add(thumb)
sobject = my.get_current_sobject()
search_type = sobject.get_search_type()
search_id = sobject.get_id()
publish_link = PublishLinkWdg(search_type,search_id)
div = DivWdg(publish_link)
div.set_style('clear: left; padding-top: 6px')
widget.add(div)
# build an iframe to show publish browsing
browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS)
iframe = WebContainer.get_iframe()
iframe.set_width(100)
url = WebContainer.get_web().get_widget_url()
url.set_option("widget", "pyasm.prod.web.PublishBrowserWdg")
url.set_option("search_type", search_type)
url.set_option("search_id", search_id)
script = iframe.get_on_script(url.to_string())
browse_link.add_event("onclick", script)
div.add(browse_link)
div.set_style('padding-top: 6px')
return widget
示例2: get_display
# 需要导入模块: from pyasm.web import WebContainer [as 别名]
# 或者: from pyasm.web.WebContainer import get_iframe [as 别名]
def get_display(self):
# set up the self refresh event for other widgets or callbacks to call
event_container = WebContainer.get_event_container()
script = ClipboardWdg.get_self_refresh_script(show_progress=False)
event_container.add_listener(self.EVENT_ID, script, replace=True )
if self.is_from_ajax():
div = Widget()
else:
div = DivWdg()
div.set_id(self.ID)
div.add_style("display: block")
div.add_class("background_box")
div.add_style("padding-left: 3px")
div.add_style("padding-right: 3px")
div.add_style("height: 1.5em")
div.add_style("width: 150px")
# handle the ajax
self.set_ajax_top_id(self.ID)
self.register_cmd(ClipboardClearCbk)
refresh_script = self.get_refresh_script()
search = Search("sthpw/clipboard")
search.add_user_filter()
search.add_filter("category", "select")
count = search.get_count()
div.add("Clipboard: %s items: " % count)
web = WebContainer.get_web()
url = WebContainer.get_web().get_widget_url()
url.set_option("widget", "pyasm.widget.ClipboardListWdg")
ref = url.to_string()
iframe = WebContainer.get_iframe()
iframe.set_width(64)
action = iframe.get_on_script(ref)
button = IconButtonWdg("View Clipboard", IconWdg.LOAD)
button.add_event("onclick", action)
div.add(button)
# add the clear clipboard icon
clear_icon = IconButtonWdg("Clear Clipboard", IconWdg.CLEAR)
clear_icon.add_event("onclick", refresh_script)
div.add(clear_icon)
return div
示例3: get_popup_script
# 需要导入模块: from pyasm.web import WebContainer [as 别名]
# 或者: from pyasm.web.WebContainer import get_iframe [as 别名]
def get_popup_script(msg='', css='', icon='', ref=None, width=70):
''' returns a javascript that will trigger a popup message box in
an iframe '''
if not ref:
url = WebContainer.get_web().get_widget_url()
url.set_option("widget", "MessageWdg")
url.set_option("args", [msg, css, icon])
ref = url.get_url()
# open iframe
iframe = WebContainer.get_iframe()
iframe.set_width(width)
action = iframe.get_on_script(ref)
return action
示例4: get_display
# 需要导入模块: from pyasm.web import WebContainer [as 别名]
# 或者: from pyasm.web.WebContainer import get_iframe [as 别名]
def get_display(my):
# add the add property button
iframe = WebContainer.get_iframe()
url = WebContainer.get_web().get_widget_url()
url.set_option("widget", "pyasm.widget.CustomAddPropertyWdg")
url.set_option("search_type", my.search_type)
url.set_option("view", my.view)
action = iframe.get_on_script(url.to_string() )
add = IconButtonWdg("Add Property", IconWdg.INSERT, True)
add.add_event("oncontextmenu", "%s;return false" % action )
add.add_event("onclick", "%s" % action )
widget = Widget()
widget.add(add)
return widget