]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_app.i
Use GetKeyCode() instead of KeyCode()
[wxWidgets.git] / wxPython / src / _app.i
index fc25d1c8c1e79138f3e9139782349a887c243357..27790ba05e13989fa8c45ab3879fa7abf9f639c8 100644 (file)
@@ -48,8 +48,9 @@ class wxPyApp : public wxEvtHandler {
 public:
 
     %pythonAppend wxPyApp
 public:
 
     %pythonAppend wxPyApp
-       "self._setCallbackInfo(self, PyApp)
-        self._setOORInfo(self)";
+       "self._setCallbackInfo(self, PyApp, False)
+        self._setOORInfo(self, False)";
+    %typemap(out) wxPyApp*;    // turn off this typemap
 
     DocStr(wxPyApp,
            "Create a new application object, starting the bootstrap process.", "");
 
     DocStr(wxPyApp,
            "Create a new application object, starting the bootstrap process.", "");
@@ -62,7 +63,11 @@ public:
 
     ~wxPyApp();
 
 
     ~wxPyApp();
 
-    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    // Turn it back on again
+    %typemap(out) wxPyApp* { $result = wxPyMake_wxObject($1, $owner); }
+
+
+    void _setCallbackInfo(PyObject* self, PyObject* _class, bool incref);
 
 
     DocDeclStr(
 
 
     DocDeclStr(
@@ -110,7 +115,7 @@ during each event loop iteration.", "");
 
 
     DocDeclStr(
 
 
     DocDeclStr(
-        virtual bool, Yield(bool onlyIfNeeded = False),
+        virtual bool, Yield(bool onlyIfNeeded = false),
         "Process all currently pending events right now, instead of waiting
 until return to the event loop.  It is an error to call ``Yield``
 recursively unless the value of ``onlyIfNeeded`` is True.
         "Process all currently pending events right now, instead of waiting
 until return to the event loop.  It is an error to call ``Yield``
 recursively unless the value of ``onlyIfNeeded`` is True.
@@ -129,6 +134,12 @@ recursively unless the value of ``onlyIfNeeded`` is True.
         "Make sure that idle events are sent again.
 :see: `wx.WakeUpIdle`", "");
 
         "Make sure that idle events are sent again.
 :see: `wx.WakeUpIdle`", "");
 
+    
+    DocDeclStr(
+        static bool , IsMainLoopRunning() const,
+        "Returns True if we're running the main loop, i.e. if the events can
+currently be dispatched.", "");
+    
 
     DocDeclStr(
         virtual int, MainLoop(),
 
     DocDeclStr(
         virtual int, MainLoop(),
@@ -142,6 +153,11 @@ all top level windows have been closed and destroyed.", "");
 :see: `wx.Exit`", "");
 
     
 :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
     DocDeclStr(
         virtual void, ExitMainLoop(),
         "Exit the main GUI loop during the next iteration of the main
@@ -279,6 +295,27 @@ it wasn't found at all.  Raises an exception on non-Windows platforms.", "");
             { wxPyRaiseNotImplemented(); return 0; }
     }
 #endif
             { wxPyRaiseNotImplemented(); return 0; }
     }
 #endif
+
+    %extend {
+        DocStr(DisplayAvailable,
+               "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 DisplayAvailable() {
+            return wxPyTestDisplayAvailable();
+        }
+    }
 };
 
 
 };
 
 
@@ -302,7 +339,7 @@ DocDeclStr(
 
 
 DocDeclStr(
 
 
 DocDeclStr(
-    bool, wxSafeYield(wxWindow* win=NULL, bool onlyIfNeeded=False),
+    bool, wxSafeYield(wxWindow* win=NULL, bool onlyIfNeeded=false),
     "This function is similar to `wx.Yield`, except that it disables the
 user input to all program windows before calling `wx.Yield` and
 re-enables it again afterwards. If ``win`` is not None, this window
     "This function is similar to `wx.Yield`, except that it disables the
 user input to all program windows before calling `wx.Yield` and
 re-enables it again afterwards. If ``win`` is not None, this window
@@ -344,6 +381,27 @@ DocDeclStrName(
 
 
 
 
 
 
+
+
+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.
+
+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(),
+    "GetDefaultPyEncoding() -> string",
+    "Gets the current encoding that wxPython will use when it needs to
+convert a Python string or unicode object to or from a wxString.", "");
+
+
 //---------------------------------------------------------------------------
 // Include some extra wxApp related python code here
 
 //---------------------------------------------------------------------------
 // Include some extra wxApp related python code here