Exemple #1
0
    def __init__(self, name, parent, index, label):
        # Initialise parent classes
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)
        BitmapMixin.__init__(self)

        # initialise instance properties
        self.label = np.TextProperty(label, default_value="", multiline="grow")
        self.default = np.CheckBoxProperty(False, default_value=False)
        self.stockitem = np.ListBoxPropertyD(self.STOCKITEMS[0],
                                             choices=self.STOCKITEMS)

        self.bitmap = np.BitmapPropertyD(min_version=(3, 0))
        self.disabled_bitmap = np.BitmapPropertyD(min_version=(3, 0))
        self.pressed_bitmap = np.BitmapPropertyD(min_version=(3, 0))
        self.current_bitmap = np.BitmapPropertyD(min_version=(3, 0))
        self.focus_bitmap = np.BitmapPropertyD(min_version=(3, 0))

        values = [wx.LEFT, wx.RIGHT, wx.TOP, wx.BOTTOM]
        aliases = ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"]
        p = self.bitmap_dir = np.RadioProperty(wx.LEFT,
                                               values,
                                               columns=4,
                                               aliases=aliases,
                                               default_value=wx.LEFT)
        p.min_version = (3, 0)
        p.blocked = True
Exemple #2
0
    def __init__(self, name, parent, bmp_file, pos):
        ManagedBase.__init__(self, name, 'wxBitmapButton', parent, pos)
        EditStylesMixin.__init__(self)
        BitmapMixin.__init__(self)

        # initialise instance properties
        self.bitmap = np.BitmapProperty(bmp_file)
        self.disabled_bitmap = np.BitmapPropertyD("")
        self.pressed_bitmap = np.BitmapPropertyD(min_version=(3, 0))
        self.current_bitmap = np.BitmapPropertyD(min_version=(3, 0))
        self.focus_bitmap = np.BitmapPropertyD(min_version=(3, 0))
        self.default = np.CheckBoxProperty(False, default_value=False)
Exemple #3
0
    def __init__(self, name, parent, id, bmp_file, sizer, pos):
        ManagedBase.__init__(self, name, 'wxBitmapButton', parent, id, sizer,
                             pos)
        EditStylesMixin.__init__(self)
        BitmapMixin.__init__(self)

        # initialise instance properties
        filedialog_style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST  # for the following two properties
        self.bitmap = np.BitmapProperty(bmp_file, style=filedialog_style)
        self.disabled_bitmap = np.BitmapPropertyD("",
                                                  default_value="",
                                                  style=filedialog_style)
        self.default = np.CheckBoxProperty(False, default_value=False)
Exemple #4
0
    def __init__(self, name, parent, label, pos):
        # Initialise parent classes
        ManagedBase.__init__(self, name, 'wxButton', parent, pos)
        EditStylesMixin.__init__(self)
        BitmapMixin.__init__(self)

        # initialise instance properties
        self.label     = np.TextProperty(label, default_value="", multiline="grow")
        self.default   = np.CheckBoxProperty(False, default_value=False)
        self.stockitem = np.ListBoxPropertyD(self.STOCKITEMS[0], choices=self.STOCKITEMS)

        self.bitmap          = np.BitmapPropertyD(min_version=(3,0))
        self.disabled_bitmap = np.BitmapPropertyD(min_version=(3,0))
        self.pressed_bitmap  = np.BitmapPropertyD(min_version=(3,0))
        self.current_bitmap  = np.BitmapPropertyD(min_version=(3,0))
        self.focus_bitmap    = np.BitmapPropertyD(min_version=(3,0))
    def __init__(self, name, parent, id, bmp_file, sizer, pos):
        ManagedBase.__init__(self, name, 'wxBitmapButton', parent, id, sizer,
                             pos)
        EditStylesMixin.__init__(self)
        BitmapMixin.__init__(self)

        # initialise instance properties
        filedialog_style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST  # for the following two properties
        self.bitmap = np.FileNameProperty(bmp_file, style=filedialog_style)
        self.disabled_bitmap = np.FileNamePropertyD("",
                                                    default_value="",
                                                    style=filedialog_style)
        self.default = np.CheckBoxProperty(False)

        if config.preferences.default_border:
            self.border.set(config.preferences.default_border_size)
            self.flag.set(wx.ALL)