Python wx.HORIZONTAL Examples

The following are 30 code examples of wx.HORIZONTAL(). 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: displayDialog.py    From Zulu with GNU Affero General Public License v3.0 6 votes vote down vote up
def __do_layout(self):
        # begin wxGlade: DisplayDialog.__do_layout
        sizer_3 = wx.BoxSizer(wx.VERTICAL)
        sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_5 = wx.StaticBoxSizer(self.sizer_5_staticbox, wx.HORIZONTAL)
        sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_4.Add(self.radio_box_crlf, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 10)
        sizer_4.Add(self.radio_box_echo, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 10)
        sizer_4.Add(self.radio_box_unprintable, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 10)
        sizer_3.Add(sizer_4, 0, wx.ALL|wx.EXPAND, 8)
        sizer_5.Add(self.button_font, 0, wx.ALL|wx.EXPAND, 2)
        sizer_5.Add(self.button_forecolor, 1, wx.ALL|wx.EXPAND, 2)
        sizer_5.Add(self.button_backcolor, 1, wx.ALL, 2)
        sizer_3.Add(sizer_5, 1, wx.EXPAND, 0)
        sizer_6.Add(self.button_cancel, 0, wx.LEFT|wx.ALIGN_BOTTOM, 8)
        sizer_6.Add(self.button_ok, 0, wx.LEFT|wx.ALIGN_BOTTOM, 60)
        sizer_3.Add(sizer_6, 1, wx.ALL|wx.EXPAND, 5)
        self.SetSizer(sizer_3)
        sizer_3.Fit(self)
        self.Layout()
        # end wxGlade 
Example #2
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 #3
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 #4
Source File: dfgui.py    From PandasDataFrameGUI with MIT License 6 votes vote down vote up
def __init__(self, parent, columns, df_list_ctrl):
        wx.Panel.__init__(self, parent)

        columns_with_neutral_selection = [''] + list(columns)
        self.columns = columns
        self.df_list_ctrl = df_list_ctrl

        self.figure = Figure(facecolor="white", figsize=(1, 1))
        self.axes = self.figure.add_subplot(111)
        self.canvas = FigureCanvas(self, -1, self.figure)

        chart_toolbar = NavigationToolbar2Wx(self.canvas)

        self.combo_box1 = wx.ComboBox(self, choices=columns_with_neutral_selection, style=wx.CB_READONLY)

        self.Bind(wx.EVT_COMBOBOX, self.on_combo_box_select)

        row_sizer = wx.BoxSizer(wx.HORIZONTAL)
        row_sizer.Add(self.combo_box1, 0, wx.ALL | wx.ALIGN_CENTER, 5)
        row_sizer.Add(chart_toolbar, 0, wx.ALL, 5)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.canvas, 1, flag=wx.EXPAND, border=5)
        sizer.Add(row_sizer)
        self.SetSizer(sizer) 
Example #5
Source File: __init__.py    From BitTorrent with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent, path='', setfunc=None,
                 editable=True,
                 dialog_title=_("Choose a folder..."),
                 button_label=_("&Browse...")):
        wx.BoxSizer.__init__(self, wx.HORIZONTAL)

        self.parent = parent
        self.setfunc = setfunc
        self.dialog_title = dialog_title
        self.button_label = button_label

        self.pathbox = wx.TextCtrl(self.parent, size=(250, -1))
        self.pathbox.SetEditable(editable)
        self.Add(self.pathbox, proportion=1, flag=wx.RIGHT, border=SPACING)
        self.pathbox.SetValue(path)

        self.button = PathDialogButton(parent,
                                       gen_dialog=self.dialog,
                                       setfunc=self.set_choice,
                                       label=self.button_label)

        self.Add(self.button) 
