+ Find the display where the given window lies, return wx.NOT_FOUND if
+ it is not shown at all.
+ """
+ return _misc_.Display_GetFromWindow(*args, **kwargs)
+
+#---------------------------------------------------------------------------
+
+class StandardPaths(object):
+ """
+ wx.StandardPaths returns standard locations in the file system and
+ should be used by programs to find their data files in a portable way.
+
+ In the description of the methods below, the example return values are
+ given for the Unix, Windows and Mac OS X systems, however please note
+ that these are just examples and the actual values may differ. For
+ example, under Windows the system administrator may change the
+ standard directories locations, i.e. the Windows directory may be
+ named W:\Win2003 instead of the default C:\Windows.
+
+ The strings appname and username should be replaced with the value
+ returned by `wx.App.GetAppName` and the name of the currently logged
+ in user, respectively. The string prefix is only used under Unix and
+ is /usr/local by default but may be changed using `SetInstallPrefix`.
+
+ The directories returned by the methods of this class may or may not
+ exist. If they don't exist, it's up to the caller to create them,
+ wx.StandardPaths doesn't do it.
+
+ Finally note that these functions only work with standardly packaged
+ applications. I.e. under Unix you should follow the standard
+ installation conventions and under Mac you should create your
+ application bundle according to the Apple guidelines. Again, this
+ class doesn't help you to do it.
+ """
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+ def __init__(self): raise AttributeError, "No constructor defined"
+ __repr__ = _swig_repr
+ ResourceCat_None = _misc_.StandardPaths_ResourceCat_None
+ ResourceCat_Messages = _misc_.StandardPaths_ResourceCat_Messages
+ ResourceCat_Max = _misc_.StandardPaths_ResourceCat_Max
+ def Get(*args, **kwargs):
+ """
+ Get() -> StandardPaths
+
+ Return the global standard paths singleton
+ """
+ return _misc_.StandardPaths_Get(*args, **kwargs)
+
+ Get = staticmethod(Get)
+ def GetConfigDir(*args, **kwargs):
+ """
+ GetConfigDir(self) -> String
+
+ Return the directory with system config files: /etc under Unix,
+ 'c:\Documents and Settings\All Users\Application Data' under Windows,
+ /Library/Preferences for Mac
+ """
+ return _misc_.StandardPaths_GetConfigDir(*args, **kwargs)
+
+ def GetUserConfigDir(*args, **kwargs):
+ """
+ GetUserConfigDir(self) -> String
+
+ Return the directory for the user config files: $HOME under Unix,
+ 'c:\Documents and Settings\username' under Windows, and
+ ~/Library/Preferences under Mac
+
+ Only use this if you have a single file to put there, otherwise
+ `GetUserDataDir` is more appropriate
+ """
+ return _misc_.StandardPaths_GetUserConfigDir(*args, **kwargs)
+
+ def GetDataDir(*args, **kwargs):
+ """
+ GetDataDir(self) -> String
+
+ Return the location of the application's global, (i.e. not
+ user-specific,) data files: prefix/share/appname under Unix,
+ 'c:\Program Files\appname' under Windows,
+ appname.app/Contents/SharedSupport app bundle directory under Mac.
+ """
+ return _misc_.StandardPaths_GetDataDir(*args, **kwargs)
+
+ def GetLocalDataDir(*args, **kwargs):
+ """
+ GetLocalDataDir(self) -> String
+
+ Return the location for application data files which are
+ host-specific. Same as `GetDataDir` except under Unix where it is
+ /etc/appname
+ """
+ return _misc_.StandardPaths_GetLocalDataDir(*args, **kwargs)
+
+ def GetUserDataDir(*args, **kwargs):
+ """
+ GetUserDataDir(self) -> String
+
+ Return the directory for the user-dependent application data files:
+ $HOME/.appname under Unix, c:\Documents and
+ Settings\username\Application Data\appname under Windows and
+ ~/Library/Application Support/appname under Mac
+ """
+ return _misc_.StandardPaths_GetUserDataDir(*args, **kwargs)
+
+ def GetUserLocalDataDir(*args, **kwargs):
+ """
+ GetUserLocalDataDir(self) -> String
+
+ Return the directory for user data files which shouldn't be shared
+ with the other machines
+
+ Same as `GetUserDataDir` for all platforms except Windows where it is
+ the 'Local Settings\Application Data\appname' directory.
+ """
+ return _misc_.StandardPaths_GetUserLocalDataDir(*args, **kwargs)
+
+ def GetPluginsDir(*args, **kwargs):
+ """
+ GetPluginsDir(self) -> String
+
+ Return the directory where the loadable modules (plugins) live:
+ prefix/lib/appname under Unix, program directory under Windows and
+ Contents/Plugins app bundle subdirectory under Mac
+ """
+ return _misc_.StandardPaths_GetPluginsDir(*args, **kwargs)
+
+ def GetResourcesDir(*args, **kwargs):
+ """
+ GetResourcesDir(self) -> String
+
+ Get resources directory. Resources are auxiliary files used by the
+ application and include things like image and sound files.
+
+ Same as `GetDataDir` for all platforms except Mac where it returns
+ Contents/Resources subdirectory of the app bundle.
+ """
+ return _misc_.StandardPaths_GetResourcesDir(*args, **kwargs)
+
+ def GetLocalizedResourcesDir(*args, **kwargs):
+ """
+ GetLocalizedResourcesDir(self, String lang, int category=ResourceCat_None) -> String
+
+ Get localized resources directory containing the resource files of the
+ specified category for the given language.
+
+ In general this is just GetResourcesDir()/lang under Windows and Unix
+ and GetResourcesDir()/lang.lproj under Mac but is something quite
+ different under Unix for the message catalog category (namely the
+ standard prefix/share/locale/lang/LC_MESSAGES.)
+ """
+ return _misc_.StandardPaths_GetLocalizedResourcesDir(*args, **kwargs)
+
+ def GetDocumentsDir(*args, **kwargs):
+ """
+ GetDocumentsDir(self) -> String
+
+ Return the Documents directory for the current user.
+
+ C:\Documents and Settings\username\Documents under Windows,
+ $HOME under Unix and ~/Documents under Mac
+ """
+ return _misc_.StandardPaths_GetDocumentsDir(*args, **kwargs)
+
+ def GetTempDir(*args, **kwargs):
+ """
+ GetTempDir(self) -> String
+
+ Return the user's directory for temporary files.
+ """
+ return _misc_.StandardPaths_GetTempDir(*args, **kwargs)
+
+ def SetInstallPrefix(*args, **kwargs):
+ """
+ SetInstallPrefix(self, String prefix)
+
+ Set the program installation directory which is /usr/local by default.
+ This value will be used by other methods such as `GetDataDir` and
+ `GetPluginsDir` as the prefix for what they return. (This function
+ only has meaning on Unix systems.)
+ """
+ return _misc_.StandardPaths_SetInstallPrefix(*args, **kwargs)
+
+ def GetInstallPrefix(*args, **kwargs):
+ """
+ GetInstallPrefix(self) -> String
+
+ Get the program installation prefix. The default is the prefix where
+ Python is installed. (This function only has meaning on Unix systems.)
+ """
+ return _misc_.StandardPaths_GetInstallPrefix(*args, **kwargs)
+
+_misc_.StandardPaths_swigregister(StandardPaths)
+
+def StandardPaths_Get(*args):
+ """
+ StandardPaths_Get() -> StandardPaths
+
+ Return the global standard paths singleton
+ """
+ return _misc_.StandardPaths_Get(*args)
+
+#---------------------------------------------------------------------------
+
+POWER_SOCKET = _misc_.POWER_SOCKET
+POWER_BATTERY = _misc_.POWER_BATTERY
+POWER_UNKNOWN = _misc_.POWER_UNKNOWN
+BATTERY_NORMAL_STATE = _misc_.BATTERY_NORMAL_STATE
+BATTERY_LOW_STATE = _misc_.BATTERY_LOW_STATE
+BATTERY_CRITICAL_STATE = _misc_.BATTERY_CRITICAL_STATE
+BATTERY_SHUTDOWN_STATE = _misc_.BATTERY_SHUTDOWN_STATE
+BATTERY_UNKNOWN_STATE = _misc_.BATTERY_UNKNOWN_STATE
+class PowerEvent(_core.Event):
+ """
+ wx.PowerEvent is generated when the system online status changes.
+ Currently this is only implemented for Windows.
+ """
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+ __repr__ = _swig_repr
+ def __init__(self, *args, **kwargs):
+ """
+ __init__(self, EventType evtType) -> PowerEvent
+
+ wx.PowerEvent is generated when the system online status changes.
+ Currently this is only implemented for Windows.
+ """
+ _misc_.PowerEvent_swiginit(self,_misc_.new_PowerEvent(*args, **kwargs))
+ def Veto(*args, **kwargs):
+ """Veto(self)"""
+ return _misc_.PowerEvent_Veto(*args, **kwargs)
+
+ def IsVetoed(*args, **kwargs):
+ """IsVetoed(self) -> bool"""
+ return _misc_.PowerEvent_IsVetoed(*args, **kwargs)
+
+_misc_.PowerEvent_swigregister(PowerEvent)
+
+wxEVT_POWER_SUSPENDING = _misc_.wxEVT_POWER_SUSPENDING
+wxEVT_POWER_SUSPENDED = _misc_.wxEVT_POWER_SUSPENDED
+wxEVT_POWER_SUSPEND_CANCEL = _misc_.wxEVT_POWER_SUSPEND_CANCEL
+wxEVT_POWER_RESUME = _misc_.wxEVT_POWER_RESUME
+EVT_POWER_SUSPENDING = wx.PyEventBinder( wxEVT_POWER_SUSPENDING , 1 )
+EVT_POWER_SUSPENDED = wx.PyEventBinder( wxEVT_POWER_SUSPENDED , 1 )
+EVT_POWER_SUSPEND_CANCEL = wx.PyEventBinder( wxEVT_POWER_SUSPEND_CANCEL , 1 )
+EVT_POWER_RESUME = wx.PyEventBinder( wxEVT_POWER_RESUME , 1 )
+
+
+def GetPowerType(*args):
+ """
+ GetPowerType() -> int
+
+ return the current system power state: online or offline
+ """
+ return _misc_.GetPowerType(*args)
+
+def GetBatteryState(*args):
+ """
+ GetBatteryState() -> int
+
+ return approximate battery state
+ """
+ return _misc_.GetBatteryState(*args)
+#---------------------------------------------------------------------------
+
+class AboutDialogInfo(object):
+ """
+ `wx.AboutDialogInfo` contains information to be shown in the standard
+ About dialog displayed by the `wx.AboutBox` function. This class
+ contains the general information about the program, such as its name,
+ version, copyright and so on, as well as lists of the program
+ developers, documentation writers, artists and translators.
+
+ While all the main platforms have a native implementation of the about
+ dialog, they are often more limited than the generic version provided
+ by wxWidgets and so the generic version is used if
+ `wx.AboutDialogInfo` has any fields not supported by the native
+ version. Currently GTK+ version supports all the possible fields
+ natively but MSW and Mac versions don't support URLs, licence text nor
+ custom icons in the about dialog and if either of those is used,
+ wxAboutBox() will automatically use the generic version so you should
+ avoid specifying these fields to achieve more native look and feel.
+
+ """
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+ __repr__ = _swig_repr
+ def __init__(self, *args, **kwargs):
+ """
+ __init__(self) -> AboutDialogInfo
+
+ `wx.AboutDialogInfo` contains information to be shown in the standard
+ About dialog displayed by the `wx.AboutBox` function. This class
+ contains the general information about the program, such as its name,
+ version, copyright and so on, as well as lists of the program
+ developers, documentation writers, artists and translators.
+
+ While all the main platforms have a native implementation of the about
+ dialog, they are often more limited than the generic version provided
+ by wxWidgets and so the generic version is used if
+ `wx.AboutDialogInfo` has any fields not supported by the native
+ version. Currently GTK+ version supports all the possible fields
+ natively but MSW and Mac versions don't support URLs, licence text nor
+ custom icons in the about dialog and if either of those is used,
+ wxAboutBox() will automatically use the generic version so you should
+ avoid specifying these fields to achieve more native look and feel.
+
+ """
+ _misc_.AboutDialogInfo_swiginit(self,_misc_.new_AboutDialogInfo(*args, **kwargs))
+ __swig_destroy__ = _misc_.delete_AboutDialogInfo
+ __del__ = lambda self : None;
+ def SetName(*args, **kwargs):
+ """
+ SetName(self, String name)
+
+ Set the name of the program. If this method is not called, the string
+ returned by `wx.App.GetAppName` will be shown in the dialog.
+ """
+ return _misc_.AboutDialogInfo_SetName(*args, **kwargs)
+
+ def GetName(*args, **kwargs):
+ """
+ GetName(self) -> String
+
+ Returns the program name.
+ """
+ return _misc_.AboutDialogInfo_GetName(*args, **kwargs)
+
+ Name = property(GetName,SetName)
+ def SetVersion(*args, **kwargs):
+ """
+ SetVersion(self, String version)
+
+ Set the version of the program. The version is in free format,
+ i.e. not necessarily in the x.y.z form but it shouldn't contain the
+ "version" word.
+ """
+ return _misc_.AboutDialogInfo_SetVersion(*args, **kwargs)
+
+ def HasVersion(*args, **kwargs):
+ """
+ HasVersion(self) -> bool
+
+ Returns ``True`` if the version property has been set.
+ """
+ return _misc_.AboutDialogInfo_HasVersion(*args, **kwargs)
+
+ def GetVersion(*args, **kwargs):
+ """
+ GetVersion(self) -> String
+
+ Returns the version value.
+ """
+ return _misc_.AboutDialogInfo_GetVersion(*args, **kwargs)
+
+ Version = property(GetVersion,SetVersion)
+ def SetDescription(*args, **kwargs):
+ """
+ SetDescription(self, String desc)
+
+ Set brief, but possibly multiline, description of the program.
+ """
+ return _misc_.AboutDialogInfo_SetDescription(*args, **kwargs)
+
+ def HasDescription(*args, **kwargs):
+ """
+ HasDescription(self) -> bool
+
+ Returns ``True`` if the description property has been set.
+ """
+ return _misc_.AboutDialogInfo_HasDescription(*args, **kwargs)
+
+ def GetDescription(*args, **kwargs):
+ """
+ GetDescription(self) -> String
+
+ Returns the description value.
+ """
+ return _misc_.AboutDialogInfo_GetDescription(*args, **kwargs)
+
+ Description = property(GetDescription,SetDescription)
+ def SetCopyright(*args, **kwargs):
+ """
+ SetCopyright(self, String copyright)
+
+ Set the short string containing the program copyright
+ information. Notice that any occurrences of "(C)" in ``copyright``
+ will be replaced by the copyright symbol (circled C) automatically,
+ which means that you can avoid using this symbol in the program source
+ code which can be problematic.
+ """
+ return _misc_.AboutDialogInfo_SetCopyright(*args, **kwargs)
+
+ def HasCopyright(*args, **kwargs):
+ """
+ HasCopyright(self) -> bool
+
+ Returns ``True`` if the copyright property has been set.
+ """
+ return _misc_.AboutDialogInfo_HasCopyright(*args, **kwargs)
+
+ def GetCopyright(*args, **kwargs):
+ """
+ GetCopyright(self) -> String
+
+ Returns the copyright value.
+ """
+ return _misc_.AboutDialogInfo_GetCopyright(*args, **kwargs)
+
+ Copyright = property(GetCopyright,SetCopyright)
+ def SetLicence(*args, **kwargs):
+ """
+ SetLicence(self, String licence)
+
+ Set the long, multiline string containing the text of the program
+ licence.
+
+ Only GTK+ version supports showing the licence text in the native
+ about dialog currently so the generic version will be used under all
+ the other platforms if this method is called. To preserve the native
+ look and feel it is advised that you do not call this method but
+ provide a separate menu item in the "Help" menu for displaying the
+ text of your program licence.
+
+ """
+ return _misc_.AboutDialogInfo_SetLicence(*args, **kwargs)
+
+ def SetLicense(*args, **kwargs):
+ """
+ SetLicense(self, String licence)
+
+ This is the same as `SetLicence`.
+ """
+ return _misc_.AboutDialogInfo_SetLicense(*args, **kwargs)
+
+ def HasLicence(*args, **kwargs):
+ """
+ HasLicence(self) -> bool
+
+ Returns ``True`` if the licence property has been set.
+ """
+ return _misc_.AboutDialogInfo_HasLicence(*args, **kwargs)
+
+ def GetLicence(*args, **kwargs):
+ """
+ GetLicence(self) -> String
+
+ Returns the licence value.
+ """
+ return _misc_.AboutDialogInfo_GetLicence(*args, **kwargs)
+
+ Licence = property(GetLicence,SetLicence)
+ License = Licence
+ def SetIcon(*args, **kwargs):
+ """
+ SetIcon(self, Icon icon)
+
+ Set the icon to be shown in the dialog. By default the icon of the
+ main frame will be shown if the native about dialog supports custom
+ icons. If it doesn't but a valid icon is specified using this method,
+ the generic about dialog is used instead so you should avoid calling
+ this function for maximally native look and feel.
+ """
+ return _misc_.AboutDialogInfo_SetIcon(*args, **kwargs)
+
+ def HasIcon(*args, **kwargs):
+ """
+ HasIcon(self) -> bool
+
+ Returns ``True`` if the icon property has been set.
+ """
+ return _misc_.AboutDialogInfo_HasIcon(*args, **kwargs)
+
+ def GetIcon(*args, **kwargs):
+ """
+ GetIcon(self) -> Icon
+
+ Return the current icon value.
+ """
+ return _misc_.AboutDialogInfo_GetIcon(*args, **kwargs)
+
+ Icon = property(GetIcon,SetIcon)
+ def _SetWebSite(*args, **kwargs):
+ """_SetWebSite(self, String url, String desc=wxEmptyString)"""
+ return _misc_.AboutDialogInfo__SetWebSite(*args, **kwargs)
+
+ def _GetWebSiteURL(*args, **kwargs):
+ """_GetWebSiteURL(self) -> String"""
+ return _misc_.AboutDialogInfo__GetWebSiteURL(*args, **kwargs)
+
+ def _GetWebSiteDescription(*args, **kwargs):
+ """_GetWebSiteDescription(self) -> String"""
+ return _misc_.AboutDialogInfo__GetWebSiteDescription(*args, **kwargs)
+
+ def HasWebSite(*args, **kwargs):
+ """HasWebSite(self) -> bool"""
+ return _misc_.AboutDialogInfo_HasWebSite(*args, **kwargs)
+
+ def SetWebSite(self, args):
+ """
+ SetWebSite(self, URL, [Description])
+
+ Set the web site property. The ``args`` parameter can
+ either be a single string for the URL, to a 2-tuple of
+ (URL, Description) strings.
+ """
+ if type(args) in [str, unicode]:
+ self._SetWebSite(args)
+ else:
+ self._SetWebSite(args[0], args[1])
+
+ def GetWebSite(self):
+ """
+ GetWebSite(self) --> (URL, Description)
+ """
+ return (self._GetWebSiteURL(), self._GetWebSiteDescription())
+
+ WebSite = property(GetWebSite,SetWebSite)
+ def SetDevelopers(*args, **kwargs):
+ """
+ SetDevelopers(self, list developers)
+
+ Set the list of the developers of the program.
+ """
+ return _misc_.AboutDialogInfo_SetDevelopers(*args, **kwargs)
+
+ def AddDeveloper(*args, **kwargs):
+ """
+ AddDeveloper(self, String developer)
+
+ Add a string to the list of developers.
+ """
+ return _misc_.AboutDialogInfo_AddDeveloper(*args, **kwargs)
+
+ def HasDevelopers(*args, **kwargs):
+ """
+ HasDevelopers(self) -> bool
+
+ Returns ``True if any developers have been set.
+ """
+ return _misc_.AboutDialogInfo_HasDevelopers(*args, **kwargs)
+
+ def GetDevelopers(*args, **kwargs):
+ """
+ GetDevelopers(self) --> list
+
+ Returns the list of developers.
+ """
+ return _misc_.AboutDialogInfo_GetDevelopers(*args, **kwargs)
+
+ Developers = property(GetDevelopers,SetDevelopers)
+ def SetDocWriters(*args, **kwargs):
+ """
+ SetDocWriters(self, list docwriters)
+
+ Set the list of the documentation writers.
+ """
+ return _misc_.AboutDialogInfo_SetDocWriters(*args, **kwargs)
+
+ def AddDocWriter(*args, **kwargs):
+ """
+ AddDocWriter(self, String docwriter)
+
+ Add a string to the list of documentation writers.
+ """
+ return _misc_.AboutDialogInfo_AddDocWriter(*args, **kwargs)
+
+ def HasDocWriters(*args, **kwargs):
+ """
+ HasDocWriters(self) -> bool
+
+ Returns ``True if any documentation writers have been set.
+ """
+ return _misc_.AboutDialogInfo_HasDocWriters(*args, **kwargs)
+
+ def GetDocWriters(*args, **kwargs):
+ """
+ GetDocWriters(self) --> list
+
+ Returns the list of documentation writers.
+ """
+ return _misc_.AboutDialogInfo_GetDocWriters(*args, **kwargs)
+
+ DocWriters = property(GetDocWriters,SetDocWriters)
+ def SetArtists(*args, **kwargs):
+ """
+ SetArtists(self, list artists)
+
+ Set the list of artists for the program.
+ """
+ return _misc_.AboutDialogInfo_SetArtists(*args, **kwargs)
+
+ def AddArtist(*args, **kwargs):
+ """
+ AddArtist(self, String artist)
+
+ Add a string to the list of artists.
+ """
+ return _misc_.AboutDialogInfo_AddArtist(*args, **kwargs)
+
+ def HasArtists(*args, **kwargs):
+ """
+ HasArtists(self) -> bool
+
+ Returns ``True`` if any artists have been set.
+ """
+ return _misc_.AboutDialogInfo_HasArtists(*args, **kwargs)
+
+ def GetArtists(*args, **kwargs):
+ """
+ GetArtists(self) --> list
+
+ Returns the list od artists.
+ """
+ return _misc_.AboutDialogInfo_GetArtists(*args, **kwargs)
+
+ Artists = property(GetArtists,SetArtists)
+ def SetTranslators(*args, **kwargs):
+ """
+ SetTranslators(self, list translators)
+
+ Sets the list of program translators.
+ """
+ return _misc_.AboutDialogInfo_SetTranslators(*args, **kwargs)
+
+ def AddTranslator(*args, **kwargs):
+ """
+ AddTranslator(self, String translator)
+
+ Add a string to the list of translators.
+ """
+ return _misc_.AboutDialogInfo_AddTranslator(*args, **kwargs)
+
+ def HasTranslators(*args, **kwargs):
+ """
+ HasTranslators(self) -> bool
+
+ Returns ``True`` if any translators have been set.
+ """
+ return _misc_.AboutDialogInfo_HasTranslators(*args, **kwargs)
+
+ def GetTranslators(*args, **kwargs):
+ """
+ GetTranslators(self) --> list
+
+ Returns the list of program translators.
+ """
+ return _misc_.AboutDialogInfo_GetTranslators(*args, **kwargs)
+
+ Translators = property(GetTranslators,SetTranslators)
+ def IsSimple(*args, **kwargs):
+ """IsSimple(self) -> bool"""
+ return _misc_.AboutDialogInfo_IsSimple(*args, **kwargs)
+
+ def GetDescriptionAndCredits(*args, **kwargs):
+ """GetDescriptionAndCredits(self) -> String"""
+ return _misc_.AboutDialogInfo_GetDescriptionAndCredits(*args, **kwargs)
+
+_misc_.AboutDialogInfo_swigregister(AboutDialogInfo)
+
+
+def AboutBox(*args, **kwargs):
+ """
+ AboutBox(AboutDialogInfo info)
+
+ This function shows the standard about dialog containing the
+ information specified in ``info``. If the current platform has a
+ native about dialog which is capable of showing all the fields in
+ `wx.AboutDialogInfo`, the native dialog is used, otherwise the
+ function falls back to the generic wxWidgets version of the dialog.