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


Python wx.FlexGridSizer方法代码示例

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


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

示例1: addTextStyles

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def addTextStyles(self, name, prefix, parent):
        hsizer = wx.StaticBoxSizer(wx.StaticBox(parent, -1, name),
                                   wx.HORIZONTAL)

        gsizer = wx.FlexGridSizer(2, 2, 0, 10)

        # wxGTK adds way more space by default than wxMSW between the
        # items, have to adjust for that
        pad = 0
        if misc.isWindows:
            pad = 5

        self.addCheckBox("Caps", prefix, parent, gsizer, pad)
        self.addCheckBox("Italic", prefix, parent, gsizer, pad)
        self.addCheckBox("Bold", prefix, parent, gsizer, pad)
        self.addCheckBox("Underlined", prefix, parent, gsizer, pad)

        hsizer.Add(gsizer, 0, wx.EXPAND)

        return hsizer 
开发者ID:trelby,项目名称:trelby,代码行数:22,代码来源:cfgdlg.py

示例2: doLayout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def doLayout(self):
        boxSizer = wx.BoxSizer(orient=wx.HORIZONTAL)
        gridSizer = wx.FlexGridSizer(rows=3, cols=2, vgap=10, hgap=10)

        # Prepare some reusable arguments for calling sizer.Add():
        expandOption = dict(flag=wx.EXPAND)
        noOptions = dict()
        emptySpace = ((0, 0), noOptions)

        # Add the controls to the sizers:
        for control, options in \
                [(self.flagLabel, noOptions),
                  emptySpace,
                 (self.flagsRadioBox, noOptions),
                 (self.commentText, expandOption),
                 (self.okButton, dict(flag=wx.ALIGN_CENTER)),
                 (self.closeButton, dict(flag=wx.ALIGN_CENTER))]:
            gridSizer.Add(control, **options)

        for control, options in \
                [(gridSizer, dict(border=5, flag=wx.ALL))]:
            boxSizer.Add(control, **options)

        self.SetSizerAndFit(boxSizer) 
开发者ID:geomagpy,项目名称:magpy,代码行数:26,代码来源:developpage.py

示例3: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def __init__(self, parent, help_entries):
        wx.Dialog.__init__(self, parent, title="Help",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)
        grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
        # create and add the entries
        bold = self.GetFont().MakeBold()
        for r, row in enumerate(self.headers + help_entries):
            for (col, width) in zip(row, self.widths):
                label = wx.StaticText(self, label=col)
                if r == 0:
                    label.SetFont(bold)
                label.Wrap(width)
                grid_sizer.Add(label, 0, 0, 0)
        # finalize layout, create button
        sizer.Add(grid_sizer, 0, wx.ALL, 6)
        OK = wx.Button(self, wx.ID_OK)
        sizer.Add(OK, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
        self.SetSizer(sizer)
        sizer.Fit(self)
        self.Layout()
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        OK.Bind(wx.EVT_BUTTON, self.OnClose) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:26,代码来源:backend_wx.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def __init__(self, parent, title):
        style = wx.DEFAULT_DIALOG_STYLE
        vbox = wx.BoxSizer(wx.VERTICAL)
        wx.Dialog.__init__(self, parent, -1, title, style=style)
        self.user_lbl = wx.StaticText(self, -1, STR_USERNAME)
        self.txt_username = wx.TextCtrl(self, -1, "")
        self.pass_lbl = wx.StaticText(self, -1, STR_PASSWORD)
        self.txt_pass = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD)
        grid_sizer_1 = wx.FlexGridSizer(2, 2, 5, 5)
        grid_sizer_1.Add(self.user_lbl, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)
        grid_sizer_1.Add(self.txt_username, 0, wx.EXPAND, 0)
        grid_sizer_1.Add(self.pass_lbl, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)
        grid_sizer_1.Add(self.txt_pass, 0, wx.EXPAND, 0)
        buttons = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        vbox.Add(grid_sizer_1, wx.EXPAND | wx.ALL, 10)
        vbox.Add(buttons)
        self.SetSizerAndFit(vbox) 
