mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 03:20:08 +01:00
Convert some code snippets for the docs.
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
-1
|
||||||
@@ -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)
|
||||||
|
|
||||||
@@ -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)
|
||||||
|
|
||||||
@@ -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"...
|
||||||
@@ -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))
|
||||||
@@ -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()
|
||||||
|
|
||||||
@@ -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)
|
||||||
|
|
||||||
|
|
||||||
@@ -182,6 +182,8 @@ def replaceCppItems(line):
|
|||||||
item = 'string'
|
item = 'string'
|
||||||
elif 'wxCoord' == item:
|
elif 'wxCoord' == item:
|
||||||
item = 'int'
|
item = 'int'
|
||||||
|
elif 'time_t' == item:
|
||||||
|
item = 'int'
|
||||||
elif item == 'char':
|
elif item == 'char':
|
||||||
item = 'int'
|
item = 'int'
|
||||||
elif item == 'double':
|
elif item == 'double':
|
||||||
|
|||||||
Reference in New Issue
Block a user