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


Python wx.ALIGN_BOTTOM属性代码示例

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


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

示例1: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def __init__(self, parent):
        wx.Dialog.__init__(self, parent, -1, _("No OpenCL devices found."))
        vbox = wx.BoxSizer(wx.VERTICAL)
        self.message = wx.StaticText(self, -1,
 _("""No OpenCL devices were found.
 If you only want to mine using CPU or CUDA, you can ignore this message.
 If you want to mine on ATI graphics cards, you may need to install the ATI Stream
 SDK, or your GPU may not support OpenCL."""))
        vbox.Add(self.message, 0, wx.ALL, 10)

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        self.no_show_chk = wx.CheckBox(self, -1)
        hbox.Add(self.no_show_chk)
        self.no_show_txt = wx.StaticText(self, -1, _("Don't show this message again"))
        hbox.Add((5, 0))
        hbox.Add(self.no_show_txt)
        vbox.Add(hbox, 0, wx.ALL, 10)
        buttons = self.CreateButtonSizer(wx.OK)
        vbox.Add(buttons, 0, wx.ALIGN_BOTTOM | wx.ALIGN_CENTER_HORIZONTAL, 0)
        self.SetSizerAndFit(vbox) 
开发者ID:theRealTacoTime,项目名称:poclbm,代码行数:23,代码来源:guiminer.py

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def __init__(self, parent, hwnds):
        eg.Dialog.__init__(
            self,
            parent,
            title="Found Windows",
            size=(500, 350),
            style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
        )
        windowList = eg.WindowList(self, hwnds)
        okButton = wx.Button(self, wx.ID_OK)
        btnSizer = eg.HBoxSizer(
            ((0, 0), 1, wx.EXPAND),
            (okButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND | wx.ALL, 5),
            ((0, 0), 1, wx.EXPAND),
            (eg.SizeGrip(self), 0, wx.ALIGN_BOTTOM | wx.ALIGN_RIGHT),
        )
        mainSizer = eg.VBoxSizer(
            (windowList, 1, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 5),
            (btnSizer, 0, wx.EXPAND),
        )
        self.SetSizer(mainSizer) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:23,代码来源:FindWindow.py

示例3: Configure

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def Configure(self, number="", msg="", service=""):
        panel = eg.ConfigPanel()
        label1Text = wx.StaticText(panel, -1, self.text.label1)
        label2Text = wx.StaticText(panel, -1, self.text.label2)
        label3Text = wx.StaticText(panel, -1, self.text.label3)
        textControl1 = wx.TextCtrl(panel, -1, number)
        textControl2 = wx.TextCtrl(panel, -1, msg)
        textControl3 = wx.TextCtrl(panel, -1, service)
        topSizer = wx.GridSizer(rows=2, cols=2)
        topSizer.Add(label1Text,0,wx.ALIGN_BOTTOM,0)
        topSizer.Add(label3Text,0,wx.ALIGN_BOTTOM,0)
        topSizer.Add(textControl1,0,wx.TOP,3)
        topSizer.Add(textControl3,0,wx.TOP,3)
        panel.sizer.Add(topSizer,0,wx.TOP|wx.EXPAND,0)
        panel.sizer.Add(label2Text,0,wx.TOP,10)
        panel.sizer.Add(textControl2,1,wx.EXPAND|wx.TOP,3)
        while panel.Affirmed():
            panel.SetResult(
                textControl1.GetValue(),
                textControl2.GetValue(),
                textControl3.GetValue()
            ) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:24,代码来源:__init__.py

示例4: GetBitmapRect

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def GetBitmapRect(self):
        client_size = self.GetClientSize()
        bitmap_size = self.BackgroundBitmap.GetSize()

        if self.BackgroundAlign & wx.ALIGN_RIGHT:
            x = client_size[0] - bitmap_size[0]
        elif self.BackgroundAlign & wx.ALIGN_CENTER_HORIZONTAL:
            x = (client_size[0] - bitmap_size[0]) // 2
        else:
            x = 0

        if self.BackgroundAlign & wx.ALIGN_BOTTOM:
            y = client_size[1] - bitmap_size[1]
        elif self.BackgroundAlign & wx.ALIGN_CENTER_VERTICAL:
            y = (client_size[1] - bitmap_size[1]) // 2
        else:
            y = 0

        return wx.Rect(x, y, bitmap_size[0], bitmap_size[1]) 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:21,代码来源:CustomTree.py

