本文整理汇总了Python中pyasm.widget.ThumbWdg.set_aspect方法的典型用法代码示例。如果您正苦于以下问题:Python ThumbWdg.set_aspect方法的具体用法?Python ThumbWdg.set_aspect怎么用?Python ThumbWdg.set_aspect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.ThumbWdg
的用法示例。
在下文中一共展示了ThumbWdg.set_aspect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.widget import ThumbWdg [as 别名]
# 或者: from pyasm.widget.ThumbWdg import set_aspect [as 别名]
def get_display(my):
top = my.top
login = my.kwargs.get("login")
if not login or login == "$LOGIN":
login = Environment.get_user_name()
login_sobj = Login.get_by_code(login)
# top.add_style("margin-top: -2px")
# top.add_style("margin-left: -2px")
thumb_div = DivWdg()
thumb_div.add_style("float: left")
thumb_div.add_style("margin-right: 5px")
thumb_div.add_style("margin-bottom: 5px")
thumb_div.add_style("padding-top: 1px")
thumb = ThumbWdg()
thumb.set_sobject(login_sobj)
thumb_div.add(thumb)
thumb.set_icon_size(90)
thumb.set_aspect("height")
full_name = login_sobj.get_full_name()
info_wdg = DivWdg()
top.add(info_wdg)
name_wdg = DivWdg()
info_wdg.add(thumb_div)
info_wdg.add(name_wdg)
name_wdg.add(" " * 3)
name_wdg.add(full_name)
name_wdg.add_style("font-size: 1.5em")
name_wdg.add_style("font-weight: bold")
name_wdg.add_style("padding: 5px")
# name_wdg.add_style("margin-left: -10px")
name_wdg.add_color("background", "background3")
name_wdg.add_style("height: 20px")
name_wdg.add_style("margin-bottom: 0px")
name_wdg.add_border()
info_wdg.add("<br/>")
from tactic.ui.container import TabWdg
# return if the supplied tab view has a config xml
if my.tab_view:
search = Search("config/widget_config")
search.add_filter("category", "TabWdg")
search.add_filter("view", my.tab_view)
config_sobj = search.get_sobject()
if config_sobj:
config_xml = config_sobj.get_value("config")
# replace the variable $login with the login clicked
if login:
config_xml = config_xml.replace("$login", login)
tab = TabWdg(config_xml=config_xml, view=my.tab_view, show_add=False, show_remove=False)
top.add(tab)
return top
config_xml = []
config_xml.append("<config>")
config_xml.append("<tab>")
config_xml.append(
"""
<element name='activity'>
<display class='tactic.ui.widget.ActivityCalendarWdg'>
<login>%s</login>
<cell_width>100px</cell_width>
<cell_height>50px</cell_height>
<show_header>true</show_header>
<show_border>false</show_border>
</display>
</element>
"""
% login
)
config_xml.append(
"""
<element name='schedule'>
<display class='tactic.ui.widget.TaskCalendarWdg'>
<assigned>%s</assigned>
<sobject_display_expr>%s</sobject_display_expr>
<show_header>true</show_header>
<show_border>false</show_border>
</display>
</element>
"""
% (login, my.sobject_display_expr)
)
config_xml.append(
"""
<element name='tasks'>
<display class='tactic.ui.panel.FastTableLayoutWdg'>
<search_type>sthpw/task</search_type>
#.........这里部分代码省略.........