From 64e8a1f072f09865b57ce399fa4401009e08d314 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 19 Dec 2003 04:45:35 +0000 Subject: [PATCH] autodoc docstring fixes and such git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_app.i | 18 +++++++++--------- wxPython/src/_app_ex.py | 6 +++--- wxPython/src/_core_rename.i | 13 ------------- wxPython/src/_defs.i | 28 ++++++++++++++++++++++++++++ wxPython/src/_event.i | 3 +++ wxPython/src/_gdicmn.i | 28 +++++++++++++++------------- wxPython/src/_streams.i | 1 - wxPython/src/_window.i | 4 ++-- wxPython/src/core.i | 8 +++----- 9 files changed, 63 insertions(+), 46 deletions(-) diff --git a/wxPython/src/_app.i b/wxPython/src/_app.i index 299cb97ffc..e2efaa1c1a 100644 --- a/wxPython/src/_app.i +++ b/wxPython/src/_app.i @@ -66,7 +66,7 @@ public: DocDeclStr( void, SetAppName(const wxString& name), "Set the application name. This value may be used automatically\n" - "by wxConfig and such."); + "by wx.Config and such."); DocDeclStr( wxString, GetClassName() const, @@ -82,7 +82,7 @@ public: DocDeclStr( void, SetVendorName(const wxString& name), "Set the application's vendor name. This value may be used automatically\n" - "by wxConfig and such."); + "by wx.Config and such."); DocDeclStr( @@ -90,13 +90,13 @@ public: "Create the app traits object to which we delegate for everything which either\n" "should be configurable by the user (then he can change the default behaviour\n" "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" + "which is GUI/console dependent as then wx.AppTraits allows us to abstract the\n" "differences behind the common facade"); DocDeclStr( virtual void, ProcessPendingEvents(), - "Process all events in the wxPendingEvents list -- it is necessary to call this\n" + "Process all events in the Pending Events list -- it is necessary to call this\n" "function to process posted events. This happens during each event loop\n" "iteration."); @@ -222,10 +222,10 @@ public: "Set the OnAssert behaviour for debug and hybrid builds. The following flags\n" "may be or'd together:\n" "\n" - " wxPYAPP_ASSERT_SUPPRESS Don't do anything\n" - " 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"); + " wx.PYAPP_ASSERT_SUPPRESS Don't do anything\n" + " wx.PYAPP_ASSERT_EXCEPTION Turn it into a Python exception if possible (default)\n" + " wx.PYAPP_ASSERT_DIALOG Display a message dialog\n" + " wx.PYAPP_ASSERT_LOG Write the assertion info to the wx.Log\n"); DocDeclStr( int, GetAssertMode(), @@ -312,7 +312,7 @@ DocStr(wxApp_CleanUp, DocStr(wxGetApp, - "Return a reference to the current wxApp object."); + "Return a reference to the current wx.App object."); %inline %{ wxPyApp* wxGetApp() { return (wxPyApp*)wxTheApp; diff --git a/wxPython/src/_app_ex.py b/wxPython/src/_app_ex.py index 492f91a93f..b843af6191 100644 --- a/wxPython/src/_app_ex.py +++ b/wxPython/src/_app_ex.py @@ -21,8 +21,8 @@ class PyOnDemandOutputWindow: def CreateOutputWindow(self, st): self.frame = wx.Frame(self.parent, -1, self.title, style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE) - self.text = wxTextCtrl(self.frame, -1, "", - style = wx.TE_MULTILINE | wx.TE_READONLY) + self.text = wx.TextCtrl(self.frame, -1, "", + style = wx.TE_MULTILINE | wx.TE_READONLY) self.frame.SetSize((450, 300)) self.frame.Show(True) EVT_CLOSE(self.frame, self.OnCloseWindow) @@ -180,7 +180,7 @@ class PyWidgetTester(wx.App): wx.App.__init__(self, 0) def OnInit(self): - self.frame = wxFrame(None, -1, "Widget Tester", pos=(0,0), size=self.size) + self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) self.SetTopWindow(self.frame) return True diff --git a/wxPython/src/_core_rename.i b/wxPython/src/_core_rename.i index 4b0a245fa2..6d93a62562 100644 --- a/wxPython/src/_core_rename.i +++ b/wxPython/src/_core_rename.i @@ -438,36 +438,23 @@ %rename(Object) wxObject; %rename(BITMAP_TYPE_INVALID) wxBITMAP_TYPE_INVALID; %rename(BITMAP_TYPE_BMP) wxBITMAP_TYPE_BMP; -%rename(BITMAP_TYPE_BMP_RESOURCE) wxBITMAP_TYPE_BMP_RESOURCE; -%rename(BITMAP_TYPE_RESOURCE) wxBITMAP_TYPE_RESOURCE; %rename(BITMAP_TYPE_ICO) wxBITMAP_TYPE_ICO; -%rename(BITMAP_TYPE_ICO_RESOURCE) wxBITMAP_TYPE_ICO_RESOURCE; %rename(BITMAP_TYPE_CUR) wxBITMAP_TYPE_CUR; -%rename(BITMAP_TYPE_CUR_RESOURCE) wxBITMAP_TYPE_CUR_RESOURCE; %rename(BITMAP_TYPE_XBM) wxBITMAP_TYPE_XBM; %rename(BITMAP_TYPE_XBM_DATA) wxBITMAP_TYPE_XBM_DATA; %rename(BITMAP_TYPE_XPM) wxBITMAP_TYPE_XPM; %rename(BITMAP_TYPE_XPM_DATA) wxBITMAP_TYPE_XPM_DATA; %rename(BITMAP_TYPE_TIF) wxBITMAP_TYPE_TIF; -%rename(BITMAP_TYPE_TIF_RESOURCE) wxBITMAP_TYPE_TIF_RESOURCE; %rename(BITMAP_TYPE_GIF) wxBITMAP_TYPE_GIF; -%rename(BITMAP_TYPE_GIF_RESOURCE) wxBITMAP_TYPE_GIF_RESOURCE; %rename(BITMAP_TYPE_PNG) wxBITMAP_TYPE_PNG; -%rename(BITMAP_TYPE_PNG_RESOURCE) wxBITMAP_TYPE_PNG_RESOURCE; %rename(BITMAP_TYPE_JPEG) wxBITMAP_TYPE_JPEG; -%rename(BITMAP_TYPE_JPEG_RESOURCE) wxBITMAP_TYPE_JPEG_RESOURCE; %rename(BITMAP_TYPE_PNM) wxBITMAP_TYPE_PNM; -%rename(BITMAP_TYPE_PNM_RESOURCE) wxBITMAP_TYPE_PNM_RESOURCE; %rename(BITMAP_TYPE_PCX) wxBITMAP_TYPE_PCX; -%rename(BITMAP_TYPE_PCX_RESOURCE) wxBITMAP_TYPE_PCX_RESOURCE; %rename(BITMAP_TYPE_PICT) wxBITMAP_TYPE_PICT; -%rename(BITMAP_TYPE_PICT_RESOURCE) wxBITMAP_TYPE_PICT_RESOURCE; %rename(BITMAP_TYPE_ICON) wxBITMAP_TYPE_ICON; -%rename(BITMAP_TYPE_ICON_RESOURCE) wxBITMAP_TYPE_ICON_RESOURCE; %rename(BITMAP_TYPE_ANI) wxBITMAP_TYPE_ANI; %rename(BITMAP_TYPE_IFF) wxBITMAP_TYPE_IFF; %rename(BITMAP_TYPE_MACCURSOR) wxBITMAP_TYPE_MACCURSOR; -%rename(BITMAP_TYPE_MACCURSOR_RESOURCE) wxBITMAP_TYPE_MACCURSOR_RESOURCE; %rename(BITMAP_TYPE_ANY) wxBITMAP_TYPE_ANY; %rename(CURSOR_NONE) wxCURSOR_NONE; %rename(CURSOR_ARROW) wxCURSOR_ARROW; diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index 85d6a8049a..66bd527637 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -195,6 +195,33 @@ typedef unsigned char byte; } %enddef +//--------------------------------------------------------------------------- +// Forward declarations and %renames for some classes, so the autodoc strings +// will be able to use the right types even when the real class declaration is +// not in the module being processed. + +#ifdef BUILDING_RENAMERS + #define FORWARD_DECLARE(wxName, Name) +#else + %define FORWARD_DECLARE(wxName, Name) + %rename(Name) wxName; + class wxName; + %enddef +#endif + +FORWARD_DECLARE(wxString, String); +FORWARD_DECLARE(wxBitmap, Bitmap); +FORWARD_DECLARE(wxDateTime, DateTime); +FORWARD_DECLARE(wxInputStream, InputStream); +FORWARD_DECLARE(wxDC, DC); +FORWARD_DECLARE(wxCursor, Cursor); +FORWARD_DECLARE(wxRegion, Region); +FORWARD_DECLARE(wxColour, Colour); +FORWARD_DECLARE(wxFont, Font); +FORWARD_DECLARE(wxCaret, Caret); +FORWARD_DECLARE(wxToolTip, ToolTip); +FORWARD_DECLARE(wxPyDropTarget, PyDropTarget); + //--------------------------------------------------------------------------- // General numeric #define's and etc. Making them all enums makes SWIG use the @@ -833,6 +860,7 @@ enum wxItemKind wxITEM_MAX }; + enum wxHitTest { wxHT_NOWHERE, diff --git a/wxPython/src/_event.i b/wxPython/src/_event.i index f75e41cd95..f59a2332ce 100644 --- a/wxPython/src/_event.i +++ b/wxPython/src/_event.i @@ -991,6 +991,8 @@ enum wxUpdateUIMode wxUPDATE_UI_PROCESS_SPECIFIED }; + + class wxUpdateUIEvent : public wxCommandEvent { public: @@ -1184,6 +1186,7 @@ enum wxIdleMode wxIDLE_PROCESS_SPECIFIED }; + class wxIdleEvent : public wxEvent { public: diff --git a/wxPython/src/_gdicmn.i b/wxPython/src/_gdicmn.i index 059343e1c2..10e869f038 100644 --- a/wxPython/src/_gdicmn.i +++ b/wxPython/src/_gdicmn.i @@ -21,36 +21,38 @@ enum wxBitmapType { wxBITMAP_TYPE_INVALID, // should be == 0 for compatibility! wxBITMAP_TYPE_BMP, - wxBITMAP_TYPE_BMP_RESOURCE, - wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE, wxBITMAP_TYPE_ICO, - wxBITMAP_TYPE_ICO_RESOURCE, wxBITMAP_TYPE_CUR, - wxBITMAP_TYPE_CUR_RESOURCE, wxBITMAP_TYPE_XBM, wxBITMAP_TYPE_XBM_DATA, wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_XPM_DATA, wxBITMAP_TYPE_TIF, - wxBITMAP_TYPE_TIF_RESOURCE, wxBITMAP_TYPE_GIF, - wxBITMAP_TYPE_GIF_RESOURCE, wxBITMAP_TYPE_PNG, - wxBITMAP_TYPE_PNG_RESOURCE, wxBITMAP_TYPE_JPEG, - wxBITMAP_TYPE_JPEG_RESOURCE, wxBITMAP_TYPE_PNM, - wxBITMAP_TYPE_PNM_RESOURCE, wxBITMAP_TYPE_PCX, - wxBITMAP_TYPE_PCX_RESOURCE, wxBITMAP_TYPE_PICT, - wxBITMAP_TYPE_PICT_RESOURCE, wxBITMAP_TYPE_ICON, - wxBITMAP_TYPE_ICON_RESOURCE, wxBITMAP_TYPE_ANI, wxBITMAP_TYPE_IFF, wxBITMAP_TYPE_MACCURSOR, - wxBITMAP_TYPE_MACCURSOR_RESOURCE, + +// wxBITMAP_TYPE_BMP_RESOURCE, +// wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE, +// wxBITMAP_TYPE_ICO_RESOURCE, +// wxBITMAP_TYPE_CUR_RESOURCE, +// wxBITMAP_TYPE_TIF_RESOURCE, +// wxBITMAP_TYPE_GIF_RESOURCE, +// wxBITMAP_TYPE_PNG_RESOURCE, +// wxBITMAP_TYPE_JPEG_RESOURCE, +// wxBITMAP_TYPE_PNM_RESOURCE, +// wxBITMAP_TYPE_PCX_RESOURCE, +// wxBITMAP_TYPE_PICT_RESOURCE, +// wxBITMAP_TYPE_ICON_RESOURCE, +// wxBITMAP_TYPE_MACCURSOR_RESOURCE, + wxBITMAP_TYPE_ANY = 50 }; diff --git a/wxPython/src/_streams.i b/wxPython/src/_streams.i index 59ff7d7d4a..df85f9914e 100644 --- a/wxPython/src/_streams.i +++ b/wxPython/src/_streams.i @@ -68,7 +68,6 @@ enum wxSeekMode }; - %name(InputStream) class wxPyInputStream { public: %extend { diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index 6bd8cd5264..9dec8acb35 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -546,13 +546,13 @@ public: DocDeclAStr( void, GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT), - "GetTextExtent(wxString string) -> (width, height)", + "GetTextExtent(String string) -> (width, height)", "Get the width and height of the text using the current font."); DocDeclAStrName( void, GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT, int *OUTPUT, int* OUTPUT, const wxFont* font = NULL), - "GetFullTextExtent(wxString string, Font font=None) ->\n (width, height, descent, externalLeading)", + "GetFullTextExtent(String string, Font font=None) ->\n (width, height, descent, externalLeading)", "Get the width, height, decent and leading of the text using the current or specified font.", GetFullTextExtent); diff --git a/wxPython/src/core.i b/wxPython/src/core.i index a41427188f..be891ef234 100644 --- a/wxPython/src/core.i +++ b/wxPython/src/core.i @@ -44,18 +44,16 @@ wx = _sys.modules[__name__] #endif -//--------------------------------------------------------------------------- -%{ - DECLARE_DEF_STRING(EmptyString); -// DECLARE_DEF_STRING(PanelNameStr); -%} //--------------------------------------------------------------------------- // Include all the files that make up the core module // wxObject, functions and other base stuff %include _defs.i + +MAKE_CONST_WXSTRING(EmptyString); + %include _obj.i %include _gdicmn.i %include _streams.i -- 2.45.2