当前位置: 首页>>代码示例>>Python>>正文


Python wx.StdDialogButtonSizer方法代码示例

本文整理汇总了Python中wx.StdDialogButtonSizer方法的典型用法代码示例。如果您正苦于以下问题:Python wx.StdDialogButtonSizer方法的具体用法?Python wx.StdDialogButtonSizer怎么用?Python wx.StdDialogButtonSizer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


在下文中一共展示了wx.StdDialogButtonSizer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: builder

# 需要导入模块: import wx [as 别名]
# 或者: from wx import StdDialogButtonSizer [as 别名]
def builder(parent, index):
    "factory function for box sizers"

    dialog = _SizerDialog(common.adding_window or parent)
    with misc.disable_stay_on_top(common.adding_window or parent):
        res = dialog.ShowModal()
    choice = dialog.orientation.GetSelection()  # 0, 1 or 2
    if choice==0:
        orientation = wx.HORIZONTAL
    elif choice==1:
        orientation = wx.VERTICAL
    else:
        orientation = "StdDialogButtonSizer"

    num = dialog.num.GetValue()
    wrap = HAVE_WRAP_SIZER and dialog.checkbox_wrap.GetValue() or False
    label = dialog.label.GetValue()
    static = dialog.checkbox_static.GetValue()

    dialog.Destroy()
    if res != wx.ID_OK: return
    with parent.frozen():
        editor = _builder( parent, index, orientation, num, static, label, wrap )

    return editor 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:27,代码来源:edit_sizers.py

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import StdDialogButtonSizer [as 别名]
def __init__(self, dlg_title, box_label, choices, options=None, defaults=None):
        """Initialise the dialog and draw the content

        dlg_title: Dialog title
        box_label: Label of the draw around the listed choices
        choices: Choices to select one (string list)"""
        pos = wx.GetMousePosition()
        wx.Dialog.__init__(self, None, -1, dlg_title, pos)

        szr = wx.BoxSizer(wx.VERTICAL)

        self.box = wx.RadioBox( self, wx.ID_ANY, box_label, wx.DefaultPosition, wx.DefaultSize,choices.split('|'),
                                1, style=wx.RA_SPECIFY_COLS )
        self.box.SetSelection(0)
        szr.Add(self.box, 5, wx.ALL | wx.EXPAND, 10)

        if options:
            self.options = []
            for o, option in enumerate(options):
                cb = wx.CheckBox(self, -1, option)
                cb.SetValue(defaults and defaults[o])
                szr.Add(cb, 0, wx.ALL, 10)
                self.options.append(cb)

        # buttons
        btnbox = wx.StdDialogButtonSizer()
        btnOK = wx.Button(self, wx.ID_OK)
        btnOK.SetDefault()
        btnCANCEL = wx.Button(self, wx.ID_CANCEL)
        btnbox.AddButton(btnOK)
        btnbox.AddButton(btnCANCEL)
        btnbox.Realize()
        szr.Add(btnbox, 0, wx.ALL|wx.ALIGN_CENTER, 5)

        self.SetAutoLayout(True)
        self.SetSizer(szr)
        szr.Fit(self) 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:39,代码来源:dialogs.py

示例3: _builder

# 需要导入模块: import wx [as 别名]
# 或者: from wx import StdDialogButtonSizer [as 别名]
def _builder(parent, index, orientation=wx.VERTICAL, slots=1, is_static=False, label="", is_wrap=False):
    name = parent.toplevel_parent.get_next_contained_name('sizer_%d')

    # add slots later
    if orientation=="StdDialogButtonSizer":
        editor = EditStdDialogButtonSizer(name, parent, index, 0)
    elif is_static:
        editor = EditStaticBoxSizer(name, parent, index, orientation, label, 0)
    elif is_wrap:
        editor = EditWrapSizer(name, parent, index, orientation, 0)
    else:
        editor = EditBoxSizer(name, parent, index, orientation, 0)

    if parent.IS_SIZER:
        if orientation=="StdDialogButtonSizer":
            editor.properties['proportion'].set(0)
            editor.properties['flag'].set('wxALIGN_RIGHT')
        else:
            editor.properties['flag'].set('wxEXPAND')

    # add the slots
    for i in range(slots):
        editor._add_slot()
    #editor.layout()

    if parent.widget: editor.create()
    return editor 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:29,代码来源:edit_sizers.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import StdDialogButtonSizer [as 别名]
def __init__(self, parent):
        pos = wx.GetMousePosition()
        wx.Dialog.__init__( self, misc.get_toplevel_parent(parent), -1, _('Select sizer type'), pos )
        choices = [_('Horizontal'), _('Vertical'), 'StdDialogButtonSizer']
        self.orientation = wx.RadioBox( self, -1, _('Orientation'), choices=choices )
        self.orientation.SetSelection(0)
        self.orientation.Bind(wx.EVT_RADIOBOX, self.on_choice_orientation)
        tmp = wx.BoxSizer(wx.HORIZONTAL)
        tmp.Add( wx.StaticText(self, -1, _('Slots: ')), 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 3 )
        self.num = wx.SpinCtrl(self, -1)
        self.num.SetValue(1)
        self.num.SetRange(0, 100)
        tmp.Add(self.num, 1, wx.ALL, 3)
        szr = wx.BoxSizer(wx.VERTICAL)
        szr.Add(self.orientation, 0, wx.ALL | wx.EXPAND, 4)
        szr.Add(tmp, 0, wx.EXPAND)
        self.checkbox_static = wx.CheckBox(self, -1, _('Has a Static Box:'))
        compat.SetToolTip(self.checkbox_static, "Use wxStaticBoxSizer")
        self.label = wx.TextCtrl(self, -1, "")
        self.label.Enable(False)
        self.checkbox_static.Bind(wx.EVT_CHECKBOX, self.on_check_statbox)
        szr.Add(self.checkbox_static, 0, wx.ALL | wx.EXPAND, 4)
        tmp = wx.BoxSizer(wx.HORIZONTAL)
        tmp.Add(wx.StaticText(self, -1, _("Label: ")), 0, wx.ALIGN_CENTER)
        tmp.Add(self.label, 1)
        szr.Add(tmp, 0, wx.ALL | wx.EXPAND, 4)

        if HAVE_WRAP_SIZER:
            self.checkbox_wrap = wx.CheckBox(self, -1, _('Wraps around'))
            compat.SetToolTip(self.checkbox_wrap, "Use wxWrapSizer")
            self.checkbox_wrap.Bind(wx.EVT_CHECKBOX, self.on_check_wrapbox)
            szr.Add(self.checkbox_wrap, 0, wx.ALL | wx.EXPAND, 4)

        # horizontal sizer for action buttons
        #hsizer = wx.BoxSizer(wx.HORIZONTAL)
        hsizer = wx.StdDialogButtonSizer()
        hsizer.Add( wx.Button(self, wx.ID_CANCEL, _('Cancel')), 1, wx.ALL, 5)
        btn = wx.Button(self, wx.ID_OK, _('OK'))
        btn.SetDefault()
        hsizer.Add(btn, 1, wx.ALL, 5)
        szr.Add(hsizer, 0, wx.EXPAND )
        self.SetAutoLayout(1)
        self.SetSizer(szr)
        szr.Fit(self)
        self.Layout()
        #self.CenterOnScreen() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:48,代码来源:edit_sizers.py


注:本文中的wx.StdDialogButtonSizer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。