diff --git a/etg/_glcanvas.py b/etg/_glcanvas.py index 3e9f8c8d..e25888e4 100644 --- a/etg/_glcanvas.py +++ b/etg/_glcanvas.py @@ -79,13 +79,18 @@ def run(): # We already have a MappedType for wxArrayInt, so just tweak the # interfaces to use that instead of a const int pointer. - c.find('wxGLCanvas').ignore() + c.find('wxGLCanvas').findOverload('const int *attribList').ignore() m = c.addCppCtor_sip( argsString="""( - wxWindow* parent, wxWindowID id=wxID_ANY, wxArrayInt* attribList=NULL, - const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, - long style=0, const wxString& name="GLCanvas", - const wxPalette& palette=wxNullPalette)""", + wxWindow* parent /TransferThis/, + wxWindowID id=wxID_ANY, + wxArrayInt* attribList=NULL, + const wxPoint& pos=wxDefaultPosition, + const wxSize& size=wxDefaultSize, + long style=0, + const wxString& name="GLCanvas", + const wxPalette& palette=wxNullPalette) + """, cppSignature="""( wxWindow* parent, wxWindowID id=wxID_ANY, const int* attribList=NULL, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, @@ -102,7 +107,7 @@ def run(): ) - m = c.find('IsDisplaySupported') + m = c.find('IsDisplaySupported').findOverload('attribList') m.find('attribList').type = 'wxArrayInt*' m.setCppCode_sip("""\ const int* attribPtr = NULL; diff --git a/etg/_stc.py b/etg/_stc.py index 137e0525..832289b0 100644 --- a/etg/_stc.py +++ b/etg/_stc.py @@ -226,6 +226,10 @@ def run(): EVT_STC_INDICATOR_RELEASE = wx.PyEventBinder( wxEVT_STC_INDICATOR_RELEASE, 1 ) EVT_STC_AUTOCOMP_CANCELLED = wx.PyEventBinder( wxEVT_STC_AUTOCOMP_CANCELLED, 1 ) EVT_STC_AUTOCOMP_CHAR_DELETED = wx.PyEventBinder( wxEVT_STC_AUTOCOMP_CHAR_DELETED, 1 ) + EVT_STC_CLIPBOARD_COPY = wx.PyEventBinder( wxEVT_STC_CLIPBOARD_COPY, 1) + EVT_STC_CLIPBOARD_PASTE = wx.PyEventBinder( wxEVT_STC_CLIPBOARD_PASTE, 1) + EVT_STC_AUTOCOMP_COMPLETED = wx.PyEventBinder( wxEVT_STC_AUTOCOMP_COMPLETED, 1) + EVT_STC_MARGIN_RIGHT_CLICK = wx.PyEventBinder( wxEVT_STC_MARGIN_RIGHT_CLICK, 1) """) #----------------------------------------------------------------- diff --git a/etg/apptrait.py b/etg/apptrait.py index 63129b3d..33e18a71 100644 --- a/etg/apptrait.py +++ b/etg/apptrait.py @@ -50,6 +50,10 @@ def run(): ]: c.find(name).factory = True + c.find('GetToolkitVersion.major').out = True + c.find('GetToolkitVersion.minor').out = True + c.find('GetToolkitVersion.micro').out = True + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/bitmap.py b/etg/bitmap.py index 466f263d..5c4d7d96 100644 --- a/etg/bitmap.py +++ b/etg/bitmap.py @@ -44,9 +44,11 @@ def run(): c = module.find('wxBitmap') assert isinstance(c, etgtools.ClassDef) c.mustHaveApp() - tools.removeVirtuals(c) + # TODO: The wxCursor version of the ctor is not implemented on OSX... + c.find('wxBitmap').findOverload('wxCursor').ignore() + c.find('wxBitmap.bits').type = 'const char*' c.find('wxBitmap.type').default = 'wxBITMAP_TYPE_ANY' c.find('LoadFile.type').default = 'wxBITMAP_TYPE_ANY' diff --git a/etg/ctrlsub.py b/etg/ctrlsub.py index 25d03dde..d96d7846 100644 --- a/etg/ctrlsub.py +++ b/etg/ctrlsub.py @@ -46,7 +46,8 @@ def run(): assert isinstance(m, etgtools.MethodDef) if 'void *' in m.argsString or \ 'wxClientData **' in m.argsString or \ - 'wxString *' in m.argsString: + 'wxString *' in m.argsString or \ + 'std::vector' in m.argsString: m.ignore() for m in c.findAll('Append'): diff --git a/etg/dataview.py b/etg/dataview.py index 9e440ad1..e18c47e7 100644 --- a/etg/dataview.py +++ b/etg/dataview.py @@ -238,13 +238,22 @@ def run(): method.find('value').type = 'wxDVCVariant&' method.cppSignature = sig + def _fixupTypeParam(klass): + param = klass.findItem('{}.varianttype'.format(klass.name)) + if param and param.default == 'GetDefaultType()': + param.default = '{}::GetDefaultType()'.format(klass.name) + c = module.find('wxDataViewRenderer') c.addPrivateCopyCtor() c.abstract = True - c.addAutoProperties() c.find('GetView').ignore(False) + # TODO: This is only available when wxUSE_ACCESSIBILITY is set to 1 + c.find('GetAccessibleDescription').ignore() + + c.addAutoProperties() + # Change variant getters to return the value for name, sig in [ ('GetValue', 'bool (wxVariant& value)'), @@ -264,6 +273,7 @@ def run(): c = module.find('wxDataViewCustomRenderer') + _fixupTypeParam(c) m = c.find('GetValueFromEditorCtrl') _fixupBoolGetters(m, 'bool (wxWindow * editor, wxVariant& value)') @@ -305,6 +315,7 @@ def run(): ]: c = module.find(name) c.addAutoProperties() + _fixupTypeParam(c) c.addItem(etgtools.WigCode("""\ virtual bool SetValue( const wxDVCVariant &value ) [bool (const wxVariant& value)]; @@ -436,6 +447,10 @@ def run(): """) + # TODO: add support for wxVector templates + c.find('GetSortingColumns').ignore() + + #----------------------------------------------------------------- c = module.find('wxDataViewEvent') tools.fixEventClass(c) diff --git a/etg/defs.py b/etg/defs.py index 72860df6..5e04afb7 100644 --- a/etg/defs.py +++ b/etg/defs.py @@ -19,7 +19,9 @@ DOCSTRING = "" # The classes and/or the basename of the Doxygen XML files to be processed by # this script. -ITEMS = [ 'defs_8h.xml' ] +ITEMS = [ 'defs_8h.xml', + 'textfile_8h.xml', + ] #--------------------------------------------------------------------------- @@ -101,8 +103,9 @@ def run(): const int RELEASE_NUMBER; """)) + # TODO: these should be removed someday module.addPyCode("BG_STYLE_CUSTOM = BG_STYLE_PAINT") - module.addItem(etgtools.DefineDef(name='wxADJUST_MINSIZE', value='0')) + module.addPyCode("ADJUST_MINSIZE = 0") #----------------------------------------------------------------- diff --git a/etg/dialog.py b/etg/dialog.py index eca2c148..49bac721 100644 --- a/etg/dialog.py +++ b/etg/dialog.py @@ -43,8 +43,6 @@ def run(): c.find('wxDialog.title').default = 'wxEmptyString' c.find('Create.title').default = 'wxEmptyString' - # PocketPC only, don't think we'll need these ;) - c.find('DoOK').ignore() c.find('GetToolBar').ignore() # Uses a template, but it would be easier to reimplement it in Python if diff --git a/etg/event.py b/etg/event.py index a43312c4..570a4d35 100644 --- a/etg/event.py +++ b/etg/event.py @@ -230,10 +230,10 @@ def run(): // pointer and disconnect that one. Unfortunately since we // wrapped the PyObject function pointer in another object we // have to do the searching ourselves... - wxList::compatibility_iterator node = self->GetDynamicEventTable()->GetFirst(); - while (node) + size_t cookie; + wxDynamicEventTableEntry *entry = self->GetFirstDynamicEntry(cookie); + while (entry) { - wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData(); if ((entry->m_id == id) && ((entry->m_lastId == lastId) || (lastId == wxID_ANY)) && ((entry->m_eventType == eventType) || (eventType == wxEVT_NULL)) && @@ -247,12 +247,13 @@ def run(): // is evaluated. (!!!) if (PyObject_RichCompareBool(cb->m_func, func, Py_EQ) == 1) { delete cb; - self->GetDynamicEventTable()->Erase(node); - delete entry; - return true; + entry->m_callbackUserData = NULL; + // Now Disconnect should work + return self->Disconnect(id, lastId, eventType, + (wxObjectEventFunction)&wxPyCallback::EventThunker); } } - node = node->GetNext(); + entry = self->GetNextDynamicEntry(cookie); } return false; } @@ -269,10 +270,6 @@ def run(): for m in c.find('CallAfter').all(): m.ignore() - # wxEventTable is not documented so we have to ignore SearchEventTable. - # TODO: Should wxEventTable be available to language bindings? - c.find('SearchEventTable').ignore() - c.find('QueueEvent.event').transfer = True module.find('wxQueueEvent.event').transfer = True diff --git a/etg/frame.py b/etg/frame.py index 643a3ad6..a7912983 100644 --- a/etg/frame.py +++ b/etg/frame.py @@ -53,7 +53,10 @@ def run(): # TODO: maybe these should go into a tools.addFrameVirtuals function? c.find('OnCreateStatusBar').isVirtual = True c.find('OnCreateToolBar').isVirtual = True + c.find('DoGiveHelp').isVirtual = True + # TODO: support this + c.find('MSWGetTaskBarButton').ignore() #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/fswatcher.py b/etg/fswatcher.py index 555ba6f8..ac41e77f 100644 --- a/etg/fswatcher.py +++ b/etg/fswatcher.py @@ -36,7 +36,7 @@ def run(): # for platforms that have INOTIFY so we need to fake it elsewhere. module.addHeaderCode(""" #include - #ifndef wxHAS_INOTIFY + #if !defined(wxHAS_INOTIFY) && !defined(wxHAVE_FSEVENTS_FILE_NOTIFICATIONS) const int wxFSW_EVENT_UNMOUNT = 0x2000; #endif """) diff --git a/etg/geometry.py b/etg/geometry.py index 682b249c..0c781ca1 100644 --- a/etg/geometry.py +++ b/etg/geometry.py @@ -51,7 +51,6 @@ def run(): c.find('GetRounded.y').out = True # these have link errors - c.find('SetPolarCoordinates').ignore() c.find('operator/=').findOverload('wxDouble').ignore() c.find('operator*=').findOverload('wxDouble').ignore() diff --git a/etg/graphics.py b/etg/graphics.py index 9ad544c4..9e36c299 100644 --- a/etg/graphics.py +++ b/etg/graphics.py @@ -171,6 +171,9 @@ def run(): } """) + # TODO: support this? + c.find('CreateFromNativeHDC').ignore() + #--------------------------------------------- c = module.find('wxGraphicsPath') tools.removeVirtuals(c) @@ -191,9 +194,34 @@ def run(): p.keepReference = True c.find('CreateContextFromImage.image').keepReference = True - # FIXME: Handle wxEnhMetaFileDC? + # TODO: support this? c.find('CreateContext').findOverload('wxEnhMetaFileDC').ignore() + # TODO: support this? + c.find('CreateContextFromNativeHDC').ignore() + + + c.find('GetGDIPlusRenderer').ignore() + c.addCppMethod('wxGraphicsRenderer*', 'GetGDIPlusRenderer', '()', isStatic=True, + doc="Returns GDI+ renderer (MSW only).", + body="""\ + #ifdef __WXMSW__ + return wxGraphicsRenderer::GetGDIPlusRenderer(); + #else + return NULL; + #endif + """) + + c.find('GetDirect2DRenderer').ignore() + c.addCppMethod('wxGraphicsRenderer*', 'GetDirect2DRenderer', '()', isStatic=True, + doc="Returns Direct2D renderer (MSW only).", + body="""\ + #ifdef __WXMSW__ + return wxGraphicsRenderer::GetDirect2DRenderer(); + #else + return NULL; + #endif + """) #--------------------------------------------- c = module.find('wxGraphicsMatrix') diff --git a/etg/grid.py b/etg/grid.py index 47c1e0ce..f2942dd2 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -395,6 +395,10 @@ def run(): c.find('SetValueAsCustom').ignore() + #----------------------------------------------------------------- + c = module.find('wxGridStringTable') + c.addPrivateCopyCtor() + #----------------------------------------------------------------- c = module.find('wxGridTableMessage') @@ -474,6 +478,9 @@ def run(): Grid.wxGridSelectRowsOrColumns = Grid.SelectRowsOrColumns """) + c.find('SetCellAlignment').findOverload('align').ignore() + c.find('SetCellTextColour').overloads = [] + #----------------------------------------------------------------- c = module.find('wxGridUpdateLocker') c.addPrivateCopyCtor() diff --git a/etg/htmltag.py b/etg/htmltag.py index e9d158c0..33e9e0f7 100644 --- a/etg/htmltag.py +++ b/etg/htmltag.py @@ -43,6 +43,10 @@ def run(): for m in c.findAll('ScanParam'): m.ignore() + c.find('GetBeginPos').ignore() + c.find('GetEndPos1').ignore() + c.find('GetEndPos2').ignore() + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/iconbndl.py b/etg/iconbndl.py index 56282666..f3c23a96 100644 --- a/etg/iconbndl.py +++ b/etg/iconbndl.py @@ -34,6 +34,11 @@ def run(): assert isinstance(c, etgtools.ClassDef) c.mustHaveApp() + # Ignore the overloads that require a WXHINSTANCE + c.find('wxIconBundle').findOverload('WXHINSTANCE').ignore() + c.find('AddIcon').findOverload('WXHINSTANCE').ignore() + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/log.py b/etg/log.py index 91944f9a..18cf0db2 100644 --- a/etg/log.py +++ b/etg/log.py @@ -88,6 +88,7 @@ def run(): c = module.find('wxLogStderr') c.find('wxLogStderr.fp').ignore() + c.find('wxLogStderr.conv').ignore() c.addPrivateCopyCtor() c.addPrivateAssignOp() diff --git a/etg/menu.py b/etg/menu.py index 23229f65..42129afa 100644 --- a/etg/menu.py +++ b/etg/menu.py @@ -155,7 +155,7 @@ def run(): GetMenus() -> (menu, label)\n Return a list of (menu, label) items for the menus in the :class:`MenuBar`.""", body="""\ - return [(self.GetMenu(i), self.GetLabelTop(i)) for i in range(self.GetMenuCount())] + return [(self.GetMenu(i), self.GetMenuLabel(i)) for i in range(self.GetMenuCount())] """) c.addPyMethod('SetMenus', '(self, items)', doc="""\ diff --git a/etg/notifmsg.py b/etg/notifmsg.py index 4dbdc1e9..5d1a15e3 100644 --- a/etg/notifmsg.py +++ b/etg/notifmsg.py @@ -34,6 +34,25 @@ def run(): c = module.find('wxNotificationMessage') assert isinstance(c, etgtools.ClassDef) + # take care of some methods only available on MSW + c.find('UseTaskBarIcon').setCppCode("""\ + #ifdef __WXMSW__ + return wxNotificationMessage::UseTaskBarIcon(icon); + #else + wxPyRaiseNotImplemented(); + return NULL; + #endif + """) + + c.find('MSWUseToasts').setCppCode("""\ + #ifdef __WXMSW__ + return wxNotificationMessage::MSWUseToasts(*shortcutPath, *appId); + #else + wxPyRaiseNotImplemented(); + return false; + #endif + """) + #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/odcombo.py b/etg/odcombo.py index aa08be45..7f241e8a 100644 --- a/etg/odcombo.py +++ b/etg/odcombo.py @@ -38,7 +38,7 @@ def run(): tools.fixWindowClass(c) - # Ignore the old C array verison of the ctor and Create methods, and + # Ignore the old C array version of the ctor and Create methods, and # fixup the remaining ctor and Create with the typical default values for # the args c.find('wxOwnerDrawnComboBox').findOverload('wxString choices').ignore() @@ -52,6 +52,7 @@ def run(): m.find('value').default = 'wxEmptyString' m.find('choices').default = 'wxArrayString()' + c.find('IsEmpty').ignore() # Unignore the protected methods that should be overridable in Python c.find('OnDrawBackground').ignore(False).isVirtual = True diff --git a/etg/propgrid.py b/etg/propgrid.py index 67f8a834..34471b2f 100644 --- a/etg/propgrid.py +++ b/etg/propgrid.py @@ -75,13 +75,6 @@ def run(): if hasattr(item, 'type') and item.type == 'wxPGPropArg': item.type = 'const wxPGPropArgCls &' - - td = module.find('wxPGVFBFlags') - assert isinstance(td, etgtools.TypedefDef) - td.type = 'unsigned char' - td.noTypeName = True - - c = module.find('wxPropertyGridEvent') tools.fixEventClass(c) @@ -102,13 +95,6 @@ def run(): EVT_PG_COL_END_DRAG = wx.PyEventBinder( wxEVT_PG_COL_END_DRAG, 1 ) """) - module.addItem(etgtools.WigCode("""\ - enum { - wxPG_SUBID1, - wxPG_SUBID2, - wxPG_SUBID_TEMP1, - }; - """)) # Switch all wxVariant types to wxPGVariant, so the propgrid-specific # version of the MappedType will be used for converting to/from Python @@ -118,6 +104,21 @@ def run(): item.type = item.type.replace('wxVariant', 'wxPGVariant') + # Switch wxPGVFBFlags to unsigned char + td = module.find('wxPGVFBFlags') + td.ignore() + + for name in ['wxPGValidationInfo.GetFailureBehavior', + 'wxPGValidationInfo.SetFailureBehavior.failureBehavior', + 'wxPropertyGridEvent.GetValidationFailureBehavior', + 'wxPropertyGridEvent.SetValidationFailureBehavior.flags', + ]: + item = module.find(name) + assert item.type == 'wxPGVFBFlags' + item.type = 'byte' + + + c = module.find('wxPropertyGridPopulator') tools.ignoreConstOverloads(c) diff --git a/etg/propgridiface.py b/etg/propgridiface.py index b74d96cf..12308004 100644 --- a/etg/propgridiface.py +++ b/etg/propgridiface.py @@ -32,6 +32,16 @@ def run(): # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. + # These are duplicates, ignore the ones in this module + module.find('wxPG_PROPERTYVALUES_FLAGS').ignore() + module.find('wxPG_LABEL').ignore() + module.find('wxPG_LABEL_STRING').ignore() + module.find('wxPG_COLOUR_BLACK').ignore() + module.find('wxPG_COLOUR').ignore() + module.find('wxPG_DEFAULT_IMAGE_SIZE').ignore() + + + #---------------------------------------------------------- c = module.find('wxPGPropArgCls') assert isinstance(c, etgtools.ClassDef) c.find('wxPGPropArgCls').findOverload('wxString &').ignore() @@ -103,13 +113,14 @@ def run(): #---------------------------------------------------------- - c = module.find('wxPropertyGridInterface') c.abstract = True for m in c.findAll('GetIterator'): if m.type == 'wxPropertyGridConstIterator': m.ignore() + tools.ignoreConstOverloads(c) + spv = c.find('SetPropertyValue') spv.findOverload('int value').ignore() spv.findOverload('wxLongLong_t value').ignore() @@ -134,6 +145,10 @@ def run(): for m in c.find('Insert').all(): m.find('newProperty').transfer = True + # Fix some syntax that sip doesn't like + p = c.find('GetPropertiesWithFlag.iterFlags') + if p.default.startswith('('): + p.default = p.default[1:-1] # Tons of Python method implementations ported from Classic... diff --git a/etg/propgridproperty.py b/etg/propgridproperty.py index e0505302..d31f9cf6 100644 --- a/etg/propgridproperty.py +++ b/etg/propgridproperty.py @@ -47,15 +47,33 @@ def run(): c.find('~wxPGCellData').ignore(False) c.bases = ['wxRefCounter'] + + #--------------------------------------------------------- + c = module.find('wxPGCell') + tools.ignoreConstOverloads(c) + + + #--------------------------------------------------------- c = module.find('wxPGCellRenderer') c.bases = ['wxRefCounter'] + #--------------------------------------------------------- + c = module.find('wxPGAttributeStorage') + c.find('const_iterator').ignore() + c.find('StartIteration').ignore() + c.find('GetNext').ignore() + + + #--------------------------------------------------------- c = module.find('wxPGProperty') tools.ignoreConstOverloads(c) + c.find('StringToValue.variant').out = True c.find('IntToValue.variant').out = True + c.find('HasFlag').findOverload('FlagType').ignore() + c.addProperty('m_value GetValue SetValue') @@ -151,6 +169,7 @@ def run(): ) + #--------------------------------------------------------- # Ignore some string constants (#defines) coming from dox, and add them # back in Python code. They are wchar_t* values and this seemed the # simplest way to deal with them. @@ -159,7 +178,6 @@ def run(): 'wxPG_ATTR_MAX', 'wxPG_ATTR_UNITS', 'wxPG_ATTR_HINT', - 'wxPG_ATTR_INLINE_HELP', 'wxPG_ATTR_AUTOCOMPLETE', 'wxPG_BOOL_USE_CHECKBOX', 'wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING', @@ -179,7 +197,7 @@ def run(): 'wxPG_DATE_PICKER_STYLE', 'wxPG_ATTR_SPINCTRL_STEP', 'wxPG_ATTR_SPINCTRL_WRAP', - 'wxPG_ATTR_SPINCTRL_MOTIONSPIN', + 'wxPG_ATTR_SPINCTRL_MOTION', 'wxPG_ATTR_MULTICHOICE_USERSTRINGMODE', 'wxPG_COLOUR_ALLOW_CUSTOM', 'wxPG_COLOUR_HAS_ALPHA', @@ -196,7 +214,7 @@ def run(): PG_ATTR_MAX = u"Max" PG_ATTR_UNITS = u"Units" PG_ATTR_HINT = u"Hint" - PG_ATTR_INLINE_HELP = u"InlineHelp" + PG_ATTR_INLINE_HELP = PG_ATTR_HINT PG_ATTR_AUTOCOMPLETE = u"AutoComplete" PG_BOOL_USE_CHECKBOX = u"UseCheckbox" PG_BOOL_USE_DOUBLE_CLICK_CYCLING = u"UseDClickCycling" @@ -216,7 +234,8 @@ def run(): PG_DATE_PICKER_STYLE = u"PickerStyle" PG_ATTR_SPINCTRL_STEP = u"Step" PG_ATTR_SPINCTRL_WRAP = u"Wrap" - PG_ATTR_SPINCTRL_MOTIONSPIN = u"MotionSpin" + PG_ATTR_SPINCTRL_MOTION = u"MotionSpin" + PG_ATTR_SPINCTRL_MOTIONSPIN = PG_ATTR_SPINCTRL_MOTION PG_ATTR_MULTICHOICE_USERSTRINGMODE= u"UserStringMode" PG_COLOUR_ALLOW_CUSTOM = u"AllowCustom" PG_COLOUR_HAS_ALPHA = u"HasAlpha" diff --git a/etg/ribbon_control.py b/etg/ribbon_control.py index ba4c93b6..bad187a1 100644 --- a/etg/ribbon_control.py +++ b/etg/ribbon_control.py @@ -33,12 +33,6 @@ def run(): module.addHeaderCode('#include ') - # Not sure why these are showing up in this module as they are in core, so - # let's just turn them off here... - module.find('wxEllipsizeFlags').ignore() - module.find('wxEllipsizeMode').ignore() - - c = module.find('wxRibbonControl') assert isinstance(c, etgtools.ClassDef) c.find('DoGetNextSmallerSize').ignore(False) diff --git a/etg/richtextbuffer.py b/etg/richtextbuffer.py index 3110a453..117702ee 100644 --- a/etg/richtextbuffer.py +++ b/etg/richtextbuffer.py @@ -321,6 +321,7 @@ def run(): #------------------------------------------------------- c = module.find('wxRichTextImage') _fixDrawObject(c) + c.find('LoadAndScaleImageCache.changed').inOut = True #------------------------------------------------------- c = module.find('wxRichTextBuffer') diff --git a/etg/srchctrl.py b/etg/srchctrl.py index b4950176..915e7505 100644 --- a/etg/srchctrl.py +++ b/etg/srchctrl.py @@ -113,12 +113,16 @@ def run(): tools.fixWindowClass(searchCtrl) module.addPyCode("""\ - EVT_SEARCHCTRL_CANCEL_BTN = wx.PyEventBinder( wxEVT_SEARCHCTRL_CANCEL_BTN, 1) - EVT_SEARCHCTRL_SEARCH_BTN = wx.PyEventBinder( wxEVT_SEARCHCTRL_SEARCH_BTN, 1) + EVT_SEARCH_CANCEL = wx.PyEventBinder( wxEVT_SEARCH_CANCEL, 1) + EVT_SEARCH = wx.PyEventBinder( wxEVT_SEARCH, 1) # deprecated wxEVT aliases + wxEVT_SEARCHCTRL_CANCEL_BTN = wxEVT_SEARCH_CANCEL + wxEVT_SEARCHCTRL_SEARCH_BTN = wxEVT_SEARCH wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN = wxEVT_SEARCHCTRL_CANCEL_BTN wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN = wxEVT_SEARCHCTRL_SEARCH_BTN + EVT_SEARCHCTRL_CANCEL_BTN = wx.PyEventBinder( wxEVT_SEARCHCTRL_CANCEL_BTN, 1) + EVT_SEARCHCTRL_SEARCH_BTN = wx.PyEventBinder( wxEVT_SEARCHCTRL_SEARCH_BTN, 1) """) #----------------------------------------------------------------- diff --git a/etg/statbox.py b/etg/statbox.py index a31691eb..779cb323 100644 --- a/etg/statbox.py +++ b/etg/statbox.py @@ -37,6 +37,21 @@ def run(): c.find('Create.label').default = 'wxEmptyString' tools.fixWindowClass(c) + # TODO: The window-label ctor is only available on MSW and GTK so disable + # for now. Maybe replace it with a factory function that returns None on + # OSX?? + c.find('wxStaticBox').findOverload('wxWindow *label').ignore() + c.find('Create').findOverload('wxWindow *label').ignore() + + # "unfix" the 2nd ctor and Create method so the required parameter lists + # are different enough for them to be overloaded. + #for name in ['wxStaticBox', 'Create']: + # m = c.find(name).findOverload('wxWindow *label') + # m.find('id').default = '' + + + + module.addGlobalStr('wxStaticBoxNameStr', c) #----------------------------------------------------------------- diff --git a/etg/stdpaths.py b/etg/stdpaths.py index 0c17ba3f..eb7ee3cd 100644 --- a/etg/stdpaths.py +++ b/etg/stdpaths.py @@ -53,13 +53,13 @@ def run(): """) c.find('SetInstallPrefix').setCppCode("""\ - #ifdef __WXMSW__ + #ifndef wxHAS_STDPATHS_INSTALL_PREFIX #else self->SetInstallPrefix(*prefix); #endif """) c.find('GetInstallPrefix').setCppCode("""\ - #ifdef __WXMSW__ + #ifndef wxHAS_STDPATHS_INSTALL_PREFIX return new wxString; #else return new wxString(self->GetInstallPrefix()); diff --git a/etg/toolbar.py b/etg/toolbar.py index f3c872b7..770069f6 100644 --- a/etg/toolbar.py +++ b/etg/toolbar.py @@ -71,8 +71,8 @@ def run(): #--------------------------------------------- c = module.find('wxToolBar') tools.fixWindowClass(c) + tools.ignoreConstOverloads(c) _fixClientData(c) - c.find('SetBitmapResource').ignore() module.addGlobalStr('wxToolBarNameStr', c) gcd = c.find('GetToolClientData') diff --git a/etg/toplevel.py b/etg/toplevel.py index f6f51768..382e446a 100644 --- a/etg/toplevel.py +++ b/etg/toplevel.py @@ -39,9 +39,6 @@ def run(): c.find('wxTopLevelWindow.title').default = 'wxEmptyString' c.find('Create.title').default = 'wxEmptyString' - c.find('HandleSettingChange').ignore() - c.find('SetLeftMenu').ignore() - c.find('SetRightMenu').ignore() c.find('IsUsingNativeDecorations').ignore() c.find('UseNativeDecorations').ignore() c.find('UseNativeDecorationsByDefault').ignore() diff --git a/etg/uiaction.py b/etg/uiaction.py index b0d9254b..bdb5cd11 100644 --- a/etg/uiaction.py +++ b/etg/uiaction.py @@ -33,7 +33,8 @@ def run(): c = module.find('wxUIActionSimulator') assert isinstance(c, etgtools.ClassDef) - + c.addPrivateCopyCtor() + c.addPrivateAssignOp() #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/webview.py b/etg/webview.py index cf045c94..2a821964 100644 --- a/etg/webview.py +++ b/etg/webview.py @@ -103,6 +103,13 @@ def run(): ## "sipCpp->LoadHistoryItem(wxSharedPtr(item));") + c.find('MSWSetModernEmulationLevel').setCppCode("""\ + #ifdef __WXMSW__ + return self->MSWSetModernEmulationLevel(modernLevel); + #else + return false; + #endif + """) diff --git a/sphinxtools/constants.py b/sphinxtools/constants.py index bc40ffd7..809c35b5 100644 --- a/sphinxtools/constants.py +++ b/sphinxtools/constants.py @@ -60,7 +60,9 @@ SECTIONS = [('return' , ':returns:'), ('note' , '.. note::'), ('see' , '.. seealso::'), ('todo' , '.. todo::'), - ('par' , '')] + ('pre' , ':precondition:'), + ('par' , '') + ] # List of things to remove/ignore (there may be more) @@ -256,10 +258,12 @@ DOXY_2_REST = [('@author:', '\n.. moduleauthor:: '), ('@kwarg', ':keyword'), ('@note:', '\n.. note:: '), ('@package:', '\n**Package:** '), - ('@package', '\n**Package:** '), + ('@package', '\n**Package:** '), ('@postcondition:', '\n:postcondition: '), ('@pre:', '\n:precondition: '), ('@precondition:', '\n:precondition: '), + ('@pre', '\n:precondition: '), + ('@precondition', '\n:precondition: '), ('@requires:', '\n:requires: '), ('@returns:', '\n:returns: '), ('@return:', '\n:returns: '),