示例5: _init_coll_MiddleGridSizer_Items

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def _init_coll_MiddleGridSizer_Items(self, parent):
        parent.AddWindow(self.Select, 0, border=0, flag=wx.ALIGN_BOTTOM)
        parent.AddWindow(self.Unselect, 0, border=0, flag=wx.ALIGN_TOP) 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:5,代码来源:commondialogs.py

示例6: __do_layout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def __do_layout(self):
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_2 = wx.BoxSizer(wx.VERTICAL)
        sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_5 = wx.BoxSizer(wx.VERTICAL)
        grid_sizer_1_copy = wx.FlexGridSizer(2, 3, 2, 10)
        grid_sizer_2_copy = wx.FlexGridSizer(2, 3, 2, 5)
        grid_sizer_2_copy.Add(self.label_2_copy, 0, wx.ALIGN_BOTTOM, 3)
        grid_sizer_2_copy.Add(self.label_3_copy, 0, wx.ALIGN_BOTTOM, 3)
        grid_sizer_2_copy.Add(self.label_4_copy, 0, wx.ALIGN_BOTTOM, 3)
        grid_sizer_2_copy.Add(self.family, 0, wx.EXPAND, 0)
        grid_sizer_2_copy.Add(self.style, 0, wx.EXPAND, 0)
        grid_sizer_2_copy.Add(self.weight, 0, wx.EXPAND, 0)
        grid_sizer_2_copy.AddGrowableCol(0)
        grid_sizer_2_copy.AddGrowableCol(1)
        grid_sizer_2_copy.AddGrowableCol(2)
        sizer_5.Add(grid_sizer_2_copy, 0, wx.EXPAND, 0)
        grid_sizer_1_copy.Add(self.label_1, 0, wx.ALIGN_BOTTOM, 0)
        grid_sizer_1_copy.Add((20, 5), 0, wx.ALIGN_BOTTOM, 0)
        grid_sizer_1_copy.Add((20, 5), 0, wx.ALIGN_BOTTOM, 0)
        grid_sizer_1_copy.Add(self.point_size, 0, 0, 0)
        grid_sizer_1_copy.Add(self.underline, 0, wx.EXPAND, 0)
        grid_sizer_1_copy.Add(self.font_btn, 0, 0, 0)
        grid_sizer_1_copy.AddGrowableCol(1)
        sizer_5.Add(grid_sizer_1_copy, 0, wx.TOP|wx.EXPAND, 3)
        sizer_5.Add(self.static_line_1, 0, wx.TOP|wx.EXPAND, 8)
        sizer_2.Add(sizer_5, 0, wx.EXPAND, 0)
        sizer_4.Add(self.ok_btn, 0, wx.RIGHT, 12)
        sizer_4.Add(self.cancel_btn, 0, 0, 0)
        sizer_2.Add(sizer_4, 0, wx.TOP|wx.ALIGN_RIGHT, 9)
        sizer_1.Add(sizer_2, 1, wx.ALL|wx.EXPAND, 10)
        self.SetAutoLayout(1)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        sizer_1.SetSizeHints(self)
        self.Layout()
        self.CenterOnScreen() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:39,代码来源:font_dialog.py

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def __init__(self, *args, **kwargs):
        kwargs["style"] = kwargs.get("style", 0) | wx.BORDER_NONE
        super(ImageChooserControl, self).__init__(*args, **kwargs)

        self._slider = wx.Slider(self, -1, style=wx.SL_AUTOTICKS)
        self._slider.SetMin(1)
        self._label = wx.StaticText(self, -1, "Some Text")

        # Work out the maximum size of the text so that we can cut off the slider to allow room
        if WX3:
            _, size_y = self._label.GetAdjustedBestSize()
            self._label.SetFont(self._label.GetFont().Italic())
            self.size_y = max(size_y, self._label.GetAdjustedBestSize()[1])
        else:
            _, size_y = self._label.GetEffectiveMinSize()
            self._label.SetFont(self._label.GetFont().Italic())
            self.size_y = max(size_y, self._label.GetEffectiveMinSize()[1])

        # Use a horizontal box to control vertical alignment
        labelSizer = wx.BoxSizer(wx.HORIZONTAL)
        labelSizer.Add(self._label, flag=wx.ALL | wx.ALIGN_BOTTOM)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self._slider, flag=wx.ALL | wx.ALIGN_LEFT)
        sizer.Add(labelSizer, proportion=1, flag=wx.EXPAND)
        self.SetSizer(sizer) 
