apply(m.Append, l)
elif type(l) == types.ListType:
subMenu = wxMenu()
- SetMenu(subMenu, l[2:])
+ SetMenu(subMenu, l[2:], shift)
m.AppendMenu(wxNewId(), l[0], subMenu, l[1])
else: # separator
m.AppendSeparator()
# Clear tree
def Clear(self):
+ self.selection = None
+ self.UnselectAll()
self.DeleteAllItems()
# Add minimal structure
if self.dom: self.dom.unlink()
self.root = self.AddRoot('XML tree', self.rootImage,
data=wxTreeItemData(self.rootObj))
self.SetItemHasChildren(self.root)
- self.UnselectAll()
self.Expand(self.root)
# Clear old data and set new
def SetData(self, dom):
+ self.selection = None
+ self.UnselectAll()
self.DeleteAllItems()
# Add minimal structure
if self.dom: self.dom.unlink()
self.mainNode.removeChild(node)
node.unlink()
self.Expand(self.root)
- self.UnselectAll()
# Add tree item for given parent item if node is DOM element node with
# object/object_ref tag. xxxParent is parent xxx object
# return
wxBeginBusyCursor()
- wxYield()
# Close old window, remember where it was
highLight = None
if testWin:
if dlg.ShowModal() == wxID_OK:
path = dlg.GetPath()
self.SetStatusText('Loading...')
- wxYield()
wxBeginBusyCursor()
try:
if self.Open(path):
else:
path = self.dataFile
self.SetStatusText('Saving...')
- wxYield()
wxBeginBusyCursor()
try:
try:
sizePanel = panel.GetSize()
panel.Reparent(self.splitter)
self.miniFrame.GetSizer().Remove(panel)
- wxYield()
# Widen
self.SetDimensions(pos.x, pos.y, size.width + sizePanel.width, size.height)
self.splitter.SplitVertically(tree, panel, conf.sashPos)
self.miniFrame.Show(True)
self.miniFrame.SetDimensions(conf.panelX, conf.panelY,
conf.panelWidth, conf.panelHeight)
- wxYield()
# Reduce width
self.SetDimensions(pos.x, pos.y,
max(size.width - sizePanel.width, self.minWidth), size.height)
self.SetStatusText('Refreshing test window...')
# (re)create
tree.CreateTestWin(g.testWin.item)
- wxYield()
self.SetStatusText('')
tree.needUpdate = False
elif tree.pendingHighLight: