]>
Commit | Line | Data |
---|---|---|
d14a1e28 RD |
1 | # Name: globals.py |
2 | # Purpose: XRC editor, global variables | |
3 | # Author: Roman Rolinsky <rolinsky@mema.ucl.ac.be> | |
4 | # Created: 02.12.2002 | |
5 | # RCS-ID: $Id$ | |
1fded56b | 6 | |
29a41103 RD |
7 | import wx |
8 | import wx.xrc as xrc | |
64bce500 | 9 | try: |
29a41103 | 10 | import wx.wizard |
64bce500 RR |
11 | except: |
12 | pass | |
d14a1e28 | 13 | import sys |
1fded56b | 14 | |
d14a1e28 RD |
15 | # Global constants |
16 | ||
d14a1e28 | 17 | progname = 'XRCed' |
28e65e0f | 18 | version = '0.1.7-4' |
29a41103 | 19 | # Minimal wxWidgets version |
306b6fe9 | 20 | MinWxVersion = (2,6,0) |
29a41103 | 21 | if wx.VERSION[:3] < MinWxVersion: |
306b6fe9 RR |
22 | print '''\ |
23 | ******************************* WARNING ************************************** | |
73b2a9a7 | 24 | This version of XRCed may not work correctly on your version of wxWidgets. |
29a41103 | 25 | Please upgrade wxWidgets to %d.%d.%d or higher. |
306b6fe9 RR |
26 | ******************************************************************************''' % MinWxVersion |
27 | ||
80389ff7 | 28 | # Can be changed to set other default encoding different |
4eb5bfc6 | 29 | #defaultEncoding = '' |
9a69d0aa | 30 | # you comment above and can uncomment this: |
29a41103 | 31 | defaultEncoding = wx.GetDefaultPyEncoding() |
d14a1e28 RD |
32 | |
33 | try: | |
34 | True | |
35 | except NameError: | |
36 | True = 1==1 | |
37 | False = 1==0 | |
38 | ||
39 | # Global variables | |
40 | ||
41 | class Globals: | |
42 | panel = None | |
43 | tree = None | |
44 | frame = None | |
45 | tools = None | |
46 | undoMan = None | |
47 | testWin = None | |
29a41103 | 48 | testWinPos = wx.DefaultPosition |
d14a1e28 | 49 | currentXXX = None |
80389ff7 | 50 | currentEncoding = defaultEncoding |
d14a1e28 | 51 | |
289128a4 | 52 | def _makeFonts(self): |
29a41103 RD |
53 | self._sysFont = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT) |
54 | self._labelFont = wx.Font(self._sysFont.GetPointSize(), wx.DEFAULT, wx.NORMAL, wx.BOLD) | |
55 | self._modernFont = wx.Font(self._sysFont.GetPointSize(), wx.MODERN, wx.NORMAL, wx.NORMAL) | |
56 | self._smallerFont = wx.Font(self._sysFont.GetPointSize()-2, wx.DEFAULT, wx.NORMAL, wx.NORMAL) | |
289128a4 RD |
57 | |
58 | def sysFont(self): | |
59 | if not hasattr(self, "_sysFont"): self._makeFonts() | |
60 | return self._sysFont | |
61 | def labelFont(self): | |
62 | if not hasattr(self, "_labelFont"): self._makeFonts() | |
63 | return self._labelFont | |
64 | def modernFont(self): | |
65 | if not hasattr(self, "_modernFont"): self._makeFonts() | |
66 | return self._modernFont | |
67 | def smallerFont(self): | |
68 | if not hasattr(self, "_smallerFont"): self._makeFonts() | |
69 | return self._smallerFont | |
70 | ||
289128a4 | 71 | |
d14a1e28 | 72 | g = Globals() |