开发者ID:dials,项目名称:dials,代码行数:28,代码来源:viewer_tools.py

示例8: _set_layout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def _set_layout(self):
        """Sets the layout of the main window. """
        main_sizer = wx.BoxSizer()
        panel_sizer = wx.BoxSizer(wx.VERTICAL)

        top_sizer = wx.BoxSizer(wx.HORIZONTAL)
        top_sizer.Add(self._url_text, 0, wx.ALIGN_BOTTOM | wx.BOTTOM, 5)
        top_sizer.AddSpacer((-1, -1), 1)
        top_sizer.Add(self._settings_button)
        panel_sizer.Add(top_sizer, 0, wx.EXPAND)

        panel_sizer.Add(self._url_list, 1, wx.EXPAND)

        mid_sizer = wx.BoxSizer(wx.HORIZONTAL)
        mid_sizer.Add(self._folder_icon)
        mid_sizer.AddSpacer((3, -1))
        mid_sizer.Add(self._path_combobox, 2, wx.ALIGN_CENTER_VERTICAL)
        mid_sizer.AddSpacer((5, -1))
        mid_sizer.Add(self._buttons["savepath"], flag=wx.ALIGN_CENTER_VERTICAL)
        mid_sizer.AddSpacer((10, -1), 1)
        mid_sizer.Add(self._videoformat_combobox, 1, wx.ALIGN_CENTER_VERTICAL)
        mid_sizer.AddSpacer((5, -1))
        mid_sizer.Add(self._buttons["add"], flag=wx.ALIGN_CENTER_VERTICAL)
        panel_sizer.Add(mid_sizer, 0, wx.EXPAND | wx.ALL, 10)

        panel_sizer.Add(self._download_text, 0, wx.BOTTOM, 5)
        panel_sizer.Add(self._status_list, 2, wx.EXPAND)

        bottom_sizer = wx.BoxSizer(wx.HORIZONTAL)
        bottom_sizer.Add(self._buttons["delete"])
        bottom_sizer.AddSpacer((5, -1))
        bottom_sizer.Add(self._buttons["play"])
        bottom_sizer.AddSpacer((5, -1))
        bottom_sizer.Add(self._buttons["up"])
        bottom_sizer.AddSpacer((5, -1))
        bottom_sizer.Add(self._buttons["down"])
        bottom_sizer.AddSpacer((5, -1))
        bottom_sizer.Add(self._buttons["reload"])
        bottom_sizer.AddSpacer((5, -1))
        bottom_sizer.Add(self._buttons["pause"])
        bottom_sizer.AddSpacer((10, -1), 1)
        bottom_sizer.Add(self._buttons["start"])
        panel_sizer.Add(bottom_sizer, 0, wx.EXPAND | wx.TOP, 5)

        main_sizer.Add(panel_sizer, 1, wx.ALL | wx.EXPAND, 10)
        self._panel.SetSizer(main_sizer)

        self._panel.Layout() 
开发者ID:MrS0m30n3,项目名称:youtube-dl-gui,代码行数:50,代码来源:mainframe.py