Example #6
Source File: tree.py    From wxGlade with MIT License 6 votes vote down vote up
def _set_cur_widget(self, editor):
        # set self.cur_widget; adjust label colors and bold if required (on Windows)
        if self.cur_widget and wx.Platform == "__WXMSW__" and self.cur_widget.item:
            item = self.cur_widget.item
            self.SetItemTextColour(item, wx.NullColour)
            self.SetItemBold( item, False )
        self.cur_widget = editor
        item = editor.item
        self.EnsureVisible(item)
        # ensure that the icon is visible
        text_rect = self.GetBoundingRect(item, True)
        if text_rect.x<22:
            self.SetScrollPos(wx.HORIZONTAL, self.GetScrollPos(wx.HORIZONTAL) - 22 + text_rect.x)
        if wx.Platform == "__WXMSW__":
            self.SetItemBold(item, True)
            self.SetItemTextColour(item, wx.BLUE)
        s = editor._get_tooltip_string()
        common.main.user_message( s and s.replace("\n", " ") or "" ) 
Example #7
Source File: static_line.py    From wxGlade with MIT License 6 votes vote down vote up
def builder(parent, index):
    "factory function for editor objects from GUI"
    dialog = wcodegen.WidgetStyleSelectionDialog(_('wxStaticLine'), _('Orientation'), 'wxLI_HORIZONTAL|wxLI_VERTICAL')
    with misc.disable_stay_on_top(common.adding_window or parent):
        res = dialog.ShowModal()
    style = dialog.get_selection()
    dialog.Destroy()
    if res != wx.ID_OK:
        return

    name = parent.toplevel_parent.get_next_contained_name('static_line_%d')
    with parent.frozen():
        editor = EditStaticLine(name, parent, index, style)
        if parent.IS_SIZER and "orient" in parent.properties and parent.orient:
            if ( (parent.orient & wx.VERTICAL   and style=="wxLI_HORIZONTAL") or 
                 (parent.orient & wx.HORIZONTAL and style=="wxLI_VERTICAL") ):
                editor.properties["flag"].add("wxEXPAND")
        if parent.widget: editor.create()
    return editor 
Example #8
Source File: edit_sizers.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, parent, title):
        wx.Dialog.__init__(self, parent, -1, title)
        self.sizer = sizer = wx.BoxSizer(wx.VERTICAL)
        self.message = wx.StaticText(self, -1, "")
        sizer.Add(self.message, 0, wx.TOP | wx.LEFT | wx.RIGHT | wx.EXPAND, 10)
        self.choices = wx.CheckListBox(self, -1, choices=[])
        sizer.Add(self.choices, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 10)
        sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL, 10)
        sz2 = wx.BoxSizer(wx.HORIZONTAL)
        sz2.Add(wx.Button(self, wx.ID_OK, ""), 0, wx.ALL, 10)
        sz2.Add(wx.Button(self, wx.ID_CANCEL, ""), 0, wx.ALL, 10)
        sizer.Add(sz2, 0, wx.ALIGN_CENTER)
        self.SetAutoLayout(True)
        self.SetSizer(sizer)
        sizer.Fit(self)
        self.CenterOnScreen() 
Example #9
Source File: edit_sizers.py    From wxGlade with MIT License 6 votes vote down vote up
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 
Example #10
Source File: ConfigPanel.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def AddGrid(self, grid, vgap=6, hgap=5):
        columns = self.maxRowNum
        sizer = wx.GridBagSizer(vgap, hgap)
        sizer.SetFlexibleDirection(wx.HORIZONTAL)
        rowFlagsGet = self.rowFlags.get
        colFlagsGet = self.colFlags.get
        for rowNum, (row, kwargs) in enumerate(grid):
            if kwargs.get("growable", False):
                sizer.AddGrowableRow(rowNum)
            for colNum, ctrl in enumerate(row):
                if ctrl is None:
                    ctrl = (1, 1)
                elif type(ctrl) in types.StringTypes:
                    ctrl = wx.StaticText(self, -1, ctrl)

                flags = rowFlagsGet(rowNum, 0) | colFlagsGet(colNum, 0)
                flags |= (wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT)
                sizer.Add(ctrl, (rowNum, colNum), (1, 1), flags)

            if colNum < columns - 1:
                sizer.SetItemSpan(ctrl, (1, columns - colNum + 1))
        self.sizer.Add(sizer, 1, wx.EXPAND) 
