当前位置: 首页>>代码示例>>Python>>正文


Python Manager.findById方法代码示例

本文整理汇总了Python中component.Manager.findById方法的典型用法代码示例。如果您正苦于以下问题:Python Manager.findById方法的具体用法?Python Manager.findById怎么用?Python Manager.findById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在component.Manager的用法示例。


在下文中一共展示了Manager.findById方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: OnData

# 需要导入模块: from component import Manager [as 别名]
# 或者: from component.Manager import findById [as 别名]
 def OnData(self, x, y, d):
     view.testWin.RemoveHighlightDT()
     self.onHL = self.left = False
     self.GetData()
     id = int(self.do.GetDataHere())
     d,other = self.WhereToDrop(x, y, d)
     if d != wx.DragNone and other:
         obj,item = other
         g.Presenter.setData(item)
         comp = Manager.findById(id)
         mouseState = wx.GetMouseState()
         forceSibling = mouseState.ControlDown()
         forceInsert = mouseState.ShiftDown()
         g.Presenter.updateCreateState(forceSibling, forceInsert)
         if not g.Presenter.checkCompatibility(comp):
             return wx.DragNone
         item = g.Presenter.create(comp)
         node = view.tree.GetPyData(item)
         parentItem = view.tree.GetItemParent(item)
         parentNode = view.tree.GetPyData(parentItem)
         parentComp = Manager.getNodeComp(parentNode)
         # If pos if not set by default and parent is not a sizer, set pos to
         # drop coordinates
         if 'pos' in comp.attributes and not comp.getAttribute(node, 'pos') \
                and parentComp.isContainer() and \
                not parentComp.isSizer():
             # Calc relative coords
             rect = view.testWin.FindObjectRect(parentItem)
             x -= rect[0].x
             y -= rect[0].y
             comp.addAttribute(node, 'pos', '%d,%d' % (x, y))
             g.Presenter.setData(item)
         view.frame.SetStatusText('Object created')
     return d
开发者ID:Einstein-NTE,项目名称:einstein,代码行数:36,代码来源:TestWin.py

示例2: OnComponentReplace

# 需要导入模块: from component import Manager [as 别名]
# 或者: from component.Manager import findById [as 别名]
 def OnComponentReplace(self, evt):
     '''Hadnler for creating new elements.'''
     comp = Manager.findById(evt.GetId() - ID.SHIFT)
     item = self.tree.GetSelection()
     index = self.tree.ItemFullIndex(item)
     oldComp = Presenter.comp
     oldNode = Presenter.replace(comp)
     g.undoMan.RegisterUndo(undo.UndoReplace(index, oldComp, oldNode))
开发者ID:e-johnson,项目名称:AndroidProject,代码行数:10,代码来源:listener.py

示例3: OnComponentCreate

# 需要导入模块: from component import Manager [as 别名]
# 或者: from component.Manager import findById [as 别名]
 def OnComponentCreate(self, evt):
     '''Hadnler for creating new elements.'''
     comp = Manager.findById(evt.GetId())
     g.undoMan.RegisterUndo(undo.UndoGlobal()) # !!! TODO
     if comp.groups[0] == 'component':
         node = Model.createComponentNode('Component')
         Presenter.create(comp, node)
     else:
         Presenter.create(comp)
开发者ID:RupertTheSlim,项目名称:Programming,代码行数:11,代码来源:listener.py

示例4: OnComponentCreate

# 需要导入模块: from component import Manager [as 别名]
# 或者: from component.Manager import findById [as 别名]
 def OnComponentCreate(self, evt):
     '''Hadnler for creating new elements.'''
     state = self.tree.GetFullState() # state just before
     comp = Manager.findById(evt.GetId())
     if comp.groups[0] == 'component':
         node = Model.createComponentNode('Component')
         item = Presenter.create(comp, node)
     else:
         item = Presenter.create(comp)
     itemIndex = self.tree.ItemFullIndex(item)
     g.undoMan.RegisterUndo(undo.UndoPasteCreate(itemIndex, state))
开发者ID:e-johnson,项目名称:AndroidProject,代码行数:13,代码来源:listener.py

示例5: OnComponentReplace

# 需要导入模块: from component import Manager [as 别名]
# 或者: from component.Manager import findById [as 别名]
 def OnComponentReplace(self, evt):
     '''Hadnler for creating new elements.'''
     comp = Manager.findById(evt.GetId() - ID.SHIFT)
     g.undoMan.RegisterUndo(undo.UndoGlobal()) # !!! TODO
     Presenter.replace(comp)
开发者ID:RupertTheSlim,项目名称:Programming,代码行数:7,代码来源:listener.py


注:本文中的component.Manager.findById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。