Begin adding wrappers for wx.aui

This commit is contained in:
Robin Dunn
2016-10-25 19:19:08 -07:00
parent 6449d05c1a
commit 8f238ad594
7 changed files with 222 additions and 1 deletions

View File

@@ -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.",

67
etg/_aui.py Normal file
View File

@@ -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 <wxpy_api.h>')
module.addImport('_core')
module.addPyCode("import wx", order=10)
module.addHeaderCode('#include <wx/aui/aui.h>')
module.addInclude(INCLUDES)
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
#---------------------------------------------------------------------------
if __name__ == '__main__':
run()

99
etg/auiframemanager.py Normal file
View File

@@ -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()

View File

@@ -85,6 +85,7 @@ MODULENAME_REPLACE = {'_core' : 'wx.',
'_msw' : 'wx.msw.',
'_ribbon' : 'wx.ribbon.',
'_propgrid': 'wx.propgrid.',
'_aui' : 'wx.aui.',
}

View File

@@ -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()

View File

@@ -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: