本文整理匯總了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()