Example #11
Source File: Viewer.py    From OpenPLC_Editor with GNU General Public License v3.0 6 votes vote down vote up
def OnScrollWindow(self, event):
        if self.Editor.HasCapture() and self.StartMousePos is not None:
            return
        if wx.Platform == '__WXMSW__':
            wx.CallAfter(self.RefreshVisibleElements)
            self.Editor.Freeze()
            wx.CallAfter(self.Editor.Thaw)
        elif event.GetOrientation() == wx.HORIZONTAL:
            self.RefreshVisibleElements(xp=event.GetPosition())
        else:
            self.RefreshVisibleElements(yp=event.GetPosition())

        # Handle scroll in debug to fully redraw area and ensuring
        # instance path is fully draw without flickering
        if self.Debug and wx.Platform != '__WXMSW__':
            x, y = self.GetViewStart()
            if event.GetOrientation() == wx.HORIZONTAL:
                self.Scroll(event.GetPosition(), y)
            else:
                self.Scroll(x, event.GetPosition())
        else:
            event.Skip() 
Example #12
Source File: settingsDialog.py    From Zulu with GNU Affero General Public License v3.0 6 votes vote down vote up
def __do_layout(self):
        # begin wxGlade: SerialDialog.__do_layout
        sizer_4 = wx.StaticBoxSizer(self.sizer_4_staticbox, wx.HORIZONTAL)
        grid_sizer_3 = wx.FlexGridSizer(7, 2, 2, 2)
        grid_sizer_3.Add(self.label_port, 0, wx.LEFT, 8)
        grid_sizer_3.Add(self.combo_box_port, 0, 0, 0)
        grid_sizer_3.Add(self.label_baudrate, 0, wx.LEFT, 8)
        grid_sizer_3.Add(self.combo_box_baudrate, 0, 0, 0)
        grid_sizer_3.Add(self.label_bytesize, 0, wx.LEFT, 8)
        grid_sizer_3.Add(self.combo_box_bytesize, 0, 0, 0)
        grid_sizer_3.Add(self.label_parity, 0, wx.LEFT, 8)
        grid_sizer_3.Add(self.combo_box_parity, 0, 0, 0)
        grid_sizer_3.Add(self.label_stopbits, 0, wx.LEFT, 8)
        grid_sizer_3.Add(self.combo_box_stopbits, 0, 0, 0)
        grid_sizer_3.Add(self.radio_box_rtscts, 0, wx.RIGHT|wx.TOP|wx.BOTTOM, 8)
        grid_sizer_3.Add(self.radio_box_xonxoff, 0, wx.LEFT|wx.TOP|wx.BOTTOM|wx.ALIGN_RIGHT, 8)
        grid_sizer_3.Add(self.button_cancel, 0, 0, 0)
        grid_sizer_3.Add(self.button_ok, 0, wx.ALIGN_RIGHT, 0)
        sizer_4.Add(grid_sizer_3, 1, wx.ALL|wx.EXPAND, 6)
        self.SetSizer(sizer_4)
        sizer_4.Fit(self)
        self.Layout()
        # end wxGlade 
Example #13
Source File: Viewer.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def OnViewerMiddleDown(self, event):
        self.Editor.CaptureMouse()
        self.StartMousePos = event.GetPosition()
        self.StartScreenPos = self.GetScrollPos(wx.HORIZONTAL), self.GetScrollPos(wx.VERTICAL)
        event.Skip() 
Example #14
Source File: edit_sizers.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, name, parent, index, elements=0):
        # elements: number of slots
        BoxSizerBase.__init__(self, name, parent, index, wx.HORIZONTAL, elements) 
