mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 04:20:07 +01:00
Added wrappers for the OSXEnableAutomaticQuoteSubstitution, OSXEnableAutomaticDashSubstitution, and SXDisableAllSmartSubstitutions methods in wx.TextCtrl.
This commit is contained in:
@@ -23,9 +23,13 @@ is included in the wxPython source archives. Along with this change a new
|
||||
maintenance releases of the 4.0.x series of wxPython, which will still track
|
||||
the ``WX_3_0_BRANCH`` wxWidgets branch.
|
||||
|
||||
|
||||
New and improved stuff in this release:
|
||||
|
||||
*
|
||||
* Added wrappers for the OSXEnableAutomaticQuoteSubstitution,
|
||||
OSXEnableAutomaticDashSubstitution, and OSXDisableAllSmartSubstitutions
|
||||
methods in wx.TextCtrl.
|
||||
|
||||
|
||||
Other changes in this release:
|
||||
|
||||
|
||||
@@ -147,13 +147,18 @@ def run():
|
||||
not c.findItem(item.name)]
|
||||
c.items.extend(items)
|
||||
|
||||
tc_excludes = ['OSXEnableAutomaticQuoteSubstitution',
|
||||
'OSXEnableAutomaticDashSubstitution',
|
||||
'OSXDisableAllSmartSubstitutions',
|
||||
]
|
||||
import textctrl
|
||||
mod = textctrl.parseAndTweakModule()
|
||||
klass = mod.find('wxTextCtrl')
|
||||
items = [item for item in klass.items if isinstance(item, etgtools.MethodDef) and
|
||||
not item.isCtor and
|
||||
not item.isDtor and
|
||||
not c.findItem(item.name)]
|
||||
not c.findItem(item.name) and
|
||||
not item.name in tc_excludes]
|
||||
c.items.extend(items)
|
||||
|
||||
c.find('EmulateKeyPress').ignore()
|
||||
|
||||
@@ -106,10 +106,43 @@ def parseAndTweakModule():
|
||||
doc="NOP, for file-like compatibility.",
|
||||
body="")
|
||||
|
||||
|
||||
# OSX methods for controlling native features
|
||||
c.addCppMethod('void', 'OSXEnableAutomaticQuoteSubstitution', '(bool enable)',
|
||||
doc="Mac-only method for turning on/off automatic quote substitutions.",
|
||||
body="""\
|
||||
#ifdef __WXMAC__
|
||||
self->OSXEnableAutomaticQuoteSubstitution(enable);
|
||||
#else
|
||||
wxPyRaiseNotImplemented();
|
||||
#endif
|
||||
""")
|
||||
|
||||
c.addCppMethod('void', 'OSXEnableAutomaticDashSubstitution', '(bool enable)',
|
||||
doc="Mac-only method for turning on/off automatic dash substitutions.",
|
||||
body="""\
|
||||
#ifdef __WXMAC__
|
||||
self->OSXEnableAutomaticDashSubstitution(enable);
|
||||
#else
|
||||
wxPyRaiseNotImplemented();
|
||||
#endif
|
||||
""")
|
||||
|
||||
c.addCppMethod('void', 'OSXDisableAllSmartSubstitutions', '()',
|
||||
doc="Mac-only method to disable all automatic text substitutions.",
|
||||
body="""\
|
||||
#ifdef __WXMAC__
|
||||
self->OSXDisableAllSmartSubstitutions();
|
||||
#else
|
||||
wxPyRaiseNotImplemented();
|
||||
#endif
|
||||
""")
|
||||
|
||||
|
||||
|
||||
c = module.find('wxTextUrlEvent')
|
||||
tools.fixEventClass(c)
|
||||
|
||||
|
||||
module.addPyCode("""\
|
||||
EVT_TEXT = wx.PyEventBinder( wxEVT_TEXT, 1)
|
||||
EVT_TEXT_ENTER = wx.PyEventBinder( wxEVT_TEXT_ENTER, 1)
|
||||
|
||||
Reference in New Issue
Block a user