]>
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 | |
d14a1e28 RD |
7 | from wxPython.wx import * |
8 | from wxPython.xrc import * | |
9 | import sys | |
1fded56b | 10 | |
d14a1e28 RD |
11 | # Global constants |
12 | ||
d14a1e28 | 13 | progname = 'XRCed' |
fd919451 | 14 | version = '0.1.4-1' |
80389ff7 RR |
15 | # Can be changed to set other default encoding different |
16 | defaultEncoding = sys.getdefaultencoding() | |
d14a1e28 RD |
17 | |
18 | try: | |
19 | True | |
20 | except NameError: | |
21 | True = 1==1 | |
22 | False = 1==0 | |
23 | ||
24 | # Global variables | |
25 | ||
26 | class Globals: | |
27 | panel = None | |
28 | tree = None | |
29 | frame = None | |
30 | tools = None | |
31 | undoMan = None | |
32 | testWin = None | |
33 | testWinPos = wxDefaultPosition | |
34 | currentXXX = None | |
80389ff7 | 35 | currentEncoding = defaultEncoding |
d14a1e28 | 36 | |
289128a4 RD |
37 | def _makeFonts(self): |
38 | self._sysFont = wxSystemSettings_GetFont(wxSYS_SYSTEM_FONT) | |
39 | self._labelFont = wxFont(self._sysFont.GetPointSize(), wxDEFAULT, wxNORMAL, wxBOLD) | |
40 | self._modernFont = wxFont(self._sysFont.GetPointSize(), wxMODERN, wxNORMAL, wxNORMAL) | |
41 | self._smallerFont = wxFont(self._sysFont.GetPointSize()-2, wxDEFAULT, wxNORMAL, wxNORMAL) | |
42 | ||
43 | def sysFont(self): | |
44 | if not hasattr(self, "_sysFont"): self._makeFonts() | |
45 | return self._sysFont | |
46 | def labelFont(self): | |
47 | if not hasattr(self, "_labelFont"): self._makeFonts() | |
48 | return self._labelFont | |
49 | def modernFont(self): | |
50 | if not hasattr(self, "_modernFont"): self._makeFonts() | |
51 | return self._modernFont | |
52 | def smallerFont(self): | |
53 | if not hasattr(self, "_smallerFont"): self._makeFonts() | |
54 | return self._smallerFont | |
55 | ||
289128a4 | 56 | |
d14a1e28 | 57 | g = Globals() |