From 8f238ad594c6eca31ed337e8d99b4718d3a543ee Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 25 Oct 2016 19:19:08 -0700 Subject: [PATCH 01/11] Begin adding wrappers for wx.aui --- docs/sphinx/itemToModuleMap.json | 29 +++++++++ etg/_aui.py | 67 +++++++++++++++++++++ etg/auiframemanager.py | 99 +++++++++++++++++++++++++++++++ ext/wxWidgets | 2 +- sphinxtools/constants.py | 1 + unittests/test_auiframemanager.py | 16 +++++ wscript | 9 +++ 7 files changed, 222 insertions(+), 1 deletion(-) create mode 100644 etg/_aui.py create mode 100644 etg/auiframemanager.py create mode 100644 unittests/test_auiframemanager.py diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index b51765b2..7a92323a 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -106,6 +106,23 @@ "ART_TOOLBAR":"wx.", "ART_UNDO":"wx.", "ART_WARNING":"wx.", +"AUI_DOCK_BOTTOM":"wx.aui.", +"AUI_DOCK_CENTER":"wx.aui.", +"AUI_DOCK_CENTRE":"wx.aui.", +"AUI_DOCK_LEFT":"wx.aui.", +"AUI_DOCK_NONE":"wx.aui.", +"AUI_DOCK_RIGHT":"wx.aui.", +"AUI_DOCK_TOP":"wx.aui.", +"AUI_MGR_ALLOW_ACTIVE_PANE":"wx.aui.", +"AUI_MGR_ALLOW_FLOATING":"wx.aui.", +"AUI_MGR_DEFAULT":"wx.aui.", +"AUI_MGR_HINT_FADE":"wx.aui.", +"AUI_MGR_LIVE_RESIZE":"wx.aui.", +"AUI_MGR_NO_VENETIAN_BLINDS_FADE":"wx.aui.", +"AUI_MGR_RECTANGLE_HINT":"wx.aui.", +"AUI_MGR_TRANSPARENT_DRAG":"wx.aui.", +"AUI_MGR_TRANSPARENT_HINT":"wx.aui.", +"AUI_MGR_VENETIAN_BLINDS_HINT":"wx.aui.", "Abort":"wx.", "AboutBox":"wx.adv.", "AboutDialogInfo":"wx.adv.", @@ -139,6 +156,11 @@ "AsIs":"wx.", "AssertHandler_t":"wx.", "AttrKind":"wx.grid.GridCellAttr.", +"AuiManager":"wx.aui.", +"AuiManagerDock":"wx.aui.", +"AuiManagerEvent":"wx.aui.", +"AuiManagerOption":"wx.aui.", +"AuiPaneInfo":"wx.aui.", "AutoBufferedPaintDC":"wx.", "AutoBufferedPaintDCFactory":"wx.", "BACKINGSTORE":"wx.", @@ -6121,6 +6143,13 @@ "wxEVT_ACTIVATE":"wx.", "wxEVT_ACTIVATE_APP":"wx.", "wxEVT_ANY":"wx.", +"wxEVT_AUI_FIND_MANAGER":"wx.aui.", +"wxEVT_AUI_PANE_ACTIVATED":"wx.aui.", +"wxEVT_AUI_PANE_BUTTON":"wx.aui.", +"wxEVT_AUI_PANE_CLOSE":"wx.aui.", +"wxEVT_AUI_PANE_MAXIMIZE":"wx.aui.", +"wxEVT_AUI_PANE_RESTORE":"wx.aui.", +"wxEVT_AUI_RENDER":"wx.aui.", "wxEVT_AUX1_DCLICK":"wx.", "wxEVT_AUX1_DOWN":"wx.", "wxEVT_AUX1_UP":"wx.", diff --git a/etg/_aui.py b/etg/_aui.py new file mode 100644 index 00000000..6ffea6c9 --- /dev/null +++ b/etg/_aui.py @@ -0,0 +1,67 @@ +#--------------------------------------------------------------------------- +# Name: etg/_aui.py +# Author: Robin Dunn +# +# Created: 25-Oct-2016 +# Copyright: (c) 2016 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_aui" +NAME = "_aui" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ ] + + +# The list of other ETG scripts and back-end generator modules that are +# included as part of this module. These should all be items that are put in +# the wxWidgets "aui" library in a multi-lib build. +INCLUDES = [ 'auiframemanager', + ] + + +# Separate the list into those that are generated from ETG scripts and the +# rest. These lists can be used from the build scripts to get a list of +# sources and/or additional dependencies when building this extension module. +ETGFILES = ['etg/%s.py' % NAME] + tools.getEtgFiles(INCLUDES) +DEPENDS = tools.getNonEtgFiles(INCLUDES) +OTHERDEPS = [ ] + + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + module.check4unittest = False + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + module.addHeaderCode('#include ') + module.addImport('_core') + module.addPyCode("import wx", order=10) + + module.addHeaderCode('#include ') + + module.addInclude(INCLUDES) + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + run() diff --git a/etg/auiframemanager.py b/etg/auiframemanager.py new file mode 100644 index 00000000..9e5d61fe --- /dev/null +++ b/etg/auiframemanager.py @@ -0,0 +1,99 @@ +#--------------------------------------------------------------------------- +# Name: etg/auiframemanager.py +# Author: Robin Dunn +# +# Created: 25-Oct-2016 +# Copyright: (c) 2016 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_aui" +NAME = "auiframemanager" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ 'wxAuiManager', + 'wxAuiPaneInfo', + 'wxAuiManagerEvent', + ] + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + + c = module.find('wxAuiManager') + assert isinstance(c, etgtools.ClassDef) + c.find('ProcessDockResult').ignore(False) + + c = module.find('wxAuiPaneInfo') + module.addItem( + tools.wxArrayWrapperTemplate( + 'wxAuiPaneInfoArray', 'wxAuiPaneInfo', module)) + + + c = module.find('wxAuiManagerEvent') + tools.fixEventClass(c) + + c.addPyCode("""\ + EVT_AUI_PANE_BUTTON = wx.PyEventBinder( wxEVT_AUI_PANE_BUTTON ) + EVT_AUI_PANE_CLOSE = wx.PyEventBinder( wxEVT_AUI_PANE_CLOSE ) + EVT_AUI_PANE_MAXIMIZE = wx.PyEventBinder( wxEVT_AUI_PANE_MAXIMIZE ) + EVT_AUI_PANE_RESTORE = wx.PyEventBinder( wxEVT_AUI_PANE_RESTORE ) + EVT_AUI_PANE_ACTIVATED = wx.PyEventBinder( wxEVT_AUI_PANE_ACTIVATED ) + EVT_AUI_RENDER = wx.PyEventBinder( wxEVT_AUI_RENDER ) + EVT_AUI_FIND_MANAGER = wx.PyEventBinder( wxEVT_AUI_FIND_MANAGER ) + """) + + + module.insertItem(0, etgtools.WigCode("""\ + // forward declarations + class wxAuiDockUIPart; + class wxAuiPaneButton; + class wxAuiDockInfo; + class wxAuiDockArt; + """)) + + + module.addItem( + tools.wxArrayWrapperTemplate( + 'wxAuiDockInfoArray', 'wxAuiDockInfo', module)) + + module.addItem( + tools.wxArrayWrapperTemplate( + 'wxAuiDockUIPartArray', 'wxAuiDockUIPart', module)) + + module.addItem( + tools.wxArrayWrapperTemplate( + 'wxAuiPaneButtonArray', 'wxAuiPaneButton', module)) + + # module.addItem( + # tools.wxArrayWrapperTemplate( + # 'wxAuiPaneInfoPtrArray', 'wxAuiPaneInfo*', module)) + # + # module.addItem( + # tools.wxArrayWrapperTemplate( + # 'wxAuiDockInfoPtrArray', 'wxAuiDockInfo*', module)) + + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/ext/wxWidgets b/ext/wxWidgets index 80e2614b..e9c8338c 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit 80e2614bacca94571716bcb0e2c35412425f67ce +Subproject commit e9c8338c8528311eee73c38201e9de6dd41b3fb3 diff --git a/sphinxtools/constants.py b/sphinxtools/constants.py index bf0e3a7b..27f59b11 100644 --- a/sphinxtools/constants.py +++ b/sphinxtools/constants.py @@ -85,6 +85,7 @@ MODULENAME_REPLACE = {'_core' : 'wx.', '_msw' : 'wx.msw.', '_ribbon' : 'wx.ribbon.', '_propgrid': 'wx.propgrid.', + '_aui' : 'wx.aui.', } diff --git a/unittests/test_auiframemanager.py b/unittests/test_auiframemanager.py new file mode 100644 index 00000000..29d2dcdb --- /dev/null +++ b/unittests/test_auiframemanager.py @@ -0,0 +1,16 @@ +import unittest +from unittests import wtc +import wx + +#--------------------------------------------------------------------------- + +class auiframemanager_Tests(wtc.WidgetTestCase): + + # TODO: Remove this test and add real ones. + def test_auiframemanager1(self): + self.fail("Unit tests for auiframemanager not implemented yet.") + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main() diff --git a/wscript b/wscript index ca588eee..acffca73 100644 --- a/wscript +++ b/wscript @@ -142,6 +142,9 @@ def configure(conf): _copyEnvGroup(conf.env, '_WX', '_WXPROPGRID') conf.env.LIB_WXPROPGRID += cfg.makeLibName('propgrid') + _copyEnvGroup(conf.env, '_WX', '_WXAUI') + conf.env.LIB_WXPAUI += cfg.makeLibName('aui') + # ** Add code for new modules here (and below for non-MSW) # tweak the PYEXT compile and link flags if making a --debug build @@ -236,6 +239,10 @@ def configure(conf): args='--cxxflags --libs propgrid,core' + rpath, uselib_store='WXPROPGRID', mandatory=True) + conf.check_cfg(path=conf.options.wx_config, package='', + args='--cxxflags --libs aui,core' + rpath, + uselib_store='WXAUI', mandatory=True) + # ** Add code for new modules here @@ -528,7 +535,9 @@ def build(bld): makeETGRule(bld, 'etg/_media.py', '_media', 'WXMEDIA') makeETGRule(bld, 'etg/_ribbon.py', '_ribbon', 'WXRIBBON') makeETGRule(bld, 'etg/_propgrid.py', '_propgrid', 'WXPROPGRID') + makeETGRule(bld, 'etg/_aui.py', '_aui', 'WXAUI') + # Modules that are platform-specific if isDarwin: makeETGRule(bld, 'etg/_webkit.py', '_webkit', 'WXWEBKIT') if isWindows: From 981c05d968dc9e4cb1a6fdafe161cc49eb0f2143 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 27 Oct 2016 08:38:02 -0700 Subject: [PATCH 02/11] Enable arraywWrapperTemplate to also be able to handle arrays of pointers to objects. --- etgtools/tweaker_tools.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index 8601a21b..e31129ab 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -954,10 +954,13 @@ del _{ListClass_pyName}___repr__ -def wxArrayWrapperTemplate(ArrayClass, ItemClass, module): +def wxArrayWrapperTemplate(ArrayClass, ItemClass, module, itemIsPtr=False): moduleName = module.module ArrayClass_pyName = removeWxPrefix(ArrayClass) - + itemRef = '*' if itemIsPtr else '&' + itemDeref = '' if itemIsPtr else '*' + addrOf = '' if itemIsPtr else '&' + # *** TODO: This can probably be done in a way that is not SIP-specfic. # Try creating extractor objects from scratch and attach cppMethods to # them as needed, etc.. @@ -971,10 +974,10 @@ public: sipRes = sipCpp->GetCount(); %End - {ItemClass}& __getitem__(ulong index); + {ItemClass}{itemRef} __getitem__(ulong index); %MethodCode if (index < sipCpp->GetCount()) {{ - sipRes = &sipCpp->Item(index); + sipRes = {addrOf}sipCpp->Item(index); }} else {{ wxPyErr_SetString(PyExc_IndexError, "sequence index out of range"); @@ -982,21 +985,21 @@ public: }} %End - int __contains__(const {ItemClass}& obj); + int __contains__({ItemClass}{itemRef} obj); %MethodCode - int idx = sipCpp->Index(*obj, false); + int idx = sipCpp->Index({itemDeref}obj, false); sipRes = idx != wxNOT_FOUND; %End - void append(const {ItemClass}& obj); + void append({ItemClass}{itemRef} obj); %MethodCode - sipCpp->Add(*obj); + sipCpp->Add({itemDeref}obj); %End // TODO: add support for index(value, [start, [stop]]) - int index(const {ItemClass}& obj); + int index({ItemClass}{itemRef} obj); %MethodCode - int idx = sipCpp->Index(*obj, false); + int idx = sipCpp->Index({itemDeref}obj, false); if (idx == wxNOT_FOUND) {{ sipError = sipErrorFail; wxPyErr_SetString(PyExc_ValueError, From 5268ebbc736effe07f8582a1fe2e1db7f2f3164b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 27 Oct 2016 18:49:41 -0700 Subject: [PATCH 03/11] Add the rest of the AUI modules and classes --- docs/sphinx/itemToModuleMap.json | 122 +++++++++++++++++++++++++++++++ etg/_aui.py | 4 + etg/auibar.py | 67 +++++++++++++++++ etg/auibook.py | 89 ++++++++++++++++++++++ etg/auidockart.py | 48 ++++++++++++ etg/auiframemanager.py | 33 +++------ etg/auitabmdi.py | 59 +++++++++++++++ etg/frame.py | 12 +-- etg/statusbar.py | 12 +-- etgtools/tweaker_tools.py | 18 ++++- ext/wxWidgets | 2 +- unittests/test_auibar.py | 16 ++++ unittests/test_auibook.py | 16 ++++ unittests/test_auidockart.py | 16 ++++ unittests/test_auitabmdi.py | 16 ++++ wscript | 2 +- 16 files changed, 486 insertions(+), 46 deletions(-) create mode 100644 etg/auibar.py create mode 100644 etg/auibook.py create mode 100644 etg/auidockart.py create mode 100644 etg/auitabmdi.py create mode 100644 unittests/test_auibar.py create mode 100644 unittests/test_auibook.py create mode 100644 unittests/test_auidockart.py create mode 100644 unittests/test_auitabmdi.py diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index 7a92323a..189a8c75 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -106,6 +106,42 @@ "ART_TOOLBAR":"wx.", "ART_UNDO":"wx.", "ART_WARNING":"wx.", +"AUI_BUTTON_CLOSE":"wx.aui.", +"AUI_BUTTON_CUSTOM1":"wx.aui.", +"AUI_BUTTON_CUSTOM2":"wx.aui.", +"AUI_BUTTON_CUSTOM3":"wx.aui.", +"AUI_BUTTON_DOWN":"wx.aui.", +"AUI_BUTTON_LEFT":"wx.aui.", +"AUI_BUTTON_MAXIMIZE_RESTORE":"wx.aui.", +"AUI_BUTTON_MINIMIZE":"wx.aui.", +"AUI_BUTTON_OPTIONS":"wx.aui.", +"AUI_BUTTON_PIN":"wx.aui.", +"AUI_BUTTON_RIGHT":"wx.aui.", +"AUI_BUTTON_STATE_CHECKED":"wx.aui.", +"AUI_BUTTON_STATE_DISABLED":"wx.aui.", +"AUI_BUTTON_STATE_HIDDEN":"wx.aui.", +"AUI_BUTTON_STATE_HOVER":"wx.aui.", +"AUI_BUTTON_STATE_NORMAL":"wx.aui.", +"AUI_BUTTON_STATE_PRESSED":"wx.aui.", +"AUI_BUTTON_UP":"wx.aui.", +"AUI_BUTTON_WINDOWLIST":"wx.aui.", +"AUI_DOCKART_ACTIVE_CAPTION_COLOUR":"wx.aui.", +"AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR":"wx.aui.", +"AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR":"wx.aui.", +"AUI_DOCKART_BACKGROUND_COLOUR":"wx.aui.", +"AUI_DOCKART_BORDER_COLOUR":"wx.aui.", +"AUI_DOCKART_CAPTION_FONT":"wx.aui.", +"AUI_DOCKART_CAPTION_SIZE":"wx.aui.", +"AUI_DOCKART_GRADIENT_TYPE":"wx.aui.", +"AUI_DOCKART_GRIPPER_COLOUR":"wx.aui.", +"AUI_DOCKART_GRIPPER_SIZE":"wx.aui.", +"AUI_DOCKART_INACTIVE_CAPTION_COLOUR":"wx.aui.", +"AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR":"wx.aui.", +"AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR":"wx.aui.", +"AUI_DOCKART_PANE_BORDER_SIZE":"wx.aui.", +"AUI_DOCKART_PANE_BUTTON_SIZE":"wx.aui.", +"AUI_DOCKART_SASH_COLOUR":"wx.aui.", +"AUI_DOCKART_SASH_SIZE":"wx.aui.", "AUI_DOCK_BOTTOM":"wx.aui.", "AUI_DOCK_CENTER":"wx.aui.", "AUI_DOCK_CENTRE":"wx.aui.", @@ -113,6 +149,9 @@ "AUI_DOCK_NONE":"wx.aui.", "AUI_DOCK_RIGHT":"wx.aui.", "AUI_DOCK_TOP":"wx.aui.", +"AUI_GRADIENT_HORIZONTAL":"wx.aui.", +"AUI_GRADIENT_NONE":"wx.aui.", +"AUI_GRADIENT_VERTICAL":"wx.aui.", "AUI_MGR_ALLOW_ACTIVE_PANE":"wx.aui.", "AUI_MGR_ALLOW_FLOATING":"wx.aui.", "AUI_MGR_DEFAULT":"wx.aui.", @@ -123,6 +162,40 @@ "AUI_MGR_TRANSPARENT_DRAG":"wx.aui.", "AUI_MGR_TRANSPARENT_HINT":"wx.aui.", "AUI_MGR_VENETIAN_BLINDS_HINT":"wx.aui.", +"AUI_NB_BOTTOM":"wx.aui.", +"AUI_NB_CLOSE_BUTTON":"wx.aui.", +"AUI_NB_CLOSE_ON_ACTIVE_TAB":"wx.aui.", +"AUI_NB_CLOSE_ON_ALL_TABS":"wx.aui.", +"AUI_NB_DEFAULT_STYLE":"wx.aui.", +"AUI_NB_LEFT":"wx.aui.", +"AUI_NB_MIDDLE_CLICK_CLOSE":"wx.aui.", +"AUI_NB_RIGHT":"wx.aui.", +"AUI_NB_SCROLL_BUTTONS":"wx.aui.", +"AUI_NB_TAB_EXTERNAL_MOVE":"wx.aui.", +"AUI_NB_TAB_FIXED_WIDTH":"wx.aui.", +"AUI_NB_TAB_MOVE":"wx.aui.", +"AUI_NB_TAB_SPLIT":"wx.aui.", +"AUI_NB_TOP":"wx.aui.", +"AUI_NB_WINDOWLIST_BUTTON":"wx.aui.", +"AUI_ORIENTATION_MASK":"wx.aui.", +"AUI_TBART_GRIPPER_SIZE":"wx.aui.", +"AUI_TBART_OVERFLOW_SIZE":"wx.aui.", +"AUI_TBART_SEPARATOR_SIZE":"wx.aui.", +"AUI_TBTOOL_TEXT_BOTTOM":"wx.aui.", +"AUI_TBTOOL_TEXT_LEFT":"wx.aui.", +"AUI_TBTOOL_TEXT_RIGHT":"wx.aui.", +"AUI_TBTOOL_TEXT_TOP":"wx.aui.", +"AUI_TB_DEFAULT_STYLE":"wx.aui.", +"AUI_TB_GRIPPER":"wx.aui.", +"AUI_TB_HORIZONTAL":"wx.aui.", +"AUI_TB_HORZ_LAYOUT":"wx.aui.", +"AUI_TB_HORZ_TEXT":"wx.aui.", +"AUI_TB_NO_AUTORESIZE":"wx.aui.", +"AUI_TB_NO_TOOLTIPS":"wx.aui.", +"AUI_TB_OVERFLOW":"wx.aui.", +"AUI_TB_PLAIN_BACKGROUND":"wx.aui.", +"AUI_TB_TEXT":"wx.aui.", +"AUI_TB_VERTICAL":"wx.aui.", "Abort":"wx.", "AboutBox":"wx.adv.", "AboutDialogInfo":"wx.adv.", @@ -156,11 +229,40 @@ "AsIs":"wx.", "AssertHandler_t":"wx.", "AttrKind":"wx.grid.GridCellAttr.", +"AuiButtonId":"wx.aui.", +"AuiDefaultDockArt":"wx.aui.", +"AuiDefaultTabArt":"wx.aui.", +"AuiDefaultToolBarArt":"wx.aui.", +"AuiDockArt":"wx.aui.", +"AuiDockInfo":"wx.aui.", +"AuiDockUIPart":"wx.aui.", +"AuiMDIChildFrame":"wx.aui.", +"AuiMDIClientWindow":"wx.aui.", +"AuiMDIParentFrame":"wx.aui.", "AuiManager":"wx.aui.", "AuiManagerDock":"wx.aui.", "AuiManagerEvent":"wx.aui.", "AuiManagerOption":"wx.aui.", +"AuiNotebook":"wx.aui.", +"AuiNotebookEvent":"wx.aui.", +"AuiNotebookOption":"wx.aui.", +"AuiNotebookPage":"wx.aui.", +"AuiPaneButton":"wx.aui.", +"AuiPaneButtonState":"wx.aui.", +"AuiPaneDockArtGradients":"wx.aui.", +"AuiPaneDockArtSetting":"wx.aui.", "AuiPaneInfo":"wx.aui.", +"AuiSimpleTabArt":"wx.aui.", +"AuiTabArt":"wx.aui.", +"AuiTabContainer":"wx.aui.", +"AuiTabContainerButton":"wx.aui.", +"AuiToolBar":"wx.aui.", +"AuiToolBarArt":"wx.aui.", +"AuiToolBarArtSetting":"wx.aui.", +"AuiToolBarEvent":"wx.aui.", +"AuiToolBarItem":"wx.aui.", +"AuiToolBarStyle":"wx.aui.", +"AuiToolBarToolTextOrientation":"wx.aui.", "AutoBufferedPaintDC":"wx.", "AutoBufferedPaintDCFactory":"wx.", "BACKINGSTORE":"wx.", @@ -6143,6 +6245,26 @@ "wxEVT_ACTIVATE":"wx.", "wxEVT_ACTIVATE_APP":"wx.", "wxEVT_ANY":"wx.", +"wxEVT_AUINOTEBOOK_ALLOW_DND":"wx.aui.", +"wxEVT_AUINOTEBOOK_BEGIN_DRAG":"wx.aui.", +"wxEVT_AUINOTEBOOK_BG_DCLICK":"wx.aui.", +"wxEVT_AUINOTEBOOK_BUTTON":"wx.aui.", +"wxEVT_AUINOTEBOOK_DRAG_DONE":"wx.aui.", +"wxEVT_AUINOTEBOOK_DRAG_MOTION":"wx.aui.", +"wxEVT_AUINOTEBOOK_END_DRAG":"wx.aui.", +"wxEVT_AUINOTEBOOK_PAGE_CHANGED":"wx.aui.", +"wxEVT_AUINOTEBOOK_PAGE_CHANGING":"wx.aui.", +"wxEVT_AUINOTEBOOK_PAGE_CLOSE":"wx.aui.", +"wxEVT_AUINOTEBOOK_PAGE_CLOSED":"wx.aui.", +"wxEVT_AUINOTEBOOK_TAB_MIDDLE_DOWN":"wx.aui.", +"wxEVT_AUINOTEBOOK_TAB_MIDDLE_UP":"wx.aui.", +"wxEVT_AUINOTEBOOK_TAB_RIGHT_DOWN":"wx.aui.", +"wxEVT_AUINOTEBOOK_TAB_RIGHT_UP":"wx.aui.", +"wxEVT_AUITOOLBAR_BEGIN_DRAG":"wx.aui.", +"wxEVT_AUITOOLBAR_MIDDLE_CLICK":"wx.aui.", +"wxEVT_AUITOOLBAR_OVERFLOW_CLICK":"wx.aui.", +"wxEVT_AUITOOLBAR_RIGHT_CLICK":"wx.aui.", +"wxEVT_AUITOOLBAR_TOOL_DROPDOWN":"wx.aui.", "wxEVT_AUI_FIND_MANAGER":"wx.aui.", "wxEVT_AUI_PANE_ACTIVATED":"wx.aui.", "wxEVT_AUI_PANE_BUTTON":"wx.aui.", diff --git a/etg/_aui.py b/etg/_aui.py index 6ffea6c9..75f9c17f 100644 --- a/etg/_aui.py +++ b/etg/_aui.py @@ -24,6 +24,10 @@ ITEMS = [ ] # included as part of this module. These should all be items that are put in # the wxWidgets "aui" library in a multi-lib build. INCLUDES = [ 'auiframemanager', + 'auidockart', + 'auibar', + 'auibook', + 'auitabmdi', ] diff --git a/etg/auibar.py b/etg/auibar.py new file mode 100644 index 00000000..c8ebb655 --- /dev/null +++ b/etg/auibar.py @@ -0,0 +1,67 @@ +#--------------------------------------------------------------------------- +# Name: etg/auibar.py +# Author: Robin Dunn +# +# Created: 26-Oct-2016 +# Copyright: (c) 2016 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_aui" +NAME = "auibar" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ 'wxAuiToolBarItem', + 'wxAuiToolBarArt', + 'wxAuiDefaultToolBarArt', + 'wxAuiToolBar', + 'wxAuiToolBarEvent', + ] + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + c = module.find('wxAuiToolBar') + assert isinstance(c, etgtools.ClassDef) + tools.fixWindowClass(c) + + + c = module.find('wxAuiToolBarEvent') + tools.fixEventClass(c) + + c.addPyCode("""\ + EVT_AUITOOLBAR_TOOL_DROPDOWN = wx.PyEventBinder( wxEVT_AUITOOLBAR_TOOL_DROPDOWN, 1 ) + EVT_AUITOOLBAR_OVERFLOW_CLICK = wx.PyEventBinder( wxEVT_AUITOOLBAR_OVERFLOW_CLICK, 1 ) + EVT_AUITOOLBAR_RIGHT_CLICK = wx.PyEventBinder( wxEVT_AUITOOLBAR_RIGHT_CLICK, 1 ) + EVT_AUITOOLBAR_MIDDLE_CLICK = wx.PyEventBinder( wxEVT_AUITOOLBAR_MIDDLE_CLICK, 1 ) + EVT_AUITOOLBAR_BEGIN_DRAG = wx.PyEventBinder( wxEVT_AUITOOLBAR_BEGIN_DRAG, 1 ) + """) + + + module.addItem(tools.wxArrayWrapperTemplate( + 'wxAuiToolBarItemArray', 'wxAuiToolBarItem', module)) + + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/etg/auibook.py b/etg/auibook.py new file mode 100644 index 00000000..16b97b0a --- /dev/null +++ b/etg/auibook.py @@ -0,0 +1,89 @@ +#--------------------------------------------------------------------------- +# Name: etg/auibook.py +# Author: Robin Dunn +# +# Created: 26-Oct-2016 +# Copyright: (c) 2016 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_aui" +NAME = "auibook" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ 'wxAuiNotebook', + 'wxAuiNotebookPage', + 'wxAuiTabContainerButton', + 'wxAuiTabContainer', + 'wxAuiTabArt', + 'wxAuiDefaultTabArt', + 'wxAuiSimpleTabArt', + 'wxAuiNotebookEvent', + ] + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + + c = module.find('wxAuiNotebook') + assert isinstance(c, etgtools.ClassDef) + tools.fixWindowClass(c) + + c = module.find('wxAuiTabContainer') + tools.ignoreConstOverloads(c) + + module.addItem(tools.wxArrayWrapperTemplate( + 'wxAuiNotebookPageArray', 'wxAuiNotebookPage', module)) + + module.addItem(tools.wxArrayWrapperTemplate( + 'wxAuiTabContainerButtonArray', 'wxAuiTabContainerButton', module)) + + c = module.find('wxAuiTabArt') + c.abstract = True + + c = module.find('wxAuiNotebookEvent') + tools.fixEventClass(c) + c.addPyCode("""\ + EVT_AUINOTEBOOK_PAGE_CLOSE = wx.PyEventBinder( wxEVT_AUINOTEBOOK_PAGE_CLOSE, 1 ) + EVT_AUINOTEBOOK_PAGE_CLOSED = wx.PyEventBinder( wxEVT_AUINOTEBOOK_PAGE_CLOSED, 1 ) + EVT_AUINOTEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_AUINOTEBOOK_PAGE_CHANGED, 1 ) + EVT_AUINOTEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_AUINOTEBOOK_PAGE_CHANGING, 1 ) + EVT_AUINOTEBOOK_BUTTON = wx.PyEventBinder( wxEVT_AUINOTEBOOK_BUTTON, 1 ) + EVT_AUINOTEBOOK_BEGIN_DRAG = wx.PyEventBinder( wxEVT_AUINOTEBOOK_BEGIN_DRAG, 1 ) + EVT_AUINOTEBOOK_END_DRAG = wx.PyEventBinder( wxEVT_AUINOTEBOOK_END_DRAG, 1 ) + EVT_AUINOTEBOOK_DRAG_MOTION = wx.PyEventBinder( wxEVT_AUINOTEBOOK_DRAG_MOTION, 1 ) + EVT_AUINOTEBOOK_ALLOW_DND = wx.PyEventBinder( wxEVT_AUINOTEBOOK_ALLOW_DND, 1 ) + EVT_AUINOTEBOOK_DRAG_DONE = wx.PyEventBinder( wxEVT_AUINOTEBOOK_DRAG_DONE, 1 ) + EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_AUINOTEBOOK_TAB_MIDDLE_DOWN, 1 ) + EVT_AUINOTEBOOK_TAB_MIDDLE_UP = wx.PyEventBinder( wxEVT_AUINOTEBOOK_TAB_MIDDLE_UP, 1 ) + EVT_AUINOTEBOOK_TAB_RIGHT_DOWN = wx.PyEventBinder( wxEVT_AUINOTEBOOK_TAB_RIGHT_DOWN, 1 ) + EVT_AUINOTEBOOK_TAB_RIGHT_UP = wx.PyEventBinder( wxEVT_AUINOTEBOOK_TAB_RIGHT_UP, 1 ) + EVT_AUINOTEBOOK_BG_DCLICK = wx.PyEventBinder( wxEVT_AUINOTEBOOK_BG_DCLICK, 1 ) + """) + + + + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/etg/auidockart.py b/etg/auidockart.py new file mode 100644 index 00000000..37a0bb23 --- /dev/null +++ b/etg/auidockart.py @@ -0,0 +1,48 @@ +#--------------------------------------------------------------------------- +# Name: etg/auidockart.py +# Author: Robin Dunn +# +# Created: 26-Oct-2016 +# Copyright: (c) 2016 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_aui" +NAME = "auidockart" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ 'wxAuiDockArt', + 'wxAuiDefaultDockArt', + ] + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + + c = module.find('wxAuiDockArt') + assert isinstance(c, etgtools.ClassDef) + + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/etg/auiframemanager.py b/etg/auiframemanager.py index 9e5d61fe..80a02a8e 100644 --- a/etg/auiframemanager.py +++ b/etg/auiframemanager.py @@ -20,6 +20,9 @@ DOCSTRING = "" ITEMS = [ 'wxAuiManager', 'wxAuiPaneInfo', 'wxAuiManagerEvent', + 'wxAuiDockInfo', + 'wxAuiDockUIPart', + 'wxAuiPaneButton', ] #--------------------------------------------------------------------------- @@ -58,34 +61,20 @@ def run(): """) - module.insertItem(0, etgtools.WigCode("""\ - // forward declarations - class wxAuiDockUIPart; - class wxAuiPaneButton; - class wxAuiDockInfo; - class wxAuiDockArt; - """)) - - - module.addItem( - tools.wxArrayWrapperTemplate( + module.addItem(tools.wxArrayWrapperTemplate( 'wxAuiDockInfoArray', 'wxAuiDockInfo', module)) - module.addItem( - tools.wxArrayWrapperTemplate( + module.addItem(tools.wxArrayWrapperTemplate( 'wxAuiDockUIPartArray', 'wxAuiDockUIPart', module)) - module.addItem( - tools.wxArrayWrapperTemplate( + module.addItem(tools.wxArrayWrapperTemplate( 'wxAuiPaneButtonArray', 'wxAuiPaneButton', module)) - # module.addItem( - # tools.wxArrayWrapperTemplate( - # 'wxAuiPaneInfoPtrArray', 'wxAuiPaneInfo*', module)) - # - # module.addItem( - # tools.wxArrayWrapperTemplate( - # 'wxAuiDockInfoPtrArray', 'wxAuiDockInfo*', module)) + module.addItem(tools.wxArrayWrapperTemplate( + 'wxAuiPaneInfoPtrArray', 'wxAuiPaneInfo', module, itemIsPtr=True)) + + module.addItem(tools.wxArrayWrapperTemplate( + 'wxAuiDockInfoPtrArray', 'wxAuiDockInfo', module, itemIsPtr=True)) #----------------------------------------------------------------- diff --git a/etg/auitabmdi.py b/etg/auitabmdi.py new file mode 100644 index 00000000..ced4cf2c --- /dev/null +++ b/etg/auitabmdi.py @@ -0,0 +1,59 @@ +#--------------------------------------------------------------------------- +# Name: etg/auitabmdi.py +# Author: Robin Dunn +# +# Created: 27-Oct-2016 +# Copyright: (c) 2016 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_aui" +NAME = "auitabmdi" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ 'wxAuiMDIParentFrame', + 'wxAuiMDIChildFrame', + 'wxAuiMDIClientWindow', + ] + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + + c = module.find('wxAuiMDIParentFrame') + assert isinstance(c, etgtools.ClassDef) + tools.fixTopLevelWindowClass(c) + + + c = module.find('wxAuiMDIChildFrame') + tools.fixTopLevelWindowClass(c) + tools.fixSetStatusWidths(c.find('SetStatusWidths')) + + + c = module.find('wxAuiMDIClientWindow') + tools.fixWindowClass(c) + + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/etg/frame.py b/etg/frame.py index 37378633..ce33fa01 100644 --- a/etg/frame.py +++ b/etg/frame.py @@ -40,16 +40,8 @@ def run(): # We already have a MappedType for wxArrayInt, so just tweak the # interface to use that instead of an array size and a const int pointer. - m = c.find('SetStatusWidths') - m.find('n').ignore() - m.find('widths_field').type = 'const wxArrayInt&' - m.find('widths_field').name = 'widths' - m.argsString = '(int n, const wxArrayInt& widths)' - m.setCppCode("""\ - const int* ptr = &widths->front(); - self->SetStatusWidths(widths->size(), ptr); - """) - + tools.fixSetStatusWidths(c.find('SetStatusWidths')) + c.addProperty('MenuBar GetMenuBar SetMenuBar') c.addProperty('StatusBar GetStatusBar SetStatusBar') c.addProperty('StatusBarPane GetStatusBarPane SetStatusBarPane') diff --git a/etg/statusbar.py b/etg/statusbar.py index d51db207..d94004ca 100644 --- a/etg/statusbar.py +++ b/etg/statusbar.py @@ -37,16 +37,8 @@ def run(): # We already have a MappedType for wxArrayInt, so just tweak the # interface to use that instead of an array size and a const int pointer. - m = c.find('SetStatusWidths') - m.find('n').ignore() - m.find('widths_field').type = 'const wxArrayInt&' - m.find('widths_field').name = 'widths' - m.argsString = '(int n, const wxArrayInt& widths)' - m.setCppCode("""\ - const int* ptr = &widths->front(); - self->SetStatusWidths(widths->size(), ptr); - """) - + tools.fixSetStatusWidths(c.find('SetStatusWidths')) + # Same thing for SetStatusStyles m = c.find('SetStatusStyles') m.find('n').ignore() diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index e31129ab..b36a0170 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -344,7 +344,21 @@ def fixHtmlSetFonts(klass): } self->SetFonts(*normal_face, *fixed_face, &sizes->Item(0)); """) - + + +def fixSetStatusWidths(m): + # We already have a MappedType for wxArrayInt, so just tweak the + # interface to use that instead of an array size and a const int pointer. + m.find('n').ignore() + m.find('widths_field').type = 'const wxArrayInt&' + m.find('widths_field').name = 'widths' + m.argsString = '(int n, const wxArrayInt& widths)' + m.setCppCode("""\ + const int* ptr = &widths->front(); + self->SetStatusWidths(widths->size(), ptr); + """) + + def removeVirtuals(klass): """ @@ -360,7 +374,7 @@ def removeVirtuals(klass): def addWindowVirtuals(klass): """ - Either turn the virtual flag back on or add a delcaration for the subset of + Either turn the virtual flag back on or add a declaration for the subset of the C++ virtuals in wxWindow classes that we will be supporting. """ publicWindowVirtuals = [ diff --git a/ext/wxWidgets b/ext/wxWidgets index e9c8338c..4926148e 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit e9c8338c8528311eee73c38201e9de6dd41b3fb3 +Subproject commit 4926148ec91b91fce1cae75a236e6db75d8db52d diff --git a/unittests/test_auibar.py b/unittests/test_auibar.py new file mode 100644 index 00000000..793f8466 --- /dev/null +++ b/unittests/test_auibar.py @@ -0,0 +1,16 @@ +import unittest +from unittests import wtc +import wx + +#--------------------------------------------------------------------------- + +class auibar_Tests(wtc.WidgetTestCase): + + # TODO: Remove this test and add real ones. + def test_auibar1(self): + self.fail("Unit tests for auibar not implemented yet.") + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main() diff --git a/unittests/test_auibook.py b/unittests/test_auibook.py new file mode 100644 index 00000000..12c72b57 --- /dev/null +++ b/unittests/test_auibook.py @@ -0,0 +1,16 @@ +import unittest +from unittests import wtc +import wx + +#--------------------------------------------------------------------------- + +class auibook_Tests(wtc.WidgetTestCase): + + # TODO: Remove this test and add real ones. + def test_auibook1(self): + self.fail("Unit tests for auibook not implemented yet.") + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main() diff --git a/unittests/test_auidockart.py b/unittests/test_auidockart.py new file mode 100644 index 00000000..390fff77 --- /dev/null +++ b/unittests/test_auidockart.py @@ -0,0 +1,16 @@ +import unittest +from unittests import wtc +import wx + +#--------------------------------------------------------------------------- + +class auidockart_Tests(wtc.WidgetTestCase): + + # TODO: Remove this test and add real ones. + def test_auidockart1(self): + self.fail("Unit tests for auidockart not implemented yet.") + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main() diff --git a/unittests/test_auitabmdi.py b/unittests/test_auitabmdi.py new file mode 100644 index 00000000..7eac2376 --- /dev/null +++ b/unittests/test_auitabmdi.py @@ -0,0 +1,16 @@ +import unittest +from unittests import wtc +import wx + +#--------------------------------------------------------------------------- + +class auitabmdi_Tests(wtc.WidgetTestCase): + + # TODO: Remove this test and add real ones. + def test_auitabmdi1(self): + self.fail("Unit tests for auitabmdi not implemented yet.") + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main() diff --git a/wscript b/wscript index acffca73..35ee041e 100644 --- a/wscript +++ b/wscript @@ -535,7 +535,7 @@ def build(bld): makeETGRule(bld, 'etg/_media.py', '_media', 'WXMEDIA') makeETGRule(bld, 'etg/_ribbon.py', '_ribbon', 'WXRIBBON') makeETGRule(bld, 'etg/_propgrid.py', '_propgrid', 'WXPROPGRID') - makeETGRule(bld, 'etg/_aui.py', '_aui', 'WXAUI') + makeETGRule(bld, 'etg/_aui.py', '_aui', 'WXAUI') # Modules that are platform-specific if isDarwin: From e4e8eee165816b084ba86fcbfb9b87eb6ab0b1fa Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Oct 2016 14:22:59 -0700 Subject: [PATCH 04/11] Add stockitem for wxGetStockLabel() --- docs/sphinx/itemToModuleMap.json | 7 +++++ etg/_core.py | 1 + etg/stockitem.py | 44 ++++++++++++++++++++++++++++++++ unittests/test_stockitem.py | 16 ++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 etg/stockitem.py create mode 100644 unittests/test_stockitem.py diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index 189a8c75..2d8b0f4f 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -1249,6 +1249,7 @@ "GetSingleChoice":"wx.", "GetSingleChoiceData":"wx.", "GetSingleChoiceIndex":"wx.", +"GetStockLabel":"wx.", "GetTextFromUser":"wx.", "GetTextFromUserPromptStr":"wx.", "GetTopLevelParent":"wx.", @@ -5303,6 +5304,11 @@ "STC_YAML_OPERATOR":"wx.stc.", "STC_YAML_REFERENCE":"wx.stc.", "STC_YAML_TEXT":"wx.stc.", +"STOCK_FOR_BUTTON":"wx.", +"STOCK_NOFLAGS":"wx.", +"STOCK_WITHOUT_ELLIPSIS":"wx.", +"STOCK_WITH_ACCELERATOR":"wx.", +"STOCK_WITH_MNEMONIC":"wx.", "STREAM_EOF":"wx.", "STREAM_NO_ERROR":"wx.", "STREAM_READ_ERROR":"wx.", @@ -5491,6 +5497,7 @@ "StatusBarPane":"wx.", "StdDialogButtonSizer":"wx.", "StockCursor":"wx.", +"StockLabelQueryFlag":"wx.", "StockPreferencesPage":"wx.", "StopWatch":"wx.", "StreamBase":"wx.", diff --git a/etg/_core.py b/etg/_core.py index 00845fff..db6c6f14 100644 --- a/etg/_core.py +++ b/etg/_core.py @@ -228,6 +228,7 @@ INCLUDES = [ # base and core stuff 'preferences', 'modalhook', 'unichar', + 'stockitem', ] diff --git a/etg/stockitem.py b/etg/stockitem.py new file mode 100644 index 00000000..c66bee80 --- /dev/null +++ b/etg/stockitem.py @@ -0,0 +1,44 @@ +#--------------------------------------------------------------------------- +# Name: etg/stockitem.py +# Author: Robin Dunn +# +# Created: 28-Oct-2016 +# Copyright: (c) 2016 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_core" +NAME = "stockitem" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ 'stockitem_8h.xml', + ] + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/unittests/test_stockitem.py b/unittests/test_stockitem.py new file mode 100644 index 00000000..751eb41a --- /dev/null +++ b/unittests/test_stockitem.py @@ -0,0 +1,16 @@ +import unittest +from unittests import wtc +import wx + +#--------------------------------------------------------------------------- + +class stockitem_Tests(wtc.WidgetTestCase): + + # TODO: Remove this test and add real ones. + def test_stockitem1(self): + self.fail("Unit tests for stockitem not implemented yet.") + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main() From bffa49bfa176c4534e4927f29d8f28397dd1def5 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Oct 2016 14:24:58 -0700 Subject: [PATCH 05/11] Update AUI_DockingWindowMgr demo --- demo/AUI_DockingWindowMgr.py | 82 +++++++++++++++++------------------- ext/wxWidgets | 2 +- 2 files changed, 40 insertions(+), 44 deletions(-) diff --git a/demo/AUI_DockingWindowMgr.py b/demo/AUI_DockingWindowMgr.py index c9b3461d..0a0dda4f 100644 --- a/demo/AUI_DockingWindowMgr.py +++ b/demo/AUI_DockingWindowMgr.py @@ -7,11 +7,7 @@ import wx import wx.grid import wx.html - -try: - from agw import aui -except ImportError: # if it's not there locally, try the wxPython lib. - import wx.lib.agw.aui as aui +import wx.aui as aui from six import BytesIO @@ -163,69 +159,69 @@ class PyAUIFrame(wx.Frame): tb1 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb1.SetToolBitmapSize(wx.Size(48,48)) - tb1.AddLabelTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) + tb1.AddTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) tb1.AddSeparator() - tb1.AddLabelTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) - tb1.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) - tb1.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) - tb1.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) + tb1.AddTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) + tb1.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) + tb1.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) + tb1.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) tb1.Realize() tb2 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb2.SetToolBitmapSize(wx.Size(16,16)) tb2_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_QUESTION, wx.ART_OTHER, wx.Size(16, 16)) - tb2.AddLabelTool(101, "Test", tb2_bmp1) - tb2.AddLabelTool(101, "Test", tb2_bmp1) - tb2.AddLabelTool(101, "Test", tb2_bmp1) - tb2.AddLabelTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) tb2.AddSeparator() - tb2.AddLabelTool(101, "Test", tb2_bmp1) - tb2.AddLabelTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) tb2.AddSeparator() - tb2.AddLabelTool(101, "Test", tb2_bmp1) - tb2.AddLabelTool(101, "Test", tb2_bmp1) - tb2.AddLabelTool(101, "Test", tb2_bmp1) - tb2.AddLabelTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) + tb2.AddTool(101, "Test", tb2_bmp1) tb2.Realize() tb3 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb3.SetToolBitmapSize(wx.Size(16,16)) tb3_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16, 16)) - tb3.AddLabelTool(101, "Test", tb3_bmp1) - tb3.AddLabelTool(101, "Test", tb3_bmp1) - tb3.AddLabelTool(101, "Test", tb3_bmp1) - tb3.AddLabelTool(101, "Test", tb3_bmp1) + tb3.AddTool(101, "Test", tb3_bmp1) + tb3.AddTool(101, "Test", tb3_bmp1) + tb3.AddTool(101, "Test", tb3_bmp1) + tb3.AddTool(101, "Test", tb3_bmp1) tb3.AddSeparator() - tb3.AddLabelTool(101, "Test", tb3_bmp1) - tb3.AddLabelTool(101, "Test", tb3_bmp1) + tb3.AddTool(101, "Test", tb3_bmp1) + tb3.AddTool(101, "Test", tb3_bmp1) tb3.Realize() tb4 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT) tb4.SetToolBitmapSize(wx.Size(16,16)) tb4_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16)) - tb4.AddLabelTool(101, "Item 1", tb4_bmp1) - tb4.AddLabelTool(101, "Item 2", tb4_bmp1) - tb4.AddLabelTool(101, "Item 3", tb4_bmp1) - tb4.AddLabelTool(101, "Item 4", tb4_bmp1) + tb4.AddTool(101, "Item 1", tb4_bmp1) + tb4.AddTool(101, "Item 2", tb4_bmp1) + tb4.AddTool(101, "Item 3", tb4_bmp1) + tb4.AddTool(101, "Item 4", tb4_bmp1) tb4.AddSeparator() - tb4.AddLabelTool(101, "Item 5", tb4_bmp1) - tb4.AddLabelTool(101, "Item 6", tb4_bmp1) - tb4.AddLabelTool(101, "Item 7", tb4_bmp1) - tb4.AddLabelTool(101, "Item 8", tb4_bmp1) + tb4.AddTool(101, "Item 5", tb4_bmp1) + tb4.AddTool(101, "Item 6", tb4_bmp1) + tb4.AddTool(101, "Item 7", tb4_bmp1) + tb4.AddTool(101, "Item 8", tb4_bmp1) tb4.Realize() tb5 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_VERTICAL) tb5.SetToolBitmapSize(wx.Size(48, 48)) - tb5.AddLabelTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) + tb5.AddTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) tb5.AddSeparator() - tb5.AddLabelTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) - tb5.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) - tb5.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) - tb5.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) + tb5.AddTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) + tb5.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) + tb5.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) + tb5.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) tb5.Realize() # add a bunch of panes @@ -451,10 +447,10 @@ class PyAUIFrame(wx.Frame): def OnAbout(self, event): - msg = "aui Demo\n" + \ + msg = "wx.aui Demo\n" + \ "An advanced window management library for wxWidgets\n" + \ "(c) Copyright 2005-2006, Kirix Corporation" - dlg = wx.MessageDialog(self, msg, "About aui Demo", + dlg = wx.MessageDialog(self, msg, "About wx.aui Demo", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() @@ -743,12 +739,12 @@ class PyAUIFrame(wx.Frame): # -- wx.SizeReportCtrl -- # (a utility control that always reports it's client size) -class SizeReportCtrl(wx.PyControl): +class SizeReportCtrl(wx.Control): def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, mgr=None): - wx.PyControl.__init__(self, parent, id, pos, size, wx.NO_BORDER) + wx.Control.__init__(self, parent, id, pos, size, wx.NO_BORDER) self._mgr = mgr diff --git a/ext/wxWidgets b/ext/wxWidgets index 4926148e..805dea96 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit 4926148ec91b91fce1cae75a236e6db75d8db52d +Subproject commit 805dea96494c9f4e5450f49be44fd2e16e0ec323 From 46eef97a193747e266454a8f769de3045a7fd5e6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 11 Nov 2016 19:39:18 -0800 Subject: [PATCH 06/11] Add some unittests for AUI --- unittests/test_auibar.py | 71 +++++++++++++++++++-- unittests/test_auibook.py | 96 ++++++++++++++++++++++++++-- unittests/test_auidockart.py | 58 +++++++++++++++-- unittests/test_auiframemanager.py | 100 ++++++++++++++++++++++++++++-- unittests/test_auitabmdi.py | 16 +++-- 5 files changed, 321 insertions(+), 20 deletions(-) diff --git a/unittests/test_auibar.py b/unittests/test_auibar.py index 793f8466..2482a179 100644 --- a/unittests/test_auibar.py +++ b/unittests/test_auibar.py @@ -1,15 +1,78 @@ import unittest from unittests import wtc import wx +import wx.aui #--------------------------------------------------------------------------- class auibar_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. - def test_auibar1(self): - self.fail("Unit tests for auibar not implemented yet.") - + def test_auibar01(self): + wx.aui.AUI_TB_TEXT + wx.aui.AUI_TB_NO_TOOLTIPS + wx.aui.AUI_TB_NO_AUTORESIZE + wx.aui.AUI_TB_GRIPPER + wx.aui.AUI_TB_OVERFLOW + wx.aui.AUI_TB_VERTICAL + wx.aui.AUI_TB_HORZ_LAYOUT + wx.aui.AUI_TB_HORIZONTAL + wx.aui.AUI_TB_PLAIN_BACKGROUND + wx.aui.AUI_TB_HORZ_TEXT + wx.aui.AUI_ORIENTATION_MASK + wx.aui.AUI_TB_DEFAULT_STYLE + wx.aui.AUI_TBART_SEPARATOR_SIZE + wx.aui.AUI_TBART_GRIPPER_SIZE + wx.aui.AUI_TBART_OVERFLOW_SIZE + wx.aui.AUI_TBTOOL_TEXT_LEFT + wx.aui.AUI_TBTOOL_TEXT_RIGHT + wx.aui.AUI_TBTOOL_TEXT_TOP + wx.aui.AUI_TBTOOL_TEXT_BOTTOM + + + + def test_auibar02(self): + evt = wx.aui.AuiToolBarEvent() + + + def test_auibar03(self): + wx.aui.wxEVT_AUITOOLBAR_TOOL_DROPDOWN + wx.aui.wxEVT_AUITOOLBAR_OVERFLOW_CLICK + wx.aui.wxEVT_AUITOOLBAR_RIGHT_CLICK + wx.aui.wxEVT_AUITOOLBAR_MIDDLE_CLICK + wx.aui.wxEVT_AUITOOLBAR_BEGIN_DRAG + + wx.aui.EVT_AUITOOLBAR_TOOL_DROPDOWN + wx.aui.EVT_AUITOOLBAR_OVERFLOW_CLICK + wx.aui.EVT_AUITOOLBAR_RIGHT_CLICK + wx.aui.EVT_AUITOOLBAR_MIDDLE_CLICK + wx.aui.EVT_AUITOOLBAR_BEGIN_DRAG + + + + def test_auibar04(self): + obj = wx.aui.AuiToolBarItem() + + + def test_auibar05(self): + with self.assertRaises(TypeError): + obj = wx.aui.AuiToolBarArt() + + + def test_auibar06(self): + obj = wx.aui.AuiDefaultToolBarArt() + + + + def test_auibar07(self): + tbar = wx.aui.AuiToolBar(self.frame) + + + def test_auibar08(self): + tbar = wx.aui.AuiToolBar() + tbar.Create(self.frame) + + + #--------------------------------------------------------------------------- if __name__ == '__main__': diff --git a/unittests/test_auibook.py b/unittests/test_auibook.py index 12c72b57..d2908752 100644 --- a/unittests/test_auibook.py +++ b/unittests/test_auibook.py @@ -1,15 +1,103 @@ import unittest from unittests import wtc import wx +import wx.aui #--------------------------------------------------------------------------- class auibook_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. - def test_auibook1(self): - self.fail("Unit tests for auibook not implemented yet.") - + def test_auibook01(self): + wx.aui.AUI_NB_TOP + wx.aui.AUI_NB_LEFT + wx.aui.AUI_NB_RIGHT + wx.aui.AUI_NB_BOTTOM + wx.aui.AUI_NB_TAB_SPLIT + wx.aui.AUI_NB_TAB_MOVE + wx.aui.AUI_NB_TAB_EXTERNAL_MOVE + wx.aui.AUI_NB_TAB_FIXED_WIDTH + wx.aui.AUI_NB_SCROLL_BUTTONS + wx.aui.AUI_NB_WINDOWLIST_BUTTON + wx.aui.AUI_NB_CLOSE_BUTTON + wx.aui.AUI_NB_CLOSE_ON_ACTIVE_TAB + wx.aui.AUI_NB_CLOSE_ON_ALL_TABS + wx.aui.AUI_NB_MIDDLE_CLICK_CLOSE + wx.aui.AUI_NB_DEFAULT_STYLE + + + + def test_auibook02(self): + nb = wx.aui.AuiNotebook() + nb.Create(self.frame) + + + def test_auibook03(self): + nb = wx.aui.AuiNotebook(self.frame) + nb.AddPage(wx.Panel(nb), "Page") + + + def test_auibook04(self): + obj = wx.aui.AuiNotebookPage() + + + def test_auibook05(self): + obj = wx.aui.AuiTabContainerButton() + + + def test_auibook06(self): + obj = wx.aui.AuiTabContainer() + + + def test_auibook07(self): + with self.assertRaises(TypeError): + obj = wx.aui.AuiTabArt() + + + def test_auibook08(self): + obj = wx.aui.AuiDefaultTabArt() + + + def test_auibook09(self): + obj = wx.aui.AuiSimpleTabArt() + + + def test_auibook10(self): + evt = wx.aui.AuiNotebookEvent() + + wx.aui.wxEVT_AUINOTEBOOK_PAGE_CLOSE + wx.aui.wxEVT_AUINOTEBOOK_PAGE_CLOSED + wx.aui.wxEVT_AUINOTEBOOK_PAGE_CHANGED + wx.aui.wxEVT_AUINOTEBOOK_PAGE_CHANGING + wx.aui.wxEVT_AUINOTEBOOK_BUTTON + wx.aui.wxEVT_AUINOTEBOOK_BEGIN_DRAG + wx.aui.wxEVT_AUINOTEBOOK_END_DRAG + wx.aui.wxEVT_AUINOTEBOOK_DRAG_MOTION + wx.aui.wxEVT_AUINOTEBOOK_ALLOW_DND + wx.aui.wxEVT_AUINOTEBOOK_DRAG_DONE + wx.aui.wxEVT_AUINOTEBOOK_TAB_MIDDLE_DOWN + wx.aui.wxEVT_AUINOTEBOOK_TAB_MIDDLE_UP + wx.aui.wxEVT_AUINOTEBOOK_TAB_RIGHT_DOWN + wx.aui.wxEVT_AUINOTEBOOK_TAB_RIGHT_UP + wx.aui.wxEVT_AUINOTEBOOK_BG_DCLICK + + wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE + wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSED + wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED + wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGING + wx.aui.EVT_AUINOTEBOOK_BUTTON + wx.aui.EVT_AUINOTEBOOK_BEGIN_DRAG + wx.aui.EVT_AUINOTEBOOK_END_DRAG + wx.aui.EVT_AUINOTEBOOK_DRAG_MOTION + wx.aui.EVT_AUINOTEBOOK_ALLOW_DND + wx.aui.EVT_AUINOTEBOOK_DRAG_DONE + wx.aui.EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN + wx.aui.EVT_AUINOTEBOOK_TAB_MIDDLE_UP + wx.aui.EVT_AUINOTEBOOK_TAB_RIGHT_DOWN + wx.aui.EVT_AUINOTEBOOK_TAB_RIGHT_UP + wx.aui.EVT_AUINOTEBOOK_BG_DCLICK + + + #--------------------------------------------------------------------------- if __name__ == '__main__': diff --git a/unittests/test_auidockart.py b/unittests/test_auidockart.py index 390fff77..dfec80a8 100644 --- a/unittests/test_auidockart.py +++ b/unittests/test_auidockart.py @@ -1,15 +1,65 @@ import unittest from unittests import wtc import wx +import wx.aui #--------------------------------------------------------------------------- class auidockart_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. - def test_auidockart1(self): - self.fail("Unit tests for auidockart not implemented yet.") - + def test_auidockart01(self): + wx.aui.AUI_DOCKART_SASH_SIZE + wx.aui.AUI_DOCKART_CAPTION_SIZE + wx.aui.AUI_DOCKART_GRIPPER_SIZE + wx.aui.AUI_DOCKART_PANE_BORDER_SIZE + wx.aui.AUI_DOCKART_PANE_BUTTON_SIZE + wx.aui.AUI_DOCKART_BACKGROUND_COLOUR + wx.aui.AUI_DOCKART_SASH_COLOUR + wx.aui.AUI_DOCKART_ACTIVE_CAPTION_COLOUR + wx.aui.AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR + wx.aui.AUI_DOCKART_INACTIVE_CAPTION_COLOUR + wx.aui.AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR + wx.aui.AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR + wx.aui.AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR + wx.aui.AUI_DOCKART_BORDER_COLOUR + wx.aui.AUI_DOCKART_GRIPPER_COLOUR + wx.aui.AUI_DOCKART_CAPTION_FONT + wx.aui.AUI_DOCKART_GRADIENT_TYPE + wx.aui.AUI_GRADIENT_NONE + wx.aui.AUI_GRADIENT_VERTICAL + wx.aui.AUI_GRADIENT_HORIZONTAL + wx.aui.AUI_BUTTON_STATE_NORMAL + wx.aui.AUI_BUTTON_STATE_HOVER + wx.aui.AUI_BUTTON_STATE_PRESSED + wx.aui.AUI_BUTTON_STATE_DISABLED + wx.aui.AUI_BUTTON_STATE_HIDDEN + wx.aui.AUI_BUTTON_STATE_CHECKED + wx.aui.AUI_BUTTON_CLOSE + wx.aui.AUI_BUTTON_MAXIMIZE_RESTORE + wx.aui.AUI_BUTTON_MINIMIZE + wx.aui.AUI_BUTTON_PIN + wx.aui.AUI_BUTTON_OPTIONS + wx.aui.AUI_BUTTON_WINDOWLIST + wx.aui.AUI_BUTTON_LEFT + wx.aui.AUI_BUTTON_RIGHT + wx.aui.AUI_BUTTON_UP + wx.aui.AUI_BUTTON_DOWN + wx.aui.AUI_BUTTON_CUSTOM1 + wx.aui.AUI_BUTTON_CUSTOM2 + wx.aui.AUI_BUTTON_CUSTOM3 + + + + def test_auidockart02(self): + with self.assertRaises(TypeError): + da = wx.aui.AuiDockArt() + + + def test_auidockart03(self): + da = wx.aui.AuiDefaultDockArt() + + + #--------------------------------------------------------------------------- if __name__ == '__main__': diff --git a/unittests/test_auiframemanager.py b/unittests/test_auiframemanager.py index 29d2dcdb..4993e6b4 100644 --- a/unittests/test_auiframemanager.py +++ b/unittests/test_auiframemanager.py @@ -1,15 +1,107 @@ import unittest from unittests import wtc import wx +import wx.aui #--------------------------------------------------------------------------- class auiframemanager_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. - def test_auiframemanager1(self): - self.fail("Unit tests for auiframemanager not implemented yet.") - + def test_auiframemanager01(self): + wx.aui.AUI_DOCK_NONE + wx.aui.AUI_DOCK_TOP + wx.aui.AUI_DOCK_RIGHT + wx.aui.AUI_DOCK_BOTTOM + wx.aui.AUI_DOCK_LEFT + wx.aui.AUI_DOCK_CENTER + wx.aui.AUI_DOCK_CENTRE + + wx.aui.AUI_MGR_ALLOW_FLOATING + wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE + wx.aui.AUI_MGR_TRANSPARENT_DRAG + wx.aui.AUI_MGR_TRANSPARENT_HINT + wx.aui.AUI_MGR_VENETIAN_BLINDS_HINT + wx.aui.AUI_MGR_RECTANGLE_HINT + wx.aui.AUI_MGR_HINT_FADE + wx.aui.AUI_MGR_NO_VENETIAN_BLINDS_FADE + wx.aui.AUI_MGR_LIVE_RESIZE + wx.aui.AUI_MGR_DEFAULT + + + + def test_auiframemanager02(self): + wx.aui.EVT_AUI_PANE_BUTTON + wx.aui.EVT_AUI_PANE_CLOSE + wx.aui.EVT_AUI_PANE_MAXIMIZE + wx.aui.EVT_AUI_PANE_RESTORE + wx.aui.EVT_AUI_PANE_ACTIVATED + wx.aui.EVT_AUI_RENDER + wx.aui.EVT_AUI_FIND_MANAGER + + wx.aui.wxEVT_AUI_PANE_BUTTON + wx.aui.wxEVT_AUI_PANE_CLOSE + wx.aui.wxEVT_AUI_PANE_MAXIMIZE + wx.aui.wxEVT_AUI_PANE_RESTORE + wx.aui.wxEVT_AUI_PANE_ACTIVATED + wx.aui.wxEVT_AUI_RENDER + wx.aui.wxEVT_AUI_FIND_MANAGER + + + + def test_auiframemanager03(self): + mgr = wx.aui.AuiManager(self.frame) + mgr.AddPane( wx.Panel(self.frame), + wx.aui.AuiPaneInfo().Top().Caption('caption').Dock()) + mgr.Update() + self.myYield() + mgr.UnInit() + + + def test_auiframemanager04(self): + mgr = wx.aui.AuiManager() + mgr.SetManagedWindow(self.frame) + mgr.AddPane( wx.Panel(self.frame), + wx.aui.AuiPaneInfo().Top().Caption('caption').Dock()) + mgr.Update() + self.myYield() + mgr.UnInit() + + + + def test_auiframemanager05(self): + pi = wx.aui.AuiPaneInfo() + pi.BestSize((5,6)) + assert pi.best_size == (5,6) + pi.BestSize(wx.Size(7,8)) + assert pi.best_size == (7,8) + pi.BestSize(1, 2) + assert pi.best_size == (1,2) + + + + def test_auiframemanager06(self): + pi = wx.aui.AuiPaneInfo().Center().Caption("hello").DefaultPane().CloseButton().Floatable() + + + def test_auiframemanager07(self): + pi1 = wx.aui.AuiPaneInfo().BestSize(12,34) + pi2 = wx.aui.AuiPaneInfo(pi1) + assert pi1 is not pi2 + assert pi1.best_size == pi2.best_size + + + def test_auiframemanager08(self): + obj = wx.aui.AuiDockInfo() + + + def test_auiframemanager09(self): + obj = wx.aui.AuiDockUIPart() + + + def test_auiframemanager10(self): + obj = wx.aui.AuiPaneButton() + + #--------------------------------------------------------------------------- if __name__ == '__main__': diff --git a/unittests/test_auitabmdi.py b/unittests/test_auitabmdi.py index 7eac2376..9568c768 100644 --- a/unittests/test_auitabmdi.py +++ b/unittests/test_auitabmdi.py @@ -1,15 +1,23 @@ import unittest from unittests import wtc import wx +import wx.aui #--------------------------------------------------------------------------- class auitabmdi_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. - def test_auitabmdi1(self): - self.fail("Unit tests for auitabmdi not implemented yet.") - + def test_auitabmdi01(self): + parent = wx.aui.AuiMDIParentFrame(self.frame, title='AUI MDI') + child = wx.aui.AuiMDIChildFrame(parent, title='Child') + + parent.Show() + self.myYield() + child.Close() + self.myYield() + parent.Close() + + #--------------------------------------------------------------------------- if __name__ == '__main__': From efa9c5982a984840d12033f4f1576ad9165f579f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 11 Nov 2016 19:40:39 -0800 Subject: [PATCH 07/11] =?UTF-8?q?Also=20check=20for=20=E2=80=98winid?= =?UTF-8?q?=E2=80=99=20in=20fixTopLevelWindowClass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etgtools/tweaker_tools.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index b36a0170..9f226e74 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -262,9 +262,9 @@ def fixWindowClass(klass, hideVirtuals=True, ignoreProtected=True): for item in klass.allItems(): if isinstance(item, extractors.MethodDef) and item.protection == 'protected': item.ignore(False) - - - + + + def fixTopLevelWindowClass(klass, hideVirtuals=True, ignoreProtected=True): """ Tweaks for TLWs @@ -275,11 +275,13 @@ def fixTopLevelWindowClass(klass, hideVirtuals=True, ignoreProtected=True): item = klass.findItem('Create') if item: item.transferThis = True - + # give the id param a default value - for item in [klass.findItem('%s.id' % klass.name), klass.findItem('Create.id')]: - if item: - item.default = 'wxID_ANY' + for name in ['id', 'winid']: + for item in [klass.findItem('%s.%s' % (klass.name, name)), + klass.findItem('Create.%s' % name)]: + if item: + item.default = 'wxID_ANY' # give title param a default too if it needs it for item in [klass.findItem('%s.title' % klass.name), klass.findItem('Create.title')]: @@ -289,14 +291,14 @@ def fixTopLevelWindowClass(klass, hideVirtuals=True, ignoreProtected=True): if hideVirtuals: removeVirtuals(klass) addWindowVirtuals(klass) - + if not ignoreProtected: for item in klass.allItems(): if isinstance(item, extractors.MethodDef) and item.protection == 'protected': item.ignore(False) - - - + + + def fixSizerClass(klass): """ Remove all virtuals except for CalcMin and RecalcSizes. From a7620e59bcb185057122fd68c7a2313d32e9ca0d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 11 Nov 2016 19:41:54 -0800 Subject: [PATCH 08/11] Update wxWidgets changeset for AUI changes --- ext/wxWidgets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/wxWidgets b/ext/wxWidgets index 805dea96..896d385d 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit 805dea96494c9f4e5450f49be44fd2e16e0ec323 +Subproject commit 896d385dc0c3985b905f497e620963c7ceaae786 From fd3ea15e0e60ede0ed51846a391379ad3b857cf1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 11 Nov 2016 20:00:35 -0800 Subject: [PATCH 09/11] =?UTF-8?q?Handle=20case=20where=20the=20docs=20say?= =?UTF-8?q?=20there=20is=20an=20image,=20but=20there=20isn=E2=80=99t.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etgtools/sphinx_generator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index d2369000..855ac9d2 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -1150,6 +1150,9 @@ class Image(Node): image_path = os.path.normpath(os.path.join(DOXYROOT, 'images', value)) static_path = os.path.join(OVERVIEW_IMAGES_ROOT, os.path.split(image_path)[1]) + if not os.path.exists(image_path): + return '' + if not os.path.isfile(static_path): shutil.copyfile(image_path, static_path) From 91fe1f02fcda58a7d1bc6fa35f747d11b57d6d61 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 11 Nov 2016 20:16:35 -0800 Subject: [PATCH 10/11] Doc updates for AUI --- TODO.rst | 2 -- docs/sphinx/_templates/main.html | 5 ++++- .../snippets/python/converted/wx.aui.AuiManager.1.py | 6 ++++++ .../snippets/python/converted/wx.aui.AuiManager.2.py | 2 ++ etg/_aui.py | 9 ++++++++- 5 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.1.py create mode 100644 docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.2.py diff --git a/TODO.rst b/TODO.rst index 38c195a7..fc5dd85f 100644 --- a/TODO.rst +++ b/TODO.rst @@ -143,8 +143,6 @@ Other Dev Stuff * [] New activex classes in wx/msw/ole/activex.h ? * Any others? - * Add _aui module ?? (or go with only agw aui?) - * Add the UTF8 PyMethods from classic (see _stc_utf8_methods.py) to StyledTextCtrl * Reimplement the classes in the valgen, valnum and valtext headers as diff --git a/docs/sphinx/_templates/main.html b/docs/sphinx/_templates/main.html index 9515dc8e..057af5a2 100644 --- a/docs/sphinx/_templates/main.html +++ b/docs/sphinx/_templates/main.html @@ -39,7 +39,7 @@ A generic, ground-up implementation of a text control capable of showing multiple text styles and images.

