本文整理汇总了Python中edit_windows.ManagedBase.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ManagedBase.__init__方法的具体用法?Python ManagedBase.__init__怎么用?Python ManagedBase.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edit_windows.ManagedBase
的用法示例。
在下文中一共展示了ManagedBase.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, label, sizer, pos, property_window, show=True):
"""\
Class to handle wxRadioButton objects
"""
import config
ManagedBase.__init__(self, name, "wxRadioButton", parent, id, sizer, pos, property_window, show=show)
self.label = label
self.value = 0 # if nonzero, che radio button is selected
self.style = 0
# label and checked properties
self.access_functions["label"] = (self.get_label, self.set_label)
self.access_functions["clicked"] = (self.get_value, self.set_value)
self.access_functions["style"] = (self.get_style, self.set_style)
self.properties["label"] = TextProperty(self, "label", None, multiline=True, label=_("label"))
self.properties["clicked"] = CheckBoxProperty(self, "clicked", None, _("Clicked"))
self.style_pos = [wx.RB_GROUP, wx.RB_SINGLE, wx.RB_USE_CHECKBOX]
self.properties["style"] = CheckListProperty(
self,
"style",
None,
["#section#" + _("Style"), "wxRB_GROUP", "wxRB_SINGLE", "wxRB_USE_CHECKBOX"],
tooltips=[
_("Marks the beginning of a new group of radio buttons."),
_(
"In some circumstances, radio buttons that are not consecutive siblings trigger a hang bug in Windows (only). If this happens, add this style to mark the button as not belonging to a group, and implement the mutually-exclusive group behaviour yourself."
),
_("Use a checkbox button instead of radio button (currently supported only on PalmOS)."),
],
)
# 2003-09-04 added default_border
if config.preferences.default_border:
self.border = config.preferences.default_border_size
self.flag = wx.ALL
示例2: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, sizer, pos, property_window,
show=True):
import config
ManagedBase.__init__(self, name, 'wxSpinCtrl', parent, id, sizer, pos,
property_window, show=show)
self.style = 0
self.value = 0
self.range = (0, 100) # Default values in wxSpinCtrl constructor.
prop = self.properties
self.access_functions['style'] = (self.get_style, self.set_style)
self.access_functions['value'] = (self.get_value, self.set_value)
self.access_functions['range'] = (self.get_range, self.set_range)
style_labels = ('#section#' + _('Style'), 'wxSP_ARROW_KEYS', 'wxSP_WRAP',
'wxTE_PROCESS_ENTER',
'wxTE_PROCESS_TAB', 'wxTE_MULTILINE', 'wxTE_PASSWORD',
'wxTE_READONLY', 'wxHSCROLL', 'wxTE_RICH',
'wxTE_RICH2', 'wxTE_AUTO_URL', 'wxTE_NOHIDESEL',
'wxTE_CENTRE', 'wxTE_RIGHT', 'wxTE_LINEWRAP',
'wxTE_WORDWRAP', 'wxNO_BORDER')
self.style_pos = (wx.SP_ARROW_KEYS, wx.SP_WRAP,
wx.TE_PROCESS_ENTER, wx.TE_PROCESS_TAB,
wx.TE_MULTILINE,wx.TE_PASSWORD, wx.TE_READONLY,
wx.HSCROLL, wx.TE_RICH, wx.TE_RICH2, wx.TE_AUTO_URL,
wx.TE_NOHIDESEL, wx.TE_CENTRE, wx.TE_RIGHT,
wx.TE_LINEWRAP, wx.TE_WORDWRAP, wx.NO_BORDER)
prop['style'] = CheckListProperty(self, 'style', None, style_labels)
prop['range'] = TextProperty(self, 'range', None, can_disable=True, label=_("range"))
prop['value'] = SpinProperty(self, 'value', None, can_disable=True, label=_("value"))
# 2003-09-04 added default_border
if config.preferences.default_border:
self.border = config.preferences.default_border_size
self.flag = wx.ALL
示例3: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, sizer, pos, property_window,
show=True):
import config
ManagedBase.__init__(self, name, 'wxTextCtrl', parent, id, sizer, pos,
property_window, show=show)
self.value = ""
self.style = 0
self.access_functions['value'] = (self.get_value, self.set_value)
self.access_functions['style'] = (self.get_style, self.set_style)
prop = self.properties
# value property
prop['value'] = TextProperty(self, 'value', None,
multiline=True, label=_("value"))
# style property
self.style_pos = (wx.TE_PROCESS_ENTER, wx.TE_PROCESS_TAB,
wx.TE_MULTILINE,wx.TE_PASSWORD, wx.TE_READONLY,
wx.HSCROLL, wx.TE_RICH, wx.TE_RICH2, wx.TE_AUTO_URL,
wx.TE_NOHIDESEL, wx.TE_CENTRE, wx.TE_RIGHT,
wx.TE_LINEWRAP, wx.TE_WORDWRAP, wx.NO_BORDER)
style_labels = ('#section#' + _('Style'), 'wxTE_PROCESS_ENTER',
'wxTE_PROCESS_TAB', 'wxTE_MULTILINE', 'wxTE_PASSWORD',
'wxTE_READONLY', 'wxHSCROLL', 'wxTE_RICH',
'wxTE_RICH2', 'wxTE_AUTO_URL', 'wxTE_NOHIDESEL',
'wxTE_CENTRE', 'wxTE_RIGHT', 'wxTE_LINEWRAP',
'wxTE_WORDWRAP', 'wxNO_BORDER')
prop['style'] = CheckListProperty(self, 'style', None, style_labels)
# 2003-09-04 added default_border
if config.preferences.default_border:
self.border = config.preferences.default_border_size
self.flag = wx.ALL
示例4: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, sizer, pos, property_window,
show=True):
"""\
Class to handle wxCalendarCtrl objects
"""
import config
self.default = False
ManagedBase.__init__(self, name, 'wxCalendarCtrl', parent, id, sizer, pos,
property_window, show=show)
#self.access_functions['label'] = (self.get_label, self.set_label)
#self.properties['label'] = TextProperty(self, 'label', None,
# multiline=True)
self.access_functions['default'] = (self.get_default, self.set_default)
self.access_functions['style'] = (self.get_style, self.set_style)
self.properties['default'] = CheckBoxProperty(self, 'default', None, label=_("default"))
style_labels = ('#section#' + _('Style'), 'wxCAL_SUNDAY_FIRST', 'wxCAL_MONDAY_FIRST',
'wxCAL_SHOW_HOLIDAYS', 'wxCAL_NO_YEAR_CHANGE', 'wxCAL_NO_MONTH_CHANGE',
'wxCAL_SHOW_SURROUNDING_WEEKS','wxCAL_SEQUENTIAL_MONTH_SELECTION')
self.style_pos = (CAL_SUNDAY_FIRST, CAL_MONDAY_FIRST,
CAL_SHOW_HOLIDAYS, CAL_NO_YEAR_CHANGE, CAL_NO_MONTH_CHANGE,
CAL_SHOW_SURROUNDING_WEEKS, CAL_SEQUENTIAL_MONTH_SELECTION)
self.tooltips = (_("Show Sunday as the first day in the week"),
_("Show Monday as the first day in the week"),
_("Highlight holidays in the calendar"),
_("Disable the year changing"),
_("Disable the month (and, implicitly, the year) changing"),
_("Show the neighbouring weeks in the previous and next months"),
_("Use alternative, more compact, style for the month and year selection controls."))
self.properties['style'] = CheckListProperty(self, 'style', None,
style_labels,tooltips=self.tooltips)
if config.preferences.default_border:
self.border = config.preferences.default_border_size
self.flag = wx.ALL
示例5: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, style, sizer, pos,
property_window, show=True):
"""\
Class to handle wxNotebook objects
"""
ManagedBase.__init__(self, name, 'wxNotebook', parent, id, sizer,
pos, property_window, show=show)
self.virtual_sizer = NotebookVirtualSizer(self)
self._is_removing_pages = False
self.style = style
self.tabs = [ ['tab1', None] ] # list of pages of this notebook
# (actually a list of
# 2-list label, window)
self.access_functions['style'] = (self.get_tab_pos, self.set_tab_pos)
self.properties['style'] = HiddenProperty(self, 'style', label=_("style"))
self.access_functions['tabs'] = (self.get_tabs, self.set_tabs)
tab_cols = [('Tab label', GridProperty.STRING)]
self.properties['tabs'] = NotebookPagesProperty(self, 'tabs', None,
tab_cols, label=_("tabs"))
del tab_cols
self.nb_sizer = None
self._create_slots = False
self.no_custom_class = False
self.access_functions['no_custom_class'] = (self.get_no_custom_class,
self.set_no_custom_class)
self.properties['no_custom_class'] = CheckBoxProperty(
self, 'no_custom_class',
label=_("Don't generate code for this custom class"))
示例6: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, sizer, pos, property_window,
show=True, style=wx.TR_HAS_BUTTONS|wx.SUNKEN_BORDER):
ManagedBase.__init__(self, name, 'wxTreeCtrl', parent, id, sizer, pos,
property_window, show=show)
self.style = style
self.access_functions['style'] = (self.get_style, self.set_style)
# style property
self.style_pos = (wx.TR_HAS_BUTTONS, wx.TR_NO_LINES, wx.TR_LINES_AT_ROOT,
wx.TR_EDIT_LABELS, wx.TR_MULTIPLE, wx.TR_NO_BUTTONS,
wx.TR_TWIST_BUTTONS, wx.TR_FULL_ROW_HIGHLIGHT,
wx.TR_HIDE_ROOT, wx.TR_ROW_LINES,
wx.TR_HAS_VARIABLE_ROW_HEIGHT,
wx.TR_SINGLE, wx.TR_MULTIPLE, wx.TR_EXTENDED,
wx.TR_DEFAULT_STYLE, wx.SIMPLE_BORDER, wx.DOUBLE_BORDER,
wx.SUNKEN_BORDER, wx.RAISED_BORDER, wx.STATIC_BORDER,
wx.NO_BORDER, wx.WANTS_CHARS,
wx.NO_FULL_REPAINT_ON_RESIZE,
wx.FULL_REPAINT_ON_RESIZE)
style_labels = ('#section#' + _('Style'), 'wxTR_HAS_BUTTONS', 'wxTR_NO_LINES',
'wxTR_LINES_AT_ROOT', 'wxTR_EDIT_LABELS',
'wxTR_MULTIPLE', 'wxTR_NO_BUTTONS',
'wxTR_TWIST_BUTTONS', 'wxTR_FULL_ROW_HIGHLIGHT',
'wxTR_HIDE_ROOT', 'wxTR_ROW_LINES',
'wxTR_HAS_VARIABLE_ROW_HEIGHT','wxTR_SINGLE',
'wxTR_MULTIPLE', 'wxTR_EXTENDED',
'wxTR_DEFAULT_STYLE', 'wxSIMPLE_BORDER',
'wxDOUBLE_BORDER', 'wxSUNKEN_BORDER',
'wxRAISED_BORDER', 'wxSTATIC_BORDER', 'wxNO_BORDER',
'wxWANTS_CHARS', 'wxNO_FULL_REPAINT_ON_RESIZE',
'wxFULL_REPAINT_ON_RESIZE')
self.properties['style'] = CheckListProperty(self, 'style', None,
style_labels)
self._item_with_name = None
示例7: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, label, sizer, pos, property_window,
show=True):
"""\
Class to handle wxStaticText objects
"""
import config
ManagedBase.__init__(self, name, 'wxStaticText', parent, id, sizer,
pos, property_window, show=show)
self.label = label
self.style = 0
self.attribute = True
self.access_functions['label'] = (self.get_label, self.set_label)
self.access_functions['style'] = (self.get_style, self.set_style)
def set_attribute(v): self.attribute = int(v)
self.access_functions['attribute'] = (lambda : self.attribute,
set_attribute)
self.properties['label'] = TextProperty(self, 'label', None,
multiline=True, label=_('label'))
self.style_pos = (wx.ALIGN_LEFT, wx.ALIGN_RIGHT, wx.ALIGN_CENTRE,
wx.ST_NO_AUTORESIZE)
style_labels = ('#section#' + _('Style'), 'wxALIGN_LEFT', 'wxALIGN_RIGHT',
'wxALIGN_CENTRE', 'wxST_NO_AUTORESIZE')
self.properties['style'] = CheckListProperty(self, 'style', None,
style_labels)
self.properties['attribute'] = CheckBoxProperty(
self, 'attribute', None, _('Store as attribute'), write_always=True)
# 2003-09-04 added default_border
if config.preferences.default_border:
self.border = config.preferences.default_border_size
self.flag = wx.ALL
示例8: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, sizer, pos, property_window,
show=True):
"""\
Class to handle wxDatePickerCtrl objects
"""
import config
self.default = False
ManagedBase.__init__(self, name, 'wxDatePickerCtrl', parent, id, sizer, pos,
property_window, show=show)
#self.access_functions['label'] = (self.get_label, self.set_label)
#self.properties['label'] = TextProperty(self, 'label', None,
# multiline=True, label=_("label"))
self.access_functions['default'] = (self.get_default, self.set_default)
self.access_functions['style'] = (self.get_style, self.set_style)
self.properties['default'] = CheckBoxProperty(self, 'default', None, label=_("default"))
style_labels = ('#section#' + _('Style'), 'wxDP_SPIN', 'wxDP_DROPDOWN',
'wxDP_DEFAULT', 'wxDP_ALLOWNONE', 'wxDP_SHOWCENTURY')
self.style_pos = (wx.DP_SPIN, wx.DP_DROPDOWN,
wx.DP_DEFAULT, wx.DP_ALLOWNONE, wx.DP_SHOWCENTURY)
self.tooltips = (_("Creates a control without a month calendar drop down but with spin-control-like arrows to change individual date components. This style is not supported by the generic version."),
_("Creates a control with a month calendar drop-down part from which the user can select a date."),
_("Creates a control with the style that is best supported for the current platform (currently wxDP_SPIN under Windows and wxDP_DROPDOWN elsewhere)."),
_("With this style, the control allows the user to not enter any valid date at all. Without it - the default - the control always has some valid date."),
_("Forces display of the century in the default date format. Without this style the century could be displayed, or not, depending on the default date representation in the system."))
self.properties['style'] = CheckListProperty(self, 'style', None,
style_labels,tooltips=self.tooltips)
if config.preferences.default_border:
self.border = config.preferences.default_border_size
self.flag = wx.ALL
示例9: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, sizer, pos, property_window,
show=True, style=wx.TAB_TRAVERSAL):
"""\
Class to handle wxPanel objects
"""
ManagedBase.__init__(self, name, 'wxPanel', parent, id, sizer,
pos, property_window, show=show)
PanelBase.__init__(self, style)
示例10: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, label, sizer, pos, property_window,
show=True):
"""\
Class to handle wxButton objects
"""
import config
self.label = label
self.default = False
self.stockitem = "None"
ManagedBase.__init__(self, name, 'wxButton', parent, id, sizer, pos,
property_window, show=show)
self.access_functions['label'] = (self.get_label, self.set_label)
self.properties['label'] = TextProperty(self, 'label', None,
multiline=True)
self.access_functions['stockitem'] = (self.get_stockitem,
self.set_stockitem)
self.access_functions['default'] = (self.get_default, self.set_default)
self.access_functions['style'] = (self.get_style, self.set_style)
self.properties['default'] = CheckBoxProperty(self, 'default', None, label=_("Default"))
self.properties['default'].tooltip = \
_("This sets the button to be the default "
"item for the panel or dialog box.")
#Get the list of items, and add a 'None'
choices = ButtonStockItems.stock_ids.keys()
choices.sort()
choices[:0] = ['None']
self.properties['stockitem'] = ComboBoxProperty(
self, 'stockitem', choices, can_disable=True, label=_("Stock item"))
self.properties['stockitem'].tooltip = \
_("Standard IDs for button identifiers")
self.style_pos = (wx.BU_LEFT, wx.BU_RIGHT, wx.BU_TOP, wx.BU_BOTTOM,
wx.BU_EXACTFIT,wx.NO_BORDER)
style_labels = ('#section#' + _('Style'), 'wxBU_LEFT', 'wxBU_RIGHT',
'wxBU_TOP', 'wxBU_BOTTOM', 'wxBU_EXACTFIT','wxNO_BORDER')
#The tooltips tuple
style_tooltips=(_("Left-justifies the label. Windows and GTK+ only."),
_("Right-justifies the bitmap label. Windows and GTK+ "
"only."),
_("Aligns the label to the top of the button. Windows "
"and GTK+ only."),
_("Aligns the label to the bottom of the button. "
"Windows and GTK+ only."),
_("Creates the button as small as possible instead of "
"making it of the standard size (which is the default "
"behaviour )."),
_("Creates a flat button. Windows and GTK+ only."))
self.properties['style'] = CheckListProperty(
self, 'style', None,
style_labels, tooltips=style_tooltips) # the tooltips tuple is
# passed as the last
# argument
# 2003-09-04 added default_border
if config.preferences.default_border:
self.border = config.preferences.default_border_size
self.flag = wx.ALL
示例11: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, sizer, pos, property_window,
show=True, style=wx.LC_REPORT|wx.SUNKEN_BORDER):
ManagedBase.__init__(self, name, 'wxListCtrl', parent, id, sizer, pos,
property_window, show=show)
self.style = style
self.access_functions['style'] = (self.get_style, self.set_style)
# style property
self.style_pos = (wx.LC_LIST, wx.LC_REPORT, wx.LC_ICON, wx.LC_VIRTUAL,
wx.LC_SMALL_ICON, wx.LC_ALIGN_TOP, wx.LC_ALIGN_LEFT,
wx.LC_AUTOARRANGE, wx.LC_EDIT_LABELS, wx.LC_NO_HEADER,
wx.LC_SINGLE_SEL, wx.LC_SORT_ASCENDING,
wx.LC_SORT_DESCENDING, wx.LC_HRULES, wx.LC_VRULES,
wx.SIMPLE_BORDER,
wx.DOUBLE_BORDER, wx.SUNKEN_BORDER, wx.RAISED_BORDER,
wx.STATIC_BORDER, wx.NO_BORDER,
wx.WANTS_CHARS, wx.NO_FULL_REPAINT_ON_RESIZE,
wx.FULL_REPAINT_ON_RESIZE)
style_labels = ('#section#' + _('Style'),
'wxLC_LIST', 'wxLC_REPORT', 'wxLC_ICON',
'wxLC_VIRTUAL', 'wxLC_SMALL_ICON',
'wxLC_ALIGN_TOP', 'wxLC_ALIGN_LEFT',
'wxLC_AUTOARRANGE', 'wxLC_EDIT_LABELS',
'wxLC_NO_HEADER', 'wxLC_SINGLE_SEL',
'wxLC_SORT_ASCENDING', 'wxLC_SORT_DESCENDING',
'wxLC_HRULES', 'wxLC_VRULES', 'wxSIMPLE_BORDER',
'wxDOUBLE_BORDER', 'wxSUNKEN_BORDER',
'wxRAISED_BORDER', 'wxSTATIC_BORDER', 'wxNO_BORDER',
'wxWANTS_CHARS', 'wxNO_FULL_REPAINT_ON_RESIZE',
'wxFULL_REPAINT_ON_RESIZE')
self.style_tooltips = (_("Multicolumn list view, with optional small icons. Columns are computed automatically, i.e. you don't set columns as in wxLC_REPORT. In other words, the list wraps, unlike a wxListBox."),
_("Single or multicolumn report view, with optional header."),
_("Large icon view, with optional labels."),
_("The application provides items text on demand. May only be used with wxLC_REPORT."),
_("Small icon view, with optional labels."),
_("Icons align to the top. Win32 default, Win32 only."),
_("Icons align to the left."),
_("Icons arrange themselves. Win32 only."),
_("Labels are editable: the application will be notified when editing starts."),
_("No header in report mode."),
_("Single selection (default is multiple)."),
_("Sort in ascending order (must still supply a comparison callback in SortItems."),
_("Sort in descending order (must still supply a comparison callback in SortItems."),
_("Draws light horizontal rules between rows in report mode."),
_("Draws light vertical rules between columns in report mode"),
_("Displays a thin border around the window. wxBORDER is the old name for this style."),
_("Displays a double border. Windows and Mac only."),
_("Displays a sunken border."),
_("Displays a raised border."),
_("Displays a border suitable for a static control. Windows only."),
_("Displays no border, overriding the default border style for the window."),
_("Use this to indicate that the window wants to get all char/key events for all keys - even for keys like TAB or ENTER which are usually used for dialog navigation and which wouldn't be generated without this style. If you need to use this style in order to get the arrows or etc., but would still like to have normal keyboard navigation take place, you should create and send a wxNavigationKeyEvent in response to the key events for Tab and Shift-Tab."),
_("On Windows, this style used to disable repainting the window completely when its size is changed. Since this behaviour is now the default, the style is now obsolete and no longer has an effect."),
_("Use this style to force a complete redraw of the window whenever it is resized instead of redrawing just the part of the window affected by resizing. Note that this was the behaviour by default before 2.5.1 release and that if you experience redraw problems with code which previously used to work you may want to try this. Currently this style applies on GTK+ 2 and Windows only, and full repainting is always done on other platforms."))
self.properties['style'] = CheckListProperty(
self, 'style', None, style_labels, tooltips=self.style_tooltips)
示例12: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, style, win_1, win_2, orientation,
sizer, pos, property_window, show=True):
"""\
Class to handle wxSplitterWindow objects
"""
ManagedBase.__init__(self, name, 'wxSplitterWindow', parent, id, sizer,
pos, property_window, show=show)
self.virtual_sizer = SplitterWindowSizer(self)
if style is None: style = wx.SP_3D
self.style = style
self.window_1 = win_1
self.window_2 = win_2
self.orientation = orientation
self.sash_pos = 0
self.access_functions['style'] = (self.get_style, self.set_style)
self.access_functions['sash_pos'] = (self.get_sash_pos,
self.set_sash_pos)
self.style_pos = (wx.SP_3D, wx.SP_3DSASH, wx.SP_3DBORDER,
#wx.SP_FULLSASH,
wx.SP_BORDER, wx.SP_NOBORDER,
wx.SP_PERMIT_UNSPLIT, wx.SP_LIVE_UPDATE,
wx.CLIP_CHILDREN)
style_labels = ('#section#' + _('Style'), 'wxSP_3D', 'wxSP_3DSASH',
'wxSP_3DBORDER', #'wxSP_FULLSASH',
'wxSP_BORDER',
'wxSP_NOBORDER', 'wxSP_PERMIT_UNSPLIT',
'wxSP_LIVE_UPDATE', 'wxCLIP_CHILDREN')
self.properties['style'] = CheckListProperty(self, 'style', None,
style_labels)
if self.orientation == wx.SPLIT_HORIZONTAL:
od = 'wxSPLIT_HORIZONTAL'
else: od = 'wxSPLIT_VERTICAL'
self.access_functions['orientation'] = (self.get_orientation,
self.set_orientation)
self.properties['orientation'] = HiddenProperty(self, 'orientation', label=_("orientation"))
self.access_functions['window_1'] = (self.get_win_1, lambda v: None)
self.access_functions['window_2'] = (self.get_win_2, lambda v: None)
self.properties['window_1'] = HiddenProperty(self, 'window_1')
self.properties['window_2'] = HiddenProperty(self, 'window_2')
self.window_1 = SizerSlot(self, self.virtual_sizer, 1)
self.window_2 = SizerSlot(self, self.virtual_sizer, 2)
self.properties['sash_pos'] = SpinProperty(self, 'sash_pos', None,
r=(0, 20),
can_disable=True, label=_("sash_pos"))
self.no_custom_class = False
self.access_functions['no_custom_class'] = (self.get_no_custom_class,
self.set_no_custom_class)
self.properties['no_custom_class'] = CheckBoxProperty(
self, 'no_custom_class',
label=_("Don't generate code for this custom class"))
示例13: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, bmp_file, sizer, pos, property_window, show=True):
"""\
Class to handle wxBitmapButton objects
"""
import config
ManagedBase.__init__(self, name, "wxBitmapButton", parent, id, sizer, pos, property_window, show=show)
self.default = False
self.set_bitmap(bmp_file)
# bitmap property
self.access_functions["bitmap"] = (self.get_bitmap, self.set_bitmap)
self.properties["bitmap"] = FileDialogProperty(
self, "bitmap", None, style=wx.OPEN | wx.FILE_MUST_EXIST, can_disable=False, label=_("bitmap")
)
self.access_functions["default"] = (self.get_default, self.set_default)
self.access_functions["style"] = (self.get_style, self.set_style)
self.properties["default"] = CheckBoxProperty(self, "default", None, label=_("default"))
# 2003-08-07: added 'disabled_bitmap' property
self.disabled_bitmap = ""
self.access_functions["disabled_bitmap"] = (self.get_disabled_bitmap, self.set_disabled_bitmap)
self.properties["disabled_bitmap"] = FileDialogProperty(
self, "disabled_bitmap", None, style=wx.OPEN | wx.FILE_MUST_EXIST, label=_("disabled bitmap")
)
# 2003-09-04 added default_border
if config.preferences.default_border:
self.border = config.preferences.default_border_size
self.flag = wx.ALL
self.style_pos = (wx.BU_AUTODRAW, wx.BU_LEFT, wx.BU_RIGHT, wx.BU_TOP, wx.BU_BOTTOM, wx.NO_BORDER)
style_labels = (
"#section#" + _("Style"),
"wxBU_AUTODRAW",
"wxBU_LEFT",
"wxBU_RIGHT",
"wxBU_TOP",
"wxBU_BOTTOM",
"wxNO_BORDER",
)
# The tooltips tuple
self.tooltips = (
_(
"If this is specified, the button will be drawn "
"automatically using the label bitmap only, providing"
" a 3D-look border. If this style is not specified, the "
"button will be drawn without borders and using all "
"provided bitmaps. WIN32 only."
"Left-justifies the bitmap label. WIN32 only."
),
_("Right-justifies the bitmap label. WIN32 only."),
_("Aligns the bitmap label to the top of the button." " WIN32 only."),
_("Aligns the bitmap label to the bottom of the button." " WIN32 only."),
_("Creates a flat button. Windows and GTK+ only."),
)
self.properties["style"] = CheckListProperty(self, "style", None, style_labels, tooltips=self.tooltips)
示例14: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, width, height, sizer, pos, property_window, show=True):
"""\
Class to handle spacers for sizers
"""
ManagedBase.__init__(self, name, "spacer", parent, id, sizer, pos, property_window, show=show)
self.__size = [width, height]
self.access_functions["width"] = (self.get_width, self.set_width)
self.access_functions["height"] = (self.get_height, self.set_height)
self.properties["width"] = SpinProperty(self, "width", None, label=_("width"))
self.properties["height"] = SpinProperty(self, "height", None, label=_("height"))
示例15: __init__
# 需要导入模块: from edit_windows import ManagedBase [as 别名]
# 或者: from edit_windows.ManagedBase import __init__ [as 别名]
def __init__(self, name, parent, id, style, sizer, pos,
property_window, show=True):
"""\
Class to handle wxNotebook objects
"""
# create new and (still) unused notebook name
if not name:
name = self.next_notebook_name()
# Increase number of created notebooks
EditNotebook.notebook_number += 1
ManagedBase.__init__(self, name, 'wxNotebook', parent, id, sizer,
pos, property_window, show=show)
self.virtual_sizer = NotebookVirtualSizer(self)
self._is_removing_pages = False
self.style = style
self.tabs = [['tab1', None]] # list of pages of this notebook
# (actually a list of
# 2-list label, window)
self.access_functions['style'] = (self.get_tab_pos, self.set_tab_pos)
self.properties['style'] = HiddenProperty(
self,
'style',
label=_("style"),
)
self.access_functions['tabs'] = (self.get_tabs, self.set_tabs)
tab_cols = [('Tab label', GridProperty.STRING)]
self.properties['tabs'] = NotebookPagesProperty(
self,
'tabs',
None,
tab_cols,
label=_("tabs"),
can_remove_last=False,
)
del tab_cols
self.nb_sizer = None
self._create_slots = False
self.no_custom_class = False
self.access_functions['no_custom_class'] = (self.get_no_custom_class,
self.set_no_custom_class)
self.properties['no_custom_class'] = CheckBoxProperty(
self, 'no_custom_class',
label=_("Don't generate code for this custom class"))
# first pane should have number 1
self.pane_number = 1