svghmi/ui.py
branchsvghmi
changeset 3208 b5330d76e225
parent 3201 6dadc1690284
child 3213 afef7011f475
equal deleted inserted replaced
3207:de6b878c324d 3208:b5330d76e225
    15 
    15 
    16 from IDEFrame import EncodeFileSystemPath, DecodeFileSystemPath
    16 from IDEFrame import EncodeFileSystemPath, DecodeFileSystemPath
    17 from docutil import get_inkscape_path
    17 from docutil import get_inkscape_path
    18 
    18 
    19 from util.ProcessLogger import ProcessLogger
    19 from util.ProcessLogger import ProcessLogger
    20 
       
    21 def SVGHMIEditorUpdater(ref):
       
    22     def SVGHMIEditorUpdate():
       
    23         o = ref()
       
    24         if o is not None:
       
    25             wx.CallAfter(o.MakeTree)
       
    26     return SVGHMIEditorUpdate
       
    27 
    20 
    28 class HMITreeSelector(wx.TreeCtrl):
    21 class HMITreeSelector(wx.TreeCtrl):
    29     def __init__(self, parent):
    22     def __init__(self, parent):
    30         global on_hmitree_update
    23         global on_hmitree_update
    31         wx.TreeCtrl.__init__(self, parent, style=(
    24         wx.TreeCtrl.__init__(self, parent, style=(
    32             wx.TR_MULTIPLE |
    25             wx.TR_MULTIPLE |
    33             wx.TR_HAS_BUTTONS |
    26             wx.TR_HAS_BUTTONS |
    34             wx.SUNKEN_BORDER |
    27             wx.SUNKEN_BORDER |
    35             wx.TR_LINES_AT_ROOT))
    28             wx.TR_LINES_AT_ROOT))
    36 
    29 
    37         on_hmitree_update = SVGHMIEditorUpdater(weakref.ref(self))
       
    38         self.MakeTree()
    30         self.MakeTree()
    39 
    31 
    40     def _recurseTree(self, current_hmitree_root, current_tc_root):
    32     def _recurseTree(self, current_hmitree_root, current_tc_root):
    41         for c in current_hmitree_root.children:
    33         for c in current_hmitree_root.children:
    42             if hasattr(c, "children"):
    34             if hasattr(c, "children"):