Changes to how overridable C++ methods are virtualized for Python.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37369 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -135,7 +135,7 @@ def axw_OEB(self, event):
|
||||
|
||||
|
||||
def axw_Cleanup(self):
|
||||
del self._wnd
|
||||
#del self._wnd
|
||||
self.close()
|
||||
pass
|
||||
|
||||
|
@@ -2896,7 +2896,7 @@ class DocPrintout(wx.Printout):
|
||||
"""
|
||||
Not quite sure why this was overridden, but it was in wxWindows! :)
|
||||
"""
|
||||
if not wx.Printout.base_OnBeginDocument(self, startPage, endPage):
|
||||
if not wx.Printout.OnBeginDocument(self, startPage, endPage):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@@ -17,10 +17,18 @@ import wx
|
||||
import wx.activex
|
||||
|
||||
clsID = '{CA8A9780-280D-11CF-A24D-444553540000}'
|
||||
progID = 'PDF.PdfCtrl.5'
|
||||
progID = 'AcroPDF.PDF.1'
|
||||
|
||||
|
||||
|
||||
# Create eventTypes and event binders
|
||||
wxEVT_Error = wx.activex.RegisterActiveXEvent('OnError')
|
||||
wxEVT_Message = wx.activex.RegisterActiveXEvent('OnMessage')
|
||||
|
||||
EVT_Error = wx.PyEventBinder(wxEVT_Error, 1)
|
||||
EVT_Message = wx.PyEventBinder(wxEVT_Message, 1)
|
||||
|
||||
|
||||
# Derive a new class from ActiveXWindow
|
||||
class PDFWindow(wx.activex.ActiveXWindow):
|
||||
def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
|
||||
@@ -30,6 +38,27 @@ class PDFWindow(wx.activex.ActiveXWindow):
|
||||
ID, pos, size, style, name)
|
||||
|
||||
# Methods exported by the ActiveX object
|
||||
def QueryInterface(self, riid):
|
||||
return self.CallAXMethod('QueryInterface', riid)
|
||||
|
||||
def AddRef(self):
|
||||
return self.CallAXMethod('AddRef')
|
||||
|
||||
def Release(self):
|
||||
return self.CallAXMethod('Release')
|
||||
|
||||
def GetTypeInfoCount(self):
|
||||
return self.CallAXMethod('GetTypeInfoCount')
|
||||
|
||||
def GetTypeInfo(self, itinfo, lcid):
|
||||
return self.CallAXMethod('GetTypeInfo', itinfo, lcid)
|
||||
|
||||
def GetIDsOfNames(self, riid, rgszNames, cNames, lcid):
|
||||
return self.CallAXMethod('GetIDsOfNames', riid, rgszNames, cNames, lcid)
|
||||
|
||||
def Invoke(self, dispidMember, riid, lcid, wFlags, pdispparams):
|
||||
return self.CallAXMethod('Invoke', dispidMember, riid, lcid, wFlags, pdispparams)
|
||||
|
||||
def LoadFile(self, fileName):
|
||||
return self.CallAXMethod('LoadFile', fileName)
|
||||
|
||||
@@ -102,28 +131,120 @@ class PDFWindow(wx.activex.ActiveXWindow):
|
||||
def setShowScrollbars(self, On):
|
||||
return self.CallAXMethod('setShowScrollbars', On)
|
||||
|
||||
def AboutBox(self):
|
||||
return self.CallAXMethod('AboutBox')
|
||||
def GetVersions(self):
|
||||
return self.CallAXMethod('GetVersions')
|
||||
|
||||
def setCurrentHightlight(self, a, b, c, d):
|
||||
return self.CallAXMethod('setCurrentHightlight', a, b, c, d)
|
||||
|
||||
def setCurrentHighlight(self, a, b, c, d):
|
||||
return self.CallAXMethod('setCurrentHighlight', a, b, c, d)
|
||||
|
||||
def postMessage(self, strArray):
|
||||
return self.CallAXMethod('postMessage', strArray)
|
||||
|
||||
# Getters, Setters and properties
|
||||
def _get_src(self):
|
||||
return self.GetAXProp('src')
|
||||
def _set_src(self, src):
|
||||
self.SetAXProp('src', src)
|
||||
src = property(_get_src, _set_src)
|
||||
|
||||
def _get_messageHandler(self):
|
||||
return self.GetAXProp('messageHandler')
|
||||
def _set_messageHandler(self, messageHandler):
|
||||
self.SetAXProp('messageHandler', messageHandler)
|
||||
messagehandler = property(_get_messageHandler, _set_messageHandler)
|
||||
|
||||
|
||||
# PROPERTIES
|
||||
# --------------------
|
||||
# src
|
||||
# type:string arg:string canGet:True canSet:True
|
||||
#
|
||||
# messagehandler
|
||||
# type:VT_VARIANT arg:VT_VARIANT canGet:True canSet:True
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# METHODS
|
||||
# --------------------
|
||||
# QueryInterface
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# riid
|
||||
# in:True out:False optional:False type:unsupported type 29
|
||||
# ppvObj
|
||||
# in:False out:True optional:False type:unsupported type 26
|
||||
#
|
||||
# AddRef
|
||||
# retType: int
|
||||
#
|
||||
# Release
|
||||
# retType: int
|
||||
#
|
||||
# GetTypeInfoCount
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# pctinfo
|
||||
# in:False out:True optional:False type:int
|
||||
#
|
||||
# GetTypeInfo
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# itinfo
|
||||
# in:True out:False optional:False type:int
|
||||
# lcid
|
||||
# in:True out:False optional:False type:int
|
||||
# pptinfo
|
||||
# in:False out:True optional:False type:unsupported type 26
|
||||
#
|
||||
# GetIDsOfNames
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# riid
|
||||
# in:True out:False optional:False type:unsupported type 29
|
||||
# rgszNames
|
||||
# in:True out:False optional:False type:unsupported type 26
|
||||
# cNames
|
||||
# in:True out:False optional:False type:int
|
||||
# lcid
|
||||
# in:True out:False optional:False type:int
|
||||
# rgdispid
|
||||
# in:False out:True optional:False type:int
|
||||
#
|
||||
# Invoke
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# dispidMember
|
||||
# in:True out:False optional:False type:int
|
||||
# riid
|
||||
# in:True out:False optional:False type:unsupported type 29
|
||||
# lcid
|
||||
# in:True out:False optional:False type:int
|
||||
# wFlags
|
||||
# in:True out:False optional:False type:int
|
||||
# pdispparams
|
||||
# in:True out:False optional:False type:unsupported type 29
|
||||
# pvarResult
|
||||
# in:False out:True optional:False type:VT_VARIANT
|
||||
# pexcepinfo
|
||||
# in:False out:True optional:False type:unsupported type 29
|
||||
# puArgErr
|
||||
# in:False out:True optional:False type:int
|
||||
#
|
||||
# LoadFile
|
||||
# retType: bool
|
||||
# params:
|
||||
# fileName
|
||||
# in:False out:False optional:False type:string
|
||||
# in:True out:False optional:False type:string
|
||||
#
|
||||
# setShowToolbar
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# On
|
||||
# in:False out:False optional:False type:bool
|
||||
# in:True out:False optional:False type:bool
|
||||
#
|
||||
# gotoFirstPage
|
||||
# retType: VT_VOID
|
||||
@@ -141,7 +262,7 @@ class PDFWindow(wx.activex.ActiveXWindow):
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# n
|
||||
# in:False out:False optional:False type:int
|
||||
# in:True out:False optional:False type:int
|
||||
#
|
||||
# goForwardStack
|
||||
# retType: VT_VOID
|
||||
@@ -153,19 +274,19 @@ class PDFWindow(wx.activex.ActiveXWindow):
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# pageMode
|
||||
# in:False out:False optional:False type:string
|
||||
# in:True out:False optional:False type:string
|
||||
#
|
||||
# setLayoutMode
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# layoutMode
|
||||
# in:False out:False optional:False type:string
|
||||
# in:True out:False optional:False type:string
|
||||
#
|
||||
# setNamedDest
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# namedDest
|
||||
# in:False out:False optional:False type:string
|
||||
# in:True out:False optional:False type:string
|
||||
#
|
||||
# Print
|
||||
# retType: VT_VOID
|
||||
@@ -177,61 +298,61 @@ class PDFWindow(wx.activex.ActiveXWindow):
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# percent
|
||||
# in:False out:False optional:False type:double
|
||||
# in:True out:False optional:False type:double
|
||||
#
|
||||
# setZoomScroll
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# percent
|
||||
# in:False out:False optional:False type:double
|
||||
# in:True out:False optional:False type:double
|
||||
# left
|
||||
# in:False out:False optional:False type:double
|
||||
# in:True out:False optional:False type:double
|
||||
# top
|
||||
# in:False out:False optional:False type:double
|
||||
# in:True out:False optional:False type:double
|
||||
#
|
||||
# setView
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# viewMode
|
||||
# in:False out:False optional:False type:string
|
||||
# in:True out:False optional:False type:string
|
||||
#
|
||||
# setViewScroll
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# viewMode
|
||||
# in:False out:False optional:False type:string
|
||||
# in:True out:False optional:False type:string
|
||||
# offset
|
||||
# in:False out:False optional:False type:double
|
||||
# in:True out:False optional:False type:double
|
||||
#
|
||||
# setViewRect
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# left
|
||||
# in:False out:False optional:False type:double
|
||||
# in:True out:False optional:False type:double
|
||||
# top
|
||||
# in:False out:False optional:False type:double
|
||||
# in:True out:False optional:False type:double
|
||||
# width
|
||||
# in:False out:False optional:False type:double
|
||||
# in:True out:False optional:False type:double
|
||||
# height
|
||||
# in:False out:False optional:False type:double
|
||||
# in:True out:False optional:False type:double
|
||||
#
|
||||
# printPages
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# from
|
||||
# in:False out:False optional:False type:int
|
||||
# in:True out:False optional:False type:int
|
||||
# to
|
||||
# in:False out:False optional:False type:int
|
||||
# in:True out:False optional:False type:int
|
||||
#
|
||||
# printPagesFit
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# from
|
||||
# in:False out:False optional:False type:int
|
||||
# in:True out:False optional:False type:int
|
||||
# to
|
||||
# in:False out:False optional:False type:int
|
||||
# in:True out:False optional:False type:int
|
||||
# shrinkToFit
|
||||
# in:False out:False optional:False type:bool
|
||||
# in:True out:False optional:False type:bool
|
||||
#
|
||||
# printAll
|
||||
# retType: VT_VOID
|
||||
@@ -240,22 +361,58 @@ class PDFWindow(wx.activex.ActiveXWindow):
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# shrinkToFit
|
||||
# in:False out:False optional:False type:bool
|
||||
# in:True out:False optional:False type:bool
|
||||
#
|
||||
# setShowScrollbars
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# On
|
||||
# in:False out:False optional:False type:bool
|
||||
# in:True out:False optional:False type:bool
|
||||
#
|
||||
# AboutBox
|
||||
# GetVersions
|
||||
# retType: VT_VARIANT
|
||||
#
|
||||
# setCurrentHightlight
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# a
|
||||
# in:True out:False optional:False type:int
|
||||
# b
|
||||
# in:True out:False optional:False type:int
|
||||
# c
|
||||
# in:True out:False optional:False type:int
|
||||
# d
|
||||
# in:True out:False optional:False type:int
|
||||
#
|
||||
# setCurrentHighlight
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# a
|
||||
# in:True out:False optional:False type:int
|
||||
# b
|
||||
# in:True out:False optional:False type:int
|
||||
# c
|
||||
# in:True out:False optional:False type:int
|
||||
# d
|
||||
# in:True out:False optional:False type:int
|
||||
#
|
||||
# postMessage
|
||||
# retType: VT_VOID
|
||||
# params:
|
||||
# strArray
|
||||
# in:True out:False optional:False type:VT_VARIANT
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# EVENTS
|
||||
# --------------------
|
||||
# Error
|
||||
# retType: VT_VOID
|
||||
#
|
||||
# Message
|
||||
# retType: VT_VOID
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
@@ -1056,10 +1056,10 @@ class SetPrintout(wx.Printout):
|
||||
self.end_pg = 1000
|
||||
|
||||
def OnBeginDocument(self, start, end):
|
||||
return self.base_OnBeginDocument(start, end)
|
||||
return super(SetPrintout, self).OnBeginDocument(start, end)
|
||||
|
||||
def OnEndDocument(self):
|
||||
self.base_OnEndDocument()
|
||||
super(SetPrintout, self).OnEndDocument()
|
||||
|
||||
def HasPage(self, page):
|
||||
try:
|
||||
@@ -1079,7 +1079,7 @@ class SetPrintout(wx.Printout):
|
||||
return (str_pg, end_pg, str_pg, end_pg)
|
||||
|
||||
def OnPreparePrinting(self):
|
||||
self.base_OnPreparePrinting()
|
||||
super(SetPrintout, self).OnPreparePrinting()
|
||||
|
||||
def OnBeginPrinting(self):
|
||||
dc = self.GetDC()
|
||||
@@ -1095,7 +1095,7 @@ class SetPrintout(wx.Printout):
|
||||
scaleY = float(h) / 1000
|
||||
self.printUserScale = min(scaleX, scaleY)
|
||||
|
||||
self.base_OnBeginPrinting()
|
||||
super(SetPrintout, self).OnBeginPrinting()
|
||||
|
||||
def GetSize(self):
|
||||
self.psizew, self.psizeh = self.GetPPIPrinter()
|
||||
|
@@ -65,19 +65,19 @@ class CCellEditor(wx.grid.PyGridCellEditor):
|
||||
""" Show or hide the edit control. Use the attr (if not None)
|
||||
to set colors or fonts for the control.
|
||||
NOTE: There is no need to everride this if you don't need
|
||||
to do something out of the ordingary.
|
||||
to do something out of the ordinary.
|
||||
"""
|
||||
self.base_Show(show, attr)
|
||||
super(CCellEditor, self).Show(show, attr)
|
||||
|
||||
def PaintBackground(self, rect, attr):
|
||||
""" Draws the part of the cell not occupied by the edit control. The
|
||||
base class version just fills it with background colour from the
|
||||
attribute.
|
||||
NOTE: There is no need to everride this if you don't need
|
||||
to do something out of the ordingary.
|
||||
to do something out of the ordinary.
|
||||
"""
|
||||
# Call base class method.
|
||||
self.base_PaintBackground(self, rect, attr)
|
||||
super(CCellEditor, self).PaintBackground(self, rect, attr)
|
||||
|
||||
def BeginEdit(self, row, col, grid):
|
||||
""" Fetch the value from the table and prepare edit control to begin editing.
|
||||
@@ -152,9 +152,9 @@ class CCellEditor(wx.grid.PyGridCellEditor):
|
||||
def Destroy(self):
|
||||
""" Final cleanup
|
||||
NOTE: There is no need to everride this if you don't need
|
||||
to do something out of the ordingary.
|
||||
to do something out of the ordinary.
|
||||
"""
|
||||
self.base_Destroy()
|
||||
super(CCellEditor, self).Destroy()
|
||||
|
||||
def Clone(self):
|
||||
""" Create a new object which is the copy of this one. Must Override. """
|
||||
|
Reference in New Issue
Block a user