def __init__(self, parent, property_window): EditBase.__init__(self, parent.name + '_statusbar', 'wxStatusBar', parent, id, property_window, custom_class=False, show=False) # style property self.style_pos = (wx.ST_SIZEGRIP,) style_labels = ('#section#' + _('Style'), 'wxST_SIZEGRIP') self.access_functions['style'] = (self.get_style, self.set_style) self.properties['style'] = CheckListProperty(self, 'style', None, style_labels) self.node = Tree.Node(self) common.app_tree.add(self.node, parent.node) self.fields = [ [self.name, "-1"] ] # list of 2-lists label, size # for the statusbar fields self.access_functions['fields'] = (self.get_fields, self.set_fields) prop = self.properties['fields'] = GridProperty( self, 'fields', None, [("Text", GridProperty.STRING), ("Size", GridProperty.INT)]) # replace the default 'write' method of 'prop' with a custom one def write_prop(outfile, tabs): from xml.sax.saxutils import escape, quoteattr fwrite = outfile.write fwrite(' ' * tabs + '<fields>\n') tabs += 1 import widget_properties for label, width in self.fields: fwrite(' ' * tabs + '<field width=%s>%s</field>\n' % (quoteattr(width), escape(widget_properties._encode(label)))) tabs -= 1 fwrite(' ' * tabs + '</fields>\n') prop.write = write_prop
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
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
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
def __init__(self, name, parent): EditBase.__init__(self, name, parent, "_menubar") self.menus = MenuProperty() self.window_id = None # just a dummy for code generation self._mb = None # the real menubar self.parent.properties["menubar"].set(True, notify=False)
def __init__(self, name, parent, class_): EditBase.__init__(self, name, parent, None, class_) self.menus = MenuProperty() self.window_id = None # just a dummy for code generation self._mb = None # the real menubar PreviewMixin.__init__(self) # add a preview button
def __init__(self, name, klass, parent): EditBase.__init__( self, name, klass, parent, wx.NewId(), custom_class=False ) EditStylesMixin.__init__(self) # for the statusbar fields fields = [[self.name, "-1"]] # list of 2-lists label, size self.fields = FieldsProperty(fields) self.node = Node(self) common.app_tree.add(self.node, parent.node)
def __init__(self, name, klass, parent): custom_class = parent is None EditBase.__init__(self, name, klass, parent, wx.NewId(), custom_class=custom_class) self.properties["base"].set('wxMenuBar') self.menus = MenuProperty() self._mb = None # the real menubar if not self.parent: PreviewMixin.__init__(self) # add a preview button else: self.preview = None
def __init__(self, name, klass, parent, property_window): custom_class = parent is None EditBase.__init__(self, name, klass, parent, wx.NewId(), property_window, custom_class=custom_class, show=False) self.base = 'wx.ToolBar' def nil(*args): return () self.tools = [] # list of Tool objects self._tb = None # the real toolbar self.style = 0 self.access_functions['style'] = (self.get_style, self.set_style) self.style_pos = [wx.TB_FLAT, wx.TB_DOCKABLE, wx.TB_3DBUTTONS] if misc.check_wx_version(2, 3, 3): self.style_pos += [wx.TB_TEXT, wx.TB_NOICONS, wx.TB_NODIVIDER, wx.TB_NOALIGN] if misc.check_wx_version(2, 5, 0): self.style_pos += [wx.TB_HORZ_LAYOUT, wx.TB_HORZ_TEXT] style_labels = ['#section#' + _('Style'), 'wxTB_FLAT', 'wxTB_DOCKABLE', 'wxTB_3DBUTTONS'] if misc.check_wx_version(2, 3, 3): style_labels += ['wxTB_TEXT', 'wxTB_NOICONS', 'wxTB_NODIVIDER', 'wxTB_NOALIGN'] if misc.check_wx_version(2, 5, 0): style_labels += ['wxTB_HORZ_LAYOUT', 'wxTB_HORZ_TEXT'] self.properties['style'] = CheckListProperty(self, 'style', None, style_labels) self.bitmapsize = '16, 15' self.access_functions['bitmapsize'] = (self.get_bitmapsize, self.set_bitmapsize) self.properties['bitmapsize'] = TextProperty(self, 'bitmapsize', None, can_disable=True, label=_("bitmapsize")) self.margins = '0, 0' self.access_functions['margins'] = (self.get_margins, self.set_margins) self.properties['margins'] = TextProperty(self, 'margins', None, can_disable=True, label=_("margins")) self.access_functions['tools'] = (self.get_tools, self.set_tools) prop = self.properties['tools'] = ToolsProperty(self, 'tools', None) self.packing = 1 self.access_functions['packing'] = (self.get_packing, self.set_packing) self.properties['packing'] = SpinProperty(self, 'packing', None, r=(0, 100), can_disable=True, label=_("packing")) self.separation = 5 self.access_functions['separation'] = (self.get_separation, self.set_separation) self.properties['separation'] = SpinProperty( self, 'separation', None, r=(0, 100), can_disable=True, label=_("separation")) # 2003-05-07 preview support PreviewMixin.__init__(self)
def __init__(self, name, klass, parent): custom_class = parent is None EditBase.__init__(self, name, klass, parent, wx.NewId(), custom_class=custom_class) self.base = 'wxMenuBar' self.menus = MenuProperty() self.window_id = None # just a dummy for code generation self._mb = None # the real menubar if not self.parent: PreviewMixin.__init__(self) # add a preview button self._is_toplevel = True else: self.preview = None self._is_toplevel = False
def __init__(self, name, klass, parent, property_window): custom_class = parent is None EditBase.__init__(self, name, klass, parent, wx.NewId(), property_window, custom_class=custom_class, show=False) self.base = 'wxMenuBar' def nil(*args): return () self.menus = [] # list of MenuTree objects self._mb = None # the real menubar self.access_functions['menus'] = (self.get_menus, self.set_menus) prop = self.properties['menus'] = MenuProperty(self, 'menus', None) ## self.node = Tree.Node(self) ## common.app_tree.add(self.node, parent.node) PreviewMixin.__init__(self)
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 = "_menubar" EditBase.__init__(self, name, klass, parent, custom_class, pos) self.menus = MenuProperty() self.window_id = None # just a dummy for code generation self._mb = None # the real menubar if self.IS_TOPLEVEL: PreviewMixin.__init__(self) # add a preview button else: self.preview = None
def __init__(self, parent, property_window): EditBase.__init__(self, parent.name + '_statusbar', 'wxStatusBar', parent, id, property_window, custom_class=False, show=False) # style property self.style_pos = (wx.ST_SIZEGRIP, ) style_labels = ('#section#' + _('Style'), 'wxST_SIZEGRIP') self.access_functions['style'] = (self.get_style, self.set_style) self.properties['style'] = CheckListProperty(self, 'style', None, style_labels) self.node = Tree.Node(self) common.app_tree.add(self.node, parent.node) self.fields = [[self.name, "-1"]] # list of 2-lists label, size # for the statusbar fields self.access_functions['fields'] = (self.get_fields, self.set_fields) prop = self.properties['fields'] = GridProperty( self, 'fields', None, [("Text", GridProperty.STRING), ("Size", GridProperty.INT)]) # replace the default 'write' method of 'prop' with a custom one def write_prop(outfile, tabs): from xml.sax.saxutils import escape, quoteattr fwrite = outfile.write fwrite(' ' * tabs + '<fields>\n') tabs += 1 import widget_properties for label, width in self.fields: fwrite(' ' * tabs + '<field width=%s>%s</field>\n' % (quoteattr(width), escape(widget_properties._encode(label)))) tabs -= 1 fwrite(' ' * tabs + '</fields>\n') prop.write = write_prop
def __init__(self, name, parent, klass): EditBase.__init__( self, name, parent, None, klass ) EditStylesMixin.__init__(self) self._init_properties() PreviewMixin.__init__(self) # add a preview button
def __init__(self, name, parent): EditBase.__init__( self, name, parent, "_toolbar" ) EditStylesMixin.__init__(self) self._init_properties() self.parent.properties["toolbar"].set(True, notify=False)
def __init__(self, name, klass, parent, property_window): custom_class = parent is None EditBase.__init__(self, name, klass, parent, wx.NewId(), property_window, custom_class=custom_class, show=False) self.base = 'wx.ToolBar' def nil(*args): return () self.tools = [] # list of Tool objects self._tb = None # the real toolbar self.style = 0 self.access_functions['style'] = (self.get_style, self.set_style) self.style_pos = [wx.TB_FLAT, wx.TB_DOCKABLE, wx.TB_3DBUTTONS] if misc.check_wx_version(2, 3, 3): self.style_pos += [ wx.TB_TEXT, wx.TB_NOICONS, wx.TB_NODIVIDER, wx.TB_NOALIGN ] if misc.check_wx_version(2, 5, 0): self.style_pos += [wx.TB_HORZ_LAYOUT, wx.TB_HORZ_TEXT] style_labels = [ '#section#' + _('Style'), 'wxTB_FLAT', 'wxTB_DOCKABLE', 'wxTB_3DBUTTONS' ] if misc.check_wx_version(2, 3, 3): style_labels += [ 'wxTB_TEXT', 'wxTB_NOICONS', 'wxTB_NODIVIDER', 'wxTB_NOALIGN' ] if misc.check_wx_version(2, 5, 0): style_labels += ['wxTB_HORZ_LAYOUT', 'wxTB_HORZ_TEXT'] self.properties['style'] = CheckListProperty(self, 'style', None, style_labels) self.bitmapsize = '16, 15' self.access_functions['bitmapsize'] = (self.get_bitmapsize, self.set_bitmapsize) self.properties['bitmapsize'] = TextProperty(self, 'bitmapsize', None, can_disable=True, label=_("bitmapsize")) self.margins = '0, 0' self.access_functions['margins'] = (self.get_margins, self.set_margins) self.properties['margins'] = TextProperty(self, 'margins', None, can_disable=True, label=_("margins")) self.access_functions['tools'] = (self.get_tools, self.set_tools) prop = self.properties['tools'] = ToolsProperty(self, 'tools', None) self.packing = 1 self.access_functions['packing'] = (self.get_packing, self.set_packing) self.properties['packing'] = SpinProperty(self, 'packing', None, r=(0, 100), can_disable=True, label=_("packing")) self.separation = 5 self.access_functions['separation'] = (self.get_separation, self.set_separation) self.properties['separation'] = SpinProperty(self, 'separation', None, r=(0, 100), can_disable=True, label=_("separation")) # 2003-05-07 preview support PreviewMixin.__init__(self)