]>
Commit | Line | Data |
---|---|---|
1 | # -*- coding: iso-8859-1 -*- | |
2 | #---------------------------------------------------------------------- | |
3 | # Name: wxPython.lib.rightalign | |
4 | # Purpose: A class derived from wxTextCtrl that aligns the text | |
5 | # on the right side of the control, (except when editing.) | |
6 | # | |
7 | # Author: Josu Oyanguren | |
8 | # | |
9 | # Created: 19-October-2001 | |
10 | # RCS-ID: $Id$ | |
11 | # Copyright: (c) 2001 by Total Control Software | |
12 | # Licence: wxWindows license | |
13 | #---------------------------------------------------------------------- | |
14 | # 12/11/2003 - Jeff Grimmett (grimmtooth@softhome.net) | |
15 | # | |
16 | # o 2.5 compatability update. | |
17 | # o Added deprecation warning. | |
18 | # | |
19 | # 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) | |
20 | # | |
21 | # o wxRightTextCtrl -> RightTextCtrl | |
22 | # | |
23 | ||
24 | """ | |
25 | Some time ago, I asked about how to right-align | |
26 | wxTextCtrls. Answer was that it is not supported. I forgot it. | |
27 | ||
28 | Just a week ago, one of my clients asked me to have numbers right | |
29 | aligned. (Indeed it was that numbers MUST be right aligned). | |
30 | ||
31 | So the game begun. Hacking, hacking, ... | |
32 | ||
33 | At last, i succeed. Here is some code that someone may find | |
34 | useful. ubRightTextCtrl is right-aligned when you are not editing, but | |
35 | left-aligned if it has focus. | |
36 | ||
37 | Hope this can help someone, as much as this list helps me. | |
38 | ||
39 | Josu Oyanguren | |
40 |