]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/wx/tools/XRCed/globals.py
Respect the REUSEADDR flag to allow rebinding; bind to local port prior to connecting...
[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.7-0'
19# Minimal wxWindows version
20MinWxVersion = (2,6,0)
21if wxVERSION[:3] < MinWxVersion:
22 print '''\
23******************************* WARNING **************************************
24 This version of XRCed may not work correctly on your version of wxWindows.
25 Please upgrade wxWindows to %d.%d.%d or higher.
26******************************************************************************''' % MinWxVersion
27
28# Can be changed to set other default encoding different
29#defaultEncoding = ''
30# you comment above and can uncomment this:
31defaultEncoding = wxGetDefaultPyEncoding()
32
33try:
34 True
35except NameError:
36 True = 1==1
37 False = 1==0
38
39# Global variables
40
41class Globals:
42 panel = None
43 tree = None
44 frame = None
45 tools = None
46 undoMan = None
47 testWin = None
48 testWinPos = wxDefaultPosition
49 currentXXX = None
50 currentEncoding = defaultEncoding
51
52 def _makeFonts(self):
53 self._sysFont = wxSystemSettings_GetFont(wxSYS_SYSTEM_FONT)
54 self._labelFont = wxFont(self._sysFont.GetPointSize(), wxDEFAULT, wxNORMAL, wxBOLD)
55 self._modernFont = wxFont(self._sysFont.GetPointSize(), wxMODERN, wxNORMAL, wxNORMAL)
56 self._smallerFont = wxFont(self._sysFont.GetPointSize()-2, wxDEFAULT, wxNORMAL, wxNORMAL)
57
58 def sysFont(self):
59 if not hasattr(self, "_sysFont"): self._makeFonts()
60 return self._sysFont
61 def labelFont(self):
62 if not hasattr(self, "_labelFont"): self._makeFonts()
63 return self._labelFont
64 def modernFont(self):
65 if not hasattr(self, "_modernFont"): self._makeFonts()
66 return self._modernFont
67 def smallerFont(self):
68 if not hasattr(self, "_smallerFont"): self._makeFonts()
69 return self._smallerFont
70
71
72g = Globals()