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