开发者ID:theRealTacoTime,项目名称:poclbm,代码行数:19,代码来源:guiminer.py

示例5: __do_layout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def __do_layout(self):
        # begin wxGlade: webcamPreviewDialog.__do_layout
        grid_sizer_24 = wx.FlexGridSizer(2, 1, 0, 0)
        sizer_3 = wx.FlexGridSizer(1, 1, 0, 0)
        sizer_3.Add(self.previewbitmap, 0, wx.EXPAND, 0)
        self.panel_1.SetSizer(sizer_3)
        sizer_3.AddGrowableRow(0)
        sizer_3.AddGrowableCol(0)
        grid_sizer_24.Add(self.panel_1, 1, wx.EXPAND, 0)
        grid_sizer_24.Add(self.previewokbutton, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
        self.SetSizer(grid_sizer_24)
        grid_sizer_24.AddGrowableRow(0)
        grid_sizer_24.AddGrowableCol(0)
        self.Layout()
        # end wxGlade

# end of class webcamPreviewDialog 
开发者ID:collingreen,项目名称:chronolapse,代码行数:19,代码来源:chronolapsegui.py

示例6: _init_sizers

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def _init_sizers(self):
        self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
        self.MainSizer = wx.FlexGridSizer(cols=3, hgap=15, rows=1, vgap=0)
        self.LeftGridSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
        self.MiddleGridSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=40)
        self.RightGridSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
        
        self._init_coll_flexGridSizer1_Items(self.flexGridSizer1)
        self._init_coll_flexGridSizer1_Growables(self.flexGridSizer1)
        self._init_coll_MainSizer_Items(self.MainSizer)
        self._init_coll_MainSizer_Growables(self.MainSizer)
        self._init_coll_LeftGridSizer_Items(self.LeftGridSizer)
        self._init_coll_LeftGridSizer_Growables(self.LeftGridSizer)
        self._init_coll_MiddleGridSizer_Items(self.MiddleGridSizer)
        self._init_coll_MiddleGridSizer_Growables(self.MiddleGridSizer)
        self._init_coll_RightGridSizer_Items(self.RightGridSizer)
        self._init_coll_RightGridSizer_Growables(self.RightGridSizer)
        
        self.SetSizer(self.flexGridSizer1) 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:21,代码来源:commondialogs.py

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def __init__(self, parent, label, xxx):
        ParamPage.__init__(self, parent, xxx)
        box = wx.StaticBox(self, -1, label)
        box.SetFont(g.labelFont())
        topSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        sizer = wx.FlexGridSizer(len(xxx.styles), 2, 0, 1)
        sizer.AddGrowableCol(1)
        for param in xxx.styles:
            present = xxx.params.has_key(param)
            check = wx.CheckBox(self, paramIDs[param],
                               param + ':', size = (LABEL_WIDTH,-1), name = param)
            check.SetValue(present)
            control = paramDict[param](self, name = param)
            control.Enable(present)
            sizer.AddMany([ (check, 0, wx.ALIGN_CENTER_VERTICAL),
                            (control, 0, wx.ALIGN_CENTER_VERTICAL | wx.GROW) ])
            self.checks[param] = check
            self.controls[param] = control
        topSizer.Add(sizer, 1, wx.ALL | wx.EXPAND, 3)
        self.SetAutoLayout(True)
        self.SetSizer(topSizer)
        topSizer.Fit(self)
    # Set data for a cahced page 
开发者ID:andreas-p,项目名称:admin4,代码行数:25,代码来源:panel.py

