本文整理汇总了Python中wx.ALIGN_CENTER_HORIZONTAL属性的典型用法代码示例。如果您正苦于以下问题:Python wx.ALIGN_CENTER_HORIZONTAL属性的具体用法?Python wx.ALIGN_CENTER_HORIZONTAL怎么用?Python wx.ALIGN_CENTER_HORIZONTAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.ALIGN_CENTER_HORIZONTAL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def __init__(self, parent, id, title):
wx.Dialog.__init__(self, parent, id, title)
self.selection_idx = None
self.selection_text = None
vbox = wx.BoxSizer(wx.VERTICAL)
stline = wx.StaticText(
self,
11,
'Duplicate Component values found!'
'\n\nPlease select which format to follow:')
vbox.Add(stline, 0, wx.ALIGN_CENTER|wx.TOP)
self.comp_list = wx.ListBox(self, 331, style=wx.LB_SINGLE)
vbox.Add(self.comp_list, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND)
self.SetSizer(vbox)
self.comp_list.Bind(wx.EVT_LISTBOX_DCLICK, self.on_selection, id=wx.ID_ANY)
self.Show(True)
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def __init__(self, parent, help_entries):
wx.Dialog.__init__(self, parent, title="Help",
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
sizer = wx.BoxSizer(wx.VERTICAL)
grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
# create and add the entries
bold = self.GetFont().MakeBold()
for r, row in enumerate(self.headers + help_entries):
for (col, width) in zip(row, self.widths):
label = wx.StaticText(self, label=col)
if r == 0:
label.SetFont(bold)
label.Wrap(width)
grid_sizer.Add(label, 0, 0, 0)
# finalize layout, create button
sizer.Add(grid_sizer, 0, wx.ALL, 6)
OK = wx.Button(self, wx.ID_OK)
sizer.Add(OK, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
self.SetSizer(sizer)
sizer.Fit(self)
self.Layout()
self.Bind(wx.EVT_CLOSE, self.OnClose)
OK.Bind(wx.EVT_BUTTON, self.OnClose)
示例3: get_summary_widgets
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def get_summary_widgets(self, summary_panel):
"""Return a list of summary widgets suitable for sizer.AddMany."""
self.summary_panel = summary_panel
self.summary_name = wx.StaticText(summary_panel, -1, self.name)
self.summary_name.Bind(wx.EVT_LEFT_UP, self.show_this_panel)
self.summary_status = wx.StaticText(summary_panel, -1, STR_STOPPED)
self.summary_shares_accepted = wx.StaticText(summary_panel, -1, "0")
self.summary_shares_invalid = wx.StaticText(summary_panel, -1, "0")
self.summary_start = wx.Button(summary_panel, -1, self.get_start_stop_state(), style=wx.BU_EXACTFIT)
self.summary_start.Bind(wx.EVT_BUTTON, self.toggle_mining)
self.summary_autostart = wx.CheckBox(summary_panel, -1)
self.summary_autostart.Bind(wx.EVT_CHECKBOX, self.toggle_autostart)
self.summary_autostart.SetValue(self.autostart)
return [
(self.summary_name, 0, wx.ALIGN_CENTER_HORIZONTAL),
(self.summary_status, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
(self.summary_shares_accepted, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
(self.summary_shares_invalid, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
(self.summary_start, 0, wx.ALIGN_CENTER, 0),
(self.summary_autostart, 0, wx.ALIGN_CENTER, 0)
]
示例4: layout_bitpenny
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def layout_bitpenny(self):
"""BitPenny doesn't require registration or a password.
The username is just their receiving address.
"""
invisible = [self.txt_pass, self.txt_host, self.txt_port,
self.pass_lbl, self.host_lbl, self.port_lbl]
self.set_widgets_visible(invisible, False)
self.set_widgets_visible([self.extra_info], True)
row = self.layout_init()
self.layout_server_and_website(row=row)
self.inner_sizer.Add(self.user_lbl, (row + 1, 0), flag=LBL_STYLE)
self.inner_sizer.Add(self.txt_username, (row + 1, 1), span=(1, 3), flag=wx.EXPAND)
self.layout_device_and_flags(row=row + 2)
self.layout_affinity(row=row + 3)
self.layout_balance(row=row + 4)
self.inner_sizer.Add(self.extra_info, (row + 5, 0), span=(1, 4), flag=wx.ALIGN_CENTER_HORIZONTAL)
self.layout_finish()
self.extra_info.SetLabel(_("No registration is required - just enter an address and press Start."))
self.txt_pass.SetValue('poclbm-gui')
self.user_lbl.SetLabel(_("Address:"))
add_tooltip(self.txt_username,
_("Your receiving address for Bitcoins.\nE.g.: 1A94cjRpaPBMV9ZNWFihB5rTFEeihBALgc"))
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def __init__(self, parent, title, current_language):
style = wx.DEFAULT_DIALOG_STYLE
vbox = wx.BoxSizer(wx.VERTICAL)
wx.Dialog.__init__(self, parent, -1, title, style=style)
self.lbl = wx.StaticText(self, -1,
_("Choose language (requires restart to take full effect)"))
vbox.Add(self.lbl, 0, wx.ALL, 10)
self.language_choices = wx.ComboBox(self, -1,
choices=sorted(LANGUAGES.keys()),
style=wx.CB_READONLY)
self.language_choices.SetStringSelection(LANGUAGES_REVERSE[current_language])
vbox.Add(self.language_choices, 0, wx.ALL, 10)
buttons = self.CreateButtonSizer(wx.OK | wx.CANCEL)
vbox.Add(buttons, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 10)
self.SetSizerAndFit(vbox)
示例6: __do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def __do_layout(self):
# begin wxGlade: webcamPreviewDialog.__do_layout
grid_sizer_24 = wx.FlexGridSizer(2, 1, 0, 0)
sizer_3 = wx.FlexGridSizer(1, 1, 0, 0)
sizer_3.Add(self.previewbitmap, 0, wx.EXPAND, 0)
self.panel_1.SetSizer(sizer_3)
sizer_3.AddGrowableRow(0)
sizer_3.AddGrowableCol(0)
grid_sizer_24.Add(self.panel_1, 1, wx.EXPAND, 0)
grid_sizer_24.Add(self.previewokbutton, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
self.SetSizer(grid_sizer_24)
grid_sizer_24.AddGrowableRow(0)
grid_sizer_24.AddGrowableCol(0)
self.Layout()
# end wxGlade
# end of class webcamPreviewDialog
示例7: _build_filesize_sizer
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def _build_filesize_sizer(self):
filesize_box_sizer = wx.StaticBoxSizer(self.filesize_box, wx.VERTICAL)
border = wx.GridBagSizer(5, 20)
border.Add(self.filesize_max_label, (0, 0), (1, 2), wx.ALIGN_CENTER_HORIZONTAL)
border.Add(self.filesize_max_spinctrl, (1, 0))
border.Add(self.filesize_max_sizeunit_combobox, (1, 1))
border.Add(self.filesize_min_label, (2, 0), (1, 2), wx.ALIGN_CENTER_HORIZONTAL)
border.Add(self.filesize_min_spinctrl, (3, 0))
border.Add(self.filesize_min_sizeunit_combobox, (3, 1))
filesize_box_sizer.Add(border, flag=wx.ALIGN_CENTER)
return filesize_box_sizer
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [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)
示例9: GetBitmapRect
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [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])
示例10: DrawTruncatedString
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def DrawTruncatedString(dc, text, bounds, align=wx.ALIGN_LEFT, valign=wx.ALIGN_TOP, ellipse=wx.RIGHT, ellipseChars="..."):
"""
Draw the given text truncated to the given bounds.
bounds must be a wx.Rect or a 4-element collection: (left, top, width, height).
If allowClipping is True, this method changes the clipping region so that no
text is drawn outside of the given bounds.
"""
if not text:
return
if align == wx.ALIGN_CENTER:
align = wx.ALIGN_CENTER_HORIZONTAL
if valign == wx.ALIGN_CENTER:
valign = wx.ALIGN_CENTER_VERTICAL
try:
bounds = wx.Rect(*bounds)
except:
pass
lines = WordWrapRenderer._Truncate(dc, text, bounds[2], ellipse, ellipseChars)
dc.DrawLabel(lines, bounds, align|valign)
示例11: OnPaint
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def OnPaint(self, evt):
dc = wx.PaintDC(self)
inset = (20, 20, 20, 20)
rect = [inset[0], inset[1], self.GetSize().width-(inset[0]+inset[2]), self.GetSize().height-(inset[1]+inset[3])]
# Calculate exactly how high the wrapped is going to be and put a frame around it.
dc.SetFont(self.font)
dc.SetPen(wx.RED_PEN)
rect[3] = WordWrapRenderer.CalculateHeight(dc, self.text, rect[2])
dc.DrawRectangle(*rect)
WordWrapRenderer.DrawString(dc, self.text, rect, wx.ALIGN_LEFT)
#WordWrapRenderer.DrawTruncatedString(dc, self.text, rect, wx.ALIGN_CENTER_HORIZONTAL,s ellipse=wx.CENTER)
#bmp = wx.EmptyBitmap(rect[0]+rect[2], rect[1]+rect[3])
#mdc = wx.MemoryDC(bmp)
#mdc.SetBackground(wx.Brush("white"))
#mdc.Clear()
#mdc.SetFont(self.font)
#mdc.SetPen(wx.RED_PEN)
#rect[3] = WordWrapRenderer.CalculateHeight(mdc, self.text, rect[2])
#mdc.DrawRectangle(*rect)
#WordWrapRenderer.DrawString(mdc, self.text, rect, wx.ALIGN_LEFT)
#del mdc
#dc = wx.ScreenDC()
#dc.DrawBitmap(bmp, 20, 20)
示例12: _do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def _do_layout(self):
vsizer = wx.BoxSizer(wx.VERTICAL)
sizer = wx.BoxSizer(wx.HORIZONTAL)
headings_sizer = self.build_heading_sizer()
sizer.Add(headings_sizer, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND | wx.LEFT, PAD_SIZE)
sizer.Add(self.settings_img, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
sizer.Add(self.running_img, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
sizer.Add(self.check_mark, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
sizer.Add(self.error_symbol, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
self.running_img.Hide()
self.check_mark.Hide()
self.error_symbol.Hide()
vsizer.Add(sizer, 1, wx.EXPAND)
self.SetSizer(vsizer)
示例13: layout_finish
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def layout_finish(self):
"""Lay out the buttons and fit the sizer to the window."""
self.frame_sizer.Add(self.inner_sizer, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 10)
self.frame_sizer.Add(self.button_sizer, 0, wx.ALIGN_CENTER_HORIZONTAL)
self.inner_sizer.AddGrowableCol(1)
self.inner_sizer.AddGrowableCol(3)
for btn in [self.start, self.balance_refresh, self.withdraw]:
self.button_sizer.Add(btn, 0, BTN_STYLE, 5)
# self.set_widgets_visible([self.external_lbl, self.txt_external],
# self.is_external_miner)
self.SetSizerAndFit(self.frame_sizer)
示例14: layout_eligius
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def layout_eligius(self):
"""Eligius doesn't require registration or a password.
The username is just their receiving address.
"""
invisible = [self.txt_pass, self.txt_host, self.txt_port,
self.withdraw,
self.pass_lbl, self.host_lbl, self.port_lbl]
self.set_widgets_visible(invisible, False)
self.set_widgets_visible([self.extra_info], True)
row = self.layout_init()
self.layout_server_and_website(row=row)
self.inner_sizer.Add(self.user_lbl, (row + 1, 0), flag=LBL_STYLE)
self.inner_sizer.Add(self.txt_username, (row + 1, 1), span=(1, 3), flag=wx.EXPAND)
self.layout_device_and_flags(row=row + 2)
self.layout_affinity(row=row + 3)
self.layout_balance(row=row + 4)
self.inner_sizer.Add(self.extra_info, (row + 5, 0), span=(1, 4), flag=wx.ALIGN_CENTER_HORIZONTAL)
self.layout_finish()
self.extra_info.SetLabel(_("No registration is required - just enter an address and press Start."))
self.txt_pass.SetValue('x')
self.user_lbl.SetLabel(_("Address:"))
add_tooltip(self.txt_username,
_("Your receiving address for Bitcoins.\nE.g.: 1JMfKKJqtkDPbRRsFSLjX1Cs2dqmjKiwj8"))
示例15: _do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER_HORIZONTAL [as 别名]
def _do_layout(self):
vsizer = wx.BoxSizer(wx.VERTICAL)
sizer = wx.BoxSizer(wx.HORIZONTAL)
headings_sizer = self.build_heading_sizer()
sizer.Add(headings_sizer, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND | wx.LEFT, PAD_SIZE)
sizer.Add(self._settings_img, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
sizer.Add(self._running_img, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
sizer.Add(self._check_mark, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
sizer.Add(self._error_symbol, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
self._running_img.Hide()
self._check_mark.Hide()
self._error_symbol.Hide()
vsizer.Add(sizer, 1, wx.EXPAND)
self.SetSizer(vsizer)