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