Example #15
Source File: RotarySettings.py    From meerk40t with MIT License 5 votes vote down vote up
def __do_layout(self):
        # begin wxGlade: RotarySettings.__do_layout
        sizer_main = wx.BoxSizer(wx.VERTICAL)
        sizer_circumference = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Object Circumference")), wx.HORIZONTAL)
        sizer_20 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Roller Circumference")), wx.HORIZONTAL)
        sizer_steps = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Rotation Steps")), wx.HORIZONTAL)
        sizer_x = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Scale X")), wx.HORIZONTAL)
        sizer_y = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Scale Y")), wx.HORIZONTAL)
        sizer_main.Add(self.checkbox_rotary, 0, 0, 0)
        sizer_y.Add(self.spin_rotary_scaley, 0, 0, 0)
        sizer_main.Add(sizer_y, 0, wx.EXPAND, 0)
        sizer_x.Add(self.spin_rotary_scalex, 0, 0, 0)
        sizer_main.Add(sizer_x, 0, wx.EXPAND, 0)
        sizer_main.Add((20, 20), 0, 0, 0)
        sizer_main.Add(self.checkbox_rotary_loop, 0, 0, 0)
        sizer_steps.Add(self.spin_rotary_rotation, 0, 0, 0)
        label_steps = wx.StaticText(self, wx.ID_ANY, _("steps"))
        sizer_steps.Add(label_steps, 0, 0, 0)
        sizer_main.Add(sizer_steps, 0, wx.EXPAND, 0)
        sizer_20.Add(self.checkbox_rotary_roller, 0, 0, 0)
        sizer_20.Add(self.spin_rotary_roller_circumference, 0, 0, 0)
        label_mm = wx.StaticText(self, wx.ID_ANY, _("mm"))
        sizer_20.Add(label_mm, 0, 0, 0)
        sizer_main.Add(sizer_20, 0, wx.EXPAND, 0)
        sizer_circumference.Add(self.spin_rotary_object_circumference, 0, 0, 0)
        label_mm2 = wx.StaticText(self, wx.ID_ANY, _("mm"))
        sizer_circumference.Add(label_mm2, 0, 0, 0)
        sizer_main.Add(sizer_circumference, 0, wx.EXPAND, 0)
        self.SetSizer(sizer_main)
        self.Layout()
        # end wxGlade 
Example #16
Source File: Utils.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *items):
        wx.BoxSizer.__init__(self, wx.HORIZONTAL)
        self.AddMany(items) 
Example #17
Source File: cfgdlg.py    From trelby with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, id, cfg):
        wx.Panel.__init__(self, parent, id)
        self.cfg = cfg

        vsizer = wx.BoxSizer(wx.VERTICAL)

        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        hsizer.Add(wx.StaticText(self, -1, "Element:"), 0,
                   wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 10)

        self.elementsCombo = wx.ComboBox(self, -1, style = wx.CB_READONLY)

        for t in config.getTIs():
            self.elementsCombo.Append(t.name, t.lt)

        hsizer.Add(self.elementsCombo, 0)

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

        vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 10)

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

        self.addTypeCombo("newEnter", "Enter creates", self, gsizer)
        self.addTypeCombo("newTab", "Tab creates", self, gsizer)
        self.addTypeCombo("nextTab", "Tab switches to", self, gsizer)
        self.addTypeCombo("prevTab", "Shift+Tab switches to", self, gsizer)

        vsizer.Add(gsizer)

        util.finishWindow(self, vsizer, center = False)

        wx.EVT_COMBOBOX(self, self.elementsCombo.GetId(), self.OnElementCombo)

        self.elementsCombo.SetSelection(0)
        self.OnElementCombo() 
Example #18
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, plString="",repeat=2,shuffle=2,crossfade=2, clear = True):
        panel = eg.ConfigPanel(self)
        text = self.text
        textCtrl = wx.TextCtrl(panel, -1, plString)
        repeatChkBoxCtrl = wx.CheckBox(panel, label=Text.repeat,style=wx.CHK_3STATE|wx.CHK_ALLOW_3RD_STATE_FOR_USER)
        repeatChkBoxCtrl.Set3StateValue(repeat)
        shuffleChkBoxCtrl = wx.CheckBox(panel, label=Text.shuffle,style=wx.CHK_3STATE|wx.CHK_ALLOW_3RD_STATE_FOR_USER)
        shuffleChkBoxCtrl.Set3StateValue(shuffle)
        crossfadeChkBoxCtrl = wx.CheckBox(panel, label=Text.crossfade,style=wx.CHK_3STATE|wx.CHK_ALLOW_3RD_STATE_FOR_USER)
        crossfadeChkBoxCtrl.Set3StateValue(crossfade)
        clearPlaylistChkBoxCtrl = wx.CheckBox(panel, label=Text.clearPlaylist)
        clearPlaylistChkBoxCtrl.SetValue(clear)
        SizerAdd = panel.sizer.Add
        SizerAdd(wx.StaticText(panel, -1, text.playlistName))
        SizerAdd(textCtrl, 0, wx.EXPAND)
        leftSizer = wx.BoxSizer(wx.VERTICAL)
        bottmSizer = wx.BoxSizer(wx.HORIZONTAL)
        bottmSizer.Add(leftSizer,2,wx.EXPAND)
        SizerAdd(bottmSizer,0,wx.EXPAND)
        leftSizer.Add(repeatChkBoxCtrl,0,wx.TOP,15,)
        leftSizer.Add(shuffleChkBoxCtrl,0,wx.TOP,15)
        leftSizer.Add(crossfadeChkBoxCtrl,0,wx.TOP,15)
        leftSizer.Add(clearPlaylistChkBoxCtrl,0,wx.TOP,15)

        while panel.Affirmed():
            panel.SetResult(
                textCtrl.GetValue(),
                repeatChkBoxCtrl.Get3StateValue(),
                shuffleChkBoxCtrl.Get3StateValue(),
                crossfadeChkBoxCtrl.Get3StateValue(),
                clearPlaylistChkBoxCtrl.GetValue(),
            ) 
