derive wxSTC from wxTextAreaBase to provide wxTextCtrl-like methods (see #9114)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -21,7 +21,7 @@ H_TEMPLATE = os.path.abspath('./stc.h.in')
|
||||
CPP_TEMPLATE = os.path.abspath('./stc.cpp.in')
|
||||
H_DEST = os.path.abspath('../../include/wx/stc/stc.h')
|
||||
CPP_DEST = os.path.abspath('./stc.cpp')
|
||||
DOCSTR_DEST = os.path.abspath('../../../wxPython/contrib/stc/_stc_gendocs.i')
|
||||
DOCSTR_DEST = '/dev/null' #os.path.abspath('../../../wxPython/contrib/stc/_stc_gendocs.i')
|
||||
|
||||
|
||||
# Value prefixes to convert
|
||||
@@ -144,9 +144,9 @@ methodOverrideMap = {
|
||||
|
||||
'PositionFromPoint' :
|
||||
(0,
|
||||
'int %s(wxPoint pt);',
|
||||
'int %s(wxPoint pt) const;',
|
||||
|
||||
'''int %s(wxPoint pt) {
|
||||
'''int %s(wxPoint pt) const {
|
||||
return SendMsg(%s, pt.x, pt.y);''',
|
||||
0),
|
||||
|
||||
@@ -410,9 +410,9 @@ methodOverrideMap = {
|
||||
|
||||
'GetLine' :
|
||||
(0,
|
||||
'wxString %s(int line);',
|
||||
'wxString %s(int line) const;',
|
||||
|
||||
'''wxString %s(int line) {
|
||||
'''wxString %s(int line) const {
|
||||
int len = LineLength(line);
|
||||
if (!len) return wxEmptyString;
|
||||
|
||||
@@ -655,6 +655,16 @@ methodOverrideMap = {
|
||||
|
||||
}
|
||||
|
||||
# all Scintilla getters are transformed into const member of wxSTC class but
|
||||
# some non-getter methods are also logically const and this set contains their
|
||||
# names (notice that it's useless to include here methods manually overridden
|
||||
# above)
|
||||
constNonGetterMethods = set((
|
||||
'LineFromPosition',
|
||||
'PositionFromLine',
|
||||
'LineLength',
|
||||
))
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
def processIface(iface, h_tmplt, cpp_tmplt, h_dest, cpp_dest, docstr_dest):
|
||||
@@ -904,7 +914,8 @@ def parseFun(line, methods, docs, values, is_const):
|
||||
if not FUNC_FOR_CMD:
|
||||
return
|
||||
|
||||
methods.append( (retType, name, number, param1, param2, tuple(docs), is_const) )
|
||||
methods.append( (retType, name, number, param1, param2, tuple(docs),
|
||||
is_const or name in constNonGetterMethods) )
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user