Python wx.FlexGridSizer() Examples

The following are 30 code examples of wx.FlexGridSizer(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wx , or try the search function .
Example #1
Source File: backend_wx.py    From Mastering-Elasticsearch-7.0 with MIT License 7 votes vote down vote up
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) 
Example #2
Source File: remove_class_inplace_input.py    From wxGlade with MIT License 6 votes vote down vote up
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 
Example #3
Source File: developpage.py    From magpy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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) 
Example #4
Source File: backend_wx.py    From GraphicDesignPatternByPython with MIT License 6 votes vote down vote up
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) 
Example #5
Source File: backend_wx.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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) 
Example #6
Source File: NetworkEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 6 votes vote down vote up
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 
Example #7
Source File: EtherCATManagementEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 6 votes vote down vote up
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)
        sizer = wx.FlexGridSizer(cols=1, hgap=20, rows=3, vgap=20)

        line = wx.StaticText(self, -1, "\n  EEPROM Access is composed to SmartView and HexView. \
                                              \n\n   - SmartView shows Config Data, Device Identity, Mailbox settings, etc. \
                                              \n\n   - HexView shows EEPROM's contents.")

        sizer.Add(line)

        self.SetSizer(sizer)


# -------------------------------------------------------------------------------
#                    For Smart View Panel
# ------------------------------------------------------------------------------- 
Example #8
Source File: panel.py    From admin4 with Apache License 2.0 6 votes vote down vote up
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 
Example #9
Source File: bug192.py    From wxGlade with MIT License 6 votes vote down vote up
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 
Example #10
Source File: ConfigEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 6 votes vote down vote up
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 
Example #11
Source File: cfgdlg.py    From trelby with GNU General Public License v2.0 6 votes vote down vote up
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 
Example #12
Source File: EtherCATManagementEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #13
Source File: guiminer.py    From poclbm with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #14
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def Configure(self, link=None):
        panel = eg.ConfigPanel()
        text = self.text
        actionCtrl = eg.ActionSelectButton(
            panel,
            eg.text.General.choose,
            text.text1,
            text.text2,
            link
        )
        mySizer = wx.FlexGridSizer(2, 2, 5, 5)
        mySizer.AddGrowableCol(1)
        mySizer.Add(panel.StaticText(text.text0), 0, wx.ALIGN_CENTER_VERTICAL)
        mySizer.Add(actionCtrl, 1, wx.EXPAND)
        panel.sizer.Add(mySizer, 1, wx.EXPAND | wx.ALL, 5)

        while panel.Affirmed():
            panel.SetResult(actionCtrl.GetValue()) 
Example #15
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def Configure(self, interval=2.0, 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()) 
Example #16
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
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()) 
Example #17
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def Configure(self, country_code="be", 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)

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

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

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

        while dialog.Affirmed():
            dialog.SetResult(Country.GetValue(),Language.GetValue()) 
Example #18
Source File: chronolapsegui.py    From chronolapse with MIT License 6 votes vote down vote up
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 
Example #19
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
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()) 
Example #20
Source File: commondialogs.py    From CANFestivino with GNU Lesser General Public License v2.1 6 votes vote down vote up
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) 
Example #21
Source File: backend_wx.py    From CogAlg with MIT License 6 votes vote down vote up
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) 
Example #22
Source File: commondialogs.py    From CANFestivino with GNU Lesser General Public License v2.1 6 votes vote down vote up
def _init_sizers(self):
        self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
        self.MainSizer = wx.BoxSizer(wx.HORIZONTAL)
        self.LeftGridSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=5)
        self.RightBoxSizer = wx.StaticBoxSizer(self.staticBox1, wx.VERTICAL)
        self.RightBoxGridSizer = wx.FlexGridSizer(cols=2, hgap=5, rows=3, vgap=10)
        
        self._init_coll_flexGridSizer1_Items(self.flexGridSizer1)
        self._init_coll_flexGridSizer1_Growables(self.flexGridSizer1)
        self._init_coll_MainSizer_Items(self.MainSizer)
        self._init_coll_LeftGridSizer_Items(self.LeftGridSizer)
        self._init_coll_LeftGridSizer_Growables(self.LeftGridSizer)
        self._init_coll_RightBoxSizer_Items(self.RightBoxSizer)
        self._init_coll_RightBoxGridSizer_Items(self.RightBoxGridSizer)
        self._init_coll_RightBoxGridSizer_Growables(self.RightBoxGridSizer)
        
        self.SetSizer(self.flexGridSizer1) 
