]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxRightTextCtrl.py
dismiss the popup when an unprocessed key is pressed
[wxWidgets.git] / wxPython / demo / wxRightTextCtrl.py
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,
15 "These text controls will align their contents to\n"
16 "the right (on wxMSW) when they don't have focus.", style=wxALIGN_RIGHT )
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)
36 self.SetAutoLayout(true)
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__