本文整理汇总了Python中thorpy.elements.element.Element.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Element.__init__方法的具体用法?Python Element.__init__怎么用?Python Element.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thorpy.elements.element.Element
的用法示例。
在下文中一共展示了Element.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self,
size,
titles,
elements=None,
normal_params=None,
heavy=False,
folders=None,
margins=None,
has_lift=True):
margins = style.DDL_MARGINS if margins is None else margins
self._clicked = None
Element.__init__(self, elements=elements, normal_params=normal_params)
painter = functions.obtain_valid_painter(painterstyle.BOX_PAINTER,
pressed=True,
## color=style.DEF_COLOR2,
size=size,
radius=style.BOX_RADIUS)
self.set_painter(painter)
self._margins = margins
self._heavy = heavy
self._dv = self._get_dirviewer(titles, size, folders)
reac_motion= Reaction(MOUSEMOTION,
self._reaction_motion,
reac_name=constants.REAC_MOTION)
self.add_reaction(reac_motion)
self._cursor_pos = (-1, -1)
self._has_lift = has_lift
self._menu = None
self._set_selecter()
self._force_lift = False
示例2: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self, nx, ny, cell_size):
Element.__init__(self)
self.grid = Grid(nx, ny, cell_size)
self.margins = style.MARGINS
self.current_coord = None
self.current_rect = None
reac_mousemotion = Reaction(pygame.MOUSEMOTION, self.func_mousemotion)
self.add_reaction(reac_mousemotion)
示例3: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self, target, color, elements=None, normal_params=None):
Element.__init__(self, "", elements, normal_params)
self.link(target)
self.shadow_radius = SHADOW_RADIUS
self.black = BLACK
self.alpha_factor = ALPHA_FACTOR
self.decay_mode = DECAY_MODE
self.capture_state = CAPTURE_STATE_STATIC
self.offset = OFFSET
self.color = color
示例4: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self, elements=None, normal_params=None, height=None):
Element.__init__(self, "", elements, normal_params)
h = max([e.get_storer_rect().height for e in self.get_elements()]) + 2
store(self, mode="h", x=1, y=h/2, align="center")
if self.father:
w = self.father.get_storer_rect().width
else:
w = functions.get_screen_size()[0]
size = (w, h)
painter = functions.obtain_valid_painter(painterstyle.BOX_PAINTER,
pressed=True,
size=size,
radius=style.BOX_RADIUS)
self.set_painter(painter)
示例5: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self, length, limvals=None, text="", elements=None,
normal_params=None):
limvals = parameters.LIMVALS if limvals is None else limvals
self._plus = None
self._minus = None
Element.__init__(self, text, elements, normal_params)
_Slider.__init__(self, length, limvals)
self.current_state.autoghost = False
## self._set_wheel_reaction(parameters.BUTTON_UNPRESS_EVENT,
## {"button": parameters.WHEELUP_BUTTON})
## self._set_unwheel_reaction(parameters.BUTTON_PRESS_EVENT,
## {"button": parameters.WHEELDOWN_BUTTON})
self._setup()
self.active_wheel = False
示例6: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self, bartext="", elements=None, normal_params=None,
storer_params=None, size=None, put_lift=True):
Element.__init__(self, "", elements, normal_params)
self.storer_params = storer_params
if self.storer_params is None:
self.storer_params = dict()
self._size = size
self._has_lift = False
self._put_lift = put_lift
self._bartext = bartext
painter = functions.obtain_valid_painter(painterstyle.BOX_PAINTER,
pressed=True,
size=size,
radius=style.BOX_RADIUS)
self.set_painter(painter)
示例7: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self, size, type_, color=None, pressed=True):
"""Vertical or horizontal graphical separation Line.
<size>: the size in pixel (single int value).
<type>: either 'horizontal', 'h' or 'vertical', 'v'.
<color>: a 3 or 4-tuple specifying the color.
<pressed>: if True, the line looks pressed.
"""
Element.__init__(self)
self.size = size
self.type = type_
if type_ == "horizontal" or type_ == "h":
size = (size, 2)
elif type_ == "vertical" or type_ == "v":
size = (2, size)
painter = ClassicFrame(size, color, pressed)
self.set_painter(painter)
示例8: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self, target, elements=None, normal_params=None):
Element.__init__(self, "", elements, normal_params)
self.link(target)
self.sun_angle = SUN_ANGLE
self.sun_angle2 = SUN_ANGLE2
self.shadow_radius = SHADOW_RADIUS
self.black = BLACK
self.alpha_factor = ALPHA_FACTOR
self.decay_mode = DECAY_MODE
self.angle_mode = ANGLE_MODE
self.mode_value = MODE_VALUE
self.capture_state = CAPTURE_STATE_STATIC
self.target_altitude = TARGET_ALTITUDE
self.offset = OFFSET
self.vertical = VERTICAL #rpg style : vertical=True
self.color = SHADOW_COLOR
示例9: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self,
titles,
size="auto",
elements=None,
normal_params=None,
heavy=False,
folders=None,
margins=None,
x=None,
has_lift=True):
"""Vertical list of multiple texts that can be selected.
<titles>: a list of strings containing the different choices to display.
<heavy>: if True, use more memory but is faster.
<margins>: the margins of the dropdown list, not taking <x> into
account.
<x>: the value at which text starts. If x = 0, folders image will be
croped!
"""
margins = style.DDL_MARGINS if margins is None else margins
size_painter = style.DDL_SIZE if size == "auto" else size
self._clicked = None
Element.__init__(self, elements=elements, normal_params=normal_params)
painter = functions.obtain_valid_painter(painterstyle.BOX_PAINTER,
pressed=True,
## color=style.DEF_COLOR2,
size=size_painter,
radius=style.BOX_RADIUS)
self.set_painter(painter)
self._margins = margins
self._heavy = heavy
self._dv = self._get_dirviewer(titles, size_painter, folders, x)
reac_motion= Reaction(MOUSEMOTION,
self._reaction_motion,
reac_name=constants.REAC_MOTION)
self.add_reaction(reac_motion)
self._cursor_pos = (-1, -1)
self._has_lift = has_lift
self._menu = None
self._set_selecter()
self._force_lift = False
self._size = size
示例10: __init__
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import __init__ [as 别名]
def __init__(self, text="", elements=None, normal_params=None):
Element.__init__(self, text, elements, normal_params)