author | Edouard Tisserant |
Tue, 03 Dec 2019 09:46:12 +0100 | |
branch | svghmi |
changeset 2818 | 65f32c94d7ec |
parent 2453 | 9900a8df922f |
child 3303 | 0ffb41625592 |
permissions | -rw-r--r-- |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
1 |
# --------------------------------------------------------------------------- # |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
2 |
# ENHANCEDSTATUSBAR wxPython IMPLEMENTATION |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
3 |
# Python Code By: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
4 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
5 |
# Andrea Gavana, @ 31 May 2005 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
6 |
# Nitro, @ 21 September 2005 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
7 |
# Latest Revision: 21 September 2005, 19.57.20 GMT+2 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
8 |
# Latest Revision before Latest Revision: 21 September 2005, 18.29.35 GMT+2 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
9 |
# Latest Revision before Latest Revision before Latest Revision: 31 May 2005, 23.17 CET |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
10 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
11 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
12 |
# TODO List/Caveats |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
13 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
14 |
# 1. Some Requests/Features To Add? |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
15 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
16 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
17 |
# For All Kind Of Problems, Requests Of Enhancements And Bug Reports, Please |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
18 |
# Write To Me At: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
19 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
20 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
21 |
# andrea.gavana@agip.it |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
22 |
# andrea_gavan@tin.it |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
23 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
24 |
# Or, Obviously, To The wxPython Mailing List!!! |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
25 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
26 |
# |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
27 |
# licensed under wxWidgets License (GPL compatible) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
28 |
# End Of Comments |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
29 |
# --------------------------------------------------------------------------- # |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
30 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
31 |
""" Description: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
32 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
33 |
EnhancedStatusBar Is A Slight Modification (Actually A Subclassing) Of wx.StatusBar. |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
34 |
It Allows You To Add Almost Any Widget You Like To The wx.StatusBar Of Your Main |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
35 |
Frame Application And Also To Layout Them Properly. |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
36 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
37 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
38 |
What It Can Do: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
39 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
40 |
1) Almost All The Functionalities Of wx.StatusBar Are Still Present; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
41 |
2) You Can Add Different Kind Of Widgets Into Every Field Of The EnhancedStatusBar; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
42 |
3) The AddWidget() Methods Accepts 2 Layout Inputs: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
43 |
- horizontalalignment: This Specify The Horizontal Alignment For Your Widget, |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
44 |
And Can Be ESB_EXACT_FIT, ESB_ALIGN_CENTER_HORIZONTAL, ESB_ALIGN_LEFT And |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
45 |
ESB_ALIGN_RIGHT; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
46 |
- varticalalignment: This Specify The Vertical Alignment For Your Widget, |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
47 |
And Can Be ESB_EXACT_FIT, ESB_ALIGN_CENTER_VERTICAL, ESB_ALIGN_BOTTOM And |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
48 |
ESB_ALIGN_LEFT; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
49 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
50 |
EnhancedStatusBar Is Freeware And Distributed Under The wxPython License. |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
51 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
52 |
Latest Revision: 21 September 2005, 19.57.20 GMT+2 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
53 |
Latest Revision before Latest Revision: 21 September 2005, 18.29.35 GMT+2 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
54 |
Latest Revision before Latest Revision before Latest Revision: 31 May 2005, 23.17 CET |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
55 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
56 |
""" |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
57 |
|
1881
091005ec69c4
fix pylint py3k conversion warning: "(no-absolute-import) import missing `from __future__ import absolute_import`"
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1846
diff
changeset
|
58 |
from __future__ import absolute_import |
2437
105c20fdeb19
python3 support: pylint, W1619 #(old-division) division w/o __future__ statement
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1881
diff
changeset
|
59 |
from __future__ import division |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
60 |
import wx |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
61 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
62 |
# Horizontal Alignment Constants |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
63 |
ESB_ALIGN_CENTER_VERTICAL = 1 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
64 |
ESB_ALIGN_TOP = 2 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
65 |
ESB_ALIGN_BOTTOM = 3 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
66 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
67 |
# Vertical Alignment Constants |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
68 |
ESB_ALIGN_CENTER_HORIZONTAL = 11 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
69 |
ESB_ALIGN_LEFT = 12 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
70 |
ESB_ALIGN_RIGHT = 13 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
71 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
72 |
# Exact Fit (Either Horizontal Or Vertical Or Both) Constant |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
73 |
ESB_EXACT_FIT = 20 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
74 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
75 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
76 |
# --------------------------------------------------------------- |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
77 |
# Class EnhancedStatusBar |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
78 |
# --------------------------------------------------------------- |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
79 |
# This Is The Main Class Implementation. See The Demo For Details |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
80 |
# --------------------------------------------------------------- |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
81 |
class EnhancedStatusBarItem(object): |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
82 |
def __init__(self, widget, pos, horizontalalignment=ESB_ALIGN_CENTER_HORIZONTAL, verticalalignment=ESB_ALIGN_CENTER_VERTICAL): |
1746
45d6f5fba016
clean-up: fix PEP8 E202 whitespace before ')'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1744
diff
changeset
|
83 |
self.__dict__.update(locals()) |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
84 |
|
1736
7e61baa047f0
clean-up: fix PEP8 E302 expected 2 blank lines, found 1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1731
diff
changeset
|
85 |
|
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
86 |
class EnhancedStatusBar(wx.StatusBar): |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
87 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
88 |
def __init__(self, parent, id=wx.ID_ANY, style=wx.ST_SIZEGRIP, |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
89 |
name="EnhancedStatusBar"): |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
90 |
"""Default Class Constructor. |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
91 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
92 |
EnhancedStatusBar.__init__(self, parent, id=wx.ID_ANY, |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
93 |
style=wx.ST_SIZEGRIP, |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
94 |
name="EnhancedStatusBar") |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
95 |
""" |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
96 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
97 |
wx.StatusBar.__init__(self, parent, id, style, name) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
98 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
99 |
self._items = {} |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
100 |
self._curPos = 0 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
101 |
self._parent = parent |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
102 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
103 |
wx.EVT_SIZE(self, self.OnSize) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
104 |
wx.CallAfter(self.OnSize, None) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
105 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
106 |
def OnSize(self, event): |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
107 |
"""Handles The wx.EVT_SIZE Events For The StatusBar. |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
108 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
109 |
Actually, All The Calculations Linked To HorizontalAlignment And |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
110 |
VerticalAlignment Are Done In This Function.""" |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
111 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
112 |
for pos, item in self._items.items(): |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
113 |
widget, horizontalalignment, verticalalignment = item.widget, item.horizontalalignment, item.verticalalignment |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
114 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
115 |
rect = self.GetFieldRect(pos) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
116 |
widgetsize = widget.GetSize() |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
117 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
118 |
rect = self.GetFieldRect(pos) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
119 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
120 |
if horizontalalignment == ESB_EXACT_FIT: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
121 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
122 |
if verticalalignment == ESB_EXACT_FIT: |
1837
c507c363625e
fix pylint warning '(pointless-string-statement) String statement has no effect'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1756
diff
changeset
|
123 |
# 1 September 2015 Fix fit align |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
124 |
widget.SetSize((rect.width-4, rect.height-4)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
125 |
widget.SetPosition((rect.x+2, rect.y+2)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
126 |
elif verticalalignment == ESB_ALIGN_CENTER_VERTICAL: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
127 |
if widgetsize[1] < rect.width - 1: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
128 |
diffs = (rect.height - widgetsize[1])/2 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
129 |
widget.SetSize((rect.width-2, widgetsize[1])) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
130 |
widget.SetPosition((rect.x-1, rect.y+diffs)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
131 |
else: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
132 |
widget.SetSize((rect.width-2, widgetsize[1])) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
133 |
widget.SetPosition((rect.x-1, rect.y-1)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
134 |
elif verticalalignment == ESB_ALIGN_TOP: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
135 |
widget.SetSize((rect.width-2, widgetsize[1])) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
136 |
widget.SetPosition((rect.x-1, rect.y)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
137 |
elif verticalalignment == ESB_ALIGN_BOTTOM: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
138 |
widget.SetSize((rect.width-2, widgetsize[1])) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
139 |
widget.SetPosition((rect.x-1, rect.height-widgetsize[1])) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
140 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
141 |
elif horizontalalignment == ESB_ALIGN_LEFT: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
142 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
143 |
xpos = rect.x - 1 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
144 |
if verticalalignment == ESB_EXACT_FIT: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
145 |
widget.SetSize((widgetsize[0], rect.height-2)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
146 |
widget.SetPosition((xpos, rect.y-1)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
147 |
elif verticalalignment == ESB_ALIGN_CENTER_VERTICAL: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
148 |
if widgetsize[1] < rect.height - 1: |
2437
105c20fdeb19
python3 support: pylint, W1619 #(old-division) division w/o __future__ statement
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1881
diff
changeset
|
149 |
diffs = (rect.height - widgetsize[1]) // 2 |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
150 |
widget.SetPosition((xpos, rect.y+diffs)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
151 |
else: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
152 |
widget.SetSize((widgetsize[0], rect.height-2)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
153 |
widget.SetPosition((xpos, rect.y-1)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
154 |
elif verticalalignment == ESB_ALIGN_TOP: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
155 |
widget.SetPosition((xpos, rect.y)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
156 |
elif verticalalignment == ESB_ALIGN_BOTTOM: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
157 |
widget.SetPosition((xpos, rect.height-widgetsize[1])) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
158 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
159 |
elif horizontalalignment == ESB_ALIGN_RIGHT: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
160 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
161 |
xpos = rect.x + rect.width - widgetsize[0] - 1 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
162 |
if verticalalignment == ESB_EXACT_FIT: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
163 |
widget.SetSize((widgetsize[0], rect.height-2)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
164 |
widget.SetPosition((xpos, rect.y-1)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
165 |
elif verticalalignment == ESB_ALIGN_CENTER_VERTICAL: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
166 |
if widgetsize[1] < rect.height - 1: |
2437
105c20fdeb19
python3 support: pylint, W1619 #(old-division) division w/o __future__ statement
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1881
diff
changeset
|
167 |
diffs = (rect.height - widgetsize[1]) // 2 |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
168 |
widget.SetPosition((xpos, rect.y+diffs)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
169 |
else: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
170 |
widget.SetSize((widgetsize[0], rect.height-2)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
171 |
widget.SetPosition((xpos, rect.y-1)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
172 |
elif verticalalignment == ESB_ALIGN_TOP: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
173 |
widget.SetPosition((xpos, rect.y)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
174 |
elif verticalalignment == ESB_ALIGN_BOTTOM: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
175 |
widget.SetPosition((xpos, rect.height-widgetsize[1])) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
176 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
177 |
elif horizontalalignment == ESB_ALIGN_CENTER_HORIZONTAL: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
178 |
|
2437
105c20fdeb19
python3 support: pylint, W1619 #(old-division) division w/o __future__ statement
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1881
diff
changeset
|
179 |
xpos = rect.x + (rect.width - widgetsize[0]) // 2 - 1 |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
180 |
if verticalalignment == ESB_EXACT_FIT: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
181 |
widget.SetSize((widgetsize[0], rect.height)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
182 |
widget.SetPosition((xpos, rect.y)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
183 |
elif verticalalignment == ESB_ALIGN_CENTER_VERTICAL: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
184 |
if widgetsize[1] < rect.height - 1: |
2437
105c20fdeb19
python3 support: pylint, W1619 #(old-division) division w/o __future__ statement
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1881
diff
changeset
|
185 |
diffs = (rect.height - widgetsize[1]) // 2 |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
186 |
widget.SetPosition((xpos, rect.y+diffs)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
187 |
else: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
188 |
widget.SetSize((widgetsize[0], rect.height-1)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
189 |
widget.SetPosition((xpos, rect.y+1)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
190 |
elif verticalalignment == ESB_ALIGN_TOP: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
191 |
widget.SetPosition((xpos, rect.y)) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
192 |
elif verticalalignment == ESB_ALIGN_BOTTOM: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
193 |
widget.SetPosition((xpos, rect.height-widgetsize[1])) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
194 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
195 |
if event is not None: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
196 |
event.Skip() |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
197 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
198 |
def AddWidget(self, widget, horizontalalignment=ESB_ALIGN_CENTER_HORIZONTAL, |
1744
69dfdb26f600
clean-up: fix PEP8 E251 unexpected spaces around keyword / parameter equals
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1741
diff
changeset
|
199 |
verticalalignment=ESB_ALIGN_CENTER_VERTICAL, pos=-1): |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
200 |
"""Add A Widget To The EnhancedStatusBar. |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
201 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
202 |
Parameters: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
203 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
204 |
- horizontalalignment: This Can Be One Of: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
205 |
a) ESB_EXACT_FIT: The Widget Will Fit Horizontally The StatusBar Field Width; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
206 |
b) ESB_ALIGN_CENTER_HORIZONTAL: The Widget Will Be Centered Horizontally In |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
207 |
The StatusBar Field; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
208 |
c) ESB_ALIGN_LEFT: The Widget Will Be Left Aligned In The StatusBar Field; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
209 |
d) ESB_ALIGN_RIGHT: The Widget Will Be Right Aligned In The StatusBar Field; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
210 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
211 |
- verticalalignment: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
212 |
a) ESB_EXACT_FIT: The Widget Will Fit Vertically The StatusBar Field Height; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
213 |
b) ESB_ALIGN_CENTER_VERTICAL: The Widget Will Be Centered Vertically In |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
214 |
The StatusBar Field; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
215 |
c) ESB_ALIGN_BOTTOM: The Widget Will Be Bottom Aligned In The StatusBar Field; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
216 |
d) ESB_ALIGN_TOP: The Widget Will Be TOP Aligned In The StatusBar Field; |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
217 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
218 |
""" |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
219 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
220 |
if pos == -1: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
221 |
pos = self._curPos |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
222 |
self._curPos += 1 |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
223 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
224 |
if self.GetFieldsCount() <= pos: |
2453
9900a8df922f
python3 support: pylint, W1625 # (raising-string) Raising a string exception
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2437
diff
changeset
|
225 |
raise ValueError("\nERROR: EnhancedStatusBar has a max of %d items, you tried to set item #%d" % |
9900a8df922f
python3 support: pylint, W1625 # (raising-string) Raising a string exception
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2437
diff
changeset
|
226 |
(self.GetFieldsCount(), pos)) |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
227 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
228 |
if horizontalalignment not in [ESB_ALIGN_CENTER_HORIZONTAL, ESB_EXACT_FIT, |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
229 |
ESB_ALIGN_LEFT, ESB_ALIGN_RIGHT]: |
2453
9900a8df922f
python3 support: pylint, W1625 # (raising-string) Raising a string exception
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2437
diff
changeset
|
230 |
raise ValueError('\nERROR: Parameter "horizontalalignment" Should Be One Of ' |
9900a8df922f
python3 support: pylint, W1625 # (raising-string) Raising a string exception
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2437
diff
changeset
|
231 |
'"ESB_ALIGN_CENTER_HORIZONTAL", "ESB_ALIGN_LEFT", "ESB_ALIGN_RIGHT"' |
9900a8df922f
python3 support: pylint, W1625 # (raising-string) Raising a string exception
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2437
diff
changeset
|
232 |
'"ESB_EXACT_FIT"') |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
233 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
234 |
if verticalalignment not in [ESB_ALIGN_CENTER_VERTICAL, ESB_EXACT_FIT, |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
235 |
ESB_ALIGN_TOP, ESB_ALIGN_BOTTOM]: |
2453
9900a8df922f
python3 support: pylint, W1625 # (raising-string) Raising a string exception
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2437
diff
changeset
|
236 |
raise ValueError('\nERROR: Parameter "verticalalignment" Should Be One Of ' |
9900a8df922f
python3 support: pylint, W1625 # (raising-string) Raising a string exception
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2437
diff
changeset
|
237 |
'"ESB_ALIGN_CENTER_VERTICAL", "ESB_ALIGN_TOP", "ESB_ALIGN_BOTTOM"' |
9900a8df922f
python3 support: pylint, W1625 # (raising-string) Raising a string exception
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2437
diff
changeset
|
238 |
'"ESB_EXACT_FIT"') |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
239 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
240 |
try: |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
241 |
self.RemoveChild(self._items[pos].widget) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
242 |
self._items[pos].widget.Destroy() |
1756
08e4394ff4fb
clean-up: fix PEP8 E701 multiple statements on one line (colon)
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1746
diff
changeset
|
243 |
except KeyError: |
08e4394ff4fb
clean-up: fix PEP8 E701 multiple statements on one line (colon)
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1746
diff
changeset
|
244 |
pass |
1731
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
245 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
246 |
self._items[pos] = EnhancedStatusBarItem(widget, pos, horizontalalignment, verticalalignment) |
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
247 |
|
6ebd9c40b2be
convert some files from CRLF to LF
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1730
diff
changeset
|
248 |
wx.CallAfter(self.OnSize, None) |