2004-01-12 22:17:17 -05: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-08 20:23:28 -05:00
|
|
|
|
|
|
|
import wx
|
2004-01-12 22:17:17 -05:00
|
|
|
import wx.lib.rightalign as right
|
2001-10-20 23:43:58 -04:00
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
class TestPanel(wx.Panel):
|
2001-10-20 23:43:58 -04:00
|
|
|
def __init__(self, parent):
|
2003-12-08 20:23:28 -05: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-20 23:43:58 -04:00
|
|
|
|
|
|
|
fgs.Add(txt)
|
2003-12-22 14:09:54 -05:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "", size=(75, -1)))
|
2001-10-20 23:43:58 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
fgs.Add((10,10))
|
2003-12-22 14:09:54 -05:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "123.45", size=(75, -1)))
|
2001-10-20 23:43:58 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
fgs.Add((10,10))
|
2003-12-22 14:09:54 -05:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "234.56", size=(75, -1)))
|
2001-10-20 23:43:58 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
fgs.Add((10,10))
|
2003-12-22 14:09:54 -05:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "345.67", size=(75, -1)))
|
2001-10-20 23:43:58 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
fgs.Add((10,10))
|
2003-12-22 14:09:54 -05:00
|
|
|
fgs.Add(right.RightTextCtrl(self, -1, "456.78", size=(75, -1)))
|
2001-10-20 23:43:58 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
|
|
|
sizer.Add(fgs, 0, wx.ALL, 25)
|
2001-10-20 23:43:58 -04:00
|
|
|
|
|
|
|
self.SetSizer(sizer)
|
2003-03-25 01:35:27 -05:00
|
|
|
self.SetAutoLayout(True)
|
2001-10-20 23:43:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
def runTest(frame, nb, log):
|
|
|
|
win = TestPanel(nb)
|
|
|
|
return win
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
overview = right.__doc__
|
2003-07-02 19:13:10 -04:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import sys,os
|
|
|
|
import run
|
|
|
|
run.main(['', os.path.basename(sys.argv[0])])
|