本文整理汇总了Python中tryton.gui.window.view_form.screen.Screen.editable_get方法的典型用法代码示例。如果您正苦于以下问题:Python Screen.editable_get方法的具体用法?Python Screen.editable_get怎么用?Python Screen.editable_get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tryton.gui.window.view_form.screen.Screen
的用法示例。
在下文中一共展示了Screen.editable_get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: One2Many
# 需要导入模块: from tryton.gui.window.view_form.screen import Screen [as 别名]
# 或者: from tryton.gui.window.view_form.screen.Screen import editable_get [as 别名]
#.........这里部分代码省略.........
if name != 'readonly':
widget.modify_text(gtk.STATE_INSENSITIVE,
self.colors['text_color_insensitive'])
def _readonly_set(self, value):
self._readonly = value
self.but_new.set_sensitive(not value)
self.but_del.set_sensitive(not value)
self.but_undel.set_sensitive(not value)
if self.attrs.get('add_remove'):
self.wid_text.set_sensitive(not value)
self.but_add.set_sensitive(not value)
self.but_remove.set_sensitive(not value)
def _sig_new(self, widget):
self.view.set_value()
record = self.screen.current_record
if record:
fields = self.screen.current_view.get_fields()
if not record.validate(fields):
self.screen.display()
return
ctx = {}
ctx.update(self.field.context_get(self.record))
sequence = None
if self.screen.current_view.view_type == 'tree':
sequence = self.screen.current_view.widget_tree.sequence
def update_sequence():
if sequence:
self.screen.group.set_sequence(field=sequence)
if (self.screen.current_view.view_type == 'form') \
or self.screen.editable_get():
self.screen.new(context=ctx)
self.screen.current_view.widget.set_sensitive(True)
update_sequence()
else:
WinForm(self.screen, lambda a: update_sequence(), new=True,
many=True, context=ctx)
def _sig_edit(self, widget=None):
self.view.set_value()
record = self.screen.current_record
if record:
fields = self.screen.current_view.get_fields()
if not record.validate(fields):
self.screen.display()
return
WinForm(self.screen, lambda a: None)
def _sig_next(self, widget):
self.view.set_value()
record = self.screen.current_record
if record:
fields = self.screen.current_view.get_fields()
if not record.validate(fields):
self.screen.display()
return
self.screen.display_next()
def _sig_previous(self, widget):
self.view.set_value()
record = self.screen.current_record
if record:
fields = self.screen.current_view.get_fields()