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


Python Component.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
 def __init__(self, parent):
     Component.__init__(self, parent)
     TextBase.__init__(self)
     CheckBase.__init__(self)
     TipBase.__init__(self)
     self.command = ''
     self.changeEvent('checked', self.__onCheckChanged, postevent = False)
开发者ID:cashlalala,项目名称:AudioBox,代码行数:9,代码来源:button.py

示例2: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
    def __init__(self, parent = None, longFormat = False):        
        Component.__init__(self, parent)
        TextBase.__init__(self)

        self.iPlatform = subsys.GetLatestInterface('IPlatform')
        self.date = 2007, 1, 1
        self.margin = (2, 2, 2, 2)
        self.longFormat = longFormat
        self.bind('Mouse Down', koan.action.PureAction(self.setFocus))

        self.__datePicker = koan.platform.CreateDatePicker(callback = self.callback, longFormat = self.longFormat)
        self.window._window.AttachChild2( self.__datePicker.GetHWND() )

        #self.__datePicker.Show( False )
        self.changeEvent('text', self.invoke, 'Value Change', self)
        self.changeEvent('date', self.__onDateChange)
        self.changeEvent('font', self.__onFontChanged, sync = False)
        self.changeEvent('fontSize', self.__onFontChanged, sync = False)
        #koan.anim.Execute(0.3, self.__datePicker.Show, True)
        
        # font
        self.bind('Visible Change', self.__onEditVisibleChange)        
        self.bind('Size Change', self.__updateEditWndPos)
        self.bind('Position Change', self.__updateEditWndPos)
        self.bind('Parent Position Change', self.__updateEditWndPos)
        self.bind('Focus Change', self.__onEditVisibleChange)
        
        child = self
        while parent != None:
            child.autoRemove(parent.bind('Parent Position Change', child.invoke, 'Parent Position Change', postevent = False))
            child = parent
            parent = child.parent
开发者ID:cashlalala,项目名称:AudioBox,代码行数:34,代码来源:datepicker.py

示例3: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
    def __init__(self, scheme = 'hard', **kwargs):
        # Initialize scheme-dependent attributes
        try: exec('self.__%s__init__()' % string.lower(scheme))
        except: raise ValueError,'\n \n ++++ CliMT.convection: Scheme "%s" unknown' % scheme

        # Initialize fields etc. 
        Component.__init__(self, **kwargs)
开发者ID:crjones-amath,项目名称:CliMT,代码行数:9,代码来源:convection.py

示例4: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
 def __init__(self, dData):
     Component.__init__(self, "BOX:%s"%(dData['componentID']), False, 1)
     self._box = sf.RectangleShape((int(dData['width']),int(dData['height'])))
     self._box.position = (int(dData['x']),int(dData['y']))
     self._box.fill_color = sf.Color.WHITE
     self._box.outline_color = sf.Color.RED
     self._box.outline_thickness = 3.0
开发者ID:WaffleTime,项目名称:TileGame,代码行数:9,代码来源:Box.py

示例5: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
	def __init__(self):
		Component.__init__(self)
		self.output = O()
		self.x = 0
		self.y = 0
		self.width = 100
		self.height = 100
开发者ID:Fhacktory-PictIF,项目名称:PictIF,代码行数:9,代码来源:processors.py

示例6: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
 def __init__(self, scheme = 'axisymmetric', **kwargs):
     # Initialize scheme-dependent attributes
     if scheme not in ['axisymmetric','two_column']:
         raise ValueError,'\n \n ++++ CliMT.dynamics: Scheme %s unknown' % scheme
     exec('self.__%s_dynamics__init__()' % string.lower(scheme))
     # Initialize fields etc. 
     Component.__init__(self, **kwargs)
开发者ID:crjones-amath,项目名称:CliMT,代码行数:9,代码来源:dynamics.py

示例7: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
    def __init__(self, transfer_func, transfer_func_params, time_const_RC,
                 time_const_output, debug=False):
        Component.__init__(self, transfer_func, transfer_func_params,
                           0, time_const_output, debug)

        self.time_const_RC = time_const_RC
        self.input_pre = 0
开发者ID:ilyasku,项目名称:CompoundPye,代码行数:9,代码来源:highpass_filter.py

示例8: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
    def __init__(self, parent = None):
        Component.__init__(self, parent)
        self.vertical = False

        # range
        self.__valueStart = 0
        self.__valueEnd = 1
        
        # value
        self.__value = 0
        
        # snap
        self.snap = 0
                
        # thumb
        self.thumb = Thumb(self)
        self.bindData('gamma', self.thumb, 'gamma', dir = '->')
        self._thumbStartAnim = koan.anim.AnimTarget('decay', 0, 0, 0, self)
        self.thumbImage = ''
        self.thumbEffect = None
        #self.bindData('thumbImage', self.thumb, 'background')
        self.autoDirty( ['thumbImage'] )

        # drag / drop thumb
        # self.changeEvent('snap', self.__updateValue)
        self.autoRemove( self.thumb.bind('Capture Begin', self.onSlideStart) )
        self.autoRemove( self.thumb.bind('Capture Offset', self.onSlideMove) )
        self.autoRemove( self.thumb.bind('Capture End', self.onSlideStop) )
        # click to
        self.bind('Mouse Down', self.onSlideTo)

        self.__updateThumbSize()
        self.bind('Size Change', self.__updateThumbSize)
开发者ID:cashlalala,项目名称:AudioBox,代码行数:35,代码来源:slider.py

