]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wx/tools/XRCed/globals.py
0a9ca2856a9372b3d577c28d590693493561e32f
[wxWidgets.git] / wxPython / wx / tools / XRCed / globals.py
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$
6
7 from wxPython.wx import *
8 from wxPython.xrc import *
9 import sys
10
11 # Global constants
12
13 progname = 'XRCed'
14 version = '0.1.4-1'
15 # Can be changed to set other default encoding different
16 defaultEncoding = sys.getdefaultencoding()
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
35 currentEncoding = defaultEncoding
36
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
56
57 g = Globals()