Example #19
Source File: ConfigPanel.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def FinishSetup(self):
        self.shown = True
        if self.lines:
            self.AddGrid(self.lines, *self.sizerProps)
        spaceSizer = wx.BoxSizer(wx.HORIZONTAL)
        spaceSizer.Add((2, 2))
        spaceSizer.Add(self.sizer, 1, wx.EXPAND | wx.TOP | wx.BOTTOM, 3)
        spaceSizer.Add((4, 4))
        self.SetSizerAndFit(spaceSizer)

        #self.dialog.FinishSetup()
        def OnEvent(dummyEvent):
            self.SetIsDirty()
        self.Bind(wx.EVT_CHECKBOX, OnEvent)
        self.Bind(wx.EVT_BUTTON, OnEvent)
        self.Bind(wx.EVT_CHOICE, OnEvent)
        self.Bind(wx.EVT_TOGGLEBUTTON, OnEvent)
        self.Bind(wx.EVT_TEXT, OnEvent)
        self.Bind(wx.EVT_RADIOBOX, OnEvent)
        self.Bind(wx.EVT_RADIOBUTTON, OnEvent)
        self.Bind(wx.EVT_TREE_SEL_CHANGED, OnEvent)
        self.Bind(wx.EVT_DATE_CHANGED, OnEvent)
        self.Bind(eg.EVT_VALUE_CHANGED, OnEvent)
        self.Bind(wx.EVT_CHECKLISTBOX, OnEvent)
        self.Bind(wx.EVT_SCROLL, OnEvent)
        self.Bind(wx.EVT_LISTBOX, OnEvent) 
Example #20
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, sep='', res = True):
        panel = eg.ConfigPanel(self)
        sepLbl = wx.StaticText(panel,-1,self.plugin.text.sepLabel)
        sepCtrl = wx.TextCtrl(panel,-1,sep)
        sepLbl.SetToolTip(wx.ToolTip(self.plugin.text.sepToolTip))
        sepCtrl.SetToolTip(wx.ToolTip(self.plugin.text.sepToolTip))
        resCtrl = wx.CheckBox(panel, -1, self.plugin.text.resType)
        resCtrl.SetValue(res)


        def onResCtrl(evt = None):
            enable = resCtrl.GetValue()
            sepCtrl.Enable(enable)
            sepLbl.Enable(enable)
            if evt:
                evt.Skip()
        resCtrl.Bind(wx.EVT_CHECKBOX, onResCtrl)
        onResCtrl()

        mySizer = wx.BoxSizer(wx.HORIZONTAL)
        panel.sizer.Add(resCtrl, 0, wx.TOP, 30)
        panel.sizer.Add(mySizer,0,wx.TOP,15)
        mySizer.Add(sepLbl,0,wx.TOP,3)
        mySizer.Add((10,1))
        mySizer.Add(sepCtrl)
        while panel.Affirmed():
            panel.SetResult(
                sepCtrl.GetValue(),
                resCtrl.GetValue()
            ) 
