X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8b9a4190f70909de9568f45389e7aa3ecbc66b8a..0a5bb138a71dfc1c706fc0858fb2801500e2c2e8:/wxPython/wx/tools/XRCed/globals.py diff --git a/wxPython/wx/tools/XRCed/globals.py b/wxPython/wx/tools/XRCed/globals.py index 49b02114ec..845e3231ff 100644 --- a/wxPython/wx/tools/XRCed/globals.py +++ b/wxPython/wx/tools/XRCed/globals.py @@ -1,8 +1,72 @@ +# Name: globals.py +# Purpose: XRC editor, global variables +# Author: Roman Rolinsky +# Created: 02.12.2002 +# RCS-ID: $Id$ -"""Renamer stub: provides a way to drop the wx prefix from wxPython objects.""" +import wx +import wx.xrc as xrc +try: + import wx.wizard +except: + pass +import sys -from wx import _rename -from wxPython.tools.XRCed import globals -_rename(globals(), globals.__dict__, modulename='tools.XRCed.globals') -del globals -del _rename +# Global constants + +progname = 'XRCed' +version = '0.1.7-5' +# Minimal wxWidgets version +MinWxVersion = (2,6,0) +if wx.VERSION[:3] < MinWxVersion: + print '''\ +******************************* WARNING ************************************** + This version of XRCed may not work correctly on your version of wxWidgets. + Please upgrade wxWidgets to %d.%d.%d or higher. +******************************************************************************''' % MinWxVersion + +# Can be changed to set other default encoding different +#defaultEncoding = '' +# you comment above and can uncomment this: +defaultEncoding = wx.GetDefaultPyEncoding() + +try: + True +except NameError: + True = 1==1 + False = 1==0 + +# Global variables + +class Globals: + panel = None + tree = None + frame = None + tools = None + undoMan = None + testWin = None + testWinPos = wx.DefaultPosition + currentXXX = None + currentEncoding = defaultEncoding + + def _makeFonts(self): + self._sysFont = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT) + self._labelFont = wx.Font(self._sysFont.GetPointSize(), wx.DEFAULT, wx.NORMAL, wx.BOLD) + self._modernFont = wx.Font(self._sysFont.GetPointSize(), wx.MODERN, wx.NORMAL, wx.NORMAL) + self._smallerFont = wx.Font(self._sysFont.GetPointSize()-2, wx.DEFAULT, wx.NORMAL, wx.NORMAL) + + def sysFont(self): + if not hasattr(self, "_sysFont"): self._makeFonts() + return self._sysFont + def labelFont(self): + if not hasattr(self, "_labelFont"): self._makeFonts() + return self._labelFont + def modernFont(self): + if not hasattr(self, "_modernFont"): self._makeFonts() + return self._modernFont + def smallerFont(self): + if not hasattr(self, "_smallerFont"): self._makeFonts() + return self._smallerFont + + +g = Globals()