]> git.saurik.com Git - wxWidgets.git/commitdiff
All the Window and GDI (pen, bitmap, etc.) classes and also many
authorRobin Dunn <robin@alldunn.com>
Tue, 1 Jun 2004 21:38:05 +0000 (21:38 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 1 Jun 2004 21:38:05 +0000 (21:38 +0000)
toplevel functions will now check that a wx.App object has already
been created and will raise a wx.PyNoAppError exception if not.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

79 files changed:
wxPython/contrib/activex/activex.i
wxPython/contrib/gizmos/gizmos.i
wxPython/contrib/glcanvas/glcanvas.i
wxPython/contrib/iewin/iewin.i
wxPython/contrib/ogl/_oglcanvas.i
wxPython/contrib/xrc/_xmlres.i
wxPython/docs/CHANGES.txt
wxPython/docs/MigrationGuide.txt
wxPython/include/wx/wxPython/wxPython.h
wxPython/include/wx/wxPython/wxPython_int.h
wxPython/src/_artprov.i
wxPython/src/_bitmap.i
wxPython/src/_brush.i
wxPython/src/_button.i
wxPython/src/_checkbox.i
wxPython/src/_choice.i
wxPython/src/_cmndlgs.i
wxPython/src/_combobox.i
wxPython/src/_control.i
wxPython/src/_core_api.i
wxPython/src/_cshelp.i
wxPython/src/_cursor.i
wxPython/src/_dc.i
wxPython/src/_defs.i
wxPython/src/_dirctrl.i
wxPython/src/_dragimg.i
wxPython/src/_font.i
wxPython/src/_functions.i
wxPython/src/_gauge.i
wxPython/src/_gdicmn.i
wxPython/src/_gdiobj.i
wxPython/src/_icon.i
wxPython/src/_image.i
wxPython/src/_imaglist.i
wxPython/src/_joystick.i
wxPython/src/_listbox.i
wxPython/src/_listctrl.i
wxPython/src/_mdi.i
wxPython/src/_menu.i
wxPython/src/_misc.i
wxPython/src/_notebook.i
wxPython/src/_palette.i
wxPython/src/_panel.i
wxPython/src/_pen.i
wxPython/src/_popupwin.i
wxPython/src/_printfw.i
wxPython/src/_process.i
wxPython/src/_pycontrol.i
wxPython/src/_pywindows.i
wxPython/src/_radio.i
wxPython/src/_region.i
wxPython/src/_sashwin.i
wxPython/src/_scrolbar.i
wxPython/src/_settings.i
wxPython/src/_slider.i
wxPython/src/_sound.i
wxPython/src/_spin.i
wxPython/src/_splitter.i
wxPython/src/_statctrls.i
wxPython/src/_statusbar.i
wxPython/src/_stockobjs.i
wxPython/src/_taskbar.i
wxPython/src/_textctrl.i
wxPython/src/_tglbtn.i
wxPython/src/_timer.i
wxPython/src/_tipdlg.i
wxPython/src/_tipwin.i
wxPython/src/_toolbar.i
wxPython/src/_toplvl.i
wxPython/src/_treectrl.i
wxPython/src/_vscroll.i
wxPython/src/_window.i
wxPython/src/calendar.i
wxPython/src/grid.i
wxPython/src/helpers.cpp
wxPython/src/html.i
wxPython/src/misc.i
wxPython/src/my_typemaps.i
wxPython/src/wizard.i

index df0f3c7cd15f9fe77b12454d6ca41ec3788a0439..c663e332a4d9149314e02d38d716bca6ffde7861 100644 (file)
@@ -515,6 +515,8 @@ specified by the TypeInfo.
 ", "");
 
 
+MustHaveApp(wxActiveXWindow);
+
 class wxActiveXWindow : public wxWindow
 {
 public:
@@ -1053,6 +1055,8 @@ public:
 %feature("noautodoc") wxIEHtmlWindowBase::GetText;
 
 
+MustHaveApp(wxIEHtmlWindowBase);
+
 class wxIEHtmlWindowBase : public wxActiveXWindow {
 public:
 
index 6f48b39f4c7be187a70f7093989441c9b39e757f..e24377889ecb3f417d5e61c68d5610c42d9f9100 100644 (file)
@@ -139,6 +139,8 @@ public:
 
 */
 
+MustHaveApp(wxDynamicSashWindow);
+
 class wxDynamicSashWindow : public wxWindow {
 public:
     %pythonAppend wxDynamicSashWindow         "self._setOORInfo(self)"
@@ -177,6 +179,7 @@ enum {
 
 // This class provides a composite control that lets the
 // user easily enter list of strings
+MustHaveApp(wxEditableListBox);
 class wxEditableListBox : public wxPanel
 {
 public:
@@ -227,6 +230,8 @@ public:
     typedef wxTreeCtrl wxPyTreeCtrl;
 %}
 
+MustHaveApp(wxRemotelyScrolledTreeCtrl);
+
 class wxRemotelyScrolledTreeCtrl: public wxPyTreeCtrl
 {
 public:
@@ -298,6 +303,8 @@ public:
 %}
 
 
+MustHaveApp(wxPyTreeCompanionWindow);
+
 %name(TreeCompanionWindow) class wxPyTreeCompanionWindow: public wxWindow
 {
 public:
@@ -323,6 +330,8 @@ public:
  * than the usual one.
  */
 
+MustHaveApp(wxThinSplitterWindow);
+
 class wxThinSplitterWindow: public wxSplitterWindow
 {
 public:
@@ -346,6 +355,8 @@ public:
  * scroll appropriately.
  */
 
+MustHaveApp(wxSplitterScrolledWindow);
+
 class wxSplitterScrolledWindow: public wxScrolledWindow
 {
 public:
@@ -375,6 +386,8 @@ enum wxLEDValueAlign
 };
 
 
+MustHaveApp(wxLEDNumberCtrl);
+
 class wxLEDNumberCtrl :        public wxControl
 {
 public:
@@ -501,6 +514,8 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyTreeListCtrl, wxTreeListCtrl)
 
 
 
+MustHaveApp(wxPyTreeListCtrl);
+
 %name(TreeListCtrl) class wxPyTreeListCtrl : public wxControl
 {
 public:
index 9892e2751a827d27cf0e394b3971a561fc69d9de..ab3dd14b296dff41dede1a0830a74bae76c9b9f1 100644 (file)
@@ -43,6 +43,8 @@ class wxPalette;
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxGLContext);
+
 class wxGLContext : public wxObject {
 public:
 #ifndef __WXMAC__  
@@ -118,6 +120,8 @@ enum {
 
 
 
+MustHaveApp(wxGLCanvas);
+
 class wxGLCanvas : public wxWindow {
 public:
     %pythonAppend wxGLCanvas   "self._setOORInfo(self)"
index 72342916c04b34c99215cc25b22213c905cc3d3f..b97f5fca0b9cfdb7f188214ffe4c4dc6fa6fb12c 100644 (file)
@@ -78,6 +78,8 @@ enum wxIEHtmlRefreshLevel {
 };
 
 
+MustHaveApp(wxIEHtmlWin);
+
 class wxIEHtmlWin : public wxWindow /* wxActiveX */ 
 {
 public:
index b220dee2a2b3b5f3b25f9a666eb4809f7f03788f..af80f9ad97a7f30d425522ac8cd24034dd48d414 100644 (file)
@@ -99,6 +99,8 @@ public:
 %}
 
 
+MustHaveApp(wxPyShapeCanvas);
+
 class wxPyShapeCanvas : public wxScrolledWindow {
 public:
     %pythonAppend wxPyShapeCanvas "self._setOORandCallbackInfo(PyShapeCanvas)"
index fca287e729688026e6dc188f0042844d2b01c746..2861a13f266d4bcad075d312db94177d59283fd8 100644 (file)
@@ -44,9 +44,8 @@ class wxXmlResource : public wxObject
 {
 public:
 
-    %pythonAppend wxXmlResource(const wxString& filemask, int flags)        "self.InitAllHandlers()"
-
-    %pythonAppend wxXmlResource(int flags)        "val.InitAllHandlers()"
+    %pythonAppend wxXmlResource(const wxString& filemask, int flags)   "self.InitAllHandlers()"
+    %pythonAppend wxXmlResource(int flags)                             "val.InitAllHandlers()"
 
     // Ctors.
     // Flags: wxXRC_USE_LOCALE
index cc94500d6287caef9821956f224b3c38fe3a604f..84e1810a90d2d7fec59b056859fd088137bcb2fc 100644 (file)
@@ -95,6 +95,10 @@ MigrationGuide_ file for details.
 EVT_STC_POSCHANGED has been removed as it has been deprecated in
 Scintilla for several releases now.
 
+All the Window and GDI (pen, bitmap, etc.) classes and also many
+toplevel functions will now check that a wx.App object has already
+been created and will raise a wx.PyNoAppError exception if not.
+
 
 
 
index 690436e242c6d0ee77e5ee5a1d73932f0fc9aa86..79d79ae3833c5f4429ce3879426acc130fa164f1 100644 (file)
@@ -52,6 +52,11 @@ Also, you will probably not be able to do any kind of GUI or bitmap
 operation unless you first have created an app object, (even on
 Windows where most anything was possible before.)
 
+**[Changed in 2.5.2.0]** All the Window and GDI (pen, bitmap, etc.)
+classes and also many toplevel functions will now check that a wx.App
+object has already been created and will raise a wx.PyNoAppError
+exception if not.
+
 
 
 SWIG 1.3
index e925902d66545329dd5c6d2a8392d26e36493bd6..dc3a1f68207e4748b9b2cdf309823f055c39d255 100644 (file)
@@ -133,6 +133,8 @@ inline wxPyCoreAPI* wxPyGetCoreAPIPtr()
 #define wxPyInstance_Check(a)                   (wxPyGetCoreAPIPtr()->p_wxPyInstance_Check(a))
 #define wxPySwigInstance_Check(a)               (wxPyGetCoreAPIPtr()->p_wxPySwigInstance_Check(a))
 
+#define wxPyCheckForApp()                       (wxPyGetCoreAPIPtr()->p_wxPyCheckForApp())
+
 
 //----------------------------------------------------------------------
 #endif
index 14686c748feb748bdb1efcc45352c92048666e48..f9421204045292ae2d10386286b0e4d3066797b3 100644 (file)
@@ -187,7 +187,9 @@ bool wxPoint2D_helper(PyObject* source, wxPoint2D** obj);
 bool wxPySimple_typecheck(PyObject* source, const wxChar* classname, int seqLen);
 bool wxColour_typecheck(PyObject* source);
 
+bool wxPyCheckForApp();
 
+    
 template<class T>
 bool wxPyTwoIntItem_helper(PyObject* source, T** obj, const wxChar* name)
 {
@@ -428,7 +430,9 @@ struct wxPyCoreAPI {
 
     bool                (*p_wxPyInstance_Check)(PyObject* obj);
     bool                (*p_wxPySwigInstance_Check)(PyObject* obj);
-    
+
+    bool                (*p_wxPyCheckForApp)();
+
 };
 
 #ifdef wxPyUSE_EXPORTED_API
index 0f1511589a549e1203cd00037a38de7968a55887..586c4e78736cf79126b11f1526301ff0e63ec1cb 100644 (file)
@@ -186,6 +186,10 @@ identical bitmap for different client values!
       of the categories above)
 ");
 
+MustHaveApp(wxPyArtProvider);
+MustHaveApp(wxPyArtProvider::GetBitmap);
+MustHaveApp(wxPyArtProvider::GetIcon);
+
 %name(ArtProvider) class wxPyArtProvider /*: public wxObject*/
 {
 public:
index 241c9ceadaa09499c75dee3108cf201342c350bb..88e91c0d5e15fd6a79c2b890eaeafabd6b474821 100644 (file)
@@ -65,6 +65,8 @@ converted to a wx.Bitmap, so any image file format supported by
 ");
 
 
+MustHaveApp(wxBitmap);
+
 class wxBitmap : public wxGDIObject
 {
 public:
@@ -306,6 +308,8 @@ A mask may be associated with a `wx.Bitmap`. It is used in
 `wx.MemoryDC` with a `wx.Bitmap` selected into it that contains a
 mask.", "");
 
+MustHaveApp(wxMask);
+
 class wxMask : public wxObject {
 public:
 
index 3545f9b975d2e721a22de6909608de9140e73135..ac34681356dcf5d005dbc93cb0d44014872c2200 100644 (file)
@@ -33,6 +33,8 @@ a `wx.DC`.  It has a colour and a style.", "
 :see: `wx.BrushList`, `wx.DC`, `wx.DC.SetBrush`
 ");
 
+MustHaveApp(wxBrush);
+
 class wxBrush : public wxGDIObject {
 public:
     DocCtorStr(
index 2826dd75a864feac79c747d54a25293bf86dad3f..cbba457512acc3bc4f38f860618e10b2137b7f5e 100644 (file)
@@ -58,6 +58,8 @@ Events
 :see: `wx.BitmapButton`
 ");
 
+MustHaveApp(wxButton);
+
 class wxButton : public wxControl
 {
 public:
@@ -143,6 +145,8 @@ Events
 :see: `wx.Button`, `wx.Bitmap`
 ");
 
+MustHaveApp(wxBitmapButton);
+
 class wxBitmapButton : public wxButton
 {
 public:
index 626c4f20fbec9828e1e07243efd52ae5a36c88ed..0d7800accb56ccfa80dec218ef755ce2ac2dea35 100644 (file)
@@ -78,6 +78,8 @@ Events
 
 
         
+MustHaveApp(wxCheckBox);
+
 class wxCheckBox : public wxControl
 {
 public:
index 37492a18d6a0b6883d0f0e3ffecfd148156d79ad..6620524128584e21e41b75d4d51c17aea3ea4094 100644 (file)
@@ -34,6 +34,8 @@ Events
 ");
        
 
+MustHaveApp(wxChoice);
+
 class wxChoice : public wxControlWithItems
 {
 public:
index 1b1294e0abc4508e0b34783031fdb9d6d5a56a61..de1705f176e135175b65c598f4103760a7bfe015 100644 (file)
@@ -80,6 +80,8 @@ integer between 0 and 15. The default custom colours are all white.", "");
 DocStr(wxColourDialog,
        "This class represents the colour chooser dialog.", "");
 
+MustHaveApp(wxColourDialog);
+
 class wxColourDialog : public wxDialog {
 public:
     %pythonAppend wxColourDialog   "self._setOORInfo(self)"
@@ -113,6 +115,8 @@ Window  Styles
     ====================  ==========================================
 ");
 
+MustHaveApp(wxDirDialog);
+
 class wxDirDialog : public wxDialog {
 public:
     %pythonAppend wxDirDialog   "self._setOORInfo(self)"
@@ -198,6 +202,8 @@ Window  Styles
 
 
 
+MustHaveApp(wxFileDialog);
+
 class wxFileDialog : public wxDialog {
 public:
     %pythonAppend wxFileDialog   "self._setOORInfo(self)"
@@ -334,6 +340,8 @@ enum { wxCHOICEDLG_STYLE };
 DocStr(wxMultiChoiceDialog,
        "A simple dialog with a multi selection listbox.", "");
 
+MustHaveApp(wxMultiChoiceDialog);
+
 class wxMultiChoiceDialog : public wxDialog
 {
 public:
@@ -374,6 +382,8 @@ integers.", "");
 DocStr(wxSingleChoiceDialog,
        "A simple dialog with a single selection listbox.", "");
 
+MustHaveApp(wxSingleChoiceDialog);
+
 class wxSingleChoiceDialog : public wxDialog {
 public:
     %pythonAppend wxSingleChoiceDialog   "self._setOORInfo(self)"
@@ -418,6 +428,8 @@ public:
 DocStr(wxTextEntryDialog,
        "A dialog with text control, [ok] and [cancel] buttons", "");
 
+MustHaveApp(wxTextEntryDialog);
+
 class wxTextEntryDialog : public wxDialog {
 public:
     %pythonAppend wxTextEntryDialog   "self._setOORInfo(self)"
@@ -528,6 +540,8 @@ DocStr(wxFontDialog,
 :see: `wx.FontData`
 ", "");
 
+MustHaveApp(wxFontDialog);
+
 class wxFontDialog : public wxDialog {
 public:
     %pythonAppend wxFontDialog   "self._setOORInfo(self)"
@@ -575,6 +589,8 @@ Window Styles
 ");
 
 
+MustHaveApp(wxMessageDialog);
+
 class wxMessageDialog : public wxDialog {
 public:
     %pythonAppend wxMessageDialog   "self._setOORInfo(self)"
@@ -625,6 +641,8 @@ Window Styles
 ");
 
 
+MustHaveApp(wxProgressDialog);
+
 class wxProgressDialog : public wxFrame {
 public:
     %pythonAppend wxProgressDialog   "self._setOORInfo(self)"
@@ -841,6 +859,8 @@ Window Styles
     =====================  =========================================
 ");
 
+MustHaveApp(wxFindReplaceDialog);
+
 class wxFindReplaceDialog : public wxDialog {
 public:
     %pythonAppend wxFindReplaceDialog     "self._setOORInfo(self)"
index 8c964c1d92bb8cb844be2ec1ab0b8844c4cd1ed8..079591dd811adf9b032160f8e532ba748f9ee55c 100644 (file)
@@ -56,6 +56,8 @@ Events
 
 
 
+MustHaveApp(wxComboBox);
+
 #ifdef __WXMSW__
 class wxComboBox : public wxChoice
 #else
index f6818657411dc08e56605b4f015f87a0c3edde18..555f535ad90a2055ad6428a1667d367ff3c724de 100644 (file)
@@ -27,6 +27,8 @@ DocStr(wxControl,
 A control is generally a small window which processes user input
 and/or displays one or more item of data.", "");
 
+MustHaveApp(wxControl);
+
 class wxControl : public wxWindow
 {
 public:
index 0cb17d7e626fd7d11c3614e709f63c6450d3387a..8ebca68b4d2727848614d353f9424ff912f816ca 100644 (file)
@@ -206,7 +206,9 @@ static wxPyCoreAPI API = {
     wxPyCBInputStream_create,
 
     wxPyInstance_Check,
-    wxPySwigInstance_Check
+    wxPySwigInstance_Check,
+
+    wxPyCheckForApp
 
 };
 
index 30a9ad44fd0167728dc4e3efb1c0205642246c7c..31944bf0a52efddad1dd9f4f090277cdddc7220f 100644 (file)
@@ -133,6 +133,8 @@ There are a couple of ways to invoke this behaviour implicitly:
 :see: `wx.ContextHelpButton`
 ", "");       
 
+MustHaveApp(wxContextHelp);
+
 class wxContextHelp : public wxObject {
 public:
     DocCtorStr(
@@ -178,6 +180,8 @@ similar buttons.
 :see: `wx.ContextHelp`, `wx.ContextHelpButton`
 ", "");
 
+MustHaveApp(wxContextHelpButton);
+
 class wxContextHelpButton : public wxBitmapButton {
 public:
     %pythonAppend wxContextHelpButton "self._setOORInfo(self)"
index 6b07a0ad676a6d2f8e03482b8c9fd0c82decc8ee..ecb8a7a9ce0ec5660f94c52f3c712d6b9e003193 100644 (file)
@@ -61,6 +61,8 @@ Stock Cursor IDs
 
 ");
 
+MustHaveApp(wxCursor);
+
 class wxCursor : public wxGDIObject
 {
 public:
index 70642a432739a22f33055a8a73a0015003f7beb6..0032639fe2d049e02a26a3ea6f7c58418051d1a4 100644 (file)
@@ -626,6 +626,8 @@ static void wxDC_GetBoundingBox(wxDC* dc, int* x1, int* y1, int* x2, int* y2) {
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxMemoryDC);
+
 class wxMemoryDC : public wxDC {
 public:
     wxMemoryDC();
@@ -643,6 +645,8 @@ public:
 %}
 
 
+MustHaveApp(wxBufferedDC);
+
 class wxBufferedDC : public wxMemoryDC
 {
 public:
@@ -680,6 +684,7 @@ public:
 
 
 
+MustHaveApp(wxBufferedPaintDC);
 
 // Creates a double buffered wxPaintDC, optionally allowing the
 // user to specify their own buffer to use.
@@ -696,6 +701,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxScreenDC);
+
 class wxScreenDC : public wxDC {
 public:
     wxScreenDC();
@@ -708,6 +715,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxClientDC);
+
 class wxClientDC : public wxDC {
 public:
       wxClientDC(wxWindow* win);
@@ -716,6 +725,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxPaintDC);
+
 class wxPaintDC : public wxDC {
 public:
       wxPaintDC(wxWindow* win);
@@ -724,6 +735,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxWindowDC);
+
 class wxWindowDC : public wxDC {
 public:
       wxWindowDC(wxWindow* win);
@@ -732,6 +745,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxMirrorDC);
+
 class wxMirrorDC : public wxDC
 {
 public:
@@ -751,6 +766,8 @@ public:
 #include <wx/dcps.h>
 %}
 
+MustHaveApp(wxPostScriptDC);
+
 class wxPostScriptDC : public wxDC {
 public:
     wxPostScriptDC(const wxPrintData& printData);
@@ -769,6 +786,10 @@ public:
 %newgroup
 
 
+MustHaveApp(wxMetaFile);
+MustHaveApp(wxMetaFileDC);
+
+
 #if defined(__WXMSW__) || defined(__WXMAC__)
 
 %{
@@ -843,6 +864,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxPrinterDC);
+
 #if defined(__WXMSW__) || defined(__WXMAC__)
 
 class  wxPrinterDC : public wxDC {
index e384cee753d513472cc6e59e207080b7ae6f36ac..2e0aa6c8a65b8b9ba06ed1c58e4a985e70da3d2d 100644 (file)
 /////////////////////////////////////////////////////////////////////////////
 
 
+//---------------------------------------------------------------------------
 // Globally turn on the autodoc feature
+
 %feature("autodoc", "1");  // 0 == no param types, 1 == show param types
 
 
+//---------------------------------------------------------------------------
+// Tell SWIG to wrap all the wrappers with our thread protection by default
+
+%exception {
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    $action
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) SWIG_fail;
+}
+
+
+// This one can be used to add a check for an existing wxApp before the real
+// work is done.  An exception is raised if there isn't one.
+%define MustHaveApp(name)
+    %exception name {
+        if (!wxPyCheckForApp()) SWIG_fail;
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        $action
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;    
+    }
+%enddef
+
+    
+
 //---------------------------------------------------------------------------
 // some type definitions to simplify things for SWIG
 
-// typedef int             wxWindowID;
-// typedef int             wxCoord;
-// typedef int             wxInt32;
-// typedef unsigned int    wxUint32;
 typedef int             wxEventType;
 typedef unsigned int    size_t;
 typedef unsigned int    time_t;
@@ -31,10 +54,6 @@ typedef unsigned char   byte;
 #define wxCoord         int
 #define wxInt32         int
 #define wxUint32        unsigned int
-//#define wxEventType     int
-//#define size_t          unsigned int
-//#define time_t          unsigned int
-//#define byte            unsigned char
 
 
 //----------------------------------------------------------------------
index 08921efef113cd6df0d7fffff063a897215bd18e..b33d7014429ff2dd2efdbbce9dcf5b0d93a83aa3 100644 (file)
@@ -54,6 +54,8 @@ public:
 
 
 
+MustHaveApp(wxGenericDirCtrl);
+
 class wxGenericDirCtrl: public wxControl
 {
 public:
@@ -136,6 +138,8 @@ leaf), done is set to True.
 
 
 
+MustHaveApp(wxDirFilterListCtrl);
+
 class wxDirFilterListCtrl: public wxChoice
 {
 public:
index 3213480036bfea4881fb606146199b21ed3e2380..fdbbb93d1f39fab39dcb3a82299fd51552de5b02 100644 (file)
@@ -24,6 +24,8 @@
 
 
 
+MustHaveApp(wxGenericDragImage);
+
 %name (DragImage) class wxGenericDragImage : public wxObject
 {
 public:
index 6045d4c4a2125fbbc64539f4f89c0a2395d5808f..c1d8805762a9e7504de0139664a0c4dfe464e881 100644 (file)
@@ -430,6 +430,10 @@ public:
 %newgroup
 
 
+MustHaveApp(wxFont);
+MustHaveApp(wxFont::GetDefaultEncoding);
+MustHaveApp(wxFont::SetDefaultEncoding);
+
 class wxFont : public wxGDIObject {
 public:
     %pythonPrepend wxFont   "if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']"
@@ -533,6 +537,8 @@ IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEnc
 
 %}
 
+MustHaveApp(wxPyFontEnumerator);
+
 %name(FontEnumerator) class wxPyFontEnumerator {
 public:
     %pythonAppend wxPyFontEnumerator "self._setCallbackInfo(self, FontEnumerator, 0)"
index 4e7423d5060697ccf6aaa481a74fc08b32aef9a5..b562214ae4b976957b71009245d86e4d8fb5fc34 100644 (file)
@@ -27,11 +27,15 @@ long wxNewId();
 void wxRegisterId(long id);
 long wxGetCurrentId();
 
+MustHaveApp(wxBell);
 void wxBell();
+
+MustHaveApp(wxEndBusyCursor);
 void wxEndBusyCursor();
 
 long wxGetElapsedTime(bool resetTimer = True);
 
+MustHaveApp(wxGetMousePosition);
 DocDeclA(
     void, wxGetMousePosition(int* OUTPUT, int* OUTPUT),
     "GetMousePosition() -> (x,y)");
@@ -63,6 +67,7 @@ enum wxShutdownFlags
 };
 
 // Shutdown or reboot the PC
+MustHaveApp(wxShutdown);
 bool wxShutdown(wxShutdownFlags wFlags);
 
 
@@ -88,6 +93,7 @@ void wxTrap();
 
 // Dialog Functions
 
+MustHaveApp(wxFileSelector);
 wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
                         const wxString& default_path = wxPyEmptyString,
                         const wxString& default_filename = wxPyEmptyString,
@@ -101,24 +107,28 @@ wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
 
 
 // Ask for filename to load
+MustHaveApp(wxLoadFileSelector);
 wxString wxLoadFileSelector(const wxString& what,
                             const wxString& extension,
                             const wxString& default_name = wxPyEmptyString,
                             wxWindow *parent = NULL);
 
 // Ask for filename to save
+MustHaveApp(wxSaveFileSelector);
 wxString wxSaveFileSelector(const wxString& what,
                             const wxString& extension,
                             const wxString& default_name = wxPyEmptyString,
                             wxWindow *parent = NULL);
 
 
+MustHaveApp(wxDirSelector);
 wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
                        const wxString& defaultPath = wxPyEmptyString,
                        long style = wxDD_DEFAULT_STYLE,
                        const wxPoint& pos = wxDefaultPosition,
                        wxWindow *parent = NULL);
 
+MustHaveApp(wxGetTextFromUser);
 wxString wxGetTextFromUser(const wxString& message,
                            const wxString& caption = wxPyEmptyString,
                            const wxString& default_value = wxPyEmptyString,
@@ -126,6 +136,7 @@ wxString wxGetTextFromUser(const wxString& message,
                            int x = -1, int y = -1,
                            bool centre = True);
 
+MustHaveApp(wxGetPasswordFromUser);
 wxString wxGetPasswordFromUser(const wxString& message,
                                const wxString& caption = wxPyEmptyString,
                                const wxString& default_value = wxPyEmptyString,
@@ -140,6 +151,7 @@ wxString wxGetPasswordFromUser(const wxString& message,
 //                         bool centre = True, int width=150, int height=200);
 
 
+MustHaveApp(wxGetSingleChoice);
 wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
                            int choices, wxString* choices_array,
                            wxWindow *parent = NULL,
@@ -147,6 +159,7 @@ wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
                            bool centre = True,
                            int width=150, int height=200);
 
+MustHaveApp(wxGetSingleChoiceIndex);
 int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
                            int choices, wxString* choices_array,
                            wxWindow *parent = NULL,
@@ -155,12 +168,14 @@ int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
                            int width=150, int height=200);
 
 
+MustHaveApp(wxMessageBox);
 int wxMessageBox(const wxString& message,
                  const wxString& caption = wxPyEmptyString,
                  int style = wxOK | wxCENTRE,
                  wxWindow *parent = NULL,
                  int x = -1, int y = -1);
 
+MustHaveApp(wxGetNumberFromUser);
 long wxGetNumberFromUser(const wxString& message,
                          const wxString& prompt,
                          const wxString& caption,
@@ -171,38 +186,60 @@ long wxGetNumberFromUser(const wxString& message,
 
 // GDI Functions
 
+MustHaveApp(wxColourDisplay);
 bool wxColourDisplay();
 
+MustHaveApp(wxDisplayDepth);
 int wxDisplayDepth();
+
+MustHaveApp(wxGetDisplayDepth);
 int wxGetDisplayDepth();
 
+MustHaveApp(wxDisplaySize);
 DocDeclA(
     void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
     "DisplaySize() -> (width, height)");
+
+MustHaveApp(wxGetDisplaySize);
 wxSize wxGetDisplaySize();
 
+MustHaveApp(wxDisplaySizeMM);
 DocDeclA(
     void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
     "DisplaySizeMM() -> (width, height)");
+
+MustHaveApp(wxGetDisplaySizeMM);
 wxSize wxGetDisplaySizeMM();
 
+MustHaveApp(wxClientDisplayRect);
 DocDeclA(
     void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
     "ClientDisplayRect() -> (x, y, width, height)");
+
+MustHaveApp(wxGetClientDisplayRect);
 wxRect wxGetClientDisplayRect();
 
+
+MustHaveApp(wxSetCursor);
 void wxSetCursor(wxCursor& cursor);
 
 
 
 // Miscellaneous functions
 
+MustHaveApp(wxBeginBusyCursor);
 void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
+
+MustHaveApp(wxGetActiveWindow);
 wxWindow * wxGetActiveWindow();
 
+MustHaveApp(wxGenericFindWindowAtPoint);
 wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
+
+MustHaveApp(wxFindWindowAtPoint);
 wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
 
+MustHaveApp(wxGetTopLevelParent);
 wxWindow* wxGetTopLevelParent(wxWindow *win);
 
 //bool wxSpawnBrowser(wxWindow *parent, wxString href);
@@ -210,6 +247,7 @@ wxWindow* wxGetTopLevelParent(wxWindow *win);
 
 
 
+MustHaveApp(wxGetKeyState);
 DocDeclStr(
     bool , wxGetKeyState(wxKeyCode key),
     "Get the state of a key (true if pressed or toggled on, false if not.)
@@ -221,6 +259,8 @@ toggle keys.  On some platforms those may be the only keys that work.
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxWakeUpMainThread);
+
 #if defined(__WXMSW__) || defined(__WXMAC__)
 void wxWakeUpMainThread();
 #else
@@ -229,10 +269,15 @@ void wxWakeUpMainThread();
 %}
 #endif
 
+
+MustHaveApp(wxMutexGuiEnter);
 void wxMutexGuiEnter();
+
+MustHaveApp(wxMutexGuiLeave);
 void wxMutexGuiLeave();
 
 
+MustHaveApp(wxMutexGuiLocker);
 class wxMutexGuiLocker  {
 public:
     wxMutexGuiLocker();
@@ -240,6 +285,7 @@ public:
 };
 
 
+MustHaveApp(wxThread);
 %inline %{
     bool wxThread_IsMain() {
 #ifdef WXP_WITH_THREAD
index 6197cde3d4a3be3aa2f2d19bab942a420ab40ef1..0aad4c78f52e9147a8b004cb74fef2ff2d5e6b8a 100644 (file)
@@ -29,6 +29,8 @@ enum {
 //---------------------------------------------------------------------------
 
 
+MustHaveApp(wxGauge);
+
 class wxGauge : public wxControl {
 public:
     %pythonAppend wxGauge         "self._setOORInfo(self)"
index 860d306be4f420bd90c043ce48a8aabe8b9a53b0..399b5749f108f18b3d732f13d7f324f572e1ec9b 100644 (file)
@@ -576,6 +576,8 @@ bottom, otherwise it is moved to the left or top respectively.", "",
 };
 
 
+MustHaveApp(wxIntersectRect);
+
 DocAStr(wxIntersectRect,
        "IntersectRect(Rect r1, Rect r2) -> Rect",
        "Calculate and return the intersection of r1 and r2.", "");
index 5eee9400d160bea3578122d046dcc2641c12316a..a334c9f2f18381c52328ffae7a2445aa6ce194b4 100644 (file)
@@ -15,6 +15,8 @@
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxGDIObject);
+
 class wxGDIObject : public wxObject {
 public:
     wxGDIObject();
index 6a69d79f411992d19c96a542a1149b8b9e7d11b2..f43e09910bfe4636800405b50c94ef606ecdde25 100644 (file)
@@ -20,6 +20,8 @@
 //---------------------------------------------------------------------------
 
 
+MustHaveApp(wxIcon);
+
 class wxIcon : public wxGDIObject
 {
 public:
index 700cfdc9386762ea5e9ee0f975decf7856764383..d248f1a0fa470758cde82b47f52f22ad5c6d5aa7 100644 (file)
@@ -90,7 +90,8 @@ public:
             else
                 return new wxImage;
         }   
-           
+
+        MustHaveApp(wxImage(const wxBitmap &bitmap));
         %name(ImageFromBitmap) wxImage(const wxBitmap &bitmap) {
             return new wxImage(bitmap.ConvertToImage());
         }
@@ -312,6 +313,9 @@ success flag and rgb values.", "");
     static wxString GetImageExtWildcard();
 
 
+MustHaveApp(ConvertToBitmap);
+MustHaveApp(ConvertToMonoBitmap);
+    
     %extend {
         wxBitmap ConvertToBitmap() {
             wxBitmap bitmap(*self);
index 87962cdbab25bbb5116a865027525072785a95ab..98625e782f3496a9997f76fce09f4bb8b79d60ca 100644 (file)
@@ -33,6 +33,8 @@ enum {
 };
 
 
+MustHaveApp(wxImageList);
+
 
 //  wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
 //  images for their items by an index into an image list.
index 24b523e1458c74b5d0719e12952529afd3fafdcc..add72d6b92fab60b5f23d0b2542807646dffd95f 100644 (file)
@@ -103,6 +103,8 @@ public:
 %}
 
 
+MustHaveApp(wxJoystick);
+
 class wxJoystick /* : public wxObject */
 {
 public:
index d2144006ce1aa3dbbc45d0b5bb7b38e45cd2cfcb..f17f096ac1eaafbc2857f3814b89691dc1b7d53d 100644 (file)
@@ -26,6 +26,8 @@ MAKE_CONST_WXSTRING(ListBoxNameStr);
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxListBox);
+
 class wxListBox : public wxControlWithItems
 {
 public:
@@ -137,6 +139,8 @@ public:
 %newgroup
 
 
+MustHaveApp(wxCheckListBox);
+
 // wxCheckListBox: a listbox whose items may be checked
 class wxCheckListBox : public wxListBox
 {
index f0b4ac39c5fa3e478ed72518190f88edf80d9ea3..c969897f71754df361c7e8ec13b2355e5540dc4a 100644 (file)
@@ -17,8 +17,8 @@
 
 %{
 #include <wx/listctrl.h>
-
 %}
+
 MAKE_CONST_WXSTRING2(ListCtrlNameStr, _T("wxListCtrl"));
 
 //---------------------------------------------------------------------------
@@ -398,6 +398,8 @@ IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr);
 
 
 
+MustHaveApp(wxPyListCtrl);
+
 %name(ListCtrl)class wxPyListCtrl : public wxControl {
 public:
 
@@ -778,6 +780,8 @@ details in the second return value (see wxLIST_HITTEST_... flags.)", "");
 %newgroup
 
 
+MustHaveApp(wxListView);
+
 // wxListView: a class which provides a little better API for list control
 class wxListView : public wxPyListCtrl
 {
index daf66d111ac943669290e5eea7e7ba6b1cd6f861..355c6cf1f86abe0bbbe44ffdcef7c91b8a764537 100644 (file)
@@ -33,6 +33,8 @@
 
 
 
+MustHaveApp(wxMDIParentFrame);
+
 class wxMDIParentFrame : public wxFrame {
 public:
     %pythonAppend wxMDIParentFrame         "self._setOORInfo(self)"
@@ -78,6 +80,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxMDIChildFrame);
+
 class wxMDIChildFrame : public wxFrame {
 public:
     %pythonAppend wxMDIChildFrame         "self._setOORInfo(self)"
@@ -109,6 +113,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxMDIClientWindow);
+
 class wxMDIClientWindow : public wxWindow {
 public:
     %pythonAppend wxMDIClientWindow         "self._setOORInfo(self)"
index af7a940d08e4984d50a69f2178f4ec445f51a973..59fb4736457184d2c9e5535c082504139f3e5b9e 100644 (file)
@@ -17,6 +17,8 @@
 %newgroup
 
 
+MustHaveApp(wxMenu);
+
 class wxMenu : public wxEvtHandler
 {
 public:
@@ -203,6 +205,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxMenuBar);
+
 class wxMenuBar : public wxWindow
 {
 public:
index a1f6e305f1ca12599e302298407241c876d3e0e9..5ae57e1f9c51abe63c75b6283a58e58b64bc9d82 100644 (file)
@@ -19,6 +19,9 @@
 
 
 #ifndef __WXX11__
+
+MustHaveApp(wxToolTip);
+
 class wxToolTip : public wxObject {
 public:
     wxToolTip(const wxString &tip);
@@ -35,6 +38,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxCaret);
+
 class wxCaret {
 public:
     wxCaret(wxWindow* window, const wxSize& size);
@@ -79,6 +84,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxBusyCursor);
+
 class  wxBusyCursor {
 public:
     wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
@@ -87,6 +94,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxWindowDisabler);
+
 class wxWindowDisabler {
 public:
     wxWindowDisabler(wxWindow *winToSkip = NULL);
@@ -95,6 +104,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxBusyInfo);
+
 class wxBusyInfo : public wxObject {
 public:
     wxBusyInfo(const wxString& message);
index 81c854cc62fbbfd238d77edeb36dd5aec230f919..853ffe03b39148d9212c33e8d7a70eb27ae5afcd 100644 (file)
@@ -22,6 +22,8 @@ MAKE_CONST_WXSTRING(NOTEBOOK_NAME);
 
 // TODO:  Virtualize this class so other book controls can be derived in Python
 
+MustHaveApp(wxBookCtrl);
+
 //  Common base class for wxList/Tree/Notebook
 class wxBookCtrl : public wxControl
 {
@@ -160,6 +162,8 @@ enum {
 
 
 
+MustHaveApp(wxNotebook);
+
 class wxNotebook : public wxBookCtrl {
 public:
     %pythonAppend wxNotebook         "self._setOORInfo(self)"
@@ -286,6 +290,8 @@ enum
 
 
 
+MustHaveApp(wxListbook);
+
 //  wxListCtrl and wxNotebook combination
 class wxListbook : public wxBookCtrl
 {
index e2fdbe4b69770454c99cc95cacb89c34c731b906..c83602f393faff77f76b193cd4234f3725be7212 100644 (file)
@@ -19,6 +19,8 @@
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxPalette);
+
 class wxPalette : public wxGDIObject {
 public:
     wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
index bee9ca00fd91eb1c2e04588804f2ef45dc6b43e1..180bd8c8ed950f32fe2b0fb4c6ae0b63b5b9f76d 100644 (file)
@@ -22,6 +22,8 @@
 %newgroup
 
 
+MustHaveApp(wxPanel);
+
 class wxPanel : public wxWindow
 {
 public:
@@ -57,6 +59,8 @@ public:
 //       derive from it and wxPanel.  But what to do about wxGTK where this
 //       is not True?
 
+MustHaveApp(wxScrolledWindow);
+
 class wxScrolledWindow : public wxPanel
 {
 public:
index cf9d76b28c111c647fb7cf96398c08929d233abf..5f9f7a278e25b4cc4478505b43a8563187889f48 100644 (file)
@@ -29,6 +29,8 @@
 %newgroup
 
 
+MustHaveApp(wxPen);
+
 class wxPen : public wxGDIObject {
 public:
     wxPen(wxColour& colour, int width=1, int style=wxSOLID);
index 38ae99eda9404da38f6de6a86f51033f52d29a96..706fbccab0b9f3b44b14dc42938bbd4c25bd995f 100644 (file)
 #ifndef __WXMAC__
 %newgroup;
 
+MustHaveApp(wxPopupWindow);
 
 // wxPopupWindow: a special kind of top level window used for popup menus,
 // combobox popups and such.
+MustHaveApp(wxPopupWindow);
+
 class wxPopupWindow : public wxWindow {
 public:
     %pythonAppend wxPopupWindow         "self._setOORInfo(self)"
@@ -73,9 +76,11 @@ IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismis
 %}
 
 
+MustHaveApp(wxPyPopupTransientWindow);
 
 // wxPopupTransientWindow: a wxPopupWindow which disappears automatically
 // when the user clicks mouse outside it or if it loses focus in any other way
+
 %name(PopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow
 {
 public:
index e81578d220f794d98dce0f689d65e55418df2416..78bb05e19d52e1e3e51e78e8637d7bec5aef3bc6 100644 (file)
@@ -149,6 +149,8 @@ public:
 
 
 
+MustHaveApp(wxPageSetupDialog);
+
 class wxPageSetupDialog : public wxDialog {
 public:
     %pythonAppend wxPageSetupDialog         "self._setOORInfo(self)"
@@ -217,6 +219,8 @@ public:
 };
 
 
+MustHaveApp(wxPrintDialog);
+
 class wxPrintDialog : public wxDialog {
 public:
     %pythonAppend wxPrintDialog         "self._setOORInfo(self)"
@@ -243,6 +247,8 @@ enum wxPrinterError
 };
 
 
+MustHaveApp(wxPrinter);
+
 class wxPrinter : public wxObject {
 public:
     wxPrinter(wxPrintDialogData* data = NULL);
@@ -323,6 +329,8 @@ IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage);
 %}
 
 
+MustHaveApp(wxPyPrintout);
+
 // Now define the custom class for SWIGging
 %name(Printout) class wxPyPrintout  : public wxObject {
 public:
@@ -377,6 +385,8 @@ public:
 
 
 
+MustHaveApp(wxPreviewCanvas);
+
 class wxPreviewCanvas: public wxScrolledWindow
 {
 public:
@@ -391,6 +401,8 @@ public:
 };
 
 
+MustHaveApp(wxPreviewFrame);
+
 class wxPreviewFrame : public wxFrame {
 public:
     %pythonAppend wxPreviewFrame   "self._setOORInfo(self)"
@@ -430,6 +442,8 @@ enum {
     wxID_PREVIEW_GOTO
 };
 
+MustHaveApp(wxPreviewControlBar);
+
 class wxPreviewControlBar: public wxPanel
 {
 public:
@@ -458,6 +472,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxPrintPreview);
+
 class wxPrintPreview : public wxObject {
 public:
     %nokwargs wxPrintPreview;
@@ -592,6 +608,8 @@ IMP_PYCALLBACK_VOID_        (wxPyPrintPreview, wxPrintPreview, DetermineScaling)
 %}
 
 
+MustHaveApp(wxPyPrintPreview);
+
 class wxPyPrintPreview : public wxPrintPreview
 {
 public:
@@ -650,6 +668,8 @@ IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, CreateControlBar);
 %}
 
 
+MustHaveApp(wxPyPreviewFrame);
+
 class wxPyPreviewFrame : public wxPreviewFrame
 {
 public:
@@ -704,6 +724,8 @@ IMP_PYCALLBACK_VOID_INT(wxPyPreviewControlBar, wxPreviewControlBar, SetZoomContr
 %}
 
 
+MustHaveApp(wxPyPreviewControlBar);
+
 class wxPyPreviewControlBar : public wxPreviewControlBar
 {
 public:
index 642a03134e62a4d25102153bd5da4016e15d173f..dffe60ec6f83358960af657883850776128d0596 100644 (file)
@@ -159,6 +159,8 @@ enum
 };
 
 
+MustHaveApp(wxExecute);
+
 long wxExecute(const wxString& command,
                int flags = wxEXEC_ASYNC,
                wxPyProcess *process = NULL);
index 205dab0e90b64368586e7f843ce206ee9132e457..eb2a01b87fb38a0e84c1595e4f010d6c5d236f6a 100644 (file)
@@ -99,6 +99,7 @@ IMP_PYCALLBACK_VIZATTR_(wxPyControl, wxControl, GetDefaultAttributes);
 %}
 
 // And now the one for SWIG to see
+MustHaveApp(wxPyControl);
 class wxPyControl : public wxControl
 {
 public:
index 6a9ad8862f5b3424f6d0f125e16e067bf4020f24..4cc0976bd3606ad22739f1c71582d2333d6f55b6 100644 (file)
@@ -129,6 +129,7 @@ IMP_PYCALLBACK_VIZATTR_(wxPyWindow, wxWindow, GetDefaultAttributes);
 %}
 
 // And now the one for SWIG to see
+MustHaveApp(wxPyWindow);
 class wxPyWindow : public wxWindow
 {
 public:
@@ -273,6 +274,7 @@ IMP_PYCALLBACK_VIZATTR_(wxPyPanel, wxPanel, GetDefaultAttributes);
  %}
 
 // And now the one for SWIG to see
+MustHaveApp(wxPyPanel);
 class wxPyPanel : public wxPanel
 {
 public:
@@ -409,6 +411,7 @@ IMP_PYCALLBACK_VIZATTR_(wxPyScrolledWindow, wxScrolledWindow, GetDefaultAttribut
 %}
 
 // And now the one for SWIG to see
+MustHaveApp(wxPyScrolledWindow);
 class wxPyScrolledWindow : public wxScrolledWindow
 {
 public:
index c70ce8c11cd829ac961e4e2932795c17162c5419..9a2551def1c88e04af1b403022317219ba06b8fc 100644 (file)
@@ -21,6 +21,8 @@ MAKE_CONST_WXSTRING(RadioButtonNameStr);
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxRadioBox);
+
 class wxRadioBox : public wxControl
 {
 public:
@@ -94,6 +96,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxRadioButton);
+
 class wxRadioButton : public wxControl
 {
 public:
index 55a9cc4834a38dde4b67b6b92c5c089cdd14f53f..29f18cb67754105f8adb3b0238220214a70e5474 100644 (file)
@@ -41,6 +41,8 @@ enum wxRegionContain
 
 
 
+MustHaveApp(wxRegion);
+
 class wxRegion : public wxGDIObject {
 public:
     wxRegion(wxCoord x=0, wxCoord y=0, wxCoord width=0, wxCoord height=0);
@@ -108,6 +110,8 @@ public:
 
 
 
+MustHaveApp(wxRegionIterator);
+
 class wxRegionIterator : public wxObject {
 public:
     wxRegionIterator(const wxRegion& region);
index eb2d828ac9b13805b00183e0b9ff94685cf7d054..df6c53ebbfe6ed05be8c3d5a3724195b7d191d17 100644 (file)
@@ -48,6 +48,8 @@ enum wxSashEdgePosition {
 // wxSashWindow allows any of its edges to have a sash which can be dragged
 // to resize the window. The actual content window will be created as a child
 // of wxSashWindow.
+MustHaveApp(wxSashWindow);
+
 class wxSashWindow: public wxWindow
 {
 public:
@@ -234,6 +236,8 @@ public:
 // This is window that can remember alignment/orientation, does its own layout,
 // and can provide sashes too. Useful for implementing docked windows with sashes in
 // an IDE-style interface.
+MustHaveApp(wxSashLayoutWindow);
+
 class wxSashLayoutWindow: public wxSashWindow
 {
 public:
index 2cdd1836399b29a9b6bb3aeec01fbf220bf7502c..a4c01b1c924e53c6bf3d3017c6314f7ee92c9ae8 100644 (file)
@@ -20,6 +20,8 @@ MAKE_CONST_WXSTRING(ScrollBarNameStr);
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxScrollBar);
+
 class wxScrollBar : public wxControl {
 public:
     %pythonAppend wxScrollBar         "self._setOORInfo(self)"
index 0525c88310d648dadc592a644721b46fabbeaec6..38720a9537716c808b1fa8eb0db52da689a5fb48 100644 (file)
@@ -148,6 +148,12 @@ enum wxSystemScreenType
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxSystemSettings::GetColour);
+MustHaveApp(wxSystemSettings::GetFont);
+MustHaveApp(wxSystemSettings::GetMetric);
+MustHaveApp(wxSystemSettings::HasFeature);
+MustHaveApp(wxSystemSettings::GetScreenType);
+MustHaveApp(wxSystemSettings::SetScreenType);
 
 class wxSystemSettings
 {
index 7ecf040a2e5b61eee95d4202dd38f85c156d0134..17d51db2e68aace230d4b320df5083eea6fe0992 100644 (file)
@@ -25,6 +25,8 @@ MAKE_CONST_WXSTRING(SliderNameStr);
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxSlider);
+
 class wxSlider : public wxControl {
 public:
     %pythonPrepend wxSlider         "if kwargs.has_key('point'): kwargs['pos'] = kwargs['point'];del kwargs['point']"
index 2339bb2cecdbc7c99e404a811635ae14405610d0..ad1e0ea9a87796c2dcbfb1a35cf9fac57e6bef8c 100644 (file)
@@ -71,6 +71,10 @@ public:
 
 
 
+MustHaveApp(wxSound);
+MustHaveApp(wxSound::Play);
+MustHaveApp(wxSound::Stop);
+
 class wxSound /*: public wxObject*/
 {
 public:
index 29b9ca22abf776e84f21ca98a4db3b98cefdcd50..7f9f33a1dacce682cff629dd9a239457c69024c7 100644 (file)
@@ -38,6 +38,7 @@ enum {
 //  wxSP_VERTICAL:     vertical spin button (the default)
 //  wxSP_ARROW_KEYS:   arrow keys increment/decrement value
 //  wxSP_WRAP:         value wraps at either end
+MustHaveApp(wxSpinButton);
 class wxSpinButton : public wxControl
 {
 public:
@@ -80,6 +81,8 @@ public:
 // a spin ctrl is a text control with a spin button which is usually used to
 // prompt the user for a numeric input
 
+MustHaveApp(wxSpinCtrl);
+
 class wxSpinCtrl : public wxControl
 {
 public:
index 962e8e0ad9294caf00bcd1f37dc2c8693653e5e4..af4516454a7fbc428851cb382fcc309b22a7daaf 100644 (file)
@@ -104,6 +104,8 @@ Events
 
 
 
+MustHaveApp(wxSplitterWindow);
+
 class wxSplitterWindow: public wxWindow
 {
 public:
index c407a4d799e1feaf3a47fed0902439863b1d5a36..f2f726e60b24d3cf9770db752df40e6d74bcb15d 100644 (file)
@@ -23,6 +23,8 @@ MAKE_CONST_WXSTRING(StaticTextNameStr);
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxStaticBox);
+
 class wxStaticBox : public wxControl {
 public:
     %pythonAppend wxStaticBox         "self._setOORInfo(self)"
@@ -50,6 +52,8 @@ public:
 %newgroup
 
 
+MustHaveApp(wxStaticLine);
+
 class wxStaticLine : public wxControl {
 public:
     %pythonAppend wxStaticLine         "self._setOORInfo(self)"
@@ -82,6 +86,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxStaticText);
+
 class wxStaticText : public wxControl {
 public:
     %pythonAppend wxStaticText         "self._setOORInfo(self)"
@@ -107,6 +113,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxStaticBitmap);
+
 class wxStaticBitmap : public wxControl {
 public:
     %pythonAppend wxStaticBitmap         "self._setOORInfo(self)"
index e3a0d66c3bbb5948e555d2955ea45e64df514820..4eb81820a0555abff0ab5657a604a7b536ace016 100644 (file)
@@ -24,6 +24,7 @@
 
 
 // wxStatusBar: a window near the bottom of the frame used for status info
+MustHaveApp(wxStatusBar);
 class wxStatusBar : public wxWindow
 {
 public:
index 12aa01349259a6e338a7b80ec3a77ca65c307db9..885b0775f0fbe102719d6331c2727eee630462ed 100644 (file)
@@ -99,6 +99,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxColourDatabase);
+
 class wxColourDatabase : public wxObject {
 public:
     wxColourDatabase();
index 5d4c54bf88e13b628e2c08099ca3373b24d7922d..3fbbbc660c69c83c7e95d63cf7ed7cecc8f0c66b 100644 (file)
@@ -56,6 +56,8 @@ enum {
 
 
 
+MustHaveApp(wxTaskBarIcon);
+
 class wxTaskBarIcon : public wxEvtHandler
 {
 public:
index 4f8e3b616f8ac6bfeb6eb03c50392d0e5915c893..7924ad77caf5e543ce14f75ff8c7114039328108 100644 (file)
@@ -161,6 +161,7 @@ public:
 
 // wxTextCtrl: a single or multiple line text zone where user can enter and
 // edit text
+MustHaveApp(wxTextCtrl);
 class wxTextCtrl : public wxControl
 {
 public:
index 9fde315a8e44cc5b4bde1f8025092ba96e467a3b..d3947cc5e373cb652e3baf191a48a7610fe78a8a 100644 (file)
@@ -50,6 +50,8 @@ public:
 }
 
 
+MustHaveApp(wxToggleButton);
+
 class wxToggleButton : public wxControl
 {
 public:
index 1042c7f52fda0dda6a9fe58477584233a1509229..e09e7509d037d6db899a2e2a5554c4394ce88084 100644 (file)
@@ -53,6 +53,8 @@ void wxPyTimer::base_Notify() {
 
 
 
+MustHaveApp(wxPyTimer);
+
 %name(Timer) class wxPyTimer : public wxEvtHandler
 {
 public:
@@ -130,6 +132,7 @@ public:
 
 
 // wxTimerRunner: starts the timer in its ctor, stops in the dtor
+MustHaveApp(wxTimerRunner);
 class wxTimerRunner
 {
 public:
index ef7d617e021dbf810cde087c7c3fac02e6c1fe1d..cd839ccca8b0b863525c6bd1a9e0e54ead29d1b9 100644 (file)
@@ -81,11 +81,13 @@ public:
 // not, the dialog on startup depending on its value, not this class).
 //
 // The function returns True if this checkbox is checked, False otherwise.
+MustHaveApp(wxShowTip);
 bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup = True);
 
 // a function which returns an implementation of wxTipProvider using the
 // specified text file as the source of tips (each line is a tip).
 %newobject wxCreateFileTipProvider;
+MustHaveApp(wxCreateFileTipProvider);
 wxTipProvider* wxCreateFileTipProvider(const wxString& filename, size_t currentTip);
 
 
index 1cb3e5cc5e23184c0078a269d6bffb8983c30d86..15e52ead463aa4a1140542f1aca53f388f5a2580 100644 (file)
@@ -23,6 +23,8 @@
 %newgroup;
 
 
+MustHaveApp(wxTipWindow);
+
 class wxTipWindow :
 #ifndef __WXMAC__
     public wxPyPopupTransientWindow
index 16db24619b6f2f0aa9f4bd94f27ac1a73904cc13..0c9ad075ce2391cbed2bb4fac2ea3113dc150d14 100644 (file)
@@ -384,6 +384,8 @@ public:
 
 
 
+MustHaveApp(wxToolBar);
+
 class wxToolBar : public wxToolBarBase {
 public:
     %pythonAppend wxToolBar         "self._setOORInfo(self)"
index 5dc4b3068488ffefacc62bef8a9a1cf3571cd18e..597b5c8399a17262b91d6438cbb2fc0ec1549026 100644 (file)
@@ -145,6 +145,8 @@ public:
 // is accounted for in client size calculations - all others should be taken
 // care of manually.
 
+MustHaveApp(wxFrame);
+
 class wxFrame : public wxTopLevelWindow {
 public:
     %pythonAppend wxFrame         "self._setOORInfo(self)"
@@ -255,6 +257,8 @@ public:
 //---------------------------------------------------------------------------
 %newgroup
 
+MustHaveApp(wxDialog);
+
 class wxDialog : public wxTopLevelWindow {
 public:
     %pythonAppend wxDialog   "self._setOORInfo(self)"
@@ -311,6 +315,8 @@ public:
 %newgroup
 
 
+MustHaveApp(wxMiniFrame);
+
 class wxMiniFrame : public wxFrame {
 public:
     %pythonAppend wxMiniFrame         "self._setOORInfo(self)"
@@ -345,6 +351,8 @@ enum {
 };
 
 
+MustHaveApp(wxSplashScreenWindow);
+
 class wxSplashScreenWindow: public wxWindow
 {
 public:
@@ -361,6 +369,8 @@ public:
 };
 
 
+MustHaveApp(wxSplashScreen);
+
 class wxSplashScreen : public wxFrame {
 public:
     %pythonAppend wxSplashScreen         "self._setOORInfo(self)"
index a59c3fc2ced705de99823cffafe23f4ddea1f202..c10298c9b5b1f63fa55f8f7f571262292894ab5c 100644 (file)
@@ -309,6 +309,8 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl);
 
 
  
+MustHaveApp(wxPyTreeCtrl);
+
 %name(TreeCtrl)class wxPyTreeCtrl : public wxControl {
 public:
     %pythonAppend wxPyTreeCtrl         "self._setOORInfo(self);self._setCallbackInfo(self, TreeCtrl)"
index fdbf1cf3c777dcd70054ac47a8e579761a019042..9cc2071a9bd73432b8cf816445a5c893fc2db648 100644 (file)
@@ -125,6 +125,8 @@ IMP_PYCALLBACK_COORD_const          (wxPyVScrolledWindow, wxVScrolledWindow, Est
    of the window and not its entire client area.
  */
 
+MustHaveApp(wxPyVScrolledWindow);
+
 %name(VScrolledWindow) class wxPyVScrolledWindow : public wxPanel
 {
 public:
@@ -282,6 +284,8 @@ IMP_PYCALLBACK__DCRECTSIZET_const    (wxPyVListBox, wxVListBox, OnDrawBackground
     It emits the same events as wxListBox and the same event macros may be used
     with it.
  */
+MustHaveApp(wxPyVListBox);
+
 %name(VListBox) class wxPyVListBox : public wxPyVScrolledWindow
 {
 public:
@@ -478,6 +482,7 @@ IMP_PYCALLBACK_STRING_SIZET     (wxPyHtmlListBox, wxHtmlListBox, OnGetItemMarkup
 
 
 // wxHtmlListBox is a listbox whose items are wxHtmlCells
+MustHaveApp(wxPyHtmlListBox);
 %name(HtmlListBox) class wxPyHtmlListBox : public wxPyVListBox
 {
 public:
index 83bccaaf2c359ad99b9d21bd668f850f028c8fcb..63a951f25a41ebb0f9f4345d288ebab6446d3440 100644 (file)
@@ -187,6 +187,10 @@ Extra Styles
 ");
 
 
+MustHaveApp(wxWindow);
+MustHaveApp(wxWindow::FindFocus);
+MustHaveApp(wxWindow::GetCapture);
+MustHaveApp(wxWindow::GetClassDefaultAttributes);
 
 class wxWindow : public wxEvtHandler
 {
@@ -1850,6 +1854,10 @@ non-None, the search will be limited to the given window
 hierarchy. The search is recursive in both cases.", "");
 
 
+MustHaveApp(wxFindWindowById);
+MustHaveApp(wxFindWindowByName);
+MustHaveApp(wxFindWindowByLabel);
+
 %inline %{
 wxWindow* wxFindWindowById( long id, const wxWindow *parent = NULL ) {
     return wxWindow::FindWindowById(id, parent);
index f3154a5a75a2c7492d1bbb31fd34035b90721b29..225444160c028f1dcdac65eea3b2c7717ab28277 100644 (file)
@@ -211,6 +211,8 @@ event.
 ");       
 
        
+MustHaveApp(wxCalendarCtrl);
+
 class wxCalendarCtrl : public wxControl
 {
 public:
index bf6b371d04b5434016004bda1034f965855e687e..ab5fd1a864bde417f06c75667c4e6f01e2c05cfa 100644 (file)
@@ -1546,6 +1546,8 @@ typedef wxGrid::wxGridSelectionModes WXGRIDSELECTIONMODES;
 
 
 
+MustHaveApp(wxGrid);
+
 class wxGrid : public wxScrolledWindow
 {
 public:
index c01fa664a407fae9102de5b82c41fd6c4d36b909..edb5a9179120fb161ad01dbdbba9c04fbf445327 100644 (file)
@@ -79,6 +79,7 @@ wxMutex*              wxPyTMutex = NULL;
 
 static PyObject* wxPython_dict = NULL;
 static PyObject* wxPyAssertionError = NULL;
+static PyObject* wxPyNoAppError = NULL;
 
 PyObject* wxPyPtrTypeMap = NULL;
 
@@ -567,7 +568,8 @@ PyObject* __wxPySetDictionary(PyObject* /* self */, PyObject* args)
         return NULL;
 
     if (!PyDict_Check(wxPython_dict)) {
-        PyErr_SetString(PyExc_TypeError, "_wxPySetDictionary must have dictionary object!");
+        PyErr_SetString(PyExc_TypeError,
+                        "_wxPySetDictionary must have dictionary object!");
         return NULL;
     }
 
@@ -580,6 +582,12 @@ PyObject* __wxPySetDictionary(PyObject* /* self */, PyObject* args)
                                             PyExc_AssertionError, NULL);
     PyDict_SetItemString(wxPython_dict, "PyAssertionError", wxPyAssertionError);
 
+    // Create an exception object to use when the app object hasn't been created yet
+    wxPyNoAppError = PyErr_NewException("wx._core.PyNoAppError",
+                                        PyExc_RuntimeError, NULL);
+    PyDict_SetItemString(wxPython_dict, "PyNoAppError", wxPyNoAppError);
+    
+
 
 #ifdef __WXMOTIF__
 #define wxPlatform "__WXMOTIF__"
@@ -636,7 +644,12 @@ PyObject* __wxPySetDictionary(PyObject* /* self */, PyObject* args)
     _AddInfoString("gtk1");
 #endif
 #endif
-
+#ifdef __WXDEBUG__
+    _AddInfoString("wx-assertions-on");
+#else
+    _AddInfoString("wx-assertions-off");
+#endif
+    
 #undef _AddInfoString
 
     PyObject* PlatInfoTuple = PyList_AsTuple(PlatInfo);
@@ -823,6 +836,22 @@ void wxPy_ReinitStockObjects(int pass)
 
 //---------------------------------------------------------------------------
 
+// Check for existence of a wxApp, setting an exception if there isn't one.
+// This doesn't need to aquire the GIL because it should only be called from
+// an %exception before the lock is released.
+
+bool wxPyCheckForApp() {
+    if (wxTheApp != NULL)
+        return true;
+    else {
+        PyErr_SetString(wxPyNoAppError, "The wx.App object must be created first!");
+        return false;
+    }
+}
+
+//---------------------------------------------------------------------------
+
+
 void wxPyClientData_dtor(wxPyClientData* self) {
     if (! wxPyDoingCleanup) {           // Don't do it during cleanup as Python
                                         // may have already garbage collected the object...
index 412fcb3b507600b610138e877f20b9e6cd916c30..ca4889fded4cc4349dcbfd6bbdc424ace9b101a1 100644 (file)
@@ -785,6 +785,8 @@ wxHtmlOpeningStatus wxPyHtmlWindow::OnOpeningURL(wxHtmlURLType type,
 
 
 
+MustHaveApp(wxPyHtmlWindow);
+
 %name(HtmlWindow) class wxPyHtmlWindow : public wxScrolledWindow {
 public:
     %pythonAppend wxPyHtmlWindow      "self._setCallbackInfo(self, HtmlWindow); self._setOORInfo(self)"
@@ -919,6 +921,8 @@ public:
 %newgroup
 
 
+MustHaveApp(wxHtmlDCRenderer);
+
 class wxHtmlDCRenderer : public wxObject {
 public:
     wxHtmlDCRenderer();
@@ -956,6 +960,8 @@ enum {
 };
 
 
+MustHaveApp(wxHtmlPrintout);
+
 class wxHtmlPrintout : public wxPyPrintout {
 public:
     wxHtmlPrintout(const wxString& title = wxPyHtmlPrintoutTitleStr);
@@ -991,6 +997,8 @@ public:
 
 
 
+MustHaveApp(wxHtmlEasyPrinting);
+
 class wxHtmlEasyPrinting : public wxObject {
 public:
     wxHtmlEasyPrinting(const wxString& name = wxPyHtmlPrintingTitleStr,
@@ -1104,6 +1112,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxHtmlHelpFrame);
+
 class wxHtmlHelpFrame : public wxFrame {
 public:
     %pythonAppend wxHtmlHelpFrame    "self._setOORInfo(self)"
@@ -1141,6 +1151,8 @@ enum {
 };
 
 
+MustHaveApp(wxHtmlHelpController);
+
 class wxHtmlHelpController : public wxEvtHandler {
 public:
     %pythonAppend wxHtmlHelpController "self._setOORInfo(self)"
index 2919e201e0ec8f5ce50aa41a1279ed2c0833763e..61579d8d0fa185cf1f761667b64eaec146546295 100644 (file)
@@ -17,8 +17,7 @@
 %{
 #include "wx/wxPython/wxPython.h"
 #include "wx/wxPython/pyclasses.h"
-#include "wx/wxPython/pyistream.h"
-    
+#include "wx/wxPython/pyistream.h"    
 %}
 
 //---------------------------------------------------------------------------
index d9b078bc4e3baa7c5f3e4fceb65de637d59be9d9..f1bfc3cd7d5f12debab316ece71830acee2fd957 100644 (file)
 /////////////////////////////////////////////////////////////////////////////
 
 
-//---------------------------------------------------------------------------
-// Tell SWIG to wrap all the wrappers with our thread protection
-
-%exception {
-    PyThreadState* __tstate = wxPyBeginAllowThreads();
-    $action
-    wxPyEndAllowThreads(__tstate);
-    if (PyErr_Occurred()) SWIG_fail;
-}
-
-
 //----------------------------------------------------------------------
 // Typemaps to convert a list of items to an int (size) and an array
 
index 03862c5cc9d04cde2ed8856f22653ebbedc08194..48a8e9d31c49b6d78b06e9704e8120bc8174d964 100644 (file)
@@ -84,6 +84,7 @@ public:
 //
 // Other than GetNext/Prev() functions, wxWizardPage is just a panel and may be
 // used as such (i.e. controls may be placed directly on it &c).
+MustHaveApp(wxWizardPage);
 class wxWizardPage : public wxPanel
 {
 public:
@@ -198,6 +199,8 @@ IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWizardPage, wxWizardPage, RemoveChild);
 
 
 
+MustHaveApp(wxPyWizardPage);
+
 class wxPyWizardPage : public wxWizardPage {
 public:
 
@@ -275,6 +278,7 @@ public:
 // OTOH, it is also possible to dynamicly decide which page to return (i.e.
 // depending on the user's choices) as the wizard sample shows - in order to do
 // this, you must derive from wxWizardPage directly.
+MustHaveApp(wxWizardPageSimple);
 class wxWizardPageSimple : public wxWizardPage
 {
 public:
@@ -307,6 +311,8 @@ public:
 
 //----------------------------------------------------------------------
 
+MustHaveApp(wxWizard);
+
 class  wxWizard : public wxDialog
 {
 public: