Add context help classes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-04-07 04:17:13 +00:00
parent 78a4c2a580
commit 9ddc80004b
5 changed files with 103 additions and 1 deletions

View File

@@ -175,7 +175,7 @@ INCLUDES = [ # core
'process',
'uiaction',
'snglinst',
'cshelp',
]

64
etg/cshelp.py Normal file
View File

@@ -0,0 +1,64 @@
#---------------------------------------------------------------------------
# Name: etg/cshelp.py
# Author: Robin Dunn
#
# Created: 06-Apr-2012
# Copyright: (c) 2012 by Total Control Software
# License: wxWindows License
#---------------------------------------------------------------------------
import etgtools
import etgtools.tweaker_tools as tools
PACKAGE = "wx"
MODULE = "_core"
NAME = "cshelp" # 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 = [ "wxHelpProvider",
"wxSimpleHelpProvider",
"wxHelpControllerHelpProvider",
"wxContextHelp",
"wxContextHelpButton",
]
#---------------------------------------------------------------------------
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('wxContextHelpButton')
assert isinstance(c, etgtools.ClassDef)
tools.fixWindowClass(c)
c = module.find('wxHelpProvider')
c.abstract = True
c.find('Set').transferBack = True
c.find('Set.helpProvider').transfer = True
c = module.find('wxSimpleHelpProvider')
c.addItem(etgtools.WigCode("virtual wxString GetHelp(const wxWindowBase* window);"))
c = module.find('wxHelpControllerHelpProvider')
c.addPrivateCopyCtor()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
#---------------------------------------------------------------------------
if __name__ == '__main__':
run()

View File

@@ -71,6 +71,7 @@ def run():
class wxCaret;
class wxImageHandler;
class wxExecuteEnv;
class wxHelpControllerBase;
"""))

View File

@@ -184,6 +184,11 @@ EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
EVT_HELP = wx.PyEventBinder( wxEVT_HELP, 1)
EVT_HELP_RANGE = wx.PyEventBinder( wxEVT_HELP, 2)
EVT_DETAILED_HELP = wx.PyEventBinder( wxEVT_DETAILED_HELP, 1)
EVT_DETAILED_HELP_RANGE = wx.PyEventBinder( wxEVT_DETAILED_HELP, 2)
EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)

32
unittests/test_cshelp.py Normal file
View File

@@ -0,0 +1,32 @@
import imp_unittest, unittest
import wtc
import wx
#---------------------------------------------------------------------------
class cshelp_Tests(wtc.WidgetTestCase):
def test_cshelp1(self):
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
pnl = wx.Panel(self.frame)
pnl.SetHelpText("HelpMe!")
cBtn = wx.ContextHelpButton(pnl)
def test_cshelp2(self):
wx.wxEVT_HELP
wx.wxEVT_DETAILED_HELP
wx.EVT_HELP
wx.EVT_HELP_RANGE
wx.EVT_DETAILED_HELP
wx.EVT_DETAILED_HELP_RANGE
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest.main()