本文整理汇总了Python中lucterios.framework.xfercomponents.XferCompLabelForm.colspan方法的典型用法代码示例。如果您正苦于以下问题:Python XferCompLabelForm.colspan方法的具体用法?Python XferCompLabelForm.colspan怎么用?Python XferCompLabelForm.colspan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lucterios.framework.xfercomponents.XferCompLabelForm
的用法示例。
在下文中一共展示了XferCompLabelForm.colspan方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: change_to_readonly
# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import colspan [as 别名]
def change_to_readonly(self, cmp_name):
old_obj = self.get_components(cmp_name)
value = old_obj.value
if isinstance(old_obj, XferCompSelect):
if isinstance(old_obj.select_list, dict) and (value in old_obj.select_list.keys()):
value = old_obj.select_list[value]
if isinstance(old_obj.select_list, list):
for key, sel_val in old_obj.select_list:
if value == key:
value = sel_val
break
elif isinstance(old_obj, XferCompDate):
value = formats.date_format(value, "DATE_FORMAT")
elif isinstance(old_obj, XferCompDateTime):
value = formats.date_format(value, "DATETIME_FORMAT")
elif isinstance(old_obj, XferCompTime):
value = formats.date_format(value, "TIME_FORMAT")
elif isinstance(old_obj, XferCompFloat) and (value is not None):
value = ("%%.%df" % old_obj.prec) % value
if value is None:
value = "---"
self.remove_component(cmp_name)
self.tab = old_obj.tab
new_lbl = XferCompLabelForm(cmp_name)
new_lbl.set_value(value)
new_lbl.col = old_obj.col
new_lbl.row = old_obj.row
new_lbl.vmin = old_obj.vmin
new_lbl.hmin = old_obj.hmin
new_lbl.colspan = old_obj.colspan
new_lbl.rowspan = old_obj.rowspan
self.add_component(new_lbl)