本文整理汇总了Python中efl.elementary.entry.Entry.select_all方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.select_all方法的具体用法?Python Entry.select_all怎么用?Python Entry.select_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.entry.Entry
的用法示例。
在下文中一共展示了Entry.select_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import select_all [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()
示例2: Interface
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import select_all [as 别名]
#.........这里部分代码省略.........
def newPress( self, obj, it ):
self.newFile()
it.selected_set(False)
def openPress( self, obj, it ):
self.openFile()
it.selected_set(False)
def savePress( self, obj, it ):
self.saveFile()
it.selected_set(False)
def saveAsPress( self, obj, it ):
self.saveAs()
it.selected_set(False)
def optionsPress( self, obj, it ):
it.selected_set(False)
def copyPress( self, obj, it ):
self.mainEn.selection_copy()
it.selected_set(False)
def pastePress( self, obj, it ):
self.mainEn.selection_paste()
it.selected_set(False)
def cutPress( self, obj, it ):
self.mainEn.selection_cut()
it.selected_set(False)
def selectAllPress( self, obj, it ):
self.mainEn.select_all()
it.selected_set(False)
def textEdited( self, obj ):
ourFile = self.mainEn.file_get()[0]
if ourFile and not self.isNewFile:
self.mainWindow.title_set("*%s - ePad"%self.mainEn.file_get()[0].split("/")[len(self.mainEn.file_get()[0].split("/"))-1])
else:
self.mainWindow.title_set("*Untitlted - ePad")
self.isSaved = False
def fileSelected( self, fs, file_selected, onStartup=False ):
if not onStartup:
self.flip.go(ELM_FLIP_INTERACTION_ROTATE)
print(file_selected)
IsSave = fs.is_save_get()
if file_selected:
if IsSave:
newfile = open(file_selected,'w') # creates new file
tmp_text = self.mainEn.entry_get()
newfile.write(tmp_text)
newfile.close()
self.mainEn.file_set(file_selected, ELM_TEXT_FORMAT_PLAIN_UTF8)
self.mainEn.entry_set(tmp_text)
self.mainEn.file_save()
self.mainWindow.title_set("%s - ePad" % file_selected.split("/")[len(file_selected.split("/"))-1])
self.isSaved = True
self.isNewFile = False
else:
try:
self.mainEn.file_set(file_selected, ELM_TEXT_FORMAT_PLAIN_UTF8)
except RuntimeError:
print("Empty file: {0}".format(file_selected))