]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxRightTextCtrl.py
reSWIGged
[wxWidgets.git] / wxPython / demo / wxRightTextCtrl.py
CommitLineData
8fa876ca
RD
1# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2#
3# o Updated for wx namespace
4#
5# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net)
6#
7# o The rightalign library needs converted for this to work correctly.
8#
b881fc78
RD
9# 12/11/2003 - Jeff Grimmett (grimmtooth@softhome.net)
10#
11# o All issues resolved.
12#
d4b73b1b
RD
13# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
14#
15# o wxRightTextCtrl -> RightTextCtrl
16#
8fa876ca
RD
17
18############################################################################\
19# Note: this demo has been converted, but the control is deprecated because |
20# wx.TextCtrl now supports the wx.TE_RIGHT style flag, which makes this |
21# control completely superfluous. |
22############################################################################/
23
24import wx
25import wx.lib.rightalign as right
729f4276
RD
26
27#----------------------------------------------------------------------
28
8fa876ca 29class TestPanel(wx.Panel):
729f4276 30 def __init__(self, parent):
8fa876ca
RD
31 wx.Panel.__init__(self, parent, -1)
32
33 fgs = wx.FlexGridSizer(cols=2, vgap=5, hgap=5)
34
35 txt = wx.StaticText(
36 self, -1,
37 "These text controls will align their contents to\n"
38 "the right (on wxMSW) when they don't have focus.",
39 style=wx.ALIGN_RIGHT
40 )
729f4276 41
729f4276 42 fgs.Add(txt)
d4b73b1b 43 fgs.Add(right.RightTextCtrl(self, -1, "", size=(75, -1)))
729f4276 44
8fa876ca 45 fgs.Add((10,10))
d4b73b1b 46 fgs.Add(right.RightTextCtrl(self, -1, "123.45", size=(75, -1)))
729f4276 47
8fa876ca 48 fgs.Add((10,10))
d4b73b1b 49 fgs.Add(right.RightTextCtrl(self, -1, "234.56", size=(75, -1)))
729f4276 50
8fa876ca 51 fgs.Add((10,10))
d4b73b1b 52 fgs.Add(right.RightTextCtrl(self, -1, "345.67", size=(75, -1)))
729f4276 53
8fa876ca 54 fgs.Add((10,10))
d4b73b1b 55 fgs.Add(right.RightTextCtrl(self, -1, "456.78", size=(75, -1)))
729f4276 56
8fa876ca
RD
57 sizer = wx.BoxSizer(wx.VERTICAL)
58 sizer.Add(fgs, 0, wx.ALL, 25)
729f4276
RD
59
60 self.SetSizer(sizer)
1e4a197e 61 self.SetAutoLayout(True)
729f4276
RD
62
63
64
65#----------------------------------------------------------------------
66
67def runTest(frame, nb, log):
68 win = TestPanel(nb)
69 return win
70
71#----------------------------------------------------------------------
72
8fa876ca 73overview = right.__doc__
1fded56b
RD
74
75
76if __name__ == '__main__':
77 import sys,os
78 import run
79 run.main(['', os.path.basename(sys.argv[0])])