本文整理匯總了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()