diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AppConsole.SetCLocale.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AppConsole.SetCLocale.2.py new file mode 100644 index 00000000..e69de29b diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.NewFromPNGData.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.NewFromPNGData.1.py new file mode 100644 index 00000000..e69de29b diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.SetTimeT.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.SetTimeT.1.py new file mode 100644 index 00000000..5e3af31b --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.SetTimeT.1.py @@ -0,0 +1,2 @@ + + -1 diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryAfter.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryAfter.1.py new file mode 100644 index 00000000..675de7bc --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryAfter.1.py @@ -0,0 +1,10 @@ + + class MyClass(public BaseClass): # something inheriting from wx.EvtHandler + + ... + def TryAfter(self, event): + if (BaseClass.TryAfter(self, event)) + return True + + return self.MyPostProcess(event) + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryBefore.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryBefore.1.py new file mode 100644 index 00000000..9d12ac3c --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryBefore.1.py @@ -0,0 +1,10 @@ + + class MyClass(BaseClass): # something inheriting from wx.EvtHandler + + ... + def TryBefore(self, event): + if (self.MyPreProcess(event)): + return True + + return BaseClass.TryBefore(self, event) + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.2.py new file mode 100644 index 00000000..e10a6161 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.2.py @@ -0,0 +1,9 @@ + + + # some code in HandleTag for "MYITEMS"... + + self.Parser.PushTagHandler(self, "PARAM") + self.ParseInner(tag) + self.Parser.PopTagHandler() + + # back to working on "MYITEMS"... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html2.WebView.GetNativeBackend.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html2.WebView.GetNativeBackend.1.py new file mode 100644 index 00000000..ebba70b5 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html2.WebView.GetNativeBackend.1.py @@ -0,0 +1,9 @@ + + # In Python the value returned will be a sip wrapper around a void* type, + # and it can be converted to the address being pointed to with int(). + webview_ptr = self.webview.GetNativeBackend() + + # Assuming you are able to get a ctypes, cffi or similar access to the + # webview library, you can use that pointer value to give it access to the + # WebView backend to operate upon. + theWebViewLib.doSomething(int(webview_ptr)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.media.MediaCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.media.MediaCtrl.1.py new file mode 100644 index 00000000..b86fb912 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.media.MediaCtrl.1.py @@ -0,0 +1,10 @@ + + # connect to the media event + self.Bind(wx.media.EVT_MEDIA_STOP, self.OnMediaStop, self.mediactrl) + + # ... + def OnMediaStop(self, evt): + if self.userWantsToSeek: + self.mediactrl.SetPosition(someOtherPosition) + evt.Veto() + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.msw.Metafile.SetClipboard.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.msw.Metafile.SetClipboard.1.py new file mode 100644 index 00000000..da609372 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.msw.Metafile.SetClipboard.1.py @@ -0,0 +1,9 @@ + + dc = wx.MetafileDC() + if dc.IsOk(): + self.DoDrawing(dc) + metafile = dc.Close() + if metafile: + success = metafile.SetClipboard(dc.MaxX() + 10, dc.MaxY() + 10) + + diff --git a/sphinxtools/utilities.py b/sphinxtools/utilities.py index 18a40164..1b5c8feb 100644 --- a/sphinxtools/utilities.py +++ b/sphinxtools/utilities.py @@ -182,6 +182,8 @@ def replaceCppItems(line): item = 'string' elif 'wxCoord' == item: item = 'int' + elif 'time_t' == item: + item = 'int' elif item == 'char': item = 'int' elif item == 'double':