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