def __init__(self, *args, **kwargs): self.__lastEventId = None self.__done = False self.setupFinished = False wx.Dialog.__init__(self, *args, **kwargs) self.Bind(wx.EVT_CLOSE, self.OnClose) eg.Notify("DialogCreate", self)
def OnKillFocusEvent(self, event): """ Handles wx.EVT_KILL_FOCUS """ if self.editLabelId is None: eg.Notify("FocusChange", None) event.Skip(True)
def OnSelectionChangedEvent(self, event): """ Handles wx.EVT_TREE_SEL_CHANGED """ node = self.GetPyData(event.GetItem()) self.document.selection = node eg.Notify("SelectionChange", node) event.Skip()
def OnEndLabelEditEvent(self, event): """ Handles wx.EVT_TREE_END_LABEL_EDIT """ self.editLabelId = None eg.Notify("FocusChange", self) itemId = event.GetItem() node = self.GetPyData(itemId) newLabel = event.GetLabel() if not event.IsEditCancelled() and node.GetLabel() != newLabel: eg.UndoHandler.Rename(self.document).Do(node, newLabel) event.Skip()
def SetTarget(self, target): if target == self.target: return if self.target: self.target.dependants.remove(self) self.target = target if target: if target.dependants is None: target.dependants = [self] else: target.dependants.append(self) self.xmlId = target.xmlId self.id2target[target.xmlId] = target eg.Notify("NodeChanged", self.owner)
def OnSetFocus(self, event): self.FocusLastItem() eg.Notify("FocusChange", self) event.Skip()
def OnKillFocus(self, event): eg.Notify("FocusChange", None) event.Skip()
def OnGetFocusEvent(self, event): """ Handles wx.EVT_SET_FOCUS """ eg.Notify("FocusChange", self) event.Skip(True)
def SetControl(self): self.realControl = self.parent.GetEditControl() eg.Notify("FocusChange", self)
def SetUndoState(self, undoState): self.undoState = undoState eg.Notify("UndoChange", undoState)
def SetIsDirty(self, flag=True): self.isDirty = flag eg.Notify("DocumentChange", flag)
def SetFilePath(self, filePath): self.filePath = filePath eg.Notify("DocumentFileChange", filePath)
def Destroy(self): eg.Notify("DialogDestroy", self) wx.Dialog.Destroy(self)
def __init__(self, *args, **kwargs): wx.Dialog.__init__(self, *args, **kwargs) eg.Notify("DialogCreate", self)
def Do(): self.document.expandedNodes.add(self) eg.Notify("NodeChanged", self)
def Refresh(self): eg.Notify("NodeChanged", self.owner)