示例9: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def __init__(self, parent, name="", text="", icon=None, url = None):
        text = REPLACE_BR_TAG.sub('\n', text)
        text = REMOVE_HTML_PATTERN.sub('', text).strip()
        if text == name:
            text = ""
        self.parent = parent
        wx.PyWindow.__init__(self, parent, -1)
        self.SetBackgroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
        )

        nameBox = wx.StaticText(self, -1, name)
        font = wx.Font(8, wx.SWISS, wx.NORMAL, wx.FONTWEIGHT_BOLD)
        nameBox.SetFont(font)

        self.text = '<html><body bgcolor="%s" text="%s">%s</body></html>' % (
            self.GetBackgroundColour().GetAsString(wx.C2S_HTML_SYNTAX),
            self.GetForegroundColour().GetAsString(wx.C2S_HTML_SYNTAX),
            text
        )
        if url:
            self.text = eg.Utils.AppUrl(self.text, url)
        descBox = eg.HtmlWindow(self, style=wx.html.HW_NO_SELECTION)
        descBox.SetBorders(1)
        descBox.SetFonts("Arial", "Times New Roman", [8, 8, 8, 8, 8, 8, 8])
        descBox.Bind(wx.html.EVT_HTML_LINK_CLICKED, self.OnLinkClicked)
        self.descBox = descBox

        staticBitmap = wx.StaticBitmap(self)
        staticBitmap.SetIcon(icon.GetWxIcon())

        mainSizer = eg.HBoxSizer(
            ((4, 4)),
            (staticBitmap, 0, wx.TOP, 5),
            ((4, 4)),
            (eg.VBoxSizer(
                ((4, 4)),
                (eg.HBoxSizer(
                    (nameBox, 1, wx.EXPAND | wx.ALIGN_BOTTOM),
                ), 0, wx.EXPAND | wx.TOP, 2),
                (descBox, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 8),
            ), 1, wx.EXPAND),
        )
        # odd sequence to setup the window, but all other ways seem
        # to wrap the text wrong
        self.SetSizer(mainSizer)
        self.SetAutoLayout(True)
        mainSizer.Fit(self)
        mainSizer.Layout()
        self.Layout()
        self.Bind(wx.EVT_SIZE, self.OnSize) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:53,代码来源:HeaderBox.py

示例10: Configure

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def Configure(self, parent):  #IGNORE:W0221
        if AboutDialog.instance:
            AboutDialog.instance.Raise()
            return
        AboutDialog.instance = self
        eg.TaskletDialog.__init__(
            self,
            parent=parent,
            title=Text.Title,
            style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        )
        notebook = wx.Notebook(self)
        notebook.AddPage(AboutPanel(notebook), Text.tabAbout)
        notebook.AddPage(SpecialThanksPanel(notebook), Text.tabSpecialThanks)
        notebook.AddPage(LicensePanel(notebook), Text.tabLicense)
        notebook.AddPage(SystemInfoPanel(notebook), Text.tabSystemInfo)
        notebook.AddPage(ChangelogPanel(notebook), Text.tabChangelog)

        def OnPageChanged(event):
            pageNum = event.GetSelection()
            notebook.ChangeSelection(pageNum)
            notebook.GetPage(pageNum).SetFocus()
        notebook.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, OnPageChanged)

        okButton = wx.Button(self, wx.ID_OK, eg.text.General.ok)
        okButton.SetDefault()
        okButton.Bind(wx.EVT_BUTTON, self.OnOK)

        buttonSizer = eg.HBoxSizer(
            ((0, 0), 1, wx.EXPAND),
            (okButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND | wx.ALL, 5),
            ((0, 0), 1, wx.EXPAND),
            (eg.SizeGrip(self), 0, wx.ALIGN_BOTTOM | wx.ALIGN_RIGHT),
        )
        mainSizer = eg.VBoxSizer(
            (notebook, 1, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 5),
            (buttonSizer, 0, wx.EXPAND),
        )
        self.SetSizerAndFit(mainSizer)
        self.SetMinSize(self.GetSize())
        while self.Affirmed():
            self.SetResult()
        AboutDialog.instance = None 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:45,代码来源:AboutDialog.py

