本文整理汇总了Python中lucterios.framework.xfercomponents.XferCompLabelForm.set_size方法的典型用法代码示例。如果您正苦于以下问题:Python XferCompLabelForm.set_size方法的具体用法?Python XferCompLabelForm.set_size怎么用?Python XferCompLabelForm.set_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lucterios.framework.xfercomponents.XferCompLabelForm
的用法示例。
在下文中一共展示了XferCompLabelForm.set_size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fillresponse
# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_size [as 别名]
def fillresponse(self, item_name='', subject='', message='', model=0, withpayment=False):
if item_name != '':
self.item = Supporting.objects.get(id=self.getparam(item_name, 0))
self.item = self.item.get_final_child()
if self.getparam("OK") is None:
dlg = self.create_custom()
icon = XferCompImage('img')
icon.set_location(0, 0, 1, 6)
icon.set_value(self.icon_path())
dlg.add_component(icon)
lbl = XferCompLabelForm('lb_subject')
lbl.set_value_as_name(_('subject'))
lbl.set_location(1, 1)
dlg.add_component(lbl)
lbl = XferCompEdit('subject')
lbl.set_value(six.text_type(self.item))
lbl.set_location(2, 1)
dlg.add_component(lbl)
lbl = XferCompLabelForm('lb_message')
lbl.set_value_as_name(_('message'))
lbl.set_location(1, 2)
dlg.add_component(lbl)
contact = self.item.third.contact.get_final_child()
lbl = XferCompMemo('message')
lbl.set_value(Params.getvalue('payoff-email-message') % {
'name': contact.get_presentation(), 'doc': self.item.get_docname()})
lbl.with_hypertext = True
lbl.set_size(130, 450)
lbl.set_location(2, 2)
dlg.add_component(lbl)
selectors = PrintModel.get_print_selector(
2, self.item.__class__)[0]
lbl = XferCompLabelForm('lb_model')
lbl.set_value_as_name(selectors[1])
lbl.set_location(1, 3)
dlg.add_component(lbl)
sel = XferCompSelect('model')
sel.set_select(selectors[2])
sel.set_location(2, 3)
dlg.add_component(sel)
if self.item.payoff_have_payment() and (len(PaymentMethod.objects.all()) > 0):
lbl = XferCompLabelForm('lb_withpayment')
lbl.set_value_as_name(_('add payment methods in email'))
lbl.set_location(1, 4)
dlg.add_component(lbl)
sel = XferCompCheck('withpayment')
sel.set_value(True)
sel.set_location(2, 4)
dlg.add_component(sel)
dlg.add_action(self.get_action(TITLE_OK, 'images/ok.png'), params={"OK": "YES"})
dlg.add_action(WrapAction(TITLE_CANCEL, 'images/cancel.png'))
else:
html_message = "<html>"
html_message += message.replace('{[newline]}', '<br/>\n').replace('{[', '<').replace(']}', '>')
if self.item.payoff_have_payment() and withpayment:
html_message += get_html_payment(self.request.META.get('HTTP_REFERER', self.request.build_absolute_uri()), self.language, self.item)
html_message += "</html>"
self.item.send_email(subject, html_message, model)
示例2: fillresponse_search_values
# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_size [as 别名]
def fillresponse_search_values(self):
comp = XferCompButton("searchButtonAdd")
comp.set_is_mini(True)
comp.set_location(4, 10, 1, 7)
comp.set_action(self.request, self.get_action("", "images/add.png"),
{'modal': FORMTYPE_REFRESH, 'close': CLOSE_NO, 'params': {'ACT': 'ADD'}})
self.add_component(comp)
comp = XferCompDate("searchValueDate")
comp.set_needed(True)
comp.set_location(3, 11)
comp.set_size(20, 200)
self.add_component(comp)
comp = XferCompFloat("searchValueFloat")
comp.set_needed(True)
comp.set_location(3, 12)
comp.set_size(20, 200)
self.add_component(comp)
comp = XferCompEdit("searchValueStr")
comp.set_location(3, 13)
comp.set_size(20, 200)
self.add_component(comp)
comp = XferCompCheckList("searchValueList")
comp.set_location(3, 14)
comp.set_size(80, 200)
self.add_component(comp)
comp = XferCompCheck("searchValueBool")
comp.set_location(3, 15)
comp.set_size(20, 200)
self.add_component(comp)
comp = XferCompTime("searchValueTime")
comp.set_needed(True)
comp.set_location(3, 16)
comp.set_size(20, 200)
self.add_component(comp)
label = XferCompLabelForm('labelsearchSep')
label.set_value("")
label.set_size(1, 200)
label.set_location(3, 17)
self.add_component(label)