本文整理汇总了Python中efl.elementary.entry.Entry.cursor_end_set方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.cursor_end_set方法的具体用法?Python Entry.cursor_end_set怎么用?Python Entry.cursor_end_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.entry.Entry
的用法示例。
在下文中一共展示了Entry.cursor_end_set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _task_edit_start
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import cursor_end_set [as 别名]
def _task_edit_start(self, task):
pp = Popup(self.top_widget)
pp.part_text_set('title,text', 'Edit task')
en = Entry(pp, editable=True, single_line=True, scrollable=True,
text=task.raw_txt)
en.callback_activated_add(lambda e: self._task_edit_end(task, en, pp))
en.callback_aborted_add(lambda e: pp.delete())
pp.part_content_set('default', en)
b = Button(pp, text='Cancel')
b.callback_clicked_add(lambda b: pp.delete())
pp.part_content_set('button1', b)
b = Button(pp, text='Accept')
b.callback_clicked_add(lambda b: self._task_edit_end(task, en, pp))
pp.part_content_set('button2', b)
pp.show()
en.cursor_begin_set()
en.cursor_selection_begin()
en.cursor_end_set()
en.cursor_selection_end()
示例2: CommandOutputEntry
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import cursor_end_set [as 别名]
class CommandOutputEntry(Table):
def __init__(self, parent, min_size=(0,0)):
Table.__init__(self, parent, size_hint_expand=EXPAND_BOTH,
size_hint_fill=FILL_BOTH)
self._entry = Entry(self, scrollable=True, editable=False,
line_wrap=ELM_WRAP_NONE,
size_hint_expand=EXPAND_BOTH,
size_hint_fill=FILL_BOTH)
self._wheel = Progressbar(self, style='wheel', pulse_mode=True,
size_hint_expand=EXPAND_BOTH)
self._rect = Rectangle(self.evas, size_hint_min=min_size,
size_hint_expand=EXPAND_BOTH, color=(0,0,0,0))
self.pack(self._entry, 0, 0, 1, 1)
self.pack(self._rect, 0, 0, 1, 1)
self.pack(self._wheel, 0, 0, 1, 1)
self._last_was_carriage = False
self._entry.show()
self._rect.show()
self.show()
@property
def text(self):
return self._entry.text
@text.setter
def text(self, text):
self._entry.text = text
def pulse_start(self):
self._rect.repeat_events = False
self._wheel.pulse(True)
self._wheel.show()
def pulse_stop(self):
self._rect.repeat_events = True
self._wheel.pulse(False)
self._wheel.hide()
def successfull(self):
self._entry.entry_append('<success>Operation successfully completed.</success><br>')
def failure(self):
self._entry.entry_append('<failure>Error! Something goes wrong.</failure><br>')
def error_set(self, text):
self._entry.text = '<failure>Error:</failure><br>%s' % text
def append_raw(self, line, sep=None):
if self._last_was_carriage is True:
self._entry.cursor_selection_begin()
self._entry.cursor_line_end_set()
self._entry.cursor_selection_end()
self._entry.entry_insert('')
if sep == '\n':
self._entry.entry_append(line + '<br>')
self._entry.cursor_end_set()
self._last_was_carriage = False
elif sep == '\r':
self._entry.entry_append(line)
self._last_was_carriage = True
else:
self._entry.entry_append(line)
self._last_was_carriage = False
示例3: __init__
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import cursor_end_set [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)
示例4: FileSelector
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import cursor_end_set [as 别名]
#.........这里部分代码省略.........
def removeButtonPressed(self, btn):
toRemove = "file://%s%s"%(self.filepathEntry.text, self.selectedFolder.text)
bks = self.getGTKBookmarks()
bks.remove(toRemove)
with open(os.path.expanduser('~/.config/gtk-3.0/bookmarks'),'w') as f:
for b in bks:
bName = b.split("/")[-1]
b = b.replace(" ", "%20")
f.write( b + " " + bName + "\n" )
self.bookmarksList.clear()
self.populateBookmarks()
self.addButton.disabled = False
self.removeButton.disabled = True
def setMode(self, ourMode):
self.mode = ourMode.lower()
self.actionButton.text = "%s "%ourMode
self.actionIcon.standard_set("document-%s"%ourMode.lower())
if self.mode != "save":
self.createFolderButton.hide()
else:
self.createFolderButton.show()
def eventsCb(self, obj, src, event_type, event):
if event.modifier_is_set("Control") and event_type == EVAS_CALLBACK_KEY_DOWN:
if event.key.lower() == "l":
self.filepathEntry.focus_set(True)
self.filepathEntry.cursor_end_set()
def toggleHiddenButtonPressed(self, btn):
self.showHidden = not self.showHidden
self.populateFiles(self.filepathEntry.text)
def toggleHidden(self):
self.showHidden = not self.showHidden
self.populateFiles(self.filepathEntry.text)
def callback_cancel_add(self, cb):
self.cancelCallback = cb
def callback_activated_add(self, cb):
self.actionCallback = cb
def callback_directory_open_add(self, cb):
self.directoryChangeCallback = cb
def cancelButtonPressed(self, btn):
if self.cancelCallback:
self.cancelCallback(self)
def actionButtonPressed(self, btn):
if self.actionCallback:
if not self.folderOnly and self.fileEntry.text:
self.actionCallback(self, "%s%s"%(self.filepathEntry.text, self.fileEntry.text))
elif self.folderOnly:
self.actionCallback(self, "%s"%(self.filepathEntry.text))
def fileEntryChanged(self, en):
typed = en.text.split("/")[-1]