示例8: __do_layout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def __do_layout(self):
        # begin wxGlade: Frame192.__do_layout
        self.sizer_as_attr = wx.FlexGridSizer(3, 1, 0, 0)
        sizer_local = wx.BoxSizer(wx.HORIZONTAL)
        label_1 = wx.StaticText(self, wx.ID_ANY, _("Just a text"), style=wx.ALIGN_CENTER)
        self.sizer_as_attr.Add(label_1, 1, wx.ALIGN_CENTER | wx.ALL | wx.EXPAND | wx.SHAPED, 5)
        static_line_1 = wx.StaticLine(self, wx.ID_ANY)
        self.sizer_as_attr.Add(static_line_1, 0, wx.ALL | wx.EXPAND, 5)
        sizer_local.Add(self.button_2, 0, 0, 0)
        sizer_local.Add(self.button_1, 0, 0, 0)
        self.sizer_as_attr.Add(sizer_local, 1, wx.ALIGN_RIGHT | wx.ALL, 5)
        self.SetSizer(self.sizer_as_attr)
        self.sizer_as_attr.SetSizeHints(self)
        self.sizer_as_attr.AddGrowableRow(0)
        self.sizer_as_attr.AddGrowableCol(0)
        self.Layout()
        # end wxGlade

# end of class Frame192 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:21,代码来源:bug192.py

示例9: __do_layout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def __do_layout(self):
        # begin wxGlade: MyDialog.__do_layout
        grid_sizer_1 = wx.FlexGridSizer(3, 1, 0, 0)
        sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
        grid_sizer_1.Add(self.text_ctrl_1, 1, wx.ALL | wx.EXPAND, 5)
        grid_sizer_1.Add(self.static_line_1, 0, wx.ALL | wx.EXPAND, 5)
        sizer_1.Add(self.button_2, 0, wx.ALL, 5)
        sizer_1.Add(self.button_1, 0, wx.ALL, 5)
        grid_sizer_1.Add(sizer_1, 1, wx.EXPAND, 0)
        self.SetSizer(grid_sizer_1)
        grid_sizer_1.Fit(self)
        grid_sizer_1.AddGrowableRow(0)
        self.Layout()
        # end wxGlade

# end of class MyDialog 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:18,代码来源:remove_class_inplace_expected.py

示例10: Configure

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def Configure(self, hl=''):

        text=self.text

        dialog = eg.ConfigPanel(self)
        sizer = dialog.sizer
        mySizer = wx.FlexGridSizer(cols=2)

        desc0 = wx.StaticText(dialog, -1, text.LanguageLabel)
        mySizer.Add(desc0, 0,  wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)

        Language = wx.TextCtrl(dialog, -1,hl)
        mySizer.Add(Language, 0, wx.EXPAND|wx.ALL, 5)

        sizer.Add(mySizer, 1, wx.EXPAND)

        while dialog.Affirmed():
            dialog.SetResult(Language.GetValue()) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:20,代码来源:__init__.py

示例11: Configure

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def Configure(self, interval=0.5, link=None):
        panel = eg.ConfigPanel()
        text = self.text
        intervalCtrl = panel.SpinNumCtrl(interval)
        macroCtrl = eg.MacroSelectButton(
            panel,
            eg.text.General.choose,
            text.text4,
            text.text5,
            link
        )

        sizer1 = eg.HBoxSizer(
            (panel.StaticText(text.text1), 0, wx.ALIGN_CENTER_VERTICAL),
            (intervalCtrl, 0, wx.LEFT | wx.RIGHT, 5),
            (panel.StaticText(text.text2), 0, wx.ALIGN_CENTER_VERTICAL),
        )
        mySizer = wx.FlexGridSizer(2, 3, 5, 5)
        mySizer.AddGrowableCol(1, 1)
        mySizer.Add(panel.StaticText(text.text3), 0, wx.ALIGN_CENTER_VERTICAL)
        mySizer.Add(macroCtrl, 1, wx.EXPAND)

        panel.sizer.AddMany(((sizer1), (mySizer, 1, wx.EXPAND | wx.TOP, 5)))
        while panel.Affirmed():
            panel.SetResult(intervalCtrl.GetValue(), macroCtrl.GetValue()) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:27,代码来源:__init__.py

