]>
Commit | Line | Data |
---|---|---|
729f4276 RD |
1 | |
2 | from wxPython.wx import * | |
3 | from wxPython.lib.rightalign import wxRightTextCtrl | |
4 | import wxPython.lib.rightalign | |
5 | ||
6 | ||
7 | #---------------------------------------------------------------------- | |
8 | ||
9 | class TestPanel(wxPanel): | |
10 | def __init__(self, parent): | |
11 | wxPanel.__init__(self, parent, -1) | |
12 | ||
13 | fgs = wxFlexGridSizer(cols=2, vgap=5, hgap=5) | |
14 | txt = wxStaticText(self, -1, | |
4309b812 RD |
15 | "These text controls will align their contents to\n" |
16 | "the right (on wxMSW) when they don't have focus.", style=wxALIGN_RIGHT ) | |
729f4276 RD |
17 | fgs.Add(txt) |
18 | fgs.Add(wxRightTextCtrl(self, -1, "", size=(75, -1))) | |
19 | ||
20 | fgs.Add(10,10) | |
21 | fgs.Add(wxRightTextCtrl(self, -1, "123.45", size=(75, -1))) | |
22 | ||
23 | fgs.Add(10,10) | |
24 | fgs.Add(wxRightTextCtrl(self, -1, "234.56", size=(75, -1))) | |
25 | ||
26 | fgs.Add(10,10) | |
27 | fgs.Add(wxRightTextCtrl(self, -1, "345.67", size=(75, -1))) | |
28 | ||
29 | fgs.Add(10,10) | |
30 | fgs.Add(wxRightTextCtrl(self, -1, "456.78", size=(75, -1))) | |
31 | ||
32 | sizer = wxBoxSizer(wxVERTICAL) | |
33 | sizer.Add(fgs, 0, wxALL, 25) | |
34 | ||
35 | self.SetSizer(sizer) | |
1e4a197e | 36 | self.SetAutoLayout(True) |
729f4276 RD |
37 | |
38 | ||
39 | ||
40 | #---------------------------------------------------------------------- | |
41 | ||
42 | def runTest(frame, nb, log): | |
43 | win = TestPanel(nb) | |
44 | return win | |
45 | ||
46 | #---------------------------------------------------------------------- | |
47 | ||
48 | overview = wxPython.lib.rightalign.__doc__ | |
e5dd90b1 | 49 | |
1fded56b RD |
50 | |
51 | ||
52 | ||
53 | if __name__ == '__main__': | |
54 | import sys,os | |
55 | import run | |
56 | run.main(['', os.path.basename(sys.argv[0])]) |