+ A set of classes for writing a ribbon-based UI, typically a combonation of tabs and toolbar, similar to the UI in MS Office and Windows 10.

@@ -47,6 +47,9 @@ + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.1.py new file mode 100644 index 00000000..f03094b9 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.1.py @@ -0,0 +1,6 @@ + + text1 = wx.TextCtrl(self) + text2 = wx.TextCtrl(self) + self.mgr.AddPane(text1, wx.LEFT, "Pane Caption") + self.mgr.AddPane(text2, wx.BOTTOM, "Pane Caption") + self.mgr.Update() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.2.py new file mode 100644 index 00000000..d2d8bfdd --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.2.py @@ -0,0 +1,2 @@ + + self.mgr.GetPane(text1).Float() diff --git a/etg/_aui.py b/etg/_aui.py index 75f9c17f..f7e9e3cb 100644 --- a/etg/_aui.py +++ b/etg/_aui.py @@ -13,7 +13,14 @@ import etgtools.tweaker_tools as tools PACKAGE = "wx" MODULE = "_aui" NAME = "_aui" # Base name of the file to generate to for this script -DOCSTRING = "" +DOCSTRING = """\ +`wx.aui` provides a set of classes for implementing an "Advanced User Interface". +More specifically, these classes enable to you present some of your application in +floating or dockable panels, notebooks with floatable tabs, etc. + +There is also a pure-python implementation of these classes available in the +`wx.lib.agw.aui` package. +""" # The classes and/or the basename of the Doxygen XML files to be processed by # this script. From fefae1e675f0e71dafe19ea655492ff847bfe10d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 22 Nov 2016 10:53:55 -0800 Subject: [PATCH 11/11] Update wxWidgets link to the merge commit --- ext/wxWidgets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/wxWidgets b/ext/wxWidgets index 896d385d..1cdab48b 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit 896d385dc0c3985b905f497e620963c7ceaae786 +Subproject commit 1cdab48bc3569dc7eb81f191d060b7dc7fecd5b3