Example #21
Source File: item_sizer.py    From iqiyi-parser with MIT License 5 votes vote down vote up
def __init__(self, parent, current_byte, total_byte, **kwargs):
        wx.BoxSizer.__init__(self, wx.HORIZONTAL)
        self.SetMinSize(wx.Size(-1, 10))
        self.parent = parent

        self.text_name = None
        self.text_percent = None
        self.text_speed = None
        self.text_progress = None

        self.total = total_byte

        self.gauge_progress = None

        self.initWidget(current=current_byte, **kwargs) 
Example #22
Source File: templates_ui.py    From wxGlade with MIT License 5 votes vote down vote up
def __do_layout(self):
        # begin wxGlade: TemplateInfoDialog.__do_layout
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_5 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Instructions")), wx.HORIZONTAL)
        sizer_4 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Description")), wx.HORIZONTAL)
        sizer_3 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Author")), wx.HORIZONTAL)
        sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
        label_template_name = wx.StaticText(self, wx.ID_ANY, _("wxGlade template: "))
        label_template_name.SetFont(wx.Font(-1, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
        sizer_2.Add(label_template_name, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 10)
        sizer_2.Add(self.template_name, 1, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 10)
        sizer_1.Add(sizer_2, 0, wx.EXPAND, 0)
        sizer_3.Add(self.author, 1, 0, 0)
        sizer_1.Add(sizer_3, 0, wx.ALL | wx.EXPAND, 5)
        sizer_4.Add(self.description, 1, wx.EXPAND, 0)
        sizer_1.Add(sizer_4, 1, wx.ALL | wx.EXPAND, 5)
        sizer_5.Add(self.instructions, 1, wx.EXPAND, 0)
        sizer_1.Add(sizer_5, 1, wx.ALL | wx.EXPAND, 5)
        sizer_6.Add(self.button_1, 0, 0, 0)
        sizer_6.Add(self.button_2, 0, wx.LEFT, 10)
        sizer_1.Add(sizer_6, 0, wx.ALIGN_RIGHT | wx.ALL, 10)
        self.SetSizer(sizer_1)
        self.Layout()
        self.Centre()
        # end wxGlade

# end of class TemplateInfoDialog 
Example #23
Source File: JobInfo.py    From meerk40t with MIT License 5 votes vote down vote up
def __do_layout(self):
        # begin wxGlade: JobInfo.__do_layout
        sizer_2 = wx.BoxSizer(wx.VERTICAL)
        sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_1 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Operations and Commands")), wx.HORIZONTAL)
        sizer_1.Add(self.operations_listbox, 10, wx.EXPAND, 0)
        sizer_1.Add(self.commands_listbox, 3, wx.EXPAND, 0)
        sizer_2.Add(sizer_1, 10, wx.EXPAND, 0)
        sizer_3.Add(self.button_writer_control, 1, wx.EXPAND, 0)
        sizer_3.Add(self.button_job_spooler, 0, 0, 0)
        sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
        self.SetSizer(sizer_2)
        self.Layout()
        self.Centre()
        # end wxGlade 
Example #24
Source File: Settings.py    From meerk40t with MIT License 5 votes vote down vote up
def __do_layout(self):
        # begin wxGlade: Settings.__do_layout
        sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_6 = wx.BoxSizer(wx.VERTICAL)
        sizer_5 = wx.BoxSizer(wx.VERTICAL)
        sizer_2 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Language")), wx.HORIZONTAL)
        sizer_5.Add(self.radio_units, 0, wx.EXPAND, 0)
        sizer_2.Add(self.combo_language, 0, 0, 0)
        sizer_5.Add(sizer_2, 0, wx.EXPAND, 0)
        sizer_1.Add(sizer_5, 1, wx.EXPAND, 0)
        sizer_6.Add(self.checklist_options, 1, wx.EXPAND, 0)
        sizer_1.Add(sizer_6, 1, wx.EXPAND, 0)
        self.SetSizer(sizer_1)
        self.Layout()
        # end wxGlade 
Example #25
Source File: edit_base.py    From wxGlade with MIT License 5 votes vote down vote up
def _get_tree_image(self):
        "Get an image name for tree display"
        if self.parent.WX_CLASS=="wxSplitterWindow":
            return 'EditSplitterSlot-%s'%self.parent._get_label(self.index)  # 'Left', 'Right', 'Top', 'Bottom'

        if not self.parent.IS_SIZER: return "EditSlot"
        name = "EditSizerSlot"
        if "orient" in self.parent.properties:
            sizer_orient = self.parent.orient
            if sizer_orient is not None:
                if sizer_orient==wx.VERTICAL:
                    name = "EditVerticalSizerSlot"
                elif sizer_orient==wx.HORIZONTAL:
                    name = "EditHorizontalSizerSlot"
        return name 
Example #26
Source File: control.py    From atbswp with GNU General Public License v3.0 5 votes vote down vote up
def init_ui(self):
        """Initialize the UI elements"""
        pnl = wx.Panel(self)
        sizer = wx.BoxSizer(orient=wx.HORIZONTAL)
        self.slider = wx.Slider(parent=pnl, id=wx.ID_ANY, value=self._current_value,
                                minValue=self.min_value, maxValue=self.max_value,
                                name="Choose a number", size=self.GetSize(),
                                style=wx.SL_VALUE_LABEL | wx.SL_AUTOTICKS)
        sizer.Add(self.slider)
        pnl.SetSizer(sizer)
        sizer.Fit(self) 
Example #27
Source File: ForceVariableDialog.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def InitCtrlNumber(self, info_sizer, defaultValue):
        """Add controls to change float and integer variables"""
        sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.InitCtrlDefault(sizer, defaultValue)
        self.SpinButtonCtrl = wx.SpinButton(self, style=wx.HORIZONTAL | wx.SP_WRAP)
        sizer.AddWindow(self.SpinButtonCtrl, border=10,
                        flag=wx.ALIGN_LEFT | wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT | wx.EXPAND)
        self.Bind(wx.EVT_SPIN_UP, self.SpinButtonChanged)
        self.Bind(wx.EVT_SPIN_DOWN, self.SpinButtonChanged)
        info_sizer.AddWindow(sizer, proportion=1, flag=wx.EXPAND) 
Example #28
Source File: Viewer.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def SetScale(self, scale_number, refresh=True, mouse_event=None):
        new_scale = max(0, min(scale_number, len(ZOOM_FACTORS) - 1))
        if self.CurrentScale != new_scale:
            if refresh:
                dc = self.GetLogicalDC()
            self.CurrentScale = new_scale
            self.ViewScale = (ZOOM_FACTORS[self.CurrentScale], ZOOM_FACTORS[self.CurrentScale])
            if refresh:
                self.Editor.Freeze()
                if mouse_event is None:
                    client_size = self.Editor.GetClientSize()
                    mouse_pos = wx.Point(client_size[0] // 2, client_size[1] // 2)
                    mouse_event = wx.MouseEvent(wx.EVT_MOUSEWHEEL.typeId)
                    mouse_event.x = mouse_pos.x
                    mouse_event.y = mouse_pos.y
                else:
                    mouse_pos = mouse_event.GetPosition()
                pos = mouse_event.GetLogicalPosition(dc)
                xmax = self.GetScrollRange(wx.HORIZONTAL) - self.GetScrollThumb(wx.HORIZONTAL)
                ymax = self.GetScrollRange(wx.VERTICAL) - self.GetScrollThumb(wx.VERTICAL)
                scrollx = max(0, round(pos.x * self.ViewScale[0] - mouse_pos.x) / SCROLLBAR_UNIT)
                scrolly = max(0, round(pos.y * self.ViewScale[1] - mouse_pos.y) / SCROLLBAR_UNIT)
                if scrollx > xmax or scrolly > ymax:
                    self.RefreshScrollBars(max(0, scrollx - xmax), max(0, scrolly - ymax))
                    self.Scroll(scrollx, scrolly)
                else:
                    self.Scroll(scrollx, scrolly)
                    self.RefreshScrollBars()
                self.RefreshScaling(refresh)
                self.Editor.Thaw() 
Example #29
Source File: App.py    From PrimarySchoolMathematics with Apache License 2.0 5 votes vote down vote up
def __do_layout(self):
        # begin wxGlade: MyDialog1.__do_layout
        sizer_25 = wx.BoxSizer(wx.VERTICAL)
        sizer_26 = wx.BoxSizer(wx.VERTICAL)
        sizer_30 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_29 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, u"第3处运算符号选择"), wx.HORIZONTAL)
        sizer_28 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, u"第2处运算符号选择"), wx.HORIZONTAL)
        sizer_27 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, u"第1处运算符号选择"), wx.HORIZONTAL)
        label_18 = wx.StaticText(self, wx.ID_ANY, u"此处为多步运算题生成运算符号选择,比如4+8-5=,\n你要做的是选择+和-号位置可以使用什么运算符号。")
        sizer_25.Add(label_18, 0, wx.ALL | wx.EXPAND, 5)
        sizer_27.Add(self.checkbox_2, 0, 0, 0)
        sizer_27.Add(self.checkbox_3, 0, 0, 0)
        sizer_27.Add(self.checkbox_4, 0, 0, 0)
        sizer_27.Add(self.checkbox_5, 0, 0, 0)
        sizer_26.Add(sizer_27, 1, wx.EXPAND, 0)
        sizer_28.Add(self.checkbox_6, 0, 0, 0)
        sizer_28.Add(self.checkbox_7, 0, 0, 0)
        sizer_28.Add(self.checkbox_8, 0, 0, 0)
        sizer_28.Add(self.checkbox_9, 0, 0, 0)
        sizer_26.Add(sizer_28, 1, wx.EXPAND, 0)
        sizer_29.Add(self.checkbox_10, 0, 0, 0)
        sizer_29.Add(self.checkbox_11, 0, 0, 0)
        sizer_29.Add(self.checkbox_12, 0, 0, 0)
        sizer_29.Add(self.checkbox_13, 0, 0, 0)
        sizer_26.Add(sizer_29, 1, wx.EXPAND, 0)
        sizer_30.Add(self.button_9, 0, wx.ALIGN_CENTER, 0)
        sizer_30.Add(self.button_10, 0, wx.ALIGN_CENTER, 0)
        sizer_26.Add(sizer_30, 1, wx.ALIGN_CENTER, 0)
        sizer_25.Add(sizer_26, 1, wx.EXPAND, 0)
        self.SetSizer(sizer_25)
        sizer_25.Fit(self)
        self.Layout()
        # end wxGlade 
