# Path: tree.py
# class TreeItemData(wx.TreeItemData):
# class TreeCtrl(wx.TreeCtrl):
# class DragTreeCtrl(TreeCtrl):
# class NodeTreeCtrl(TreeCtrl):
# class ServerTreeCtrl(DragTreeCtrl):
#   def __init__(self, node):
#   def __init__(self, parentWin, name, size=wx.DefaultSize, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT):
#   def Match(self, item, patterns, case=False):
#   def FindPattern(self, currentItem, patterns, case=False):
#   def GetNode(self, item=None):
#   def GetFrame(self):
#   def GetChildItems(self, item):
#   def __init__(self, parentWin, name, size=wx.DefaultSize, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT):
#   def OnBeginDrag(self, evt):
#   def OnEndDrag(self, evt):
#   def __init__(self, parentWin, name, size=wx.DefaultSize, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT):
#   def OnTreeActivate(self, evt):
#   def OnTreeExpand(self, evt):
#   def OnTreeRightClick(self, evt):
#   def SelectNode(self, node, delayed=False):
#   def Append(self, parentItem, node):
#   def IsChild(self, child, parent):
#   def Refresh(self, item, node=None):
#   def doFind(self, item, toFind, level=99):
#   def Find(self, item, toFind, level=99):
#   def DeleteChildren(self, item):
#   def DeleteNode(self, node):
#   def DeleteItem(self, item):
#   def __init__(self, parentWin, size=wx.DefaultSize, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT):
#   def ExecuteDrag(self, targetItem):
#   def OnTreeActivate(self, evt):
#   def OnAddGroup(self, evt):
#   def OnDelGroup(self, evt):
#   def OnEdit(self, _ev):
#   def OnUnregister(self, evt):
#   def OnTreeRightClick(self, evt):
#   def getImage(self, name, server):
#   def ExpandFirst(self):
#   def InsertAfter(self, parentItem, prev, name, data):
#   def Append(self, parentItem, name, data):
#   def StoreServers(self):
#   def ConnectServer(self, server, treename):
#   def addGroup(self, name):
#   def RegisterServer(self, settings, initial=False):


from xxx import *                       # xxx imports globals and params
from tree import ID_NEW
        from tree import customCreateMap
        from wx.lib import buttons
import images
    # Update UI after key presses, if necessary
    def UpdateIfNeeded(self):
        tree = g.tree
        if self.ctrl != tree.ctrl or self.shift != tree.shift:
            # Enabling is needed only for ctrl
            if self.ctrl != tree.ctrl: self.UpdateUI()
            self.ctrl = tree.ctrl
            self.shift = tree.shift
            if tree.ctrl:
                status = 'SBL'
            elif tree.shift:
                status = 'INS'
            else:
                status = ''
            g.frame.SetStatusText(status, 1)

    # Update interface
    def UpdateUI(self):
        if not self.IsShown(): return
        # Update status bar
        tree = g.tree
        item = tree.selection
        # If nothing selected, disable everything and return
        if not item:
            # Disable everything
            for grp in range(GROUPNUM):
                self.EnableGroup(grp, False)
            self.state = None
            return
        if tree.ctrl: needInsert = True

# Path: tree.py
# class TreeItemData(wx.TreeItemData):
# class TreeCtrl(wx.TreeCtrl):
# class DragTreeCtrl(TreeCtrl):
# class NodeTreeCtrl(TreeCtrl):
# class ServerTreeCtrl(DragTreeCtrl):
#   def __init__(self, node):
#   def __init__(self, parentWin, name, size=wx.DefaultSize, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT):
#   def Match(self, item, patterns, case=False):
#   def FindPattern(self, currentItem, patterns, case=False):
#   def GetNode(self, item=None):
#   def GetFrame(self):
#   def GetChildItems(self, item):
#   def __init__(self, parentWin, name, size=wx.DefaultSize, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT):
#   def OnBeginDrag(self, evt):
#   def OnEndDrag(self, evt):
#   def __init__(self, parentWin, name, size=wx.DefaultSize, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT):
#   def OnTreeActivate(self, evt):
#   def OnTreeExpand(self, evt):
#   def OnTreeRightClick(self, evt):
#   def SelectNode(self, node, delayed=False):
#   def Append(self, parentItem, node):
#   def IsChild(self, child, parent):
#   def Refresh(self, item, node=None):
#   def doFind(self, item, toFind, level=99):
#   def Find(self, item, toFind, level=99):
#   def DeleteChildren(self, item):
#   def DeleteNode(self, node):
#   def DeleteItem(self, item):
#   def __init__(self, parentWin, size=wx.DefaultSize, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT):
#   def ExecuteDrag(self, targetItem):
#   def OnTreeActivate(self, evt):
#   def OnAddGroup(self, evt):
#   def OnDelGroup(self, evt):
#   def OnEdit(self, _ev):
#   def OnUnregister(self, evt):
#   def OnTreeRightClick(self, evt):
#   def getImage(self, name, server):
#   def ExpandFirst(self):
#   def InsertAfter(self, parentItem, prev, name, data):
#   def Append(self, parentItem, name, data):
#   def StoreServers(self):
#   def ConnectServer(self, server, treename):
#   def addGroup(self, name):
#   def RegisterServer(self, settings, initial=False):


# Path: xrced/tools.py
from xxx import *                       # xxx imports globals and params
from tree import ID_NEW
        from tree import customCreateMap
        from wx.lib import buttons
import images

    # Update UI after key presses, if necessary
    def UpdateIfNeeded(self):
        tree = g.tree
        if self.ctrl != tree.ctrl or self.shift != tree.shift:
            # Enabling is needed only for ctrl
            if self.ctrl != tree.ctrl: self.UpdateUI()
            self.ctrl = tree.ctrl
            self.shift = tree.shift
            if tree.ctrl:
                status = 'SBL'
            elif tree.shift:
                status = 'INS'
            else:
                status = ''
            g.frame.SetStatusText(status, 1)

    # Update interface
    def UpdateUI(self):
        if not self.IsShown(): return
        # Update status bar
        tree = g.tree
        item = tree.selection
        # If nothing selected, disable everything and return
        if not item:
            # Disable everything
            for grp in range(GROUPNUM):
                self.EnableGroup(grp, False)
            self.state = None
            return
        if tree.ctrl: needInsert = True

        else: needInsert = tree.NeedInsert(item)