]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/RightTextCtrl.py
Fix "warning: operation on 'y' may be undefined".
[wxWidgets.git] / wxPython / demo / RightTextCtrl.py
CommitLineData
95bfd958
RD
1#####################################################################\
2# Note: This control is deprecated because wx.TextCtrl now supports |
3# the wx.TE_RIGHT style flag, which makes this control completely |
4# superfluous. |
5#####################################################################/
8fa876ca
RD
6
7import wx
95bfd958 8import wx.lib.rightalign as right
729f4276
RD
9
10#----------------------------------------------------------------------
11
8fa876ca 12class TestPanel(wx.Panel):
729f4276 13 def __init__(self, parent):
8fa876ca
RD
14 wx.Panel.__init__(self, parent, -1)
15
16 fgs = wx.FlexGridSizer(cols=2, vgap=5, hgap=5)
17
18 txt = wx.StaticText(
19 self, -1,
20 "These text controls will align their contents to\n"
21 "the right (on wxMSW) when they don't have focus.",
22 style=wx.ALIGN_RIGHT
23 )
729f4276 24
729f4276 25 fgs.Add(txt)
d4b73b1b 26 fgs.Add(right.RightTextCtrl(self, -1, "", size=(75, -1)))
729f4276 27
8fa876ca 28 fgs.Add((10,10))
d4b73b1b 29 fgs.Add(right.RightTextCtrl(self, -1, "123.45", size=(75, -1)))
729f4276 30
8fa876ca 31 fgs.Add((10,10))
d4b73b1b 32 fgs.Add(right.RightTextCtrl(self, -1, "234.56", size=(75, -1)))
729f4276 33
8fa876ca 34 fgs.Add((10,10))
d4b73b1b 35 fgs.Add(right.RightTextCtrl(self, -1, "345.67", size=(75, -1)))
729f4276 36
8fa876ca 37 fgs.Add((10,10))
d4b73b1b 38 fgs.Add(right.RightTextCtrl(self, -1, "456.78", size=(75, -1)))
729f4276 39
8fa876ca
RD
40 sizer = wx.BoxSizer(wx.VERTICAL)
41 sizer.Add(fgs, 0, wx.ALL, 25)
729f4276
RD
42
43 self.SetSizer(sizer)
1e4a197e 44 self.SetAutoLayout(True)
729f4276
RD
45
46
47
48#----------------------------------------------------------------------
49
50def runTest(frame, nb, log):
51 win = TestPanel(nb)
52 return win
53
54#----------------------------------------------------------------------
55
8fa876ca 56overview = right.__doc__
1fded56b
RD
57
58
59if __name__ == '__main__':
60 import sys,os
61 import run
8eca4fef 62 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])