More docstrings.
Fixed wxWave compilation on Linux. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -59,96 +59,133 @@ public:
|
|||||||
|
|
||||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||||
|
|
||||||
// set/get the application name
|
|
||||||
wxString GetAppName() const;
|
|
||||||
void SetAppName(const wxString& name);
|
|
||||||
|
|
||||||
// set/get the app class name
|
DocDeclStr(
|
||||||
wxString GetClassName() const;
|
wxString, GetAppName() const,
|
||||||
void SetClassName(const wxString& name);
|
"Get the application name.");
|
||||||
|
DocDeclStr(
|
||||||
|
void, SetAppName(const wxString& name),
|
||||||
|
"Set the application name. This value may be used automatically\n"
|
||||||
|
"by wxConfig and such.");
|
||||||
|
|
||||||
// set/get the vendor name
|
DocDeclStr(
|
||||||
const wxString& GetVendorName() const;
|
wxString, GetClassName() const,
|
||||||
void SetVendorName(const wxString& name);
|
"Get the application's class name.");
|
||||||
|
DocDeclStr(
|
||||||
|
void, SetClassName(const wxString& name),
|
||||||
|
"Set the application's class name. This value may be used for X-resources if\n"
|
||||||
|
"applicable for the platform");
|
||||||
|
|
||||||
// create the app traits object to which we delegate for everything which
|
DocDeclStr(
|
||||||
// either should be configurable by the user (then he can change the
|
const wxString&, GetVendorName() const,
|
||||||
// default behaviour simply by overriding CreateTraits() and returning his
|
"Get the application's vendor name.");
|
||||||
// own traits object) or which is GUI/console dependent as then wxAppTraits
|
DocDeclStr(
|
||||||
// allows us to abstract the differences behind the common fa<EFBFBD>ade
|
void, SetVendorName(const wxString& name),
|
||||||
wxAppTraits *GetTraits();
|
"Set the application's vendor name. This value may be used automatically\n"
|
||||||
|
"by wxConfig and such.");
|
||||||
// process all events in the wxPendingEvents list -- it is necessary to
|
|
||||||
// call this function to process posted events. This happens during each
|
|
||||||
// event loop iteration.
|
|
||||||
virtual void ProcessPendingEvents();
|
|
||||||
|
|
||||||
// process all currently pending events right now
|
|
||||||
//
|
|
||||||
// it is an error to call Yield() recursively unless the value of
|
|
||||||
// onlyIfNeeded is True
|
|
||||||
//
|
|
||||||
// WARNING: this function is dangerous as it can lead to unexpected
|
|
||||||
// reentrancies (i.e. when called from an event handler it
|
|
||||||
// may result in calling the same event handler again), use
|
|
||||||
// with _extreme_ care or, better, don't use at all!
|
|
||||||
virtual bool Yield(bool onlyIfNeeded = False);
|
|
||||||
|
|
||||||
// make sure that idle events are sent again
|
|
||||||
virtual void WakeUpIdle();
|
|
||||||
|
|
||||||
|
|
||||||
// execute the main GUI loop, the function returns when the loop ends
|
DocDeclStr(
|
||||||
virtual int MainLoop();
|
wxAppTraits*, GetTraits(),
|
||||||
|
"Create the app traits object to which we delegate for everything which either\n"
|
||||||
// exit the main loop thus terminating the application
|
"should be configurable by the user (then he can change the default behaviour\n"
|
||||||
virtual void Exit();
|
"simply by overriding CreateTraits() and returning his own traits object) or\n"
|
||||||
|
"which is GUI/console dependent as then wxAppTraits allows us to abstract the\n"
|
||||||
// exit the main GUI loop during the next iteration (i.e. it does not
|
"differences behind the common facade");
|
||||||
// stop the program immediately!)
|
|
||||||
virtual void ExitMainLoop();
|
|
||||||
|
|
||||||
// returns True if there are unprocessed events in the event queue
|
|
||||||
virtual bool Pending();
|
|
||||||
|
|
||||||
// process the first event in the event queue (blocks until an event
|
|
||||||
// apperas if there are none currently)
|
|
||||||
virtual bool Dispatch();
|
|
||||||
|
|
||||||
|
|
||||||
// this virtual function is called in the GUI mode when the application
|
DocDeclStr(
|
||||||
// becomes idle and normally just sends wxIdleEvent to all interested
|
virtual void, ProcessPendingEvents(),
|
||||||
// parties
|
"Process all events in the wxPendingEvents list -- it is necessary to call this\n"
|
||||||
//
|
"function to process posted events. This happens during each event loop\n"
|
||||||
// it should return True if more idle events are needed, False if not
|
"iteration.");
|
||||||
virtual bool ProcessIdle() ;
|
|
||||||
|
|
||||||
// Send idle event to window and all subwindows
|
|
||||||
// Returns True if more idle time is requested.
|
|
||||||
virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
|
|
||||||
|
|
||||||
// Perform standard OnIdle behaviour: call from port's OnIdle
|
|
||||||
void OnIdle(wxIdleEvent& event);
|
|
||||||
|
|
||||||
|
|
||||||
// return True if our app has focus
|
DocDeclStr(
|
||||||
virtual bool IsActive() const;
|
virtual bool, Yield(bool onlyIfNeeded = False),
|
||||||
|
"Process all currently pending events right now, instead of waiting until\n"
|
||||||
|
"return to the event loop. It is an error to call Yield() recursively unless\n"
|
||||||
|
"the value of onlyIfNeeded is True.\n"
|
||||||
|
"\n"
|
||||||
|
"WARNING: This function is dangerous as it can lead to unexpected\n"
|
||||||
|
" reentrancies (i.e. when called from an event handler it\n"
|
||||||
|
" may result in calling the same event handler again), use\n"
|
||||||
|
" with _extreme_ care or, better, don't use at all!\n");
|
||||||
|
|
||||||
// set the "main" top level window
|
|
||||||
void SetTopWindow(wxWindow *win);
|
|
||||||
|
|
||||||
// return the "main" top level window (if it hadn't been set previously
|
DocDeclStr(
|
||||||
// with SetTopWindow(), will return just some top level window and, if
|
virtual void, WakeUpIdle(),
|
||||||
// there are none, will return NULL)
|
"Make sure that idle events are sent again");
|
||||||
virtual wxWindow *GetTopWindow() const;
|
|
||||||
|
|
||||||
// control the exit behaviour: by default, the program will exit the
|
|
||||||
// main loop (and so, usually, terminate) when the last top-level
|
DocDeclStr(
|
||||||
// program window is deleted. Beware that if you disable this behaviour
|
virtual int, MainLoop(),
|
||||||
// (with SetExitOnFrameDelete(False)), you'll have to call
|
"Execute the main GUI loop, the function returns when the loop ends.");
|
||||||
// ExitMainLoop() explicitly from somewhere.
|
|
||||||
void SetExitOnFrameDelete(bool flag);
|
|
||||||
bool GetExitOnFrameDelete() const;
|
DocDeclStr(
|
||||||
|
virtual void, Exit(),
|
||||||
|
"Exit the main loop thus terminating the application.");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
virtual void, ExitMainLoop(),
|
||||||
|
"Exit the main GUI loop during the next iteration (i.e. it does not\n"
|
||||||
|
"stop the program immediately!)");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
virtual bool, Pending(),
|
||||||
|
"Returns True if there are unprocessed events in the event queue.");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
virtual bool, Dispatch(),
|
||||||
|
"Process the first event in the event queue (blocks until an event\n"
|
||||||
|
"appears if there are none currently)");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
virtual bool, ProcessIdle(),
|
||||||
|
"Called from the MainLoop when the application becomes idle and sends an\n"
|
||||||
|
"IdleEvent to all interested parties. Returns True is more idle events are\n"
|
||||||
|
"needed, False if not.");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
virtual bool, SendIdleEvents(wxWindow* win, wxIdleEvent& event),
|
||||||
|
"Send idle event to window and all subwindows. Returns True if more idle time\n"
|
||||||
|
"is requested.");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
virtual bool, IsActive() const,
|
||||||
|
"Return True if our app has focus.");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
void, SetTopWindow(wxWindow *win),
|
||||||
|
"Set the \"main\" top level window");
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
virtual wxWindow*, GetTopWindow() const,
|
||||||
|
"Return the \"main\" top level window (if it hadn't been set previously with\n"
|
||||||
|
"SetTopWindow(), will return just some top level window and, if there not any,\n"
|
||||||
|
"will return None)");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
void, SetExitOnFrameDelete(bool flag),
|
||||||
|
"Control the exit behaviour: by default, the program will exit the main loop\n"
|
||||||
|
"(and so, usually, terminate) when the last top-level program window is\n"
|
||||||
|
"deleted. Beware that if you disable this behaviour (with\n"
|
||||||
|
"SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() explicitly\n"
|
||||||
|
"from somewhere.\n");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
bool, GetExitOnFrameDelete() const,
|
||||||
|
"Get the current exit behaviour setting.");
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Get display mode that is used use. This is only used in framebuffer
|
// Get display mode that is used use. This is only used in framebuffer
|
||||||
@@ -161,9 +198,16 @@ public:
|
|||||||
virtual bool SetDisplayMode(const wxVideoMode& info);
|
virtual bool SetDisplayMode(const wxVideoMode& info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// set use of best visual flag (see below)
|
|
||||||
void SetUseBestVisual( bool flag );
|
DocDeclStr(
|
||||||
bool GetUseBestVisual() const;
|
void, SetUseBestVisual( bool flag ),
|
||||||
|
"Set whether the app should try to use the best available visual on systems\n"
|
||||||
|
"where more than one is available, (Sun, SGI, XFree86 4, etc.)");
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
bool, GetUseBestVisual() const,
|
||||||
|
"Get current UseBestVisual setting.");
|
||||||
|
|
||||||
|
|
||||||
// set/get printing mode: see wxPRINT_XXX constants.
|
// set/get printing mode: see wxPRINT_XXX constants.
|
||||||
//
|
//
|
||||||
@@ -172,14 +216,20 @@ public:
|
|||||||
virtual void SetPrintMode(int mode);
|
virtual void SetPrintMode(int mode);
|
||||||
int GetPrintMode() const;
|
int GetPrintMode() const;
|
||||||
|
|
||||||
// Get/Set OnAssert behaviour. The following flags may be or'd together:
|
|
||||||
//
|
DocDeclStr(
|
||||||
// wxPYAPP_ASSERT_SUPPRESS Don't do anything
|
void, SetAssertMode(int mode),
|
||||||
// wxPYAPP_ASSERT_EXCEPTION Turn it into a Python exception if possible
|
"Set the OnAssert behaviour for debug and hybrid builds. The following flags\n"
|
||||||
// wxPYAPP_ASSERT_DIALOG Display a message dialog
|
"may be or'd together:\n"
|
||||||
// wxPYAPP_ASSERT_LOG Write the assertion info to the wxLog
|
"\n"
|
||||||
int GetAssertMode();
|
" wxPYAPP_ASSERT_SUPPRESS Don't do anything\n"
|
||||||
void SetAssertMode(int mode);
|
" wxPYAPP_ASSERT_EXCEPTION Turn it into a Python exception if possible (default)\n"
|
||||||
|
" wxPYAPP_ASSERT_DIALOG Display a message dialog\n"
|
||||||
|
" wxPYAPP_ASSERT_LOG Write the assertion info to the wxLog\n");
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
int, GetAssertMode(),
|
||||||
|
"Get the current OnAssert behaviour setting.");
|
||||||
|
|
||||||
|
|
||||||
static bool GetMacSupportPCMenuShortcuts();
|
static bool GetMacSupportPCMenuShortcuts();
|
||||||
@@ -194,12 +244,15 @@ public:
|
|||||||
static void SetMacExitMenuItemId(long val);
|
static void SetMacExitMenuItemId(long val);
|
||||||
static void SetMacHelpMenuTitleName(const wxString& val);
|
static void SetMacHelpMenuTitleName(const wxString& val);
|
||||||
|
|
||||||
// For internal use only
|
|
||||||
void _BootstrapApp();
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
void, _BootstrapApp(),
|
||||||
|
"For internal use only");
|
||||||
|
|
||||||
|
DocStr(GetComCtl32Version,
|
||||||
|
"Returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it\n"
|
||||||
|
"wasn't found at all. Raises an exception on non-Windows platforms.");
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
// returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
|
|
||||||
// wasn't found at all
|
|
||||||
static int GetComCtl32Version();
|
static int GetComCtl32Version();
|
||||||
#else
|
#else
|
||||||
%extend {
|
%extend {
|
||||||
@@ -214,28 +267,52 @@ public:
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
%newgroup;
|
%newgroup;
|
||||||
|
|
||||||
// Force an exit from main loop
|
|
||||||
void wxExit();
|
|
||||||
|
|
||||||
// Yield to other apps/messages
|
DocDeclStr(
|
||||||
bool wxYield();
|
void, wxExit(),
|
||||||
bool wxYieldIfNeeded();
|
"Force an exit of the application. Convenience for wx.GetApp().Exit()");
|
||||||
bool wxSafeYield(wxWindow* win=NULL, bool onlyIfNeeded=False);
|
|
||||||
|
|
||||||
// Cause the message queue to become empty again
|
|
||||||
void wxWakeUpIdle();
|
|
||||||
|
|
||||||
// Send an event to be processed later
|
DocDeclStr(
|
||||||
void wxPostEvent(wxEvtHandler *dest, wxEvent& event);
|
bool, wxYield(),
|
||||||
|
"Yield to other apps/messages. Convenience for wx.GetApp().Yield()");
|
||||||
|
|
||||||
// This is used to cleanup after wxWindows when Python shuts down.
|
DocDeclStr(
|
||||||
|
bool, wxYieldIfNeeded(),
|
||||||
|
"Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
bool, wxSafeYield(wxWindow* win=NULL, bool onlyIfNeeded=False),
|
||||||
|
"This function is similar to wx.Yield, except that it disables the user input\n"
|
||||||
|
"to all program windows before calling wx.Yield and re-enables it again\n"
|
||||||
|
"afterwards. If win is not None, this window will remain enabled, allowing the\n"
|
||||||
|
"implementation of some limited user interaction.\n"
|
||||||
|
"\n"
|
||||||
|
"Returns the result of the call to wx.Yield.");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
void, wxWakeUpIdle(),
|
||||||
|
"Cause the message queue to become empty again, so idle events will be sent.");
|
||||||
|
|
||||||
|
|
||||||
|
DocDeclStr(
|
||||||
|
void, wxPostEvent(wxEvtHandler *dest, wxEvent& event),
|
||||||
|
"Send an event to a window or other wx.EvtHandler to be processed later.");
|
||||||
|
|
||||||
|
|
||||||
|
DocStr(wxApp_CleanUp,
|
||||||
|
"For internal use only, it is used to cleanup after wxWindows when Python shuts down.");
|
||||||
%inline %{
|
%inline %{
|
||||||
void wxApp_CleanUp() {
|
void wxApp_CleanUp() {
|
||||||
__wxPyCleanup();
|
__wxPyCleanup();
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
// Return a reference to the current wxApp object.
|
|
||||||
|
DocStr(wxGetApp,
|
||||||
|
"Return a reference to the current wxApp object.");
|
||||||
%inline %{
|
%inline %{
|
||||||
wxPyApp* wxGetApp() {
|
wxPyApp* wxGetApp() {
|
||||||
return (wxPyApp*)wxTheApp;
|
return (wxPyApp*)wxTheApp;
|
||||||
|
@@ -2,28 +2,23 @@
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
class PyOnDemandOutputWindow:
|
class PyOnDemandOutputWindow:
|
||||||
|
"""
|
||||||
|
A class that can be used for redirecting Python's stdout and
|
||||||
|
stderr streams. It will do nothing until something is wrriten to
|
||||||
|
the stream at which point it will create a Frame with a text area
|
||||||
|
and write the text there.
|
||||||
|
"""
|
||||||
def __init__(self, title = "wxPython: stdout/stderr"):
|
def __init__(self, title = "wxPython: stdout/stderr"):
|
||||||
self.frame = None
|
self.frame = None
|
||||||
self.title = title
|
self.title = title
|
||||||
self.parent = None
|
self.parent = None
|
||||||
|
|
||||||
def SetParent(self, parent):
|
def SetParent(self, parent):
|
||||||
|
"""Set the window to be used as the popup Frame's parent."""
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
|
||||||
def OnCloseWindow(self, event):
|
|
||||||
if self.frame != None:
|
|
||||||
self.frame.Destroy()
|
|
||||||
self.frame = None
|
|
||||||
self.text = None
|
|
||||||
|
|
||||||
# These methods provide the file-like output behaviour.
|
def CreateOutputWindow(self, st):
|
||||||
def write(self, str):
|
|
||||||
if not wx.Thread_IsMain():
|
|
||||||
# Aquire the GUI mutex before making GUI calls. Mutex is released
|
|
||||||
# when locker is deleted at the end of this function.
|
|
||||||
locker = wx.MutexGuiLocker()
|
|
||||||
|
|
||||||
if not self.frame:
|
|
||||||
self.frame = wx.Frame(self.parent, -1, self.title,
|
self.frame = wx.Frame(self.parent, -1, self.title,
|
||||||
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
|
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
|
||||||
self.text = wxTextCtrl(self.frame, -1, "",
|
self.text = wxTextCtrl(self.frame, -1, "",
|
||||||
@@ -31,22 +26,47 @@ class PyOnDemandOutputWindow:
|
|||||||
self.frame.SetSize((450, 300))
|
self.frame.SetSize((450, 300))
|
||||||
self.frame.Show(True)
|
self.frame.Show(True)
|
||||||
EVT_CLOSE(self.frame, self.OnCloseWindow)
|
EVT_CLOSE(self.frame, self.OnCloseWindow)
|
||||||
self.text.AppendText(str)
|
|
||||||
|
|
||||||
|
# These methods provide the file-like output behaviour.
|
||||||
|
def write(self, text):
|
||||||
|
"""
|
||||||
|
Create the output window if needed and write the string to it.
|
||||||
|
If not called in the context of the gui thread then uses
|
||||||
|
CallAfter to do the work there.
|
||||||
|
"""
|
||||||
|
if self.frame is None:
|
||||||
|
if not wx.Thread_IsMain():
|
||||||
|
wx.CallAfter(self.CreateOutputWindow, text)
|
||||||
|
else:
|
||||||
|
self.CreateOutputWindow(text)
|
||||||
|
else:
|
||||||
|
if not wx.Thread_IsMain():
|
||||||
|
wx.CallAfter(self.text.AppendText, text)
|
||||||
|
else:
|
||||||
|
self.text.AppendText(text)
|
||||||
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
if self.frame != None:
|
if self.frame is not None:
|
||||||
if not wx.Thread_IsMain():
|
wx.CallAfter(self.frame.Close)
|
||||||
locker = wx.MutexGuiLocker()
|
|
||||||
self.frame.Close()
|
|
||||||
|
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
if self.frame is not None:
|
||||||
|
self.frame.Destroy()
|
||||||
|
self.frame = None
|
||||||
|
self.text = None
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# The main application class. Derive from this and implement an OnInit
|
|
||||||
# method that creates a frame and then calls self.SetTopWindow(frame)
|
|
||||||
|
|
||||||
_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
|
_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
|
||||||
|
|
||||||
class App(wx.PyApp):
|
class App(wx.PyApp):
|
||||||
|
"""
|
||||||
|
The main application class. Derive from this and implement an OnInit
|
||||||
|
method that creates a frame and then calls self.SetTopWindow(frame)
|
||||||
|
"""
|
||||||
outputWindowClass = PyOnDemandOutputWindow
|
outputWindowClass = PyOnDemandOutputWindow
|
||||||
|
|
||||||
def __init__(self, redirect=_defRedirect, filename=None, useBestVisual=False):
|
def __init__(self, redirect=_defRedirect, filename=None, useBestVisual=False):
|
||||||
@@ -137,13 +157,20 @@ App_GetComCtl32Version = _core.PyApp_GetComCtl32Version
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
class PySimpleApp(wx.App):
|
class PySimpleApp(wx.App):
|
||||||
def __init__(self, redirect=False, filename=None):
|
"""
|
||||||
wx.App.__init__(self, redirect, filename)
|
A simple application class. You can just create one of these and
|
||||||
|
then then make your top level windows later, and not have to worry
|
||||||
|
about OnInit."""
|
||||||
|
|
||||||
|
def __init__(self, redirect=False, filename=None, useBestVisual=False):
|
||||||
|
wx.App.__init__(self, redirect, filename, useBestVisual)
|
||||||
|
|
||||||
def OnInit(self):
|
def OnInit(self):
|
||||||
wx.InitAllImageHandlers()
|
wx.InitAllImageHandlers()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
# Is anybody using this one?
|
||||||
class PyWidgetTester(wx.App):
|
class PyWidgetTester(wx.App):
|
||||||
def __init__(self, size = (250, 100)):
|
def __init__(self, size = (250, 100)):
|
||||||
self.size = size
|
self.size = size
|
||||||
|
@@ -132,7 +132,11 @@ public:
|
|||||||
|
|
||||||
wxLayoutConstraints();
|
wxLayoutConstraints();
|
||||||
|
|
||||||
bool SatisfyConstraints(wxWindow *win, int *OUTPUT);
|
|
||||||
|
DocDeclA(
|
||||||
|
bool, SatisfyConstraints(wxWindow *win, int *OUTPUT),
|
||||||
|
"SatisfyConstraints(Window win) -> (areSatisfied, noChanges)");
|
||||||
|
|
||||||
bool AreSatisfied() const;
|
bool AreSatisfied() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ public:
|
|||||||
~wxWave();
|
~wxWave();
|
||||||
|
|
||||||
bool IsOk() const;
|
bool IsOk() const;
|
||||||
bool Play(bool async = True, bool looped = False) const;
|
bool Play(bool async = True, bool looped = False);
|
||||||
|
|
||||||
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
%pythoncode { def __nonzero__(self): return self.IsOk() }
|
||||||
};
|
};
|
||||||
|
@@ -4396,105 +4396,177 @@ class PyApp(EvtHandler):
|
|||||||
return _core.PyApp__setCallbackInfo(*args, **kwargs)
|
return _core.PyApp__setCallbackInfo(*args, **kwargs)
|
||||||
|
|
||||||
def GetAppName(*args, **kwargs):
|
def GetAppName(*args, **kwargs):
|
||||||
"""GetAppName() -> wxString"""
|
"""GetAppName() -> wxString
|
||||||
|
|
||||||
|
Get the application name."""
|
||||||
return _core.PyApp_GetAppName(*args, **kwargs)
|
return _core.PyApp_GetAppName(*args, **kwargs)
|
||||||
|
|
||||||
def SetAppName(*args, **kwargs):
|
def SetAppName(*args, **kwargs):
|
||||||
"""SetAppName(wxString name)"""
|
"""SetAppName(wxString name)
|
||||||
|
|
||||||
|
Set the application name. This value may be used automatically
|
||||||
|
by wxConfig and such."""
|
||||||
return _core.PyApp_SetAppName(*args, **kwargs)
|
return _core.PyApp_SetAppName(*args, **kwargs)
|
||||||
|
|
||||||
def GetClassName(*args, **kwargs):
|
def GetClassName(*args, **kwargs):
|
||||||
"""GetClassName() -> wxString
|
"""GetClassName() -> wxString
|
||||||
|
|
||||||
Returns the class name of the C++ object using wxRTTI."""
|
Get the application's class name."""
|
||||||
return _core.PyApp_GetClassName(*args, **kwargs)
|
return _core.PyApp_GetClassName(*args, **kwargs)
|
||||||
|
|
||||||
def SetClassName(*args, **kwargs):
|
def SetClassName(*args, **kwargs):
|
||||||
"""SetClassName(wxString name)"""
|
"""SetClassName(wxString name)
|
||||||
|
|
||||||
|
Set the application's class name. This value may be used for X-resources if
|
||||||
|
applicable for the platform"""
|
||||||
return _core.PyApp_SetClassName(*args, **kwargs)
|
return _core.PyApp_SetClassName(*args, **kwargs)
|
||||||
|
|
||||||
def GetVendorName(*args, **kwargs):
|
def GetVendorName(*args, **kwargs):
|
||||||
"""GetVendorName() -> wxString"""
|
"""GetVendorName() -> wxString
|
||||||
|
|
||||||
|
Get the application's vendor name."""
|
||||||
return _core.PyApp_GetVendorName(*args, **kwargs)
|
return _core.PyApp_GetVendorName(*args, **kwargs)
|
||||||
|
|
||||||
def SetVendorName(*args, **kwargs):
|
def SetVendorName(*args, **kwargs):
|
||||||
"""SetVendorName(wxString name)"""
|
"""SetVendorName(wxString name)
|
||||||
|
|
||||||
|
Set the application's vendor name. This value may be used automatically
|
||||||
|
by wxConfig and such."""
|
||||||
return _core.PyApp_SetVendorName(*args, **kwargs)
|
return _core.PyApp_SetVendorName(*args, **kwargs)
|
||||||
|
|
||||||
def GetTraits(*args, **kwargs):
|
def GetTraits(*args, **kwargs):
|
||||||
"""GetTraits() -> wxAppTraits"""
|
"""GetTraits() -> wxAppTraits
|
||||||
|
|
||||||
|
Create the app traits object to which we delegate for everything which either
|
||||||
|
should be configurable by the user (then he can change the default behaviour
|
||||||
|
simply by overriding CreateTraits() and returning his own traits object) or
|
||||||
|
which is GUI/console dependent as then wxAppTraits allows us to abstract the
|
||||||
|
differences behind the common facade"""
|
||||||
return _core.PyApp_GetTraits(*args, **kwargs)
|
return _core.PyApp_GetTraits(*args, **kwargs)
|
||||||
|
|
||||||
def ProcessPendingEvents(*args, **kwargs):
|
def ProcessPendingEvents(*args, **kwargs):
|
||||||
"""ProcessPendingEvents()"""
|
"""ProcessPendingEvents()
|
||||||
|
|
||||||
|
Process all events in the wxPendingEvents list -- it is necessary to call this
|
||||||
|
function to process posted events. This happens during each event loop
|
||||||
|
iteration."""
|
||||||
return _core.PyApp_ProcessPendingEvents(*args, **kwargs)
|
return _core.PyApp_ProcessPendingEvents(*args, **kwargs)
|
||||||
|
|
||||||
def Yield(*args, **kwargs):
|
def Yield(*args, **kwargs):
|
||||||
"""Yield(bool onlyIfNeeded=False) -> bool"""
|
"""Yield(bool onlyIfNeeded=False) -> bool
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
WARNING: This function is dangerous as it can lead to unexpected
|
||||||
|
reentrancies (i.e. when called from an event handler it
|
||||||
|
may result in calling the same event handler again), use
|
||||||
|
with _extreme_ care or, better, don't use at all!
|
||||||
|
"""
|
||||||
return _core.PyApp_Yield(*args, **kwargs)
|
return _core.PyApp_Yield(*args, **kwargs)
|
||||||
|
|
||||||
def WakeUpIdle(*args, **kwargs):
|
def WakeUpIdle(*args, **kwargs):
|
||||||
"""WakeUpIdle()"""
|
"""WakeUpIdle()
|
||||||
|
|
||||||
|
Make sure that idle events are sent again"""
|
||||||
return _core.PyApp_WakeUpIdle(*args, **kwargs)
|
return _core.PyApp_WakeUpIdle(*args, **kwargs)
|
||||||
|
|
||||||
def MainLoop(*args, **kwargs):
|
def MainLoop(*args, **kwargs):
|
||||||
"""MainLoop() -> int"""
|
"""MainLoop() -> int
|
||||||
|
|
||||||
|
Execute the main GUI loop, the function returns when the loop ends."""
|
||||||
return _core.PyApp_MainLoop(*args, **kwargs)
|
return _core.PyApp_MainLoop(*args, **kwargs)
|
||||||
|
|
||||||
def Exit(*args, **kwargs):
|
def Exit(*args, **kwargs):
|
||||||
"""Exit()"""
|
"""Exit()
|
||||||
|
|
||||||
|
Exit the main loop thus terminating the application."""
|
||||||
return _core.PyApp_Exit(*args, **kwargs)
|
return _core.PyApp_Exit(*args, **kwargs)
|
||||||
|
|
||||||
def ExitMainLoop(*args, **kwargs):
|
def ExitMainLoop(*args, **kwargs):
|
||||||
"""ExitMainLoop()"""
|
"""ExitMainLoop()
|
||||||
|
|
||||||
|
Exit the main GUI loop during the next iteration (i.e. it does not
|
||||||
|
stop the program immediately!)"""
|
||||||
return _core.PyApp_ExitMainLoop(*args, **kwargs)
|
return _core.PyApp_ExitMainLoop(*args, **kwargs)
|
||||||
|
|
||||||
def Pending(*args, **kwargs):
|
def Pending(*args, **kwargs):
|
||||||
"""Pending() -> bool"""
|
"""Pending() -> bool
|
||||||
|
|
||||||
|
Returns True if there are unprocessed events in the event queue."""
|
||||||
return _core.PyApp_Pending(*args, **kwargs)
|
return _core.PyApp_Pending(*args, **kwargs)
|
||||||
|
|
||||||
def Dispatch(*args, **kwargs):
|
def Dispatch(*args, **kwargs):
|
||||||
"""Dispatch() -> bool"""
|
"""Dispatch() -> bool
|
||||||
|
|
||||||
|
Process the first event in the event queue (blocks until an event
|
||||||
|
appears if there are none currently)"""
|
||||||
return _core.PyApp_Dispatch(*args, **kwargs)
|
return _core.PyApp_Dispatch(*args, **kwargs)
|
||||||
|
|
||||||
def ProcessIdle(*args, **kwargs):
|
def ProcessIdle(*args, **kwargs):
|
||||||
"""ProcessIdle() -> bool"""
|
"""ProcessIdle() -> bool
|
||||||
|
|
||||||
|
Called from the MainLoop when the application becomes idle and sends an
|
||||||
|
IdleEvent to all interested parties. Returns True is more idle events are
|
||||||
|
needed, False if not."""
|
||||||
return _core.PyApp_ProcessIdle(*args, **kwargs)
|
return _core.PyApp_ProcessIdle(*args, **kwargs)
|
||||||
|
|
||||||
def SendIdleEvents(*args, **kwargs):
|
def SendIdleEvents(*args, **kwargs):
|
||||||
"""SendIdleEvents(Window win, IdleEvent event) -> bool"""
|
"""SendIdleEvents(Window win, IdleEvent event) -> bool
|
||||||
|
|
||||||
|
Send idle event to window and all subwindows. Returns True if more idle time
|
||||||
|
is requested."""
|
||||||
return _core.PyApp_SendIdleEvents(*args, **kwargs)
|
return _core.PyApp_SendIdleEvents(*args, **kwargs)
|
||||||
|
|
||||||
def OnIdle(*args, **kwargs):
|
|
||||||
"""OnIdle(IdleEvent event)"""
|
|
||||||
return _core.PyApp_OnIdle(*args, **kwargs)
|
|
||||||
|
|
||||||
def IsActive(*args, **kwargs):
|
def IsActive(*args, **kwargs):
|
||||||
"""IsActive() -> bool"""
|
"""IsActive() -> bool
|
||||||
|
|
||||||
|
Return True if our app has focus."""
|
||||||
return _core.PyApp_IsActive(*args, **kwargs)
|
return _core.PyApp_IsActive(*args, **kwargs)
|
||||||
|
|
||||||
def SetTopWindow(*args, **kwargs):
|
def SetTopWindow(*args, **kwargs):
|
||||||
"""SetTopWindow(Window win)"""
|
"""SetTopWindow(Window win)
|
||||||
|
|
||||||
|
Set the "main" top level window"""
|
||||||
return _core.PyApp_SetTopWindow(*args, **kwargs)
|
return _core.PyApp_SetTopWindow(*args, **kwargs)
|
||||||
|
|
||||||
def GetTopWindow(*args, **kwargs):
|
def GetTopWindow(*args, **kwargs):
|
||||||
"""GetTopWindow() -> Window"""
|
"""GetTopWindow() -> Window
|
||||||
|
|
||||||
|
Return the "main" top level window (if it hadn't been set previously with
|
||||||
|
SetTopWindow(), will return just some top level window and, if there not any,
|
||||||
|
will return None)"""
|
||||||
return _core.PyApp_GetTopWindow(*args, **kwargs)
|
return _core.PyApp_GetTopWindow(*args, **kwargs)
|
||||||
|
|
||||||
def SetExitOnFrameDelete(*args, **kwargs):
|
def SetExitOnFrameDelete(*args, **kwargs):
|
||||||
"""SetExitOnFrameDelete(bool flag)"""
|
"""SetExitOnFrameDelete(bool flag)
|
||||||
|
|
||||||
|
Control the exit behaviour: by default, the program will exit the main loop
|
||||||
|
(and so, usually, terminate) when the last top-level program window is
|
||||||
|
deleted. Beware that if you disable this behaviour (with
|
||||||
|
SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() explicitly
|
||||||
|
from somewhere.
|
||||||
|
"""
|
||||||
return _core.PyApp_SetExitOnFrameDelete(*args, **kwargs)
|
return _core.PyApp_SetExitOnFrameDelete(*args, **kwargs)
|
||||||
|
|
||||||
def GetExitOnFrameDelete(*args, **kwargs):
|
def GetExitOnFrameDelete(*args, **kwargs):
|
||||||
"""GetExitOnFrameDelete() -> bool"""
|
"""GetExitOnFrameDelete() -> bool
|
||||||
|
|
||||||
|
Get the current exit behaviour setting."""
|
||||||
return _core.PyApp_GetExitOnFrameDelete(*args, **kwargs)
|
return _core.PyApp_GetExitOnFrameDelete(*args, **kwargs)
|
||||||
|
|
||||||
def SetUseBestVisual(*args, **kwargs):
|
def SetUseBestVisual(*args, **kwargs):
|
||||||
"""SetUseBestVisual(bool flag)"""
|
"""SetUseBestVisual(bool flag)
|
||||||
|
|
||||||
|
Set whether the app should try to use the best available visual on systems
|
||||||
|
where more than one is available, (Sun, SGI, XFree86 4, etc.)"""
|
||||||
return _core.PyApp_SetUseBestVisual(*args, **kwargs)
|
return _core.PyApp_SetUseBestVisual(*args, **kwargs)
|
||||||
|
|
||||||
def GetUseBestVisual(*args, **kwargs):
|
def GetUseBestVisual(*args, **kwargs):
|
||||||
"""GetUseBestVisual() -> bool"""
|
"""GetUseBestVisual() -> bool
|
||||||
|
|
||||||
|
Get current UseBestVisual setting."""
|
||||||
return _core.PyApp_GetUseBestVisual(*args, **kwargs)
|
return _core.PyApp_GetUseBestVisual(*args, **kwargs)
|
||||||
|
|
||||||
def SetPrintMode(*args, **kwargs):
|
def SetPrintMode(*args, **kwargs):
|
||||||
@@ -4505,14 +4577,25 @@ Returns the class name of the C++ object using wxRTTI."""
|
|||||||
"""GetPrintMode() -> int"""
|
"""GetPrintMode() -> int"""
|
||||||
return _core.PyApp_GetPrintMode(*args, **kwargs)
|
return _core.PyApp_GetPrintMode(*args, **kwargs)
|
||||||
|
|
||||||
def GetAssertMode(*args, **kwargs):
|
|
||||||
"""GetAssertMode() -> int"""
|
|
||||||
return _core.PyApp_GetAssertMode(*args, **kwargs)
|
|
||||||
|
|
||||||
def SetAssertMode(*args, **kwargs):
|
def SetAssertMode(*args, **kwargs):
|
||||||
"""SetAssertMode(int mode)"""
|
"""SetAssertMode(int mode)
|
||||||
|
|
||||||
|
Set the OnAssert behaviour for debug and hybrid builds. The following flags
|
||||||
|
may be or'd together:
|
||||||
|
|
||||||
|
wxPYAPP_ASSERT_SUPPRESS Don't do anything
|
||||||
|
wxPYAPP_ASSERT_EXCEPTION Turn it into a Python exception if possible (default)
|
||||||
|
wxPYAPP_ASSERT_DIALOG Display a message dialog
|
||||||
|
wxPYAPP_ASSERT_LOG Write the assertion info to the wxLog
|
||||||
|
"""
|
||||||
return _core.PyApp_SetAssertMode(*args, **kwargs)
|
return _core.PyApp_SetAssertMode(*args, **kwargs)
|
||||||
|
|
||||||
|
def GetAssertMode(*args, **kwargs):
|
||||||
|
"""GetAssertMode() -> int
|
||||||
|
|
||||||
|
Get the current OnAssert behaviour setting."""
|
||||||
|
return _core.PyApp_GetAssertMode(*args, **kwargs)
|
||||||
|
|
||||||
def GetMacSupportPCMenuShortcuts(*args, **kwargs):
|
def GetMacSupportPCMenuShortcuts(*args, **kwargs):
|
||||||
"""PyApp.GetMacSupportPCMenuShortcuts() -> bool"""
|
"""PyApp.GetMacSupportPCMenuShortcuts() -> bool"""
|
||||||
return _core.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
|
return _core.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
|
||||||
@@ -4564,11 +4647,16 @@ Returns the class name of the C++ object using wxRTTI."""
|
|||||||
|
|
||||||
SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
|
SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
|
||||||
def _BootstrapApp(*args, **kwargs):
|
def _BootstrapApp(*args, **kwargs):
|
||||||
"""_BootstrapApp()"""
|
"""_BootstrapApp()
|
||||||
|
|
||||||
|
For internal use only"""
|
||||||
return _core.PyApp__BootstrapApp(*args, **kwargs)
|
return _core.PyApp__BootstrapApp(*args, **kwargs)
|
||||||
|
|
||||||
def GetComCtl32Version(*args, **kwargs):
|
def GetComCtl32Version(*args, **kwargs):
|
||||||
"""PyApp.GetComCtl32Version() -> int"""
|
"""PyApp.GetComCtl32Version() -> int
|
||||||
|
|
||||||
|
Returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
|
||||||
|
wasn't found at all. Raises an exception on non-Windows platforms."""
|
||||||
return _core.PyApp_GetComCtl32Version(*args, **kwargs)
|
return _core.PyApp_GetComCtl32Version(*args, **kwargs)
|
||||||
|
|
||||||
GetComCtl32Version = staticmethod(GetComCtl32Version)
|
GetComCtl32Version = staticmethod(GetComCtl32Version)
|
||||||
@@ -4621,68 +4709,87 @@ def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
|
|||||||
return _core.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
|
return _core.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
|
||||||
|
|
||||||
def PyApp_GetComCtl32Version(*args, **kwargs):
|
def PyApp_GetComCtl32Version(*args, **kwargs):
|
||||||
"""PyApp_GetComCtl32Version() -> int"""
|
"""PyApp_GetComCtl32Version() -> int
|
||||||
|
|
||||||
|
Returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
|
||||||
|
wasn't found at all. Raises an exception on non-Windows platforms."""
|
||||||
return _core.PyApp_GetComCtl32Version(*args, **kwargs)
|
return _core.PyApp_GetComCtl32Version(*args, **kwargs)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def Exit(*args, **kwargs):
|
def Exit(*args, **kwargs):
|
||||||
"""Exit()"""
|
"""Exit()
|
||||||
|
|
||||||
|
Force an exit of the application. Convenience for wx.GetApp().Exit()"""
|
||||||
return _core.Exit(*args, **kwargs)
|
return _core.Exit(*args, **kwargs)
|
||||||
|
|
||||||
def Yield(*args, **kwargs):
|
def Yield(*args, **kwargs):
|
||||||
"""Yield() -> bool"""
|
"""Yield() -> bool
|
||||||
|
|
||||||
|
Yield to other apps/messages. Convenience for wx.GetApp().Yield()"""
|
||||||
return _core.Yield(*args, **kwargs)
|
return _core.Yield(*args, **kwargs)
|
||||||
|
|
||||||
def YieldIfNeeded(*args, **kwargs):
|
def YieldIfNeeded(*args, **kwargs):
|
||||||
"""YieldIfNeeded() -> bool"""
|
"""YieldIfNeeded() -> bool
|
||||||
|
|
||||||
|
Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)"""
|
||||||
return _core.YieldIfNeeded(*args, **kwargs)
|
return _core.YieldIfNeeded(*args, **kwargs)
|
||||||
|
|
||||||
def SafeYield(*args, **kwargs):
|
def SafeYield(*args, **kwargs):
|
||||||
"""SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool"""
|
"""SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
|
||||||
|
|
||||||
|
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 will remain enabled, allowing the
|
||||||
|
implementation of some limited user interaction.
|
||||||
|
|
||||||
|
Returns the result of the call to wx.Yield."""
|
||||||
return _core.SafeYield(*args, **kwargs)
|
return _core.SafeYield(*args, **kwargs)
|
||||||
|
|
||||||
def WakeUpIdle(*args, **kwargs):
|
def WakeUpIdle(*args, **kwargs):
|
||||||
"""WakeUpIdle()"""
|
"""WakeUpIdle()
|
||||||
|
|
||||||
|
Cause the message queue to become empty again, so idle events will be sent."""
|
||||||
return _core.WakeUpIdle(*args, **kwargs)
|
return _core.WakeUpIdle(*args, **kwargs)
|
||||||
|
|
||||||
def PostEvent(*args, **kwargs):
|
def PostEvent(*args, **kwargs):
|
||||||
"""PostEvent(EvtHandler dest, Event event)"""
|
"""PostEvent(EvtHandler dest, Event event)
|
||||||
|
|
||||||
|
Send an event to a window or other wx.EvtHandler to be processed later."""
|
||||||
return _core.PostEvent(*args, **kwargs)
|
return _core.PostEvent(*args, **kwargs)
|
||||||
|
|
||||||
def App_CleanUp(*args, **kwargs):
|
def App_CleanUp(*args, **kwargs):
|
||||||
"""App_CleanUp()"""
|
"""App_CleanUp()
|
||||||
|
|
||||||
|
For internal use only, it is used to cleanup after wxWindows when Python shuts down."""
|
||||||
return _core.App_CleanUp(*args, **kwargs)
|
return _core.App_CleanUp(*args, **kwargs)
|
||||||
|
|
||||||
def GetApp(*args, **kwargs):
|
def GetApp(*args, **kwargs):
|
||||||
"""GetApp() -> PyApp"""
|
"""GetApp() -> PyApp
|
||||||
|
|
||||||
|
Return a reference to the current wxApp object."""
|
||||||
return _core.GetApp(*args, **kwargs)
|
return _core.GetApp(*args, **kwargs)
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
class PyOnDemandOutputWindow:
|
class PyOnDemandOutputWindow:
|
||||||
|
"""
|
||||||
|
A class that can be used for redirecting Python's stdout and
|
||||||
|
stderr streams. It will do nothing until something is wrriten to
|
||||||
|
the stream at which point it will create a Frame with a text area
|
||||||
|
and write the text there.
|
||||||
|
"""
|
||||||
def __init__(self, title = "wxPython: stdout/stderr"):
|
def __init__(self, title = "wxPython: stdout/stderr"):
|
||||||
self.frame = None
|
self.frame = None
|
||||||
self.title = title
|
self.title = title
|
||||||
self.parent = None
|
self.parent = None
|
||||||
|
|
||||||
def SetParent(self, parent):
|
def SetParent(self, parent):
|
||||||
|
"""Set the window to be used as the popup Frame's parent."""
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
|
||||||
def OnCloseWindow(self, event):
|
|
||||||
if self.frame != None:
|
|
||||||
self.frame.Destroy()
|
|
||||||
self.frame = None
|
|
||||||
self.text = None
|
|
||||||
|
|
||||||
# These methods provide the file-like output behaviour.
|
def CreateOutputWindow(self, st):
|
||||||
def write(self, str):
|
|
||||||
if not wx.Thread_IsMain():
|
|
||||||
# Aquire the GUI mutex before making GUI calls. Mutex is released
|
|
||||||
# when locker is deleted at the end of this function.
|
|
||||||
locker = wx.MutexGuiLocker()
|
|
||||||
|
|
||||||
if not self.frame:
|
|
||||||
self.frame = wx.Frame(self.parent, -1, self.title,
|
self.frame = wx.Frame(self.parent, -1, self.title,
|
||||||
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
|
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
|
||||||
self.text = wxTextCtrl(self.frame, -1, "",
|
self.text = wxTextCtrl(self.frame, -1, "",
|
||||||
@@ -4690,22 +4797,47 @@ class PyOnDemandOutputWindow:
|
|||||||
self.frame.SetSize((450, 300))
|
self.frame.SetSize((450, 300))
|
||||||
self.frame.Show(True)
|
self.frame.Show(True)
|
||||||
EVT_CLOSE(self.frame, self.OnCloseWindow)
|
EVT_CLOSE(self.frame, self.OnCloseWindow)
|
||||||
self.text.AppendText(str)
|
|
||||||
|
|
||||||
|
# These methods provide the file-like output behaviour.
|
||||||
|
def write(self, text):
|
||||||
|
"""
|
||||||
|
Create the output window if needed and write the string to it.
|
||||||
|
If not called in the context of the gui thread then uses
|
||||||
|
CallAfter to do the work there.
|
||||||
|
"""
|
||||||
|
if self.frame is None:
|
||||||
|
if not wx.Thread_IsMain():
|
||||||
|
wx.CallAfter(self.CreateOutputWindow, text)
|
||||||
|
else:
|
||||||
|
self.CreateOutputWindow(text)
|
||||||
|
else:
|
||||||
|
if not wx.Thread_IsMain():
|
||||||
|
wx.CallAfter(self.text.AppendText, text)
|
||||||
|
else:
|
||||||
|
self.text.AppendText(text)
|
||||||
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
if self.frame != None:
|
if self.frame is not None:
|
||||||
if not wx.Thread_IsMain():
|
wx.CallAfter(self.frame.Close)
|
||||||
locker = wx.MutexGuiLocker()
|
|
||||||
self.frame.Close()
|
|
||||||
|
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
if self.frame is not None:
|
||||||
|
self.frame.Destroy()
|
||||||
|
self.frame = None
|
||||||
|
self.text = None
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# The main application class. Derive from this and implement an OnInit
|
|
||||||
# method that creates a frame and then calls self.SetTopWindow(frame)
|
|
||||||
|
|
||||||
_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
|
_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
|
||||||
|
|
||||||
class App(wx.PyApp):
|
class App(wx.PyApp):
|
||||||
|
"""
|
||||||
|
The main application class. Derive from this and implement an OnInit
|
||||||
|
method that creates a frame and then calls self.SetTopWindow(frame)
|
||||||
|
"""
|
||||||
outputWindowClass = PyOnDemandOutputWindow
|
outputWindowClass = PyOnDemandOutputWindow
|
||||||
|
|
||||||
def __init__(self, redirect=_defRedirect, filename=None, useBestVisual=False):
|
def __init__(self, redirect=_defRedirect, filename=None, useBestVisual=False):
|
||||||
@@ -4796,13 +4928,20 @@ App_GetComCtl32Version = _core.PyApp_GetComCtl32Version
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
class PySimpleApp(wx.App):
|
class PySimpleApp(wx.App):
|
||||||
def __init__(self, redirect=False, filename=None):
|
"""
|
||||||
wx.App.__init__(self, redirect, filename)
|
A simple application class. You can just create one of these and
|
||||||
|
then then make your top level windows later, and not have to worry
|
||||||
|
about OnInit."""
|
||||||
|
|
||||||
|
def __init__(self, redirect=False, filename=None, useBestVisual=False):
|
||||||
|
wx.App.__init__(self, redirect, filename, useBestVisual)
|
||||||
|
|
||||||
def OnInit(self):
|
def OnInit(self):
|
||||||
wx.InitAllImageHandlers()
|
wx.InitAllImageHandlers()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
# Is anybody using this one?
|
||||||
class PyWidgetTester(wx.App):
|
class PyWidgetTester(wx.App):
|
||||||
def __init__(self, size = (250, 100)):
|
def __init__(self, size = (250, 100)):
|
||||||
self.size = size
|
self.size = size
|
||||||
@@ -7455,7 +7594,7 @@ class LayoutConstraints(Object):
|
|||||||
self.thisown = 1
|
self.thisown = 1
|
||||||
del newobj.thisown
|
del newobj.thisown
|
||||||
def SatisfyConstraints(*args, **kwargs):
|
def SatisfyConstraints(*args, **kwargs):
|
||||||
"""SatisfyConstraints(Window win, int OUTPUT) -> bool"""
|
"""SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
|
||||||
return _core.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
|
return _core.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
|
||||||
|
|
||||||
def AreSatisfied(*args, **kwargs):
|
def AreSatisfied(*args, **kwargs):
|
||||||
|
@@ -17740,36 +17740,6 @@ static PyObject *_wrap_PyApp_SendIdleEvents(PyObject *self, PyObject *args, PyOb
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static PyObject *_wrap_PyApp_OnIdle(PyObject *self, PyObject *args, PyObject *kwargs) {
|
|
||||||
PyObject *resultobj;
|
|
||||||
wxPyApp *arg1 = (wxPyApp *) 0 ;
|
|
||||||
wxIdleEvent *arg2 = 0 ;
|
|
||||||
PyObject * obj0 = 0 ;
|
|
||||||
PyObject * obj1 = 0 ;
|
|
||||||
char *kwnames[] = {
|
|
||||||
(char *) "self",(char *) "event", NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyApp_OnIdle",kwnames,&obj0,&obj1)) goto fail;
|
|
||||||
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPyApp,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
||||||
if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxIdleEvent,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
||||||
if (arg2 == NULL) {
|
|
||||||
PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
|
||||||
(arg1)->OnIdle(*arg2);
|
|
||||||
|
|
||||||
wxPyEndAllowThreads(__tstate);
|
|
||||||
if (PyErr_Occurred()) SWIG_fail;
|
|
||||||
}
|
|
||||||
Py_INCREF(Py_None); resultobj = Py_None;
|
|
||||||
return resultobj;
|
|
||||||
fail:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static PyObject *_wrap_PyApp_IsActive(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_PyApp_IsActive(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject *resultobj;
|
PyObject *resultobj;
|
||||||
wxPyApp *arg1 = (wxPyApp *) 0 ;
|
wxPyApp *arg1 = (wxPyApp *) 0 ;
|
||||||
@@ -18005,31 +17975,6 @@ static PyObject *_wrap_PyApp_GetPrintMode(PyObject *self, PyObject *args, PyObje
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static PyObject *_wrap_PyApp_GetAssertMode(PyObject *self, PyObject *args, PyObject *kwargs) {
|
|
||||||
PyObject *resultobj;
|
|
||||||
wxPyApp *arg1 = (wxPyApp *) 0 ;
|
|
||||||
int result;
|
|
||||||
PyObject * obj0 = 0 ;
|
|
||||||
char *kwnames[] = {
|
|
||||||
(char *) "self", NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PyApp_GetAssertMode",kwnames,&obj0)) goto fail;
|
|
||||||
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPyApp,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
||||||
{
|
|
||||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
|
||||||
result = (int)(arg1)->GetAssertMode();
|
|
||||||
|
|
||||||
wxPyEndAllowThreads(__tstate);
|
|
||||||
if (PyErr_Occurred()) SWIG_fail;
|
|
||||||
}
|
|
||||||
resultobj = PyInt_FromLong((long)result);
|
|
||||||
return resultobj;
|
|
||||||
fail:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static PyObject *_wrap_PyApp_SetAssertMode(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_PyApp_SetAssertMode(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject *resultobj;
|
PyObject *resultobj;
|
||||||
wxPyApp *arg1 = (wxPyApp *) 0 ;
|
wxPyApp *arg1 = (wxPyApp *) 0 ;
|
||||||
@@ -18055,6 +18000,31 @@ static PyObject *_wrap_PyApp_SetAssertMode(PyObject *self, PyObject *args, PyObj
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject *_wrap_PyApp_GetAssertMode(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
|
PyObject *resultobj;
|
||||||
|
wxPyApp *arg1 = (wxPyApp *) 0 ;
|
||||||
|
int result;
|
||||||
|
PyObject * obj0 = 0 ;
|
||||||
|
char *kwnames[] = {
|
||||||
|
(char *) "self", NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PyApp_GetAssertMode",kwnames,&obj0)) goto fail;
|
||||||
|
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPyApp,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
||||||
|
{
|
||||||
|
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||||
|
result = (int)(arg1)->GetAssertMode();
|
||||||
|
|
||||||
|
wxPyEndAllowThreads(__tstate);
|
||||||
|
if (PyErr_Occurred()) SWIG_fail;
|
||||||
|
}
|
||||||
|
resultobj = PyInt_FromLong((long)result);
|
||||||
|
return resultobj;
|
||||||
|
fail:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static PyObject *_wrap_PyApp_GetMacSupportPCMenuShortcuts(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_PyApp_GetMacSupportPCMenuShortcuts(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject *resultobj;
|
PyObject *resultobj;
|
||||||
bool result;
|
bool result;
|
||||||
@@ -35612,7 +35582,6 @@ static PyMethodDef SwigMethods[] = {
|
|||||||
{ (char *)"PyApp_Dispatch", (PyCFunction) _wrap_PyApp_Dispatch, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_Dispatch", (PyCFunction) _wrap_PyApp_Dispatch, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_ProcessIdle", (PyCFunction) _wrap_PyApp_ProcessIdle, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_ProcessIdle", (PyCFunction) _wrap_PyApp_ProcessIdle, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_SendIdleEvents", (PyCFunction) _wrap_PyApp_SendIdleEvents, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_SendIdleEvents", (PyCFunction) _wrap_PyApp_SendIdleEvents, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_OnIdle", (PyCFunction) _wrap_PyApp_OnIdle, METH_VARARGS | METH_KEYWORDS },
|
|
||||||
{ (char *)"PyApp_IsActive", (PyCFunction) _wrap_PyApp_IsActive, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_IsActive", (PyCFunction) _wrap_PyApp_IsActive, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_SetTopWindow", (PyCFunction) _wrap_PyApp_SetTopWindow, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_SetTopWindow", (PyCFunction) _wrap_PyApp_SetTopWindow, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_GetTopWindow", (PyCFunction) _wrap_PyApp_GetTopWindow, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_GetTopWindow", (PyCFunction) _wrap_PyApp_GetTopWindow, METH_VARARGS | METH_KEYWORDS },
|
||||||
@@ -35622,8 +35591,8 @@ static PyMethodDef SwigMethods[] = {
|
|||||||
{ (char *)"PyApp_GetUseBestVisual", (PyCFunction) _wrap_PyApp_GetUseBestVisual, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_GetUseBestVisual", (PyCFunction) _wrap_PyApp_GetUseBestVisual, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_SetPrintMode", (PyCFunction) _wrap_PyApp_SetPrintMode, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_SetPrintMode", (PyCFunction) _wrap_PyApp_SetPrintMode, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_GetPrintMode", (PyCFunction) _wrap_PyApp_GetPrintMode, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_GetPrintMode", (PyCFunction) _wrap_PyApp_GetPrintMode, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_GetAssertMode", (PyCFunction) _wrap_PyApp_GetAssertMode, METH_VARARGS | METH_KEYWORDS },
|
|
||||||
{ (char *)"PyApp_SetAssertMode", (PyCFunction) _wrap_PyApp_SetAssertMode, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_SetAssertMode", (PyCFunction) _wrap_PyApp_SetAssertMode, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
{ (char *)"PyApp_GetAssertMode", (PyCFunction) _wrap_PyApp_GetAssertMode, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_GetMacSupportPCMenuShortcuts", (PyCFunction) _wrap_PyApp_GetMacSupportPCMenuShortcuts, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_GetMacSupportPCMenuShortcuts", (PyCFunction) _wrap_PyApp_GetMacSupportPCMenuShortcuts, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_GetMacAboutMenuItemId", (PyCFunction) _wrap_PyApp_GetMacAboutMenuItemId, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_GetMacAboutMenuItemId", (PyCFunction) _wrap_PyApp_GetMacAboutMenuItemId, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ (char *)"PyApp_GetMacPreferencesMenuItemId", (PyCFunction) _wrap_PyApp_GetMacPreferencesMenuItemId, METH_VARARGS | METH_KEYWORDS },
|
{ (char *)"PyApp_GetMacPreferencesMenuItemId", (PyCFunction) _wrap_PyApp_GetMacPreferencesMenuItemId, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
@@ -10496,7 +10496,7 @@ static PyObject *_wrap_Wave_Play(PyObject *self, PyObject *args, PyObject *kwarg
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||||
result = (bool)((wxWave const *)arg1)->Play(arg2,arg3);
|
result = (bool)(arg1)->Play(arg2,arg3);
|
||||||
|
|
||||||
wxPyEndAllowThreads(__tstate);
|
wxPyEndAllowThreads(__tstate);
|
||||||
if (PyErr_Occurred()) SWIG_fail;
|
if (PyErr_Occurred()) SWIG_fail;
|
||||||
|
Reference in New Issue
Block a user