本文整理汇总了Python中pyasm.web.DivWdg.set_dimensions方法的典型用法代码示例。如果您正苦于以下问题:Python DivWdg.set_dimensions方法的具体用法?Python DivWdg.set_dimensions怎么用?Python DivWdg.set_dimensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.DivWdg
的用法示例。
在下文中一共展示了DivWdg.set_dimensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_dimensions [as 别名]
def get_display(self):
web = WebContainer.get_web()
palette = web.get_palette()
widget = DivWdg()
widget.add_style("width: 100%")
widget.add_style("text-align: center")
from tactic.ui.app import PageHeaderWdg
header = PageHeaderWdg(show_project=False)
widget.add( header )
security = Environment.get_security()
search = Search("sthpw/project")
search.add_where("\"code\" not in ('sthpw', 'admin', 'unittest')")
search.add_where("\"type\" not in ('resource')")
# hide template projects
if security.check_access("builtin", "view_site_admin", "allow") or security.check_access("builtin", "view_template_projects", "allow"):
pass
else:
search.add_op("begin")
search.add_filter("is_template", True, op='!=')
search.add_filter("is_template", 'NULL', quoted=False, op='is')
search.add_op("or")
search.add_order_by("category")
projects = search.get_sobjects()
num = len(projects)
# sort by project
if num < 5:
columns = 1
icon_size = 90
width = 500
elif num < 15:
columns = 2
icon_size = 60
width = 700
else:
columns = 3
icon_size = 45
width = 800
div = DivWdg()
div.add_style("margin-left: auto")
div.add_style("margin-right: auto")
#div.add_style("width: 520px")
div.center()
widget.add(div)
#logo = TacticLogoWdg()
#div.add(logo)
div.add("<br/>"*3)
bg_color = palette.color("background")
#div.add_color("color", "color")
from tactic.ui.container import RoundedCornerDivWdg
div = RoundedCornerDivWdg(hex_color_code=bg_color,corner_size="10")
div.set_dimensions( width_str='%spx' % width, content_height_str='50px' )
div.add_border()
div.add_style("overflow: hidden")
div.set_box_shadow()
div.add_style("margin-left: auto")
div.add_style("margin-right: auto")
div.add_style("width: %spx" % width)
table = Table()
table.set_max_width()
table.add_style("margin-left: auto")
table.add_style("margin-right: auto")
table.add_style("background-color: %s" % bg_color)
table.add_color("color", "color")
tr, td = table.add_row_cell()
logo_div = DivWdg()
logo_div.add_gradient("background", "background3", -5, -10)
td.add(logo_div)
logo = TacticLogoWdg()
logo_div.add(logo)
logo_div.add_style("margin: -6 -6 6 -6")
app_name = WebContainer.get_web().get_app_name()
security = Environment.get_security()
last_category = None
has_category = False
index = 0
# if TACTIC has not been set up, show the configuration page
# FIXME: what is the requirement for is_installed?
config_path = Config.get_config_path()
if not os.path.exists(config_path):
#.........这里部分代码省略.........