2004-01-13 03:17:17 +00:00
|
|
|
#####################################################################\
|
|
|
|
# Note: This control is deprecated because wx.TextCtrl now supports |
|
|
|
|
# the wx.TE_RIGHT style flag, which makes this control completely |
|
|
|
|
# superfluous. |
|
|
|
|
#####################################################################/
|
2003-12-09 01:23:28 +00:00
|
|
|
|
|
|
|
import wx
|
2004-01-13 03:17:17 +00:00
|
|
|
import wx.lib.rightalign as right
|
2001-10-21 03:43:58 +00:00
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
class TestPanel(wx.Panel):
|
2001-10-21 03:43:58 +00:00
|
|
|
def __init__(self, parent):
|
2003-12-09 01:23:28 +00:00
|
|
|
wx.Panel.__init__(self, parent, -1)
|
|
|
|
|
|
|
|
fgs = wx.FlexGridSizer(cols=2, vgap=5, hgap=5)
|
|
|
|
|
|
|
|
txt = wx.StaticText(
|
|
|
|
self, -1,
|
|
|
|
"These text controls will align their contents to\n"
|
|
|
|
"the right (on wxMSW) when they don't have focus.",
|
|
|
|
style=wx.ALIGN_RIGHT
|
|
|
|
)
|
2001-10-21 03:43:58 +00:00
|
|
|
|
|
|
|
fgs.Add(txt)
|
2003-12-22 19:09:54 +00:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "", size=(75, -1)))
|
2001-10-21 03:43:58 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
fgs.Add((10,10))
|
2003-12-22 19:09:54 +00:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "123.45", size=(75, -1)))
|
2001-10-21 03:43:58 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
fgs.Add((10,10))
|
2003-12-22 19:09:54 +00:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "234.56", size=(75, -1)))
|
2001-10-21 03:43:58 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
fgs.Add((10,10))
|
2003-12-22 19:09:54 +00:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "345.67", size=(75, -1)))
|
2001-10-21 03:43:58 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
fgs.Add((10,10))
|
2003-12-22 19:09:54 +00:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "456.78", size=(75, -1)))
|
2001-10-21 03:43:58 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
|
|
|
sizer.Add(fgs, 0, wx.ALL, 25)
|
2001-10-21 03:43:58 +00:00
|
|
|
|
|
|
|
self.SetSizer(sizer)
|
2003-03-25 06:35:27 +00:00
|
|
|
self.SetAutoLayout(True)
|
2001-10-21 03:43:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
def runTest(frame, nb, log):
|
|
|
|
win = TestPanel(nb)
|
|
|
|
return win
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
overview = right.__doc__
|
2003-07-02 23:13:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import sys,os
|
|
|
|
import run
|
2004-03-05 00:06:33 +00:00
|
|
|
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
|