示例#1
0
    def __init__(self, name, parent, pos):
        ManagedBase.__init__(self, name, 'wxSpinButton', parent, pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.range = np.IntRangePropertyA("0, 100")
        self.value = np.SpinPropertyA(0, val_range=(0, 100), immediate=True)
示例#2
0
    def __init__(self, name, parent, id, choices, sizer, pos):
        ManagedBase.__init__(self, name, 'wxCheckListBox', parent, id, sizer, pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.selection = np.SpinProperty(-1, val_range=len(choices)-1, default_value=-1, immediate=True )
        self.choices   = ChoicesProperty( choices, [(_('Label'), np.GridProperty.STRING)] )
示例#3
0
    def __init__(self, name, parent, id, label, sizer, pos):
        ManagedBase.__init__(self, name, 'wxStaticText', parent, id, sizer, pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.label     = np.TextProperty(label, multiline="grow")
        self.attribute = np.CheckBoxProperty(False, default_value=False)
示例#4
0
    def __init__(self, name, parent, index, bmp_file):
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.bitmap = np.BitmapProperty(bmp_file)
        self.attribute = np.CheckBoxProperty(False, default_value=False)
    def __init__(self, name, parent, id, style, sizer, pos):
        ManagedBase.__init__(self, name, 'wxStaticLine', parent, id, sizer, pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.attribute = np.CheckBoxProperty(False, default_value=False)
        if style: self.properties["style"].set(style)
    def __init__(self, name, parent, id, win_1, win_2, orientation, sizer,
                 pos):
        ManagedBase.__init__(self, name, 'wxSplitterWindow', parent, id, sizer,
                             pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.no_custom_class = np.CheckBoxProperty(False, default_value=False)
        self.sash_pos = np.SpinPropertyD(0, default_value="")
        if hasattr(wx, "SpinCtrlDouble"):
            self.sash_gravity = np.SpinDoublePropertyD(0.5, (0.0, 1.0),
                                                       default_value=0.0,
                                                       immediate=True)
        else:
            self.sash_gravity = np.FloatPropertyD(0.5, (0.0, 1.0),
                                                  default_value=0.0)
        self.min_pane_size = np.SpinProperty(20)

        # hidden properties: orientation string, window_1, window_2
        self.orientation = np.Property(orientation)
        self.window_1 = ChildWidgetNameProperty("_window_1")
        self.window_2 = ChildWidgetNameProperty("_window_2")

        self.virtual_sizer = SplitterWindowSizer(self)
        labels = ("SLOT Left",
                  "SLOT Right") if orientation == "wxSPLIT_VERTICAL" else (
                      "SLOT Top", "SLOT Bottom")
        self._window_1 = win_1 or SizerSlot(
            self, self.virtual_sizer, 1, label=labels[0])
        self._window_2 = win_2 or SizerSlot(
            self, self.virtual_sizer, 2, label=labels[1])
示例#7
0
    def __init__(self, name, klass, parent):
        if parent.IS_ROOT:
            self.__dict__["IS_TOPLEVEL"] = True
        if self.IS_TOPLEVEL:
            custom_class = True
            pos = None
        else:
            custom_class = False
            pos = "_toolbar"
        EditBase.__init__(self, name, 'wxToolBar', parent, custom_class, pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.bitmapsize = np.IntPairPropertyD('16, 15', default_value='16, 15')
        self.margins = np.IntPairPropertyD('0, 0', default_value='0, 0')
        self.packing = np.SpinPropertyD(1,
                                        val_range=(0, 100),
                                        default_value=1,
                                        immediate=True)
        self.separation = np.SpinPropertyD(5,
                                           val_range=(0, 100),
                                           default_value=5,
                                           immediate=True)
        self.tools = ToolsProperty()  # incl. the Edit button

        self.window_id = None  # just a dummy for code generation

        self.widget = self._tb = None  # a panel and the actual ToolBar

        if self.IS_TOPLEVEL:
            PreviewMixin.__init__(self)  # add a preview button
        else:
            self.preview = None
示例#8
0
    def __init__(self, name, parent, index, choices):
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.selection = np.SpinProperty(-1, val_range=len(choices)-1, immediate=True )
        self.choices   = ChoicesProperty( choices, [(_('Label'), np.GridProperty.STRING)] )
示例#9
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
示例#10
0
    def __init__(self, name, parent, id, style, win_1, win_2, orientation,
                 sizer, pos):
        ManagedBase.__init__(self, name, 'wxSplitterWindow', parent, id, sizer,
                             pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.no_custom_class = np.CheckBoxProperty(False, default_value=False)
        self.sash_pos = np.SpinPropertyD(0, default_value=0)
        self.min_pane_size = np.SpinProperty(20)

        # hidden properties: orientation string, window_1, window_2
        self.orientation = np.Property(orientation)
        self.window_1 = ChildWidgetNameProperty("_window_1")
        self.window_2 = ChildWidgetNameProperty("_window_2")

        self.virtual_sizer = SplitterWindowSizer(self)
        labels = ("SLOT Left",
                  "SLOT Right") if orientation == "wxSPLIT_VERTICAL" else (
                      "SLOT Top", "SLOT Bottom")
        self._window_1 = win_1 or SizerSlot(self, self.virtual_sizer, 1,
                                            labels[0])
        self._window_2 = win_2 or SizerSlot(self, self.virtual_sizer, 2,
                                            labels[1])

        if style: self.properties["style"].set(style)
示例#11
0
    def __init__(self, name, parent, id, sizer, pos):
        # initialize base classes
        ManagedBase.__init__(self, name, 'wxTextCtrl', parent, id, sizer, pos)
        EditStylesMixin.__init__(self)

        # initialize instance properties
        self.value = np.TextProperty("", multiline=True)
示例#12
0
    def __init__(self, name, parent, label, pos):
        ManagedBase.__init__(self, name, 'wxRadioButton', parent, pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.label   = np.TextProperty("", multiline="grow")
        self.clicked = np.CheckBoxProperty(False, default_value=False)
示例#13
0
    def __init__(self, name, parent, index, style):
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.attribute = np.CheckBoxProperty(False, default_value=False)
        if style: self.properties["style"].set(style)
示例#14
0
    def __init__(self, name, parent, index, style=wx.TR_HAS_BUTTONS|wx.BORDER_SUNKEN):
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        if style: self.properties["style"].set(style)
        self._item_with_name = None  # a Tree item for visualization
示例#15
0
 def __init__(self, name, parent, index, style=wx.LC_REPORT | wx.BORDER_SUNKEN):
     ManagedBase.__init__(self, name, parent, index)
     EditStylesMixin.__init__(self, style)
     self.columns = GridColsProperty([])
     self.rows_number = np.SpinProperty(0, immediate=True, default_value=0)
     self.properties["style"]._ignore_names = {"wxLC_VIRTUAL"}
     self.properties["style"]._one_required = ["wxLC_ICON", "wxLC_SMALL_ICON", "wxLC_LIST", "wxLC_REPORT"]
示例#16
0
    def __init__(self, name, parent, index):
        # initialize base classes
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)

        # initialize instance properties
        self.value = np.TextProperty("", multiline="grow")
示例#17
0
文件: slider.py 项目: wxGlade/wxGlade
    def __init__(self, name, parent, index, style):
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self, style)

        # initialise instance properties
        self.range = np.IntRangePropertyA("0, 10", notnull=True)
        self.value = np.SpinPropertyA(0, val_range=(0, 10), immediate=True)
示例#18
0
    def __init__(self, name, klass, parent):
        custom_class = parent is None
        EditBase.__init__(self,
                          name,
                          'wxToolBar',
                          parent,
                          wx.NewId(),
                          custom_class=custom_class)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.bitmapsize = np.IntPairPropertyD('16, 15', default_value='16, 15')
        self.margins = np.IntPairPropertyD('0, 0', default_value='0, 0')
        self.packing = np.SpinPropertyD(1,
                                        val_range=(0, 100),
                                        default_value=1,
                                        immediate=True)
        self.separation = np.SpinPropertyD(5,
                                           val_range=(0, 100),
                                           default_value=5,
                                           immediate=True)
        self.tools = ToolsProperty()  # incl. the Edit button

        self.window_id = None  # just a dummy for code generation

        self.widget = self._tb = None  # a panel and the actual ToolBar

        if not self.parent:
            PreviewMixin.__init__(self)  # add a preview button
            self._is_toplevel = True
        else:
            self.preview = None
            self._is_toplevel = False
示例#19
0
    def __init__(self, name, parent, index):
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.range = np.IntRangePropertyA( "0, 100" )
        self.value = np.SpinPropertyA(0, val_range=(0,100), immediate=True, default_value="")
示例#20
0
    def __init__(self, name, parent, pos):
        # Initialise parent classes
        ManagedBase.__init__(self, name, 'wxCalendarCtrl', parent, pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.default = np.CheckBoxProperty(False, default_value=False)
示例#21
0
文件: gauge.py 项目: wxGlade/wxGlade
    def __init__(self, name, parent, index, style):
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)
        if style: self.properties["style"].set(style)

        # initialise instance properties
        self.range = np.SpinProperty(10, val_range=(0,10000000), immediate=True)
示例#22
0
    def __init__(self, name, parent, index, label=""):
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.label   = np.TextProperty(label, multiline="grow")
        self.clicked = np.CheckBoxProperty(False, default_value=False)
示例#23
0
    def __init__(self, name, parent, bmp_file, pos):
        ManagedBase.__init__(self, name, 'wxStaticBitmap', parent, pos)
        EditStylesMixin.__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)
        self.attribute = np.CheckBoxProperty(False, default_value=False)
示例#24
0
    def __init__(self, name, parent, id, style, sizer, pos):
        ManagedBase.__init__(self, name, 'wxGauge', parent, id, sizer, pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.range = np.SpinProperty(10,
                                     val_range=(0, 10000000),
                                     immediate=True)
示例#25
0
    def __init__(self, name, parent, id, label, sizer, pos):
        ManagedBase.__init__(self, name, 'wxToggleButton', parent, id, sizer,
                             pos)
        EditStylesMixin.__init__(self)

        # initialise instance variable
        self.label = np.TextProperty("", multiline="grow")
        self.value = np.CheckBoxProperty(False, default_value=False)
示例#26
0
    def __init__(self, name, parent, index, label):
        ManagedBase.__init__(self, name, parent, index)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.label     = np.TextProperty(label, multiline="grow")
        self.attribute = np.CheckBoxProperty(False, default_value=False)
        self.wrap      = np.SpinPropertyD(100, val_range=(1,100000), immediate=True, default_value=-1)
示例#27
0
    def __init__(self, name, parent):
        EditBase.__init__( self, name, parent, index="_statusbar")
        EditStylesMixin.__init__(self)

        # for the statusbar fields
        fields = [[self.name, "-1"]]  # list of 2-lists label, size
        self.fields = FieldsProperty(fields)
        self.window_id = None  # just a dummy for code generation
示例#28
0
    def __init__(self, name, parent, id, style, sizer, pos):
        ManagedBase.__init__(self, name, 'wxSlider', parent, id, sizer, pos)
        EditStylesMixin.__init__(self)

        # initialise instance properties
        self.range = np.IntRangePropertyA("0, 10", notnull=True)
        self.value = np.SpinPropertyA(0, val_range=(0, 10), immediate=True)
        if style: self.properties["style"].set(style)
示例#29
0
    def __init__(self, style='wxTAB_TRAVERSAL'):
        "Class to handle wxPanel objects"
        EditStylesMixin.__init__(self, style, 'wxPanel')

        # initialise properties
        self.scrollable      = np.CheckBoxProperty(False, default_value=False)
        self.scroll_rate = prop = np.IntPairPropertyD( "10, 10" )
        prop.set_blocked(True)
    def __init__(self, name, parent, id, sizer, pos):
        # Initialise parent classes
        ManagedBase.__init__(self, name, 'wxDatePickerCtrl', parent, id, sizer,
                             pos)
        EditStylesMixin.__init__(self)

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