本文整理汇总了Python中efl.elementary.entry.Entry.focus方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.focus方法的具体用法?Python Entry.focus怎么用?Python Entry.focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.entry.Entry
的用法示例。
在下文中一共展示了Entry.focus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import focus [as 别名]
def __init__(self, repo, win):
self.repo = repo
self.win = win
self.confirmed = False
StandardWindow.__init__(self, 'Egitu', 'Egitu', autodel=True)
vbox = Box(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.resize_object_add(vbox)
vbox.show()
# title
en = Entry(self, editable=False,
text='<title><align=center>Commit changes</align></title>',
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
vbox.pack_end(en)
en.show()
panes = Panes(self, content_left_size = 0.2, horizontal=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
vbox.pack_end(panes)
panes.show()
# message entry
en = Entry(self, editable=True, scrollable=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
en.part_text_set('guide', 'Enter commit message here')
panes.part_content_set("left", en)
en.show()
self.msg_entry = en
# diff entry
self.diff_entry = DiffedEntry(self)
panes.part_content_set("right", self.diff_entry)
self.diff_entry.show()
# buttons
hbox = Box(self, horizontal=True, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
vbox.pack_end(hbox)
hbox.show()
bt = Button(self, text="Cancel")
bt.callback_clicked_add(lambda b: self.delete())
hbox.pack_end(bt)
bt.show()
bt = Button(self, text="Commit")
bt.callback_clicked_add(self.commit_button_cb)
hbox.pack_end(bt)
bt.show()
# show the window and give focus to the editable entry
self.size = 500, 500
self.show()
en.focus = True
# load the diff
repo.request_diff(self.diff_done_cb, only_staged=True)
示例2: __init__
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import focus [as 别名]
def __init__(self, parent, app):
self.app = app
Popup.__init__(self, parent)
self.part_text_set('title,text', 'Save current status')
self.part_content_set('title,icon', SafeIcon(self, 'git-stash'))
# main vertical box
box = Box(self, size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
self.content = box
box.show()
# separator
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_HORIZ)
box.pack_end(sep)
sep.show()
# description
en = Entry(self, single_line=True, scrollable=True,
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
en.part_text_set('guide', 'Stash description (or empty for the default)')
en.text = 'WIP on ' + app.repo.status.head_describe
box.pack_end(en)
en.show()
# include untracked
ck = Check(self, text='Include untracked files', state=True,
size_hint_expand=EXPAND_HORIZ, size_hint_align=(0.0,0.5))
box.pack_end(ck)
ck.show()
# separator
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_HORIZ)
box.pack_end(sep)
sep.show()
# buttons
bt = Button(self, text='Close')
bt.callback_clicked_add(lambda b: self.delete())
self.part_content_set('button1', bt)
bt.show()
bt = Button(self, text='Stash', content=SafeIcon(self, 'git-stash'))
bt.callback_clicked_add(self._stash_clicked_cb, en, ck)
self.part_content_set('button2', bt)
bt.show()
# focus to the entry and show
en.select_all()
en.focus = True
self.show()
示例3: __init__
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import focus [as 别名]
def __init__(self, parent, done_cb, title, text=None, guide=None, not_empty=True):
self.done_cb = done_cb
Popup.__init__(self, parent)
self.part_text_set('title,text', title)
box = Box(self, padding=(0,4))
self.content = box
box.show()
if text:
lb = Label(self, text=text)
box.pack_end(lb)
lb.show()
en = Entry(self, single_line=True, scrollable=True,
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
if guide is not None:
en.part_text_set('guide', guide)
box.pack_end(en)
en.show()
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_HORIZ)
box.pack_end(sep)
sep.show()
b = Button(self, text='Cancel')
b.callback_clicked_add(lambda b: self.delete())
self.part_content_set('button1', b)
b.show()
b = Button(self, text='OK', disabled=not_empty)
b.callback_clicked_add(self._confirmed_cb, en, done_cb)
self.part_content_set('button2', b)
b.show()
if not_empty is True:
en.callback_changed_user_add(self._entry_changed, b)
en.focus = True
self.show()
示例4: elm_input_events_clicked
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import focus [as 别名]
def elm_input_events_clicked(obj, item=None):
win = StandardWindow("inputevents", "Input Events Test", autodel=True)
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
box = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(box)
box.show()
entry = Entry(win, scrollable=True, size_hint_align=FILL_BOTH,
size_hint_weight=(1.0, 0.2))
entry.text = (
"This example will show how Elementary input events are handled. "
"Typing in this entry will log in the entry box below all events "
"caught by event handlers set to this Entry widget and its parent, "
"the Window widget. Key up events are checked for in the callback "
"and won't propagate to a parent widget."
)
entry.show()
log_entry = Entry(win, editable=False, scrollable=True, focus_allow=False,
size_hint_align=FILL_BOTH, size_hint_weight=(1.0, 0.8))
log_entry.callback_changed_add(changed_cb)
log_entry.show()
btn = Button(win, text="Clear log", focus_allow=False)
btn.callback_clicked_add(lambda x: setattr(log_entry, "entry", ""))
btn.show()
box.pack_end(entry)
box.pack_end(log_entry)
box.pack_end(btn)
entry.elm_event_callback_add(events_cb, log_entry)
entry.markup_filter_append(filter_cb)
win.elm_event_callback_add(events_cb, log_entry)
win.resize(640, 480)
win.show()
entry.focus = True
示例5: __init__
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import focus [as 别名]
def __init__(self, app, revert_commit=None, cherrypick_commit=None):
self.app = app
self.confirmed = False
self.revert_commit = revert_commit
self.cherrypick_commit = cherrypick_commit
DialogWindow.__init__(self, app.win, 'Egitu', 'Egitu',
size=(500,500), autodel=True)
vbox = Box(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.resize_object_add(vbox)
vbox.show()
# title
if revert_commit:
title = 'Revert commit'
elif cherrypick_commit:
title = 'Cherry-pick commit'
else:
title = 'Commit changes'
en = Entry(self, editable=False,
text='<title><align=center>%s</align></title>' % title,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
vbox.pack_end(en)
en.show()
# auto-commit checkbox (for revert and cherry-pick)
if revert_commit or cherrypick_commit:
ck = Check(vbox, state=True)
ck.text = 'Automatically commit, in branch: %s' % \
app.repo.status.current_branch.name
ck.callback_changed_add(lambda c: self.msg_entry.disabled_set(not c.state))
vbox.pack_end(ck)
ck.show()
self.autocommit_chk = ck
# Panes
panes = Panes(self, content_left_size = 0.2, horizontal=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
vbox.pack_end(panes)
panes.show()
# message entry
en = Entry(self, editable=True, scrollable=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
en.part_text_set('guide', 'Enter commit message here')
panes.part_content_set("left", en)
if revert_commit:
en.text = 'Revert "%s"<br><br>This reverts commit %s.<br><br>' % \
(utf8_to_markup(revert_commit.title),
revert_commit.sha)
elif cherrypick_commit:
en.text = '%s<br><br>%s<br>(cherry picked from commit %s)<br>' % \
(utf8_to_markup(cherrypick_commit.title),
utf8_to_markup(cherrypick_commit.message),
cherrypick_commit.sha)
en.cursor_end_set()
en.show()
self.msg_entry = en
# diff entry
self.diff_entry = DiffedEntry(self)
panes.part_content_set('right', self.diff_entry)
self.diff_entry.show()
# buttons
hbox = Box(self, horizontal=True, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
vbox.pack_end(hbox)
hbox.show()
bt = Button(self, text='Cancel')
bt.callback_clicked_add(lambda b: self.delete())
hbox.pack_end(bt)
bt.show()
if revert_commit:
label = 'Revert'
elif cherrypick_commit:
label = 'Cherry-pick'
else:
label = 'Commit'
bt = Button(self, text=label)
bt.callback_clicked_add(self.commit_button_cb)
hbox.pack_end(bt)
bt.show()
# show the window and give focus to the editable entry
self.show()
en.focus = True
# load the diff
if revert_commit:
app.repo.request_diff(self.diff_done_cb, revert=True,
ref1=revert_commit.sha)
elif cherrypick_commit:
app.repo.request_diff(self.diff_done_cb, ref1=cherrypick_commit.sha)
else:
app.repo.request_diff(self.diff_done_cb, only_staged=True)