示例12: _create_NetworkEditor

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def _create_NetworkEditor(self, prnt):
        self.NetworkEditor = wx.Panel(
            id=-1, parent=prnt, pos=wx.Point(0, 0),
            size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL)

        NetworkEditorTemplate._init_ctrls(self, self.NetworkEditor)

        main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=1, vgap=0)
        main_sizer.AddGrowableCol(0)
        main_sizer.AddGrowableRow(0)

        main_sizer.AddWindow(self.NetworkNodes, 0, border=5, flag=wx.GROW | wx.ALL)

        self.NetworkEditor.SetSizer(main_sizer)

        return self.NetworkEditor 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:18,代码来源:NetworkEditor.py

示例13: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def __init__(self, parent, controler):
        """
        Constructor
        @param parent: Reference to the parent EtherCATManagementTreebook class
        @param controler: _EthercatSlaveCTN class in EthercatSlave.py
        """
        wx.Panel.__init__(self, parent, -1)
        self.Controler = controler

        self.PDOMonitoringEditorMainSizer = wx.BoxSizer(wx.VERTICAL)
        self.PDOMonitoringEditorInnerMainSizer = wx.FlexGridSizer(cols=1, hgap=10, rows=2, vgap=10)

        self.CallPDOChoicebook = PDOChoicebook(self, controler=self.Controler)
        self.PDOMonitoringEditorInnerMainSizer.Add(self.CallPDOChoicebook, wx.ALL)

        self.PDOMonitoringEditorMainSizer.Add(self.PDOMonitoringEditorInnerMainSizer)

        self.SetSizer(self.PDOMonitoringEditorMainSizer) 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:20,代码来源:EtherCATManagementEditor.py

示例14: _create_EthercatNodeEditor

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def _create_EthercatNodeEditor(self, prnt):
        self.EthercatNodeEditor = wx.Panel(prnt, style=wx.TAB_TRAVERSAL)

        main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
        main_sizer.AddGrowableCol(0)
        main_sizer.AddGrowableRow(1)

        variables_label = wx.StaticText(self.EthercatNodeEditor,
                                        label=_('Variable entries:'))
        main_sizer.AddWindow(variables_label, border=10, flag=wx.TOP | wx.LEFT | wx.RIGHT)

        self.NodeVariables = NodeVariablesSizer(self.EthercatNodeEditor, self.Controler)
        main_sizer.AddSizer(self.NodeVariables, border=10,
                            flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)

        self.EthercatNodeEditor.SetSizer(main_sizer)

        return self.EthercatNodeEditor 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:20,代码来源:ConfigEditor.py

示例15: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import FlexGridSizer [as 别名]
def __init__(self, parent, items):
        wx.Dialog.__init__(self, parent, -1, "Choose scripts",
                           style = wx.DEFAULT_DIALOG_STYLE)

        vsizer = wx.BoxSizer(wx.VERTICAL)

        gsizer = wx.FlexGridSizer(2, 2, 5, 0)

        self.addCombo("first", "Compare script", self, gsizer, items, 0)
        self.addCombo("second", "to", self, gsizer, items, 1)

        vsizer.Add(gsizer)

        self.forceCb = wx.CheckBox(self, -1, "Use same configuration")
        self.forceCb.SetValue(True)
        vsizer.Add(self.forceCb, 0, wx.TOP, 10)

        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        hsizer.Add((1, 1), 1)

        cancelBtn = gutil.createStockButton(self, "Cancel")
        hsizer.Add(cancelBtn)

        okBtn = gutil.createStockButton(self, "OK")
        hsizer.Add(okBtn, 0, wx.LEFT, 10)

        vsizer.Add(hsizer, 0, wx.EXPAND | wx.TOP, 10)

        util.finishWindow(self, vsizer)

        wx.EVT_BUTTON(self, cancelBtn.GetId(), self.OnCancel)
        wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK)

        okBtn.SetFocus() 
开发者ID:trelby,项目名称:trelby,代码行数:37,代码来源:misc.py


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