本文整理汇总了Python中wx.ALIGN_CENTER属性的典型用法代码示例。如果您正苦于以下问题:Python wx.ALIGN_CENTER属性的具体用法?Python wx.ALIGN_CENTER怎么用?Python wx.ALIGN_CENTER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.ALIGN_CENTER属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def __init__(self, parent, text, title):
wx.Dialog.__init__(self, parent, -1, title,
style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
vsizer = wx.BoxSizer(wx.VERTICAL)
tc = wx.TextCtrl(self, -1, size = wx.Size(400, 200),
style = wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_LINEWRAP)
tc.SetValue(text)
vsizer.Add(tc, 1, wx.EXPAND);
vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
okBtn = gutil.createStockButton(self, "OK")
vsizer.Add(okBtn, 0, wx.ALIGN_CENTER)
util.finishWindow(self, vsizer)
wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK)
okBtn.SetFocus()
示例2: doLayout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [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)
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
box = wx.BoxSizer(wx.VERTICAL)
box.Add((20, 30))
keys = buttonDefs.keys()
for k in keys:
text = buttonDefs[k][1]
btn = wx.Button(self, k, text)
box.Add(btn, 0, wx.ALIGN_CENTER|wx.ALL, 15)
self.Bind(wx.EVT_BUTTON, self.OnButton, btn)
# put a GLCanvas on the wx.Panel
c = CubeCanvas(self)
c.SetMinSize((200, 200))
box.Add(c, 0, wx.ALIGN_CENTER|wx.ALL, 15)
c = ConeCanvas(self)
c.SetMinSize((200, 200))
box.Add(c, 0, wx.ALIGN_CENTER|wx.ALL, 15)
self.SetAutoLayout(True)
self.SetSizer(box)
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:27,代码来源:import_OpenGL_cube_and_cone.py
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def __init__(self, parent, label, param):
self.sliderLabel = wx.StaticText(parent, label=label)
self.sliderText = wx.TextCtrl(parent, -1, style=wx.TE_PROCESS_ENTER)
self.slider = wx.Slider(parent, -1)
# self.slider.SetMax(param.maximum*1000)
self.slider.SetRange(0, param.maximum * 1000)
self.setKnob(param.value)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.sliderLabel, 0,
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL,
border=2)
sizer.Add(self.sliderText, 0,
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL,
border=2)
sizer.Add(self.slider, 1, wx.EXPAND)
self.sizer = sizer
self.slider.Bind(wx.EVT_SLIDER, self.sliderHandler)
self.sliderText.Bind(wx.EVT_TEXT_ENTER, self.sliderTextHandler)
self.param = param
self.param.attach(self)
示例5: get_summary_widgets
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [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)
]
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [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)
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def __init__(self, parent, pickerClass, pickerGetter, localizedPickerLabel):
wx.Dialog.__init__(self, parent, title=localizedPickerLabel)
self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, wx.ID_OK, label=_('ok'))
self.picker = pickerClass(self, style=Constants.WX_DP_DROPDOWN)
self.pickerGetter = pickerGetter
vertical_container = wx.BoxSizer(wx.VERTICAL)
vertical_container.AddSpacer(10)
vertical_container.Add(self.picker, 0, wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER, 15)
vertical_container.AddSpacer(10)
button_sizer = wx.BoxSizer(wx.HORIZONTAL)
button_sizer.AddStretchSpacer(1)
button_sizer.Add(self.ok_button, 0)
vertical_container.Add(button_sizer, 0, wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER, 15)
vertical_container.AddSpacer(20)
self.SetSizerAndFit(vertical_container)
self.Bind(wx.EVT_BUTTON, self.onOkButton, self.ok_button)
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [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)
示例9: _build_playlist_sizer
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def _build_playlist_sizer(self):
playlist_box_sizer = wx.StaticBoxSizer(self.playlist_box, wx.VERTICAL)
playlist_box_sizer.AddSpacer((-1, 10))
border = wx.GridBagSizer(5, 40)
border.Add(self.playlist_start_label, (0, 0), flag=wx.ALIGN_CENTER_VERTICAL)
border.Add(self.playlist_start_spinctrl, (0, 1))
border.Add(self.playlist_stop_label, (1, 0), flag=wx.ALIGN_CENTER_VERTICAL)
border.Add(self.playlist_stop_spinctrl, (1, 1))
border.Add(self.playlist_max_label, (2, 0), flag=wx.ALIGN_CENTER_VERTICAL)
border.Add(self.playlist_max_spinctrl, (2, 1))
playlist_box_sizer.Add(border, flag=wx.ALIGN_CENTER)
return playlist_box_sizer
示例10: _build_filesize_sizer
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [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
示例11: InitUI
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def InitUI(self):
pnl = wx.Panel(self)
vbox = wx.BoxSizer(wx.VERTICAL)
sb = wx.StaticBox(pnl, label=u'请输入员工号')
sbs = wx.StaticBoxSizer(sb, orient=wx.VERTICAL)
self.tcCheckin = wx.TextCtrl(pnl)
sbs.Add(self.tcCheckin, 0, wx.ALL|wx.EXPAND, 5)
pnl.SetSizer(sbs)
hbox2 = wx.BoxSizer(wx.HORIZONTAL)
okButton = wx.Button(self, label=u'确认')
closeButton = wx.Button(self, label=u'取消')
hbox2.Add(okButton)
hbox2.Add(closeButton, flag=wx.LEFT, border=5)
vbox.Add(pnl, 0, wx.ALL|wx.EXPAND, 5)
vbox.Add(hbox2, 0, wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM, 10)
self.SetSizer(vbox)
self.Layout()
okButton.Bind(wx.EVT_BUTTON, self.OnConfirm)
closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
示例12: Notify
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def Notify(self):
if hasattr(self, 'TotalMsgs') and self.TotalMsgs > 0:
toaster = TB.ToasterBox(self, tbstyle=TB.TB_COMPLEX)
toaster.SetPopupSize((200, 120))
toaster.SetPopupPauseTime(4000)
toaster.SetPopupPositionByInt(3)
toaster.SetPopupBackgroundColour('#F2F5A9')
tbpanel = toaster.GetToasterBoxWindow()
panel = wx.Panel(tbpanel, -1)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.AddSpacer(10)
st = wx.StaticText(panel, wx.ID_ANY, label= u'有新消息!')
sizer.Add(st, 0, wx.ALIGN_CENTER|wx.ALL, 10)
button = wx.Button(panel, wx.ID_ANY, u"点击查看")
self.Bind(wx.EVT_BUTTON, self.OnMessages, button)
sizer.Add(button, 0, wx.ALIGN_CENTER|wx.ALL, 10)
panel.SetSizer(sizer)
toaster.AddPanel(panel)
wx.CallLater(1000, toaster.Play)
示例13: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = kwds.get("style", 0)
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((200, 200))
self.SetTitle("frame_1")
sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.label_1 = wx.StaticText(self, wx.ID_ANY, "placeholder - every design\nneeds a toplevel window", style=wx.ALIGN_CENTER)
sizer_1.Add(self.label_1, 1, wx.ALL | wx.EXPAND, 0)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
# end of class MyFrame
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = kwds.get("style", 0)
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((200, 200))
self.SetTitle("frame_1")
# Tool Bar
self.frame_1_toolbar = wx.ToolBar(self, -1)
self.frame_1_toolbar.AddLabelTool(wx.ID_UP, "UpDown", wx.ArtProvider.GetBitmap(wx.ART_GO_UP, wx.ART_OTHER, (32, 32)), wx.ArtProvider.GetBitmap(wx.ART_GO_DOWN, wx.ART_OTHER, (32, 32)), wx.ITEM_CHECK, "Up or Down", "Up or Down")
self.SetToolBar(self.frame_1_toolbar)
self.frame_1_toolbar.Realize()
# Tool Bar end
sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.label_1 = wx.StaticText(self, wx.ID_ANY, "placeholder - every design\nneeds a toplevel window", style=wx.ALIGN_CENTER)
sizer_1.Add(self.label_1, 1, wx.ALL | wx.EXPAND, 0)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
# end of class MyFrame
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ALIGN_CENTER [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = kwds.get("style", 0)
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((200, 200))
self.SetTitle("frame_1")
# Tool Bar
self.frame_1_toolbar = wx.ToolBar(self, -1)
self.frame_1_toolbar.AddTool(wx.ID_UP, "UpDown", wx.ArtProvider.GetBitmap(wx.ART_GO_UP, wx.ART_OTHER, (32, 32)), wx.ArtProvider.GetBitmap(wx.ART_GO_DOWN, wx.ART_OTHER, (32, 32)), wx.ITEM_CHECK, "Up or Down", "Up or Down")
self.SetToolBar(self.frame_1_toolbar)
self.frame_1_toolbar.Realize()
# Tool Bar end
sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.label_1 = wx.StaticText(self, wx.ID_ANY, "placeholder - every design\nneeds a toplevel window", style=wx.ALIGN_CENTER)
sizer_1.Add(self.label_1, 1, wx.ALL | wx.EXPAND, 0)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
# end of class MyFrame