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


Python Console.error_unknown_column_key方法代码示例

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


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

示例1: render

# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import error_unknown_column_key [as 别名]
    def render(self, screen):
        """
        Surface tekent layer, de rest gaat op de layer, en screen tekent de surface.
        :param screen: self.screen van partyscreen
        """
        self.surface.blit(self.layer, (0, self.lay_rect.y - self.rect.y))
        self.layer.blit(self.background, (0, 0))

        # zwarte background achter de titel. is voor scrollen.
        pygame.draw.rect(self.surface, COLORKEY, pygame.Rect(TITLERECT))
        self.surface.blit(self.title, (self.title_x, self.title_y))

        # zwarte omranding ná de titel, omdat de titel uitsteekt.
        pygame.draw.rect(self.surface, self.linecolor, self.surface.get_rect(), 1)

        for index, row in enumerate(self.view_matrix):
            for row_nr, columnx in enumerate(self.total_columns):
                if columnx[0] == ColumnType.icon:
                    self.layer.blit(
                        row[row_nr],
                        (columnx[1], self.columnsy + self.iconoffset + index * self.rowheight))
                elif columnx[0] == ColumnType.text:
                    self.layer.blit(
                        row[row_nr],
                        (columnx[1], self.columnsy + index * self.rowheight))
                else:
                    Console.error_unknown_column_key()
                    raise KeyError

        if self.lay_rect.y - self.rect.y < 0:
            self.surface.blit(self.up_arrow, (self.box_width + ARROWRIGHT, ARROWTOP))
        if self.lay_rect.y - self.rect.y - BOTTOMSPACER > self.rect.height - self.layer_height:
            self.surface.blit(self.down_arrow, (self.box_width + ARROWRIGHT, self.box_height + ARROWBOTTOM))

        screen.blit(self.surface, self.rect.topleft)
开发者ID:thomas64,项目名称:pyRPG2,代码行数:37,代码来源:basebox.py

示例2: render

# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import error_unknown_column_key [as 别名]
    def render(self, screen):
        """
        Surface tekent layer, de rest gaat op de layer, en screen tekent de surface.
        :param screen: self.screen van shopscreen
        """
        self.surface.blit(self.layer, (0, self.lay_rect.y - self.rect.y))
        self.layer.blit(self.background, (0, 0))

        # omranding
        pygame.draw.rect(self.surface, self.linecolor, self.surface.get_rect(), 1)
        # verticale lijnen
        for columnx in self.total_columns:
            pygame.draw.line(self.surface, self.linecolor, (columnx[1], self.columnsy), (columnx[1], self.layer_height))

        # horizontale vierkanten
        for index, row in enumerate(range(0, int(self.layer_height / self.rowheight))):
            if index == self.cur_item:
                pygame.draw.rect(self.layer, self.selectcolor,
                                 (self.column1x, self.columnsy + index * self.rowheight,
                                  self.box_width, self.rowheight + 1), 0)
            pygame.draw.rect(self.layer, self.linecolor,
                             (self.column1x, self.columnsy + index * self.rowheight,
                              self.box_width, self.rowheight + 1), 1)

        for index, row in enumerate(self.table_view):
            for row_nr, columnx in enumerate(self.total_columns):
                if columnx[0] in (ColumnType.icon, ColumnType.f_icon, ColumnType.s_icon):
                    self.layer.blit(
                        row[row_nr],
                        (columnx[1] + self.iconoffset, self.columnsy + self.iconoffset + index * self.rowheight))
                elif columnx[0] == ColumnType.text:
                    self.layer.blit(
                        row[row_nr],
                        (columnx[1] + self.textoffset, self.columnsy + self.textoffset + index * self.rowheight))
                else:
                    Console.error_unknown_column_key()
                    raise KeyError

        screen.blit(self.surface, self.rect.topleft)
开发者ID:thomas64,项目名称:pyRPG2,代码行数:41,代码来源:listbox.py


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