示例9: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
    def __init__(self, parent = None):        
        Component.__init__(self, parent)
        TextBase.__init__(self)
        self.vscroll = False
        self.hscroll = False
        self.maxlen = -1
        self.bgColor = color.white

        self.margin = (2, 2, 2, 2)
        self.bind('Mouse Down', koan.action.PureAction(self.setFocus))

        self.__edit = koan.platform.CreateEdit(callback = self.callback)
        self.changeEvent('text', self.__onTextChanged, sync = False)
        self.changeEvent('text', self.invoke, 'Value Change', self)
        self.changeEvent('align', self.__onEditStyleChange)
        self.changeEvent('vscroll', self.__onEditStyleChange)
        self.changeEvent('hscroll', self.__onEditStyleChange)
        self.changeEvent('maxlen', self.__onEditMaxlenChange, sync = False)
        
        # font
        self.changeEvent('font', self.__onFontChanged, sync = False)
        self.changeEvent('fontSize', self.__onFontChanged, sync = False)
        self.changeEvent('fontColor', self.__onFontColorChange, sync = False)
        self.changeEvent('bgColor', self.__onBgColorChange, sync = False)
        self.bind('Visible Change', self.__onEditVisibleChange)        
        self.bind('Size Change', self.__updateEditWndPos)
        self.bind('Position Change', self.__updateEditWndPos)
        self.bind('Parent Position Change', self.__updateEditWndPos)
        self.bind('Focus Change', self.__onEditVisibleChange)
        
        child = self
        while parent != None:
            child.autoRemove(parent.bind('Parent Position Change', child.invoke, 'Parent Position Change', postevent = False))
            child = parent
            parent = child.parent
开发者ID:cashlalala,项目名称:AudioBox,代码行数:37,代码来源:edit.py

示例10: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
    def __init__(self, scheme='slab', **kwargs):
        # Initialize scheme-dependent attributes
        if   scheme == 'slab': self.__slab__init__()
        else: raise ValueError,'\n \n ++++ CliMT.ocean: Scheme %s unknown' % scheme

        # Initialize parameters, grid, fields etc
        Component.__init__(self, **kwargs)
开发者ID:crjones-amath,项目名称:CliMT,代码行数:9,代码来源:ocean.py

示例11: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
    def __init__(self, parent=None):
        Component.__init__(self, parent)
        CaptureObject.__init__(self)
        self.vertical = True

        self.autoHide = False
        self.setRange(100, 10)
        self.changeEvent("autoHide", self.__fixVisible)
        self.changeEvent("fullSize", self.__fixVisible)
        self.changeEvent("viewSize", self.__fixVisible)

        self.__offset = 0  # 0 ~ 1
        self.thumbEffect = None
        self.thumbMinSize = 50
        self.thumbImage = ""
        self.isMouseOverThumb = False
        self.capture = False

        self.autoDirty(["viewSize", "fullSize", "thumbImage"])
        self.changeEvent("fullSize", self.__fixScroll)
        self.changeEvent("viewSize", self.__fixScroll)

        self.bind("Capture Begin", self.__onBeginScroll, postevent=False)
        self.bind("Capture Offset", self.__onScroll, postevent=False)
        self.bind("Capture End", self.__onEndScroll, postevent=False)
        self.bind("Mouse Move", self.__onMouseMove)
        self.bind("Mouse Leave", setattr, self, "isMouseOverThumb", False)
        self.__thumbStartAnim = koan.anim.AnimTarget("decay", 0, 0, 0, self)
开发者ID:cashlalala,项目名称:AudioBox,代码行数:30,代码来源:scrollbar.py

示例12: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
    def __init__(self, dData):   #sComponentID, textureGrid, fDelay, iFrameWidth, iFrameHeight, iFramesWide, iFramesHigh):
        Component.__init__(self, "ANIMATION:%s"%(dData['componentID']), True, 2)

        #This animation starts off as inactive and will await a trigger from a system function
        self._bActive = False

        #This will denote the time in-between each frame of the animation in the textureGrid.
        self._fDelay = dData['delay']

        #This will tell us when it is time to update the frame.
        self._fAnim_Time = 0.0

        #The current frame on the texture grid (top-left)
        self._iCurrent_Frame = [0,0]

        #The texture grid details
        self._iFrame_Width = dData['frameWidth']
        self._iFrame_Height = dData['frameHeight']
        self._iFrames_Wide = dData['framesWide']
        self._iFrames_High = dData['framesHigh']

        #This holds the texture for the animation!
        self._Animation_Sprite = sf.Sprite(dData['Texture'][0])

        self._Animation_Sprite.set_texture_rect(sf.IntRect(0,0,self._iFrame_Width, self._iFrame_Height))
开发者ID:WaffleTime,项目名称:TileGame,代码行数:27,代码来源:Animation_Sprite.py

示例13: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
 def __init__(self):
     Component.__init__(self)
     self.tailNodes = []
     self.previousHeadX = 1
     self.previousHeadY = 1
     self.tailIndex = 0
     self.addNodeOnUpdate = False
开发者ID:ramirezmike,项目名称:Snake-in-Python-3,代码行数:9,代码来源:tailComponent.py

示例14: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
    def __init__(self, cShape, cBody, dData):
        Component.__init__(self, "CSHAPE:%s"%(dData['componentID']), False, 0)

        self._sDependent_Comp_Name = dData["dependentComponentName"]

        self._cShape = cShape

        self._cBody = cBody
开发者ID:WaffleTime,项目名称:TileGame,代码行数:10,代码来源:Collision_Shape.py

示例15: __init__

# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import __init__ [as 别名]
 def __init__(self, owner, playergroup, enemygroup):
     Component.__init__(self, owner)
     
     self.playergroup = playergroup
     self.enemygroup = enemygroup
     
     # All entity list
     self.entitylist = []
开发者ID:PoolC,项目名称:pythonstudy,代码行数:10,代码来源:entitymanager.py


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