mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
Starting work on wrapping propgrid
This commit is contained in:
70
etg/_propgrid.py
Normal file
70
etg/_propgrid.py
Normal file
@@ -0,0 +1,70 @@
|
||||
#---------------------------------------------------------------------------
|
||||
# Name: etg/_propgrid.py
|
||||
# Author: Robin Dunn
|
||||
#
|
||||
# Created: 23-Feb-2015
|
||||
# Copyright: (c) 2015 by Total Control Software
|
||||
# License: wxWindows License
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
import etgtools
|
||||
import etgtools.tweaker_tools as tools
|
||||
from etgtools import PyFunctionDef, PyCodeDef, PyPropertyDef
|
||||
|
||||
PACKAGE = "wx"
|
||||
MODULE = "_propgrid"
|
||||
NAME = "_propgrid" # 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 "propgrid" library in a multi-lib build.
|
||||
INCLUDES = [ 'property',
|
||||
'propgrideditors',
|
||||
'propgridpagestate',
|
||||
'propgridiface',
|
||||
'propgrid',
|
||||
]
|
||||
|
||||
|
||||
# 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.addInclude(INCLUDES)
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
50
etg/property.py
Normal file
50
etg/property.py
Normal file
@@ -0,0 +1,50 @@
|
||||
#---------------------------------------------------------------------------
|
||||
# Name: etg/property.py
|
||||
# Author: Robin Dunn
|
||||
#
|
||||
# Created: 23-Feb-2015
|
||||
# Copyright: (c) 2015 by Total Control Software
|
||||
# License: wxWindows License
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
import etgtools
|
||||
import etgtools.tweaker_tools as tools
|
||||
|
||||
PACKAGE = "wx"
|
||||
MODULE = "_propgrid"
|
||||
NAME = "property" # 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 = [ 'wxPGProperty',
|
||||
'wxPGCell',
|
||||
'wxPGChoices',
|
||||
'wxPGPaintData',
|
||||
'wxPGCellRenderer',
|
||||
]
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
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('wxPGProperty')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
55
etg/propgrid.py
Normal file
55
etg/propgrid.py
Normal file
@@ -0,0 +1,55 @@
|
||||
#---------------------------------------------------------------------------
|
||||
# Name: etg/propgrid.py
|
||||
# Author: Robin Dunn
|
||||
#
|
||||
# Created: 23-Feb-2015
|
||||
# Copyright: (c) 2015 by Total Control Software
|
||||
# License: wxWindows License
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
import etgtools
|
||||
import etgtools.tweaker_tools as tools
|
||||
|
||||
PACKAGE = "wx"
|
||||
MODULE = "_propgrid"
|
||||
NAME = "propgrid" # 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 = [ 'interface_2wx_2propgrid_2propgrid_8h.xml',
|
||||
'wxPGValidationInfo',
|
||||
'wxPropertyGrid',
|
||||
]
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
module.find('wxPGSortCallback').ignore()
|
||||
|
||||
c = module.find('wxPGValidationInfo')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
|
||||
|
||||
c = module.find('wxPropertyGrid')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
c.bases.remove('wxScrollHelper')
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
47
etg/propgrideditors.py
Normal file
47
etg/propgrideditors.py
Normal file
@@ -0,0 +1,47 @@
|
||||
#---------------------------------------------------------------------------
|
||||
# Name: etg/propgrideditors.py
|
||||
# Author: Robin Dunn
|
||||
#
|
||||
# Created: 23-Feb-2015
|
||||
# Copyright: (c) 2015 by Total Control Software
|
||||
# License: wxWindows License
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
import etgtools
|
||||
import etgtools.tweaker_tools as tools
|
||||
|
||||
PACKAGE = "wx"
|
||||
MODULE = "_propgrid"
|
||||
NAME = "propgrideditors" # 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 = [ 'wxPGEditor',
|
||||
'wxPGMultiButton',
|
||||
]
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
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('')
|
||||
#assert isinstance(c, etgtools.ClassDef)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
47
etg/propgridiface.py
Normal file
47
etg/propgridiface.py
Normal file
@@ -0,0 +1,47 @@
|
||||
#---------------------------------------------------------------------------
|
||||
# Name: etg/propgridiface.py
|
||||
# Author: Robin Dunn
|
||||
#
|
||||
# Created: 23-Feb-2015
|
||||
# Copyright: (c) 2015 by Total Control Software
|
||||
# License: wxWindows License
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
import etgtools
|
||||
import etgtools.tweaker_tools as tools
|
||||
|
||||
PACKAGE = "wx"
|
||||
MODULE = "_propgrid"
|
||||
NAME = "propgridiface" # 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 = [ 'wxPropertyGridInterface',
|
||||
|
||||
]
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
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('wxPropertyGridInterface')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
56
etg/propgridpagestate.py
Normal file
56
etg/propgridpagestate.py
Normal file
@@ -0,0 +1,56 @@
|
||||
#---------------------------------------------------------------------------
|
||||
# Name: etg/propgridpagestate.py
|
||||
# Author: Robin Dunn
|
||||
#
|
||||
# Created: 23-Feb-2015
|
||||
# Copyright: (c) 2015 by Total Control Software
|
||||
# License: wxWindows License
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
import etgtools
|
||||
import etgtools.tweaker_tools as tools
|
||||
|
||||
PACKAGE = "wx"
|
||||
MODULE = "_propgrid"
|
||||
NAME = "propgridpagestate" # 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 = [ 'wxPropertyGridHitTestResult',
|
||||
'wxPropertyGridIterator',
|
||||
'wxPGVIterator',
|
||||
]
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
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('wxPropertyGridHitTestResult')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
|
||||
|
||||
c = module.find('wxPropertyGridIterator')
|
||||
# The base class is not documented, and it looks like it may not be
|
||||
# needed, so just pretend this class has no base class. At least for
|
||||
# now...
|
||||
c.bases = []
|
||||
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
16
unittests/test_property.py
Normal file
16
unittests/test_property.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import imp_unittest, unittest
|
||||
import wtc
|
||||
import wx
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class property_Tests(wtc.WidgetTestCase):
|
||||
|
||||
# TODO: Remove this test and add real ones.
|
||||
def test_property1(self):
|
||||
self.fail("Unit tests for property not implemented yet.")
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
63
unittests/test_propgrid.py
Normal file
63
unittests/test_propgrid.py
Normal file
@@ -0,0 +1,63 @@
|
||||
import imp_unittest, unittest
|
||||
import wtc
|
||||
import wx
|
||||
import wx.propgrid as pg
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class propgrid_Tests(wtc.WidgetTestCase):
|
||||
|
||||
def test_propgrid1(self):
|
||||
obj = pg.PGValidationInfo()
|
||||
|
||||
|
||||
def test_propgrid0(self):
|
||||
pg.PG_AUTO_SORT
|
||||
pg.PG_HIDE_CATEGORIES
|
||||
pg.PG_ALPHABETIC_MODE
|
||||
pg.PG_BOLD_MODIFIED
|
||||
pg.PG_SPLITTER_AUTO_CENTER
|
||||
pg.PG_TOOLTIPS
|
||||
pg.PG_HIDE_MARGIN
|
||||
pg.PG_STATIC_SPLITTER
|
||||
pg.PG_STATIC_LAYOUT
|
||||
pg.PG_LIMITED_EDITING
|
||||
pg.PG_TOOLBAR
|
||||
pg.PG_DESCRIPTION
|
||||
pg.PG_NO_INTERNAL_BORDER
|
||||
pg.PG_EX_INIT_NOCAT
|
||||
pg.PG_EX_NO_FLAT_TOOLBAR
|
||||
pg.PG_EX_MODE_BUTTONS
|
||||
pg.PG_EX_HELP_AS_TOOLTIPS
|
||||
pg.PG_EX_NATIVE_DOUBLE_BUFFERING
|
||||
pg.PG_EX_AUTO_UNSPECIFIED_VALUES
|
||||
pg.PG_EX_WRITEONLY_BUILTIN_ATTRIBUTES
|
||||
pg.PG_EX_HIDE_PAGE_BUTTONS
|
||||
pg.PG_EX_MULTIPLE_SELECTION
|
||||
pg.PG_EX_ENABLE_TLP_TRACKING
|
||||
pg.PG_EX_NO_TOOLBAR_DIVIDER
|
||||
pg.PG_EX_TOOLBAR_SEPARATOR
|
||||
pg.PG_VFB_STAY_IN_PROPERTY
|
||||
pg.PG_VFB_BEEP
|
||||
pg.PG_VFB_MARK_CELL
|
||||
pg.PG_VFB_SHOW_MESSAGE
|
||||
pg.PG_VFB_SHOW_MESSAGEBOX
|
||||
pg.PG_VFB_SHOW_MESSAGE_ON_STATUSBAR
|
||||
pg.PG_VFB_DEFAULT
|
||||
pg.PG_ACTION_INVALID
|
||||
pg.PG_ACTION_NEXT_PROPERTY
|
||||
pg.PG_ACTION_PREV_PROPERTY
|
||||
pg.PG_ACTION_EXPAND_PROPERTY
|
||||
pg.PG_ACTION_COLLAPSE_PROPERTY
|
||||
pg.PG_ACTION_CANCEL_EDIT
|
||||
pg.PG_ACTION_EDIT
|
||||
pg.PG_ACTION_PRESS_BUTTON
|
||||
pg.PG_ACTION_MAX
|
||||
|
||||
pg.PG_DEFAULT_STYLE
|
||||
pg.PGMAN_DEFAULT_STYLE
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
16
unittests/test_propgrideditors.py
Normal file
16
unittests/test_propgrideditors.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import imp_unittest, unittest
|
||||
import wtc
|
||||
import wx
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class propgrideditors_Tests(wtc.WidgetTestCase):
|
||||
|
||||
# TODO: Remove this test and add real ones.
|
||||
def test_propgrideditors1(self):
|
||||
self.fail("Unit tests for propgrideditors not implemented yet.")
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
16
unittests/test_propgridiface.py
Normal file
16
unittests/test_propgridiface.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import imp_unittest, unittest
|
||||
import wtc
|
||||
import wx
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class propgridiface_Tests(wtc.WidgetTestCase):
|
||||
|
||||
# TODO: Remove this test and add real ones.
|
||||
def test_propgridiface1(self):
|
||||
self.fail("Unit tests for propgridiface not implemented yet.")
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
16
unittests/test_propgridpagestate.py
Normal file
16
unittests/test_propgridpagestate.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import imp_unittest, unittest
|
||||
import wtc
|
||||
import wx
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class propgridpagestate_Tests(wtc.WidgetTestCase):
|
||||
|
||||
# TODO: Remove this test and add real ones.
|
||||
def test_propgridpagestate1(self):
|
||||
self.fail("Unit tests for propgridpagestate not implemented yet.")
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
8
wscript
8
wscript
@@ -138,6 +138,9 @@ def configure(conf):
|
||||
_copyEnvGroup(conf.env, '_WX', '_WXRIBBON')
|
||||
conf.env.LIB_WXRIBBON += cfg.makeLibName('ribbon')
|
||||
|
||||
_copyEnvGroup(conf.env, '_WX', '_WXPROPGRID')
|
||||
conf.env.LIB_WXPROPGRID += cfg.makeLibName('propgrid')
|
||||
|
||||
# ** Add code for new modules here (and below for non-MSW)
|
||||
|
||||
# tweak the PYEXT compile and link flags if making a --debug build
|
||||
@@ -228,6 +231,10 @@ def configure(conf):
|
||||
args='--cxxflags --libs ribbon,core,net' + rpath,
|
||||
uselib_store='WXRIBBON', mandatory=True)
|
||||
|
||||
conf.check_cfg(path=conf.options.wx_config, package='',
|
||||
args='--cxxflags --libs core' + rpath,
|
||||
uselib_store='WXPROPGRID', mandatory=True)
|
||||
|
||||
# ** Add code for new modules here
|
||||
|
||||
|
||||
@@ -519,6 +526,7 @@ def build(bld):
|
||||
makeETGRule(bld, 'etg/_richtext.py', '_richtext', 'WXHTML WXRICHTEXT')
|
||||
makeETGRule(bld, 'etg/_media.py', '_media', 'WXMEDIA')
|
||||
makeETGRule(bld, 'etg/_ribbon.py', '_ribbon', 'WXRIBBON')
|
||||
makeETGRule(bld, 'etg/_ribbon.py', '_propgrid', 'WXPROPGRID')
|
||||
|
||||
if isDarwin:
|
||||
makeETGRule(bld, 'etg/_webkit.py', '_webkit', 'WXWEBKIT')
|
||||
|
||||
Reference in New Issue
Block a user