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


Python wx.HORIZONTAL属性代码示例

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


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

示例1: addTextStyles

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [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 HORIZONTAL [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 HORIZONTAL [as 别名]
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) 
开发者ID:bluenote10,项目名称:PandasDataFrameGUI,代码行数:27,代码来源:dfgui.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
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) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:24,代码来源:__init__.py

示例5: _set_cur_widget

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
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 "" ) 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:20,代码来源:tree.py

示例6: builder

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
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 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:21,代码来源:static_line.py

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
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() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:18,代码来源:edit_sizers.py

示例8: builder

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [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

示例9: AddGrid

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
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) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:24,代码来源:ConfigPanel.py

示例10: OnScrollWindow

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
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() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:24,代码来源:Viewer.py

示例11: __do_layout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
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 
开发者ID:nccgroup,项目名称:Zulu,代码行数:25,代码来源:settingsDialog.py

示例12: __do_layout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
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 
开发者ID:nccgroup,项目名称:Zulu,代码行数:23,代码来源:displayDialog.py

示例13: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
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() 
开发者ID:trelby,项目名称:trelby,代码行数:39,代码来源:cfgdlg.py

示例14: _on_right_click

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
def _on_right_click(self, event):
        """
        Copies a cell into clipboard on right click. Unfortunately,
        determining the clicked column is not straightforward. This
        appraoch is inspired by the TextEditMixin in:
        /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/lib/mixins/listctrl.py
        More references:
        - http://wxpython-users.1045709.n5.nabble.com/Getting-row-col-of-selected-cell-in-ListCtrl-td2360831.html
        - https://groups.google.com/forum/#!topic/wxpython-users/7BNl9TA5Y5U
        - https://groups.google.com/forum/#!topic/wxpython-users/wyayJIARG8c
        """
        if self.HitTest(event.GetPosition()) != wx.NOT_FOUND:
            x, y = event.GetPosition()
            row, flags = self.HitTest((x, y))

            col_locs = [0]
            loc = 0
            for n in range(self.GetColumnCount()):
                loc = loc + self.GetColumnWidth(n)
                col_locs.append(loc)

            scroll_pos = self.GetScrollPos(wx.HORIZONTAL)
            # this is crucial step to get the scroll pixel units
            unit_x, unit_y = self.GetMainWindow().GetScrollPixelsPerUnit()

            col = bisect(col_locs, x + scroll_pos * unit_x) - 1

            value = self.df.iloc[row, col]
            # print(row, col, scroll_pos, value)

            clipdata = wx.TextDataObject()
            clipdata.SetText(str(value))
            wx.TheClipboard.Open()
            wx.TheClipboard.SetData(clipdata)
            wx.TheClipboard.Close() 
开发者ID:bluenote10,项目名称:PandasDataFrameGUI,代码行数:37,代码来源:dfgui.py

示例15: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import HORIZONTAL [as 别名]
def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 400,300 ), style = wx.TAB_TRAVERSAL, name = wx.EmptyString ):
        wx.Panel.__init__ ( self, parent, id = id, pos = pos, size = size, style = style, name = name )

        bSizer20 = wx.BoxSizer( wx.VERTICAL )

        self.notebook = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.NB_TOP|wx.BORDER_DEFAULT )

        bSizer20.Add( self.notebook, 1, wx.EXPAND |wx.ALL, 5 )

        bSizer39 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_button41 = wx.Button( self, wx.ID_ANY, u"Save current settings", wx.DefaultPosition, wx.DefaultSize, 0|wx.BORDER_DEFAULT )
        bSizer39.Add( self.m_button41, 0, wx.ALL, 5 )


        bSizer39.Add( ( 50, 0), 0, wx.EXPAND, 5 )

        self.m_button42 = wx.Button( self, wx.ID_ANY, u"Generate BOM", wx.DefaultPosition, wx.DefaultSize, 0|wx.BORDER_DEFAULT )

        self.m_button42.SetDefault()
        bSizer39.Add( self.m_button42, 0, wx.ALL, 5 )

        self.m_button43 = wx.Button( self, wx.ID_CANCEL, u"Cancel", wx.DefaultPosition, wx.DefaultSize, 0|wx.BORDER_DEFAULT )
        bSizer39.Add( self.m_button43, 0, wx.ALL, 5 )


        bSizer20.Add( bSizer39, 0, wx.ALIGN_CENTER, 5 )


        self.SetSizer( bSizer20 )
        self.Layout()

        # Connect Events
        self.m_button41.Bind( wx.EVT_BUTTON, self.OnSaveSettings )
        self.m_button42.Bind( wx.EVT_BUTTON, self.OnGenerateBom )
        self.m_button43.Bind( wx.EVT_BUTTON, self.OnExit ) 
开发者ID:openscopeproject,项目名称:InteractiveHtmlBom,代码行数:38,代码来源:dialog_base.py


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