Example #23
Source File: backend_wx.py    From coffeegrindsize with MIT License 6 votes vote down vote up
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) 
Example #24
Source File: add_class_inplace_orig.py    From wxGlade with MIT License 6 votes vote down vote up
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 
Example #25
Source File: add_class_inplace_extended.py    From wxGlade with MIT License 6 votes vote down vote up
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 
Example #26
Source File: remove_class_inplace_expected.py    From wxGlade with MIT License 6 votes vote down vote up
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 
Example #27
Source File: ComplexExample_30_Phoenix.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrameGrid.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((492, 300))
        self.SetTitle(_("FrameOggCompressionDetails"))

        self._szr_frame = wx.BoxSizer(wx.VERTICAL)

        self.grid_sizer = wx.FlexGridSizer(3, 1, 0, 0)
        self._szr_frame.Add(self.grid_sizer, 1, wx.EXPAND, 0)

        self.grid = wx.grid.Grid(self, wx.ID_ANY, size=(1, 1))
        self.grid.CreateGrid(8, 3)
        self.grid_sizer.Add(self.grid, 1, wx.EXPAND, 0)

        self.static_line = wx.StaticLine(self, wx.ID_ANY)
        self.grid_sizer.Add(self.static_line, 0, wx.ALL | wx.EXPAND, 5)

        self.button = wx.Button(self, wx.ID_CLOSE, "")
        self.button.SetFocus()
        self.button.SetDefault()
        self.grid_sizer.Add(self.button, 0, wx.ALIGN_RIGHT | wx.ALL, 5)

        self.grid_sizer.AddGrowableRow(0)
        self.grid_sizer.AddGrowableCol(0)

        self.SetSizer(self._szr_frame)
        self._szr_frame.SetSizeHints(self)

        self.Layout()
        # end wxGlade

# end of class MyFrameGrid 
Example #28
Source File: ComplexExample_30_Classic.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrameGrid.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((492, 300))
        self.SetTitle(_("FrameOggCompressionDetails"))

        self._szr_frame = wx.BoxSizer(wx.VERTICAL)

        self.grid_sizer = wx.FlexGridSizer(3, 1, 0, 0)
        self._szr_frame.Add(self.grid_sizer, 1, wx.EXPAND, 0)

        self.grid = wx.grid.Grid(self, wx.ID_ANY, size=(1, 1))
        self.grid.CreateGrid(8, 3)
        self.grid_sizer.Add(self.grid, 1, wx.EXPAND, 0)

        self.static_line = wx.StaticLine(self, wx.ID_ANY)
        self.grid_sizer.Add(self.static_line, 0, wx.ALL | wx.EXPAND, 5)

        self.button = wx.Button(self, wx.ID_CLOSE, "")
        self.button.SetFocus()
        self.button.SetDefault()
        self.grid_sizer.Add(self.button, 0, wx.ALIGN_RIGHT | wx.ALL, 5)

        self.grid_sizer.AddGrowableRow(0)
        self.grid_sizer.AddGrowableCol(0)

        self.SetSizer(self._szr_frame)
        self._szr_frame.SetSizeHints(self)

        self.Layout()
        # end wxGlade

# end of class MyFrameGrid 
Example #29
Source File: spacer.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self):
        wx.Dialog.__init__(self, common.main, -1, _("Enter size"), wx.GetMousePosition())
        # the controls
        self.width  = wx.SpinCtrl(self, -1, "20")
        self.height = wx.SpinCtrl(self, -1, "20")
        self.width.SetFocus()
        self.width.SetSelection(-1, -1)
        self.height.SetSelection(-1, -1)
        # the main sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # grid sizer with the controls
        gsizer = wx.FlexGridSizer(cols=2)
        for label, control in [("Width", self.width), ("Height", self.height)]:
            gsizer.Add(wx.StaticText(self, -1, _(label)), 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
            gsizer.Add(control, 0, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
        sizer.Add(gsizer)
        # horizontal sizer for action buttons
        hsizer = wx.BoxSizer(wx.HORIZONTAL)
        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)
        sizer.Add(hsizer, 0, wx.EXPAND|wx.ALIGN_CENTER )

        self.SetAutoLayout(True)
        self.SetSizer(sizer)
        sizer.Fit(self) 
Example #30
Source File: PyOgg2_MyFrame.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: PyOgg2_MyFrame.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((400, 300))
        self.SetTitle(_("FrameOggCompressionDetails"))

        sizer_5 = wx.BoxSizer(wx.VERTICAL)

        grid_sizer_3 = wx.FlexGridSizer(3, 1, 0, 0)
        sizer_5.Add(grid_sizer_3, 1, wx.EXPAND, 0)

        self.grid_1 = wx.grid.Grid(self, wx.ID_ANY, size=(1, 1))
        self.grid_1.CreateGrid(8, 3)
        grid_sizer_3.Add(self.grid_1, 1, wx.EXPAND, 0)

        self.static_line_2 = wx.StaticLine(self, wx.ID_ANY)
        grid_sizer_3.Add(self.static_line_2, 0, wx.ALL | wx.EXPAND, 5)

        self.button_6 = wx.Button(self, wx.ID_CLOSE, "")
        self.button_6.SetFocus()
        self.button_6.SetDefault()
        grid_sizer_3.Add(self.button_6, 0, wx.ALIGN_RIGHT | wx.ALL, 5)

        grid_sizer_3.AddGrowableRow(0)
        grid_sizer_3.AddGrowableCol(0)

        self.SetSizer(sizer_5)

        self.Layout()
        # end wxGlade