示例11: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def __init__(self, parent, datatypes, infos):
        wx.Dialog.__init__(self, parent, title=_('Edit array type properties'))

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

        top_sizer = wx.BoxSizer(wx.HORIZONTAL)
        main_sizer.AddSizer(top_sizer, border=20,
                            flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)

        basetype_label = wx.StaticText(self, label=_('Base Type:'))
        top_sizer.AddWindow(basetype_label, 1, flag=wx.ALIGN_BOTTOM)

        self.BaseType = wx.ComboBox(self, style=wx.CB_READONLY)
        top_sizer.AddWindow(self.BaseType, 1, flag=wx.GROW)

        self.Dimensions = CustomEditableListBox(self, label=_("Dimensions:"),
                                                style=(wx.gizmos.EL_ALLOW_NEW |
                                                       wx.gizmos.EL_ALLOW_EDIT |
                                                       wx.gizmos.EL_ALLOW_DELETE))
        for func in ["_OnLabelEndEdit",
                     "_OnAddButton",
                     "_OnDelButton",
                     "_OnUpButton",
                     "_OnDownButton"]:
            setattr(self.Dimensions, func, self.OnDimensionsChanged)
        main_sizer.AddSizer(self.Dimensions, border=20,
                            flag=wx.GROW | wx.LEFT | wx.RIGHT)

        button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
        self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
        main_sizer.AddSizer(button_sizer, border=20,
                            flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)

        self.SetSizer(main_sizer)

        for datatype in datatypes:
            self.BaseType.Append(datatype)

        if isinstance(infos, tuple) and infos[0] == "array":
            self.BaseType.SetStringSelection(infos[1])
            self.Dimensions.SetStrings(map("..".join, infos[2]))
        elif infos in datatypes:
            self.BaseType.SetStringSelection(infos)

        self.BaseType.SetFocus()
        self.Fit() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:50,代码来源:ArrayTypeDialog.py

示例12: DrawText

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_BOTTOM [as 别名]
def DrawText(self, dc, txt, bounds, font=None, alignment=wx.ALIGN_LEFT, valignment=wx.ALIGN_CENTRE,
                 image=None, color=None, canWrap=True, imageIndex=-1, listCtrl=None):
        """
        Draw the given text in the given DC according to the given characteristics.

        This is the workhorse text drawing method for our reporting engine.

        The *font*, *alignment*, and *color* attributes are applied to the drawn text.

        If *image* is not None, it will be drawn to the left of the text. All text is indented
        by the width of the image, even if the text is multi-line.

        If *imageIndex* is 0 or more and *listCtrl* is not None, the corresponding image from
        the ListCtrl's small image list will be drawn to the left of the text.

        If *canWrap* is True, the text will be wrapped to fit within the given bounds. If it is False,
        then the first line of *txt* will be truncated at the edge of the given *bounds*.
        """
        GAP_BETWEEN_IMAGE_AND_TEXT = 4

        def _CalcBitmapPosition(r, height):
            if valignment == wx.ALIGN_TOP:
                return RectUtils.Top(r)
            elif valignment == wx.ALIGN_CENTER:
                return RectUtils.CenterY(r) - height / 2
            elif valignment == wx.ALIGN_BOTTOM:
                return RectUtils.Bottom(r) - height
            else:
                return RectUtils.Top(r)

        # Draw any image
        if image:
            y = _CalcBitmapPosition(bounds, image.Height)
            dc.DrawBitmap(image, RectUtils.Left(bounds), y)
            RectUtils.MoveLeftBy(bounds, image.GetWidth()+GAP_BETWEEN_IMAGE_AND_TEXT)
        elif listCtrl and imageIndex >=0:
            imageList = listCtrl.GetImageList(wx.IMAGE_LIST_SMALL)
            y = _CalcBitmapPosition(bounds, imageList.GetSize(0)[1])
            imageList.Draw(imageIndex, dc, RectUtils.Left(bounds), y, wx.IMAGELIST_DRAW_TRANSPARENT)
            RectUtils.MoveLeftBy(bounds, imageList.GetSize(0)[0]+GAP_BETWEEN_IMAGE_AND_TEXT)

        # Draw the text
        dc.SetFont(font or self.GetFont())
        dc.SetTextForeground(color or self.GetTextColor() or wx.BLACK)
        if canWrap:
            WordWrapRenderer.DrawString(dc, txt, bounds, alignment, valignment)
        else:
            WordWrapRenderer.DrawTruncatedString(dc, txt, bounds, alignment, valignment) 
开发者ID:JackonYang,项目名称:bookhub,代码行数:50,代码来源:ListCtrlPrinter.py


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