本文整理汇总了Python中pyasm.widget.TextWdg.add_border方法的典型用法代码示例。如果您正苦于以下问题:Python TextWdg.add_border方法的具体用法?Python TextWdg.add_border怎么用?Python TextWdg.add_border使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.TextWdg
的用法示例。
在下文中一共展示了TextWdg.add_border方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_bottom_wdg
# 需要导入模块: from pyasm.widget import TextWdg [as 别名]
# 或者: from pyasm.widget.TextWdg import add_border [as 别名]
#.........这里部分代码省略.........
elif row_to_draw == self.ENT_ROW:
time_prefix = 'ent'
div = DivWdg()
div.add("ET")
div.add_styles('text-align: right; margin-right: 4px; margin-bottom: 6px')
td.add(div)
for idx, day in enumerate(days):
day_wdg = DivWdg()
day_wdg.add(day)
td = table.add_cell()
td.add_style("width: %spx" % self.day_width)
# keep it as text input for consistent alignment
text = TextWdg("%sday_%s" % (time_prefix, day) )
if row_to_draw == self.OT_ROW:
sobj_daily_dict = self.summary_ot[idx]
else:
sobj_daily_dict = self.summary_st[idx]
if search_keys:
sobj_daily_sub_dict = Common.subset_dict(sobj_daily_dict, search_keys)
else:
sobj_daily_sub_dict = sobj_daily_dict
daily_total = 0
for value in sobj_daily_sub_dict.values():
if value:
daily_total += value
text.set_value(daily_total)
td.add(text)
text.add_class("spt_day%s" % (time_prefix))
text.add_style("width: %spx"%(self.day_width-2))
#text.add_style("width: 100%")
text.add_style("text-align: right")
text.add_style("padding: 2px 3px")
text.add_style('font-weight: 500')
text.set_attr("readonly", "readonly")
text.add_style("box-sizing: border-box")
# grey out the text color
text.add_color('color', 'color', +40)
text.add_style("margin: 0px 1px")
text.add_border()
if day == today:
#text.add_style("border: solid 1px black")
pass
elif idx in [0,6]:
if row_to_draw == self.OT_ROW:
# FOOTER: Overtime, weekends
text.add_color("background", "background2", modifier=[-15,0,5])
else:
# FOOTER: Straight time, weekends
text.add_color("background", "background2", modifier=[0,15,20])
text = TextWdg("total")
daily_total = 0
if row_to_draw == self.OT_ROW:
sobj_daily_dict = self.summary_ot[7]
else:
sobj_daily_dict = self.summary_st[7]
if search_keys:
sobj_daily_sub_dict = Common.subset_dict(sobj_daily_dict, search_keys)
else:
sobj_daily_sub_dict = sobj_daily_dict
for value in sobj_daily_sub_dict.values():
if value:
daily_total += value
text.set_value(daily_total)
td = table.add_cell(text)
text.add_class("spt_total%s" % (time_prefix))
td.add_style("width: %spx"%self.day_width)
text.add_styles("font-weight: 500;width: %spx; text-align: right; padding-left: 2px; margin-left: 5px"%(self.day_width))
text.add_style("box-sizing: border-box")
text.set_attr("readonly", "readonly")
text.add_color('color', 'color', +40)
text.add_border()
if row_to_draw == self.OT_ROW:
# FOOTER: Overtime, total.
text.add_color("background", "background2", modifier=[5,-15,0])
else:
# FOOTER: Straight time, total
text.add_color("background", "background2", modifier=[20,0,15])
td = table.add_blank_cell()
td.add_style('width','100%')
return top