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


Python Control.layout方法代码示例

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


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

示例1: layout

# 需要导入模块: from widgets import Control [as 别名]
# 或者: from widgets.Control import layout [as 别名]
    def layout(self, x, y):
        Control.layout(self, x, y)

        self.field.update(x, y, self.width, self.height)
        x, y, width, height = self.field.get_content_region()

        font = self.label.document.get_font()
        height = font.ascent - font.descent
        self.label.x = x
        self.label.y = y - font.descent
开发者ID:isS,项目名称:sy-game,代码行数:12,代码来源:menu.py

示例2: layout

# 需要导入模块: from widgets import Control [as 别名]
# 或者: from widgets.Control import layout [as 别名]
    def layout(self, x, y):
        """
        Places the Button.

        @param x X coordinate of lower left corner
        @param y Y coordinate of lower left corner
        """
        Control.layout(self, x, y)
        self.button.update(self.x, self.y, self.width, self.height)
        if self.highlight is not None:
            self.highlight.update(self.x, self.y, self.width, self.height)
        x, y, width, height = self.button.get_content_region()
        font = self.label.document.get_font()
        self.label.x = x + width/2 - self.label.content_width/2
        self.label.y = y + height/2 - font.ascent/2 - font.descent
开发者ID:AngelFishy,项目名称:Kytten,代码行数:17,代码来源:button.py

示例3: layout

# 需要导入模块: from widgets import Control [as 别名]
# 或者: from widgets.Control import layout [as 别名]
    def layout(self, x, y):
        """
        Places the Checkbox.

        @param x X coordinate of lower left corner
        @param y Y coordinate of lower left corner
        """
        Control.layout(self, x, y)
        if self.align == HALIGN_RIGHT:  # label goes on right
            self.checkbox.update(x, y + self.height/2 - self.checkbox.height/2,
                                 self.checkbox.width, self.checkbox.height)
            self.label.x = x + self.checkbox.width + self.padding
        else: # label goes on left
            self.label.x = x
            self.checkbox.update(x + self.label.content_width + self.padding,
                                 y + self.height/2 - self.checkbox.height/2,
                                 self.checkbox.width, self.checkbox.height)

        if self.highlight is not None:
            self.highlight.update(self.x, self.y, self.width, self.height)

        font = self.label.document.get_font()
        height = font.ascent - font.descent
        self.label.y = y + self.height/2 - height/2 - font.descent
开发者ID:chrisbiggar,项目名称:sidescrolltesting,代码行数:26,代码来源:checkbox.py


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