本文整理汇总了Python中wx.TE_CENTRE属性的典型用法代码示例。如果您正苦于以下问题:Python wx.TE_CENTRE属性的具体用法?Python wx.TE_CENTRE怎么用?Python wx.TE_CENTRE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.TE_CENTRE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_CENTRE [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.radio_box_1 = wx.RadioBox(self, wx.ID_ANY, u"运算类型选择", choices=[u"加法", u"减法", u"乘法", u"除法"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.radio_box_2 = wx.RadioBox(self, wx.ID_ANY, u"选择几步运算", choices=[u"一步", u"二步", u"三步"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.radio_box_3 = wx.RadioBox(self, wx.ID_ANY, u"题型设置", choices=[u"求结果", u"求算数项"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.button_1 = wx.Button(self, wx.ID_ANY, u"运行项及结果范围设置")
self.button_2 = wx.Button(self, wx.ID_ANY, u"运算符号设置")
self.checkbox_1 = wx.CheckBox(self, wx.ID_ANY, u"使用括号")
self.radio_box_4 = wx.RadioBox(self, wx.ID_ANY, u"加法设置", choices=[u"随机进位", u"加法进位", u"没有进位"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.radio_box_5 = wx.RadioBox(self, wx.ID_ANY, u"减法设置", choices=[u"随机退位", u"减法退位", u"没有退位"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.text_ctrl_16 = wx.TextCtrl(self, wx.ID_ANY, "20", style=wx.TE_CENTRE)
self.button_6 = wx.Button(self, wx.ID_ANY, u"添加口算题")
self.button_7 = wx.Button(self, wx.ID_ANY, u"清空口算题")
self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_ctrl_2 = wx.TextCtrl(self, wx.ID_ANY, "5", style=wx.TE_CENTRE)
self.text_ctrl_3 = wx.TextCtrl(self, wx.ID_ANY, "3", style=wx.TE_CENTRE)
self.text_ctrl_4 = wx.TextCtrl(self, wx.ID_ANY, u"小学生口算题")
self.text_ctrl_5 = wx.TextCtrl(self, wx.ID_ANY, u"姓名:__________ 日期:____月____日 时间:________ 对题:____道", style=wx.TE_LEFT)
self.button_8 = wx.Button(self, wx.ID_ANY, u"点此生成口算题打印文档")
self.__set_properties()
self.__do_layout()
# end wxGlade
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_CENTRE [as 别名]
def __init__(self, olv, subItemIndex, **kwargs):
style = wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB
# Allow for odd case where parent isn't an ObjectListView
if hasattr(olv, "columns"):
if olv.HasFlag(wx.LC_ICON):
style |= (wx.TE_CENTRE | wx.TE_MULTILINE)
else:
style |= olv.columns[subItemIndex].GetAlignmentForText()
wx.TextCtrl.__init__(self, olv, style=style, size=(0,0), **kwargs)
# With the MULTILINE flag, the text control always has a vertical
# scrollbar, which looks stupid. I don't know how to get rid of it.
# This doesn't do it:
# self.ToggleWindowStyle(wx.VSCROLL)
#----------------------------------------------------------------------------
示例3: Submit
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_CENTRE [as 别名]
def Submit(self, event):
self.button = event.GetEventObject()
self.button.Disable()
self.text_control = wx.TextCtrl(
self.panel,
-1,
'',
pos=(50, 120),
size=(400, 100),
style=wx.TE_MULTILINE | wx.TE_CENTRE | wx.TE_READONLY
| wx.TE_NO_VSCROLL | wx.TE_AUTO_URL | wx.TE_RICH2 | wx.BORDER_NONE
)
self.Parse(self.MyFrame)
示例4: GetAlignmentForText
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_CENTRE [as 别名]
def GetAlignmentForText(self):
"""
Return the alignment of this column in a form that can be used as
a style flag on a text control
"""
return {
"l": wx.TE_LEFT,
"c": wx.TE_CENTRE,
"r": wx.TE_RIGHT,
}.get(self.align[:1], wx.TE_LEFT)
#-------------------------------------------------------------------------------
# Value accessing
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_CENTRE [as 别名]
def __init__(self, main):
BTDialog.__init__(self, main, size = (300,400),
style=wx.DEFAULT_DIALOG_STYLE|wx.CLIP_CHILDREN|wx.WANTS_CHARS)
self.Bind(wx.EVT_CLOSE, self.close)
self.SetTitle(_("About %s")%app_name)
self.sizer = VSizer()
i = wx.the_app.image_library.get(('logo', 'banner'))
b = wx.BitmapFromImage(i)
self.bitmap = ElectroStaticBitmap(self, b)
self.sizer.AddFirst(self.bitmap, flag=wx.ALIGN_CENTER_HORIZONTAL)
version_str = version
if int(version_str[2]) % 2:
version_str = version_str + ' ' + _("Beta")
if '__WXGTK__' in wx.PlatformInfo:
# wtf, "Version" forces a line break before the
# version_str on WXGTK only -- most other strings work
# fine.
version_text = _("version %s") % version_str
else:
version_text = _("Version %s") % version_str
version_label = ElectroStaticText(self, label=version_text)
self.sizer.Add(version_label, flag=wx.ALIGN_CENTER_HORIZONTAL)
if branch is not None:
blabel = ElectroStaticText(self, label='working dir: %s' % branch)
self.sizer.Add(blabel, flag=wx.ALIGN_CENTER_HORIZONTAL)
self.credits_scroll = CreditsScroll(self, 'credits', style=wx.TE_CENTRE)
self.lic_scroll = CreditsScroll(self, 'LICENSE', style=wx.TE_CENTRE)
self.sizer.Add(self.lic_scroll, flag=wx.GROW, proportion=1)
self.sizer.Add(self.credits_scroll, flag=wx.GROW, proportion=1)
self.lic_scroll.Hide()
self.button_sizer = HSizer()
self.credits_button = wx.Button(parent=self, id=wx.ID_ANY, label=_("Li&cense"))
self.credits_button.Bind(wx.EVT_BUTTON, self.toggle_credits)
self.button_sizer.AddFirst(self.credits_button)
self.sizer.Add(self.button_sizer, flag=wx.ALIGN_CENTER_HORIZONTAL, proportion=0, border=0)
self.SetSizerAndFit(self.sizer)
for w in (self, self.bitmap,
self.credits_scroll,
self.credits_button):
w.Bind(wx.EVT_CHAR, self.key)
self.SetFocus()