• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python element.Element类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中thorpy.elements.element.Element的典型用法代码示例。如果您正苦于以下问题:Python Element类的具体用法?Python Element怎么用?Python Element使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: set_size

 def set_size(self, size, state=None, center_title=True, adapt_text=True,
              cut=None, margins=style.MARGINS, refresh_title=False):
     Element.set_size(self, size, state, center_title, adapt_text, cut, margins,
                      refresh_title)
     if self._lift:
         self.remove_elements([self._lift])
         self.refresh_lift()
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.3,代码行数:7,代码来源:box.py


示例2: finish

    def finish(self):
        Element.finish(self)
        (x, y) = self.is_family_bigger()
        if (y and self._has_lift) or self._force_lift:
            self.add_lift(typ="dv")
##            self._lift.active_wheel = True
            self._lift.active_wheel = False
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.1,代码行数:7,代码来源:ddlf.py


示例3: __init__

    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
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.1,代码行数:30,代码来源:ddlf.py


示例4: finish

 def finish(self):
     Element.finish(self)
     self._drag_element.set_center((None, self.get_fus_center()[1]))
     for state in self._states:
         self._states[state].refresh_ghost_rect()
     self._setup()
     self._drag_element.place_at(self.initial_value)
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.1,代码行数:7,代码来源:slider.py


示例5: set_topleft

 def set_topleft(self, pos, state=constants.STATE_NORMAL):
     left, top = pos
     w = self._states[state].fusionner.rect.width
     zone = self.father._iwriter.get_zone()
     if left + w > zone.right:
         left = zone.right - w
     Element.set_topleft(self, (left, top), state)
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.1,代码行数:7,代码来源:_cursor.py


示例6: set_painter

 def set_painter(self, painter, autopress=True):
     """To use before finish"""
     Element.set_painter(self, painter)
     if autopress:
         painter = copy(painter)
         painter.pressed = True
     self.press_params.params["painter"] = painter
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.1,代码行数:7,代码来源:pressable.py


示例7: __init__

 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)
开发者ID:YannThorimbert,项目名称:Thorpy-1.5.2a,代码行数:8,代码来源:drawgrid.py


示例8: finish

 def finish(self):
     self._path_element._set_path_elements()
     Element.finish(self)
     self.store()
     centerx = self.get_fus_rect().centerx
     self.text_element.set_center((centerx, None))
     ycoord = self._path_element._elements[0].get_storer_rect().centery
     self._path_element._set_path_elements(ycoord)
     self.set_prison()
开发者ID:YannThorimbert,项目名称:Thorpy-1.5.2a,代码行数:9,代码来源:browser.py


示例9: finish

    def finish(self):
        Element.finish(self)
        if self._size == "auto":
            self.fit_children(only_children=False)
        (x, y) = self.is_family_bigger()
        if (y and self._has_lift) or self._force_lift:
            self.add_lift(type_="dv")
##            self._lift.active_wheel = True
            self._lift.active_wheel = False
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.3,代码行数:9,代码来源:ddlf.py


示例10: __init__

 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
开发者ID:YannThorimbert,项目名称:ThorPy-1.0,代码行数:10,代码来源:_halo.py


示例11: finish

 def finish(self):
     Element.finish(self)
     if not self._size:
         self._size = self.get_fus_rect()
     self.set_size(self._size)
     for line in self.get_lines(STATE_NORMAL):
         e = OneLineText(line)
         e.finish()
         e.set_writer(self.current_state.fusionner.title._writer)
         self.add_elements([e])
     self.format_txt()
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.2,代码行数:11,代码来源:text.py


示例12: make_text

def make_text(text, font_size=style.FONT_SIZE, font_color=style.FONT_COLOR):
    params = {"font_color":font_color, "font_size":font_size}
    button = Element(text, normal_params=params)
    if not "\n" in text:
        button.set_style("text")
    button.finish()
    if "\n" in text:
        button.scale_to_title()
        button.set_main_color((0,0,0,0))
    return button
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.1,代码行数:10,代码来源:_wrappers.py


示例13: __init__

    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
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.1,代码行数:14,代码来源:slider.py


示例14: __init__

 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)
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.3,代码行数:14,代码来源:box.py


示例15: __init__

 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)
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.2,代码行数:15,代码来源:box.py


示例16: __init__

 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
开发者ID:YannThorimbert,项目名称:ThorPy-1.0,代码行数:16,代码来源:_shadow.py


示例17: __init__

 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)
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.3,代码行数:16,代码来源:line.py


示例18: finish

    def finish(self):
        Element.finish(self)
        if self._size == "auto":
            self.fit_children(only_children=False)
            w,h = None, None
            if self.get_fus_rect().height > style.DDL_MAX_SIZE[1]:
                h = style.DDL_MAX_SIZE[1]
            if self.get_fus_rect().width > style.DDL_MAX_SIZE[0]:
                w = style.DDL_MAX_SIZE[0]
            if w or h:
                self.set_size((w,h))
        (x, y) = self.is_family_bigger()
        if (y and self._has_lift) or self._force_lift:
            self.add_lift(type_="dv")
##            self._lift.active_wheel = True
            self._lift.active_wheel = False
开发者ID:YannThorimbert,项目名称:Thorpy-1.5.2a,代码行数:16,代码来源:ddlf.py


示例19: _get_file_element

 def _get_file_element(self, name):
     painter = functions.obtain_valid_painter(painterstyle.NAME_PAINTER,
                                              size=style.SIZE)
     el = Element(name)
     el.set_painter(painter)
     el.set_style(style.STYLE_NAME)
     el.finish()
     return el
开发者ID:YannThorimbert,项目名称:ThorPy-1.4.2,代码行数:8,代码来源:browserlauncher.py


示例20: __init__

    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
开发者ID:YannThorimbert,项目名称:Thorpy-1.5.2a,代码行数:41,代码来源:ddlf.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python functions.debug_msg函数代码示例发布时间:2022-05-27
下一篇:
Python clickable.Clickable类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap