X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b881fc787d2823bdd8a415080b82feee90804a17..db679b8c836e69c111cdc31e62cf92cebe4f938f:/wxPython/wx/lib/rightalign.py?ds=sidebyside diff --git a/wxPython/wx/lib/rightalign.py b/wxPython/wx/lib/rightalign.py index f002373799..6ee642acd4 100644 --- a/wxPython/wx/lib/rightalign.py +++ b/wxPython/wx/lib/rightalign.py @@ -16,6 +16,10 @@ # o 2.5 compatability update. # o Added deprecation warning. # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxRightTextCtrl -> RightTextCtrl +# """ Some time ago, I asked about how to right-align @@ -33,7 +37,7 @@ left-aligned if it has focus. Hope this can help someone, as much as this list helps me. Josu Oyanguren -Ubera Servicios Informáticos. +Ubera Servicios Informaticos. P.S. This only works well on wxMSW. @@ -60,7 +64,7 @@ warnings.warn(warningmsg, DeprecationWarning, stacklevel=2) #---------------------------------------------------------------------- -class wxRightTextCtrl(wx.TextCtrl): +class RightTextCtrl(wx.TextCtrl): def __init__(self, parent, id, *args, **kwargs): wx.TextCtrl.__init__(self, parent, id, *args, **kwargs) self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus) @@ -84,18 +88,18 @@ class wxRightTextCtrl(wx.TextCtrl): dc.SetTextForeground(fclr) - dc.SetClippingRegion(0, 0, dcwidth, dcheight) - dc.DrawText(text, (x, y)) + dc.SetClippingRegion((0, 0), (dcwidth, dcheight)) + dc.DrawText(text, x, y) if x < 0: toofat = '...' markwidth = dc.GetTextExtent(toofat)[0] dc.SetPen(wx.Pen(dc.GetBackground().GetColour(), 1, wx.SOLID )) - dc.DrawRectangle((0,0), (markwidth, dcheight)) + dc.DrawRectangle(0,0, markwidth, dcheight) dc.SetPen(wx.Pen(wx.RED, 1, wx.SOLID )) dc.SetBrush(wx.TRANSPARENT_BRUSH) - dc.DrawRectangle((1, 1), (dcwidth-2, dcheight-2)) - dc.DrawText(toofat, (1, y)) + dc.DrawRectangle(1, 1, dcwidth-2, dcheight-2) + dc.DrawText(toofat, 1, y) def OnKillFocus(self, event):