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