Python wx.TE_CENTRE Examples

The following are 5 code examples of wx.TE_CENTRE(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wx , or try the search function .
Example #1
Source File: wxglade_out.py    From PrimarySchoolMathematics with Apache License 2.0 6 votes vote down vote up
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 
Example #2
Source File: CellEditor.py    From bookhub with MIT License 6 votes vote down vote up
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)

#---------------------------------------------------------------------------- 
Example #3
Source File: filmow_to_letterboxd.py    From filmow_to_letterboxd with MIT License 5 votes vote down vote up
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) 
Example #4
Source File: ObjectListView.py    From bookhub with MIT License 5 votes vote down vote up
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 
Example #5
Source File: DownloadManager.py    From BitTorrent with GNU General Public License v3.0 4 votes vote down vote up
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()