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