本文整理汇总了Python中wx.LIST_NEXT_ALL属性的典型用法代码示例。如果您正苦于以下问题:Python wx.LIST_NEXT_ALL属性的具体用法?Python wx.LIST_NEXT_ALL怎么用?Python wx.LIST_NEXT_ALL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.LIST_NEXT_ALL属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnInsertName
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def OnInsertName(self, event):
item = self.list.GetNextItem(-1, wx.LIST_NEXT_ALL,
wx.LIST_STATE_SELECTED)
if item == -1:
return
# this seems to return column 0's text, which is lucky, because I
# don't see a way of getting other columns' texts...
name = self.list.GetItemText(item)
for ch in name:
self.ctrl.OnKeyChar(util.MyKeyEvent(ord(ch)))
示例2: _ListCtrl_GetFocusedItem
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def _ListCtrl_GetFocusedItem(self):
"""
Gets the currently focused item or -1 if none is focused.
"""
return self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_FOCUSED)
示例3: _ListCtrl_GetNextSelected
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def _ListCtrl_GetNextSelected(self, item):
"""
Returns subsequent selected items, or -1 when no more are selected.
"""
return self.GetNextItem(item, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
示例4: get_selected_items
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def get_selected_items(self):
"""
Gets the selected items for the list control.
Selection is returned as a list of selected indices,
low to high.
"""
selection = []
current = -1 # start at -1 to get the first selected item
while True:
next = self.GetNextItem(current, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
if next == -1:
return selection
else:
selection.append(next)
current = next
示例5: get_selected
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def get_selected(self):
return self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
示例6: OnCmdCopy
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def OnCmdCopy(self, dummyEvent=None):
text = ""
lines = 1
firstItem = item = self.GetNextItem(
-1,
wx.LIST_NEXT_ALL,
wx.LIST_STATE_SELECTED
)
if item != -1:
text = self.OnGetItemText(item, 0)[1:]
item = self.GetNextItem(
item,
wx.LIST_NEXT_ALL,
wx.LIST_STATE_SELECTED
)
while item != -1:
lines += 1
text += "\r\n" + self.OnGetItemText(item, 0)[1:]
item = self.GetNextItem(
item,
wx.LIST_NEXT_ALL,
wx.LIST_STATE_SELECTED
)
if text != "" and wx.TheClipboard.Open():
textDataObject = wx.TextDataObject(text)
dataObjectComposite = wx.DataObjectComposite()
dataObjectComposite.Add(textDataObject)
if lines == 1:
eventstring, icon = self.GetItemData(firstItem)[:2]
if icon == EVENT_ICON:
customDataObject = wx.CustomDataObject("DragEventItem")
customDataObject.SetData(eventstring.encode("UTF-8"))
dataObjectComposite.Add(customDataObject)
wx.TheClipboard.SetData(dataObjectComposite)
wx.TheClipboard.Close()
wx.TheClipboard.Flush()
示例7: GetFocusedRow
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def GetFocusedRow(self):
"""
Return the index of the row that has the focus. -1 means no focus
"""
return self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_FOCUSED)
示例8: YieldSelectedObjects
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def YieldSelectedObjects(self):
"""
Progressively yield the selected modelObjects
"""
i = self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
while i != -1:
yield self.GetObjectAt(i)
i = self.GetNextItem(i, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
#----------------------------------------------------------------------------
# Calculating
示例9: GetSelectedGroups
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def GetSelectedGroups(self):
"""
Return a list of the groups that are selected
"""
selectedGroups = list()
i = self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
while i != -1:
model = self.innerList[i]
if isinstance(model, ListGroup):
selectedGroups.append(model)
i = self.GetNextItem(i, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
return selectedGroups
示例10: OnSearch
# 需要导入模块: import wx [as 别名]
# 或者: from wx import LIST_NEXT_ALL [as 别名]
def OnSearch(self, event = None):
l = []
wx.BeginBusyCursor()
s = util.lower(misc.fromGUI(self.searchEntry.GetValue()))
sex = self.sexRb.GetSelection()
nt = self.nameRb.GetSelection()
selTypes = {}
item = -1
while 1:
item = self.typeList.GetNextItem(item, wx.LIST_NEXT_ALL,
wx.LIST_STATE_SELECTED)
if item == -1:
break
selTypes[self.typeList.GetItemData(item)] = True
if len(selTypes) == len(nameArr.typeNamesCnt):
doTypes = False
else:
doTypes = True
for i in xrange(nameArr.count):
if (sex != 2) and (sex == nameArr.sex[i]):
continue
if doTypes and nameArr.type[i] not in selTypes:
continue
if s:
name = util.lower(nameArr.name[i])
if nt == 0:
if not name.startswith(s):
continue
elif nt == 1:
if name.find(s) == -1:
continue
elif nt == 2:
if not name.endswith(s):
continue
l.append(i)
self.list.items = l
self.list.SetItemCount(len(l))
self.list.EnsureVisible(0)
wx.EndBusyCursor()
self.foundLabel.SetLabel("%d names found." % len(l))