]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/wx/tools/XRCed/globals.py
'[1219035] cleanup: miscellaneous' and minor source cleaning.
[wxWidgets.git] / wxPython / wx / tools / XRCed / globals.py
... / ...
CommitLineData
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
7from wxPython.wx import *
8from wxPython.xrc import *
9try:
10 from wxPython.wizard import *
11except:
12 pass
13import sys
14
15# Global constants
16
17progname = 'XRCed'
18version = '0.1.5-2'
19# Can be changed to set other default encoding different
20defaultEncoding = ''
21# you comment above and can uncomment this:
22#import wx
23#defaultEncoding = wx.GetDefaultPyEncoding()
24
25try:
26 True
27except NameError:
28 True = 1==1
29 False = 1==0
30
31# Global variables
32
33class 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
42 currentEncoding = defaultEncoding
43
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
63
64g = Globals()