Example #30
Source File: templates_ui.py    From wxGlade with MIT License 5 votes vote down vote up
def __do_layout(self):
        # begin wxGlade: TemplateListDialog.__do_layout
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_8 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_4 = wx.BoxSizer(wx.VERTICAL)
        sizer_7 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Instructions")), wx.HORIZONTAL)
        sizer_6 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Description")), wx.HORIZONTAL)
        sizer_5 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Author")), wx.HORIZONTAL)
        sizer_3 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Available templates")), wx.VERTICAL)
        sizer_3.Add(self.template_names, 1, wx.ALL | wx.EXPAND, 3)
        sizer_2.Add(sizer_3, 1, wx.ALL | wx.EXPAND, 5)
        sizer_4.Add(self.template_name, 0, wx.ALL, 7)
        sizer_5.Add(self.author, 1, 0, 0)
        sizer_4.Add(sizer_5, 0, wx.ALL | wx.EXPAND, 5)
        sizer_6.Add(self.description, 1, wx.EXPAND, 0)
        sizer_4.Add(sizer_6, 1, wx.ALL | wx.EXPAND, 5)
        sizer_7.Add(self.instructions, 1, wx.EXPAND, 0)
        sizer_4.Add(sizer_7, 1, wx.ALL | wx.EXPAND, 5)
        sizer_2.Add(sizer_4, 2, wx.EXPAND, 0)
        sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
        sizer_8.Add(self.btn_open, 0, 0, 0)
        sizer_8.Add(self.btn_edit, 0, wx.LEFT, 10)
        sizer_8.Add(self.btn_delete, 0, wx.LEFT, 10)
        sizer_8.Add(self.btn_cancel, 0, wx.LEFT, 10)
        sizer_1.Add(sizer_8, 0, wx.ALIGN_RIGHT | wx.ALL, 10)
        self.SetSizer(sizer_1)
        self.Layout()
        self.Centre()
        # end wxGlade