當前位置: 首頁>>代碼示例>>Python>>正文


Python PyUtils.getProxyClass方法代碼示例

本文整理匯總了Python中PyUtils.getProxyClass方法的典型用法代碼示例。如果您正苦於以下問題:Python PyUtils.getProxyClass方法的具體用法?Python PyUtils.getProxyClass怎麽用?Python PyUtils.getProxyClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyUtils的用法示例。


在下文中一共展示了PyUtils.getProxyClass方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import PyUtils [as 別名]
# 或者: from PyUtils import getProxyClass [as 別名]
    def __init__(self, memberName, object, tree, treeItemId, container = None, index = None):
        """Subclasses must calls this constructor.
        Pass a string giving the member name for this node (member should be either App.Proxys.Member.Object or App.Proxys.Member.ObjectList.          
        Pass the object to observe, the member information for this object (from App.Proxys.Member).
        Also pass the tree and the treeItemId where this object is found.
        In container, pass the object that contains this node (in an HAS_A or HAS_MANY relationship)
        In index, pass the index of this node within its container (in an HAS_MANY relationship)        
        """
        super( NodeData, self ).__init__()
        self._memberName = memberName
        self._object = object
        self._tree = tree
        self._treeItemId = treeItemId
        self._container = container
        self._index = index
        if object is None :
            self._proxyClass = None
            iconIndex = getIconIndex( '../data/ui/noneIcon.png' )
        else:
            object.addObserver( self )
            self._proxyClass = PyUtils.getProxyClass(object)
            iconIndex = getIconIndex( self._proxyClass.getIcon() )
        self._tree.SetItemImage( self._treeItemId, iconIndex )

        self._subMemberNodes = []
        if self._proxyClass is not None :
            for subMember in self._proxyClass.getObjectMembers():
                self._subMemberNodes.append( _createSubMemberNode(subMember, self._tree, self._treeItemId, object) )

        tree.SetItemPyData( treeItemId, self )
        
        # Initial update
        self.update()
開發者ID:MontyThibault,項目名稱:cartwheel-3d-Research-Modifications,代碼行數:35,代碼來源:NodeData.py


注:本文中的PyUtils.getProxyClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。