X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/27c9e43cc09bb6ba136a5a3897232d73df1e878f..0a5bb138a71dfc1c706fc0858fb2801500e2c2e8:/wxPython/src/_app.i diff --git a/wxPython/src/_app.i b/wxPython/src/_app.i index 3285fef3db..91d1a8fb8b 100644 --- a/wxPython/src/_app.i +++ b/wxPython/src/_app.i @@ -47,9 +47,7 @@ DocStr(wxPyApp, class wxPyApp : public wxEvtHandler { public: - %pythonAppend wxPyApp - "self._setCallbackInfo(self, PyApp) - self._setOORInfo(self)"; + %pythonAppend wxPyApp "self._setOORInfo(self, False);" setCallbackInfo(PyApp) %typemap(out) wxPyApp*; // turn off this typemap DocStr(wxPyApp, @@ -67,7 +65,7 @@ public: %typemap(out) wxPyApp* { $result = wxPyMake_wxObject($1, $owner); } - void _setCallbackInfo(PyObject* self, PyObject* _class); + void _setCallbackInfo(PyObject* self, PyObject* _class, bool incref=false); DocDeclStr( @@ -153,6 +151,11 @@ all top level windows have been closed and destroyed.", ""); :see: `wx.Exit`", ""); + DocDeclStr( + virtual wxLayoutDirection , GetLayoutDirection() const, + "Return the layout direction for the current locale.", ""); + + DocDeclStr( virtual void, ExitMainLoop(), "Exit the main GUI loop during the next iteration of the main @@ -262,13 +265,13 @@ systems where more than one is available, (Sun, SGI, XFree86 4, etc.)", ""); "Get the current OnAssert behaviour setting.", ""); - static bool GetMacSupportPCMenuShortcuts(); + static bool GetMacSupportPCMenuShortcuts(); // TODO, deprecate this static long GetMacAboutMenuItemId(); static long GetMacPreferencesMenuItemId(); static long GetMacExitMenuItemId(); static wxString GetMacHelpMenuTitleName(); - static void SetMacSupportPCMenuShortcuts(bool val); + static void SetMacSupportPCMenuShortcuts(bool val); // TODO, deprecate this static void SetMacAboutMenuItemId(long val); static void SetMacPreferencesMenuItemId(long val); static void SetMacExitMenuItemId(long val); @@ -290,6 +293,41 @@ it wasn't found at all. Raises an exception on non-Windows platforms.", ""); { wxPyRaiseNotImplemented(); return 0; } } #endif + + %extend { + DocStr(IsDisplayAvailable, + "Tests if it is possible to create a GUI in the current environment. +This will mean different things on the different platforms. + + * On X Windows systems this function will return ``False`` if it is + not able to open a connection to the X display, which can happen + if $DISPLAY is not set, or is not set correctly. + + * On Mac OS X a ``False`` return value will mean that wx is not + able to access the window manager, which can happen if logged in + remotely or if running from the normal version of python instead + of the framework version, (i.e., pythonw.) + + * On MS Windows... +", ""); + static bool IsDisplayAvailable() { + return wxPyTestDisplayAvailable(); + } + } + + + %property(AppName, GetAppName, SetAppName, doc="See `GetAppName` and `SetAppName`"); + %property(AssertMode, GetAssertMode, SetAssertMode, doc="See `GetAssertMode` and `SetAssertMode`"); + %property(ClassName, GetClassName, SetClassName, doc="See `GetClassName` and `SetClassName`"); + %property(ExitOnFrameDelete, GetExitOnFrameDelete, SetExitOnFrameDelete, doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`"); + %property(LayoutDirection, GetLayoutDirection, doc="See `GetLayoutDirection`"); + %property(PrintMode, GetPrintMode, SetPrintMode, doc="See `GetPrintMode` and `SetPrintMode`"); + %property(TopWindow, GetTopWindow, SetTopWindow, doc="See `GetTopWindow` and `SetTopWindow`"); + %property(Traits, GetTraits, doc="See `GetTraits`"); + %property(UseBestVisual, GetUseBestVisual, SetUseBestVisual, doc="See `GetUseBestVisual` and `SetUseBestVisual`"); + %property(VendorName, GetVendorName, SetVendorName, doc="See `GetVendorName` and `SetVendorName`"); + + %property(Active, IsActive); }; @@ -361,7 +399,13 @@ DocDeclAStr( void , wxSetDefaultPyEncoding(const char* encoding), "SetDefaultPyEncoding(string encoding)", "Sets the encoding that wxPython will use when it needs to convert a -Python string or unicode object to or from a wxString.", ""); +Python string or unicode object to or from a wxString. + +The default encoding is the value of ``locale.getdefaultlocale()[1]`` +but please be aware that the default encoding within the same locale +may be slightly different on different platforms. For example, please +see http://www.alanwood.net/demos/charsetdiffs.html for differences +between the common latin/roman encodings.", ""); DocDeclAStr( const char* , wxGetDefaultPyEncoding(),