ActionBlockDialog.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:beremiz 作者: nucleron 项目源码 文件源码
def _updateColAttrs(self, grid):
        """
        wx.Grid -> update the column attributes to add the
        appropriate renderer given the column name.

        Otherwise default to the default renderer.
        """

        for row in range(self.GetNumberRows()):
            for col in range(self.GetNumberCols()):
                editor = None
                renderer = None
                readonly = False
                colname = self.GetColLabelValue(col, False)
                if colname == "Qualifier":
                    editor = wx.grid.GridCellChoiceEditor()
                    editor.SetParameters(self.Parent.QualifierList)
                if colname == "Duration":
                    editor = wx.grid.GridCellTextEditor()
                    renderer = wx.grid.GridCellStringRenderer()
                    readonly = not self.Parent.DurationList[self.data[row].qualifier]
                elif colname == "Type":
                    editor = wx.grid.GridCellChoiceEditor()
                    editor.SetParameters(self.Parent.TypeList)
                elif colname == "Value":
                    value_type = self.data[row].type
                    if value_type == "Action":
                        editor = wx.grid.GridCellChoiceEditor()
                        editor.SetParameters(self.Parent.ActionList)
                    elif value_type == "Variable":
                        editor = wx.grid.GridCellChoiceEditor()
                        editor.SetParameters(self.Parent.VariableList)
                    elif value_type == "Inline":
                        editor = wx.grid.GridCellTextEditor()
                        renderer = wx.grid.GridCellStringRenderer()
                elif colname == "Indicator":
                    editor = wx.grid.GridCellChoiceEditor()
                    editor.SetParameters(self.Parent.VariableList)

                grid.SetCellEditor(row, col, editor)
                grid.SetCellRenderer(row, col, renderer)
                grid.SetReadOnly(row, col, readonly)

                grid.SetCellBackgroundColour(row, col, wx.WHITE)
            self.ResizeRow(grid, row)

# -------------------------------------------------------------------------------
#                            Action Block Dialog
# -------------------------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号