本文整理汇总了Python中pyasm.widget.ThumbWdg.set_icon_type方法的典型用法代码示例。如果您正苦于以下问题:Python ThumbWdg.set_icon_type方法的具体用法?Python ThumbWdg.set_icon_type怎么用?Python ThumbWdg.set_icon_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.ThumbWdg
的用法示例。
在下文中一共展示了ThumbWdg.set_icon_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.widget import ThumbWdg [as 别名]
# 或者: from pyasm.widget.ThumbWdg import set_icon_type [as 别名]
def get_display(my):
my.sobject = my.get_sobject()
top = DivWdg()
top.add_class("spt_detail_top")
top.add_color("background", "background")
top.add_color("color", "color")
if not my.sobject:
top.add("No SObject defined for this widget")
return top
if my.parent:
my.search_type = my.parent.get_base_search_type()
my.search_key = SearchKey.get_by_sobject(my.parent)
top.add_attr("spt_parent_key", my.search_key)
my.pipeline_code = my.parent.get_value("pipeline_code", no_exception=True)
my.full_search_type = my.parent.get_search_type()
else:
my.pipeline_code = my.sobject.get_value("pipeline_code", no_exception=True)
my.search_type = my.sobject.get_base_search_type()
my.search_key = SearchKey.get_by_sobject(my.sobject)
my.full_search_type = my.sobject.get_search_type()
if not my.pipeline_code:
my.pipeline_code = 'default'
top.add_style("text-align: left")
my.set_as_panel(top)
table = Table()
#from tactic.ui.container import ResizableTableWdg
#table = ResizableTableWdg()
table.add_color("background", "background")
table.add_color("color", "color")
top.add(table)
table.set_max_width()
table.add_row()
# left
#td = table.add_cell(resize=False)
td = table.add_cell()
#td.add_style("padding: 10px")
td.add_style("width: 200px")
td.add_style("min-width: 200px")
td.add_style("vertical-align: top")
#td.add_border()
#td.add_style("border-style: solid")
#td.add_style("border-width: 1px 0 1px 1px")
#td.add_color("border-color", "border")
#td.add_color("background", "background", -10)
if my.parent:
code = my.parent.get_code()
else:
code = my.sobject.get_code()
# add the tile
title = DivWdg()
td.add(title)
title.add_gradient("background", "background3", 0, -10)
title.add_style("height: 20px")
title.add_style("padding: 4px")
title.add_style("font-weight: bold")
title.add_style("font-size: 1.4em")
title.add("%s" % code)
title.add_border()
div = DivWdg()
td.add(div)
div.add_class("spt_sobject_detail_top")
thumb_table = Table()
div.add(thumb_table)
thumb_table.add_row()
thumb = ThumbWdg()
# use a larger version for clearer display
thumb.set_icon_type('web')
# prefer to see the original image, then web
thumb.set_option('image_link_order', 'main|web|.swf')
thumb.set_option("detail", "false")
thumb.set_option("icon_size", "100%")
td = thumb_table.add_cell(thumb)
td.add_style("vertical-align: top")
td.add_style("width: 200px")
td.add_style("padding: 20px")
if my.parent:
thumb.set_sobject(my.parent)
else:
thumb.set_sobject(my.sobject)
#.........这里部分代码省略.........