Beispiel #1
0
    def __init__(self, name, klass, parent, id):
        EditBase.__init__(self, name, klass, parent, id)

        self.window_id = np.TextPropertyD("wxID_ANY",
                                          name="id",
                                          default_value=None)
        self.size = np.SizePropertyD("-1, -1", default_value="-1, -1")

        self.sel_marker = None  # selection markers (a SelectionMarker instance)

        # background, foreground, font properties
        # their actual values will be stored/modified after widget creation in 'finish_widget_creation'
        # before that, the actual values will be stored in this dict from the actual values of the widget:
        self._original = {'font': None}
        # colors
        self.background = np.ColorPropertyD(None)
        self.foreground = np.ColorPropertyD(None)
        # font
        if "font" in self.PROPERTIES:
            self._font_changed = False  # this is True if the user has selected a custom font
            if config.use_gui:
                font = self._build_from_font(
                    compat.wx_SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT))
                font[1] = 'default'
            else:
                font = (9, 'default', 'normal', 'normal', 0, 'Segoe UI')
            self.font = np.FontPropertyD(tuple(font))

        # tooltip, focused, hiden
        self.tooltip = np.TextPropertyD(multiline="grow")
        self.disabled = np.CheckBoxProperty(False, default_value=False)
        self.focused = np.CheckBoxProperty(False, default_value=False)
        self.hidden = np.CheckBoxProperty(False, default_value=False)
Beispiel #2
0
    def __init__(self, name, parent, id, sizer, pos):
        "Class to handle wxGrid objects"
        ManagedBase.__init__(self, name, 'wxGrid', parent, id, sizer, pos)

        # instance properties
        self.create_grid = np.CheckBoxProperty(True)
        columns = [['A', -1], ['B', -1], ['C', -1]]
        self.columns = GridColsProperty([])
        rows =  [[str(n),-1] for n in range(10)]
        self.rows = GridRowsProperty( rows )
        self.properties["rows_number"] = self.properties["rows"]  # backward compatibility
        #self.rows_number        = np.SpinProperty(10, immediate=True)
        self.row_label_size     = np.SpinPropertyD(30, default_value=30, immediate=True)
        self.col_label_size     = np.SpinPropertyD(30, default_value=30, immediate=True)

        self.lines_color        = np.ColorPropertyD('#000000', default_value='#000000')
        self.label_bg_color     = np.ColorPropertyD('#C0C0C0', default_value='#C0C0C0')

        self.enable_editing     = np.CheckBoxProperty(True)
        self.enable_grid_lines  = np.CheckBoxProperty(True)
        self.enable_col_resize  = np.CheckBoxProperty(True)
        self.enable_row_resize  = np.CheckBoxProperty(True)
        self.enable_grid_resize = np.CheckBoxProperty(True)

        self.selection_mode = np.RadioProperty(0, [0,1,2], ["Cells","Rows","Columns"], aliases=self._SELECTION_MODES,
                                               columns=3)
Beispiel #3
0
    def __init__(self, name, parent, id, sizer, pos):
        "Class to handle wxGrid objects"
        ManagedBase.__init__(self, name, 'wxGrid', parent, id, sizer, pos)

        # instance properties
        self.create_grid = np.CheckBoxProperty(True)
        columns = [['A', '-1'], ['B', '-1'], ['C', '-1']]
        self.columns = GridColsProperty(columns,
                                        [('Label', np.GridProperty.STRING),
                                         ('Size', np.GridProperty.INT)])
        self.rows_number = np.SpinProperty(10, immediate=True)
        self.row_label_size = np.SpinPropertyD(30,
                                               default_value=30,
                                               immediate=True)
        self.col_label_size = np.SpinPropertyD(30,
                                               default_value=30,
                                               immediate=True)

        self.lines_color = np.ColorPropertyD('#000000',
                                             default_value='#000000')
        self.label_bg_color = np.ColorPropertyD('#C0C0C0',
                                                default_value='#C0C0C0')

        self.enable_editing = np.CheckBoxProperty(True)
        self.enable_grid_lines = np.CheckBoxProperty(True)
        self.enable_col_resize = np.CheckBoxProperty(True)
        self.enable_row_resize = np.CheckBoxProperty(True)
        self.enable_grid_resize = np.CheckBoxProperty(True)

        self.selection_mode = np.RadioProperty(0, [0, 1, 2],
                                               ["Cells", "Rows", "Columns"],
                                               aliases=self._SELECTION_MODES,
                                               columns=3)