Opened 4 years ago

Closed 4 years ago

#17808 closed defect (fixed)

Fixing non-conformant names for some wxSTC values

Reported by: NewPagodi Owned by: Artur Wieczorek <artwik@…>
Priority: normal Milestone:
Component: wxStyledText Version: dev-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

As discussed in #17807, in mapping values defined in Scintilla.iface that have names beginning with 'SCXX' to values in stc.h, the convention mostly used is to strip out the 'SC' before prepending 'wxSTC_'. For example, SCWS_INVISIBLE gets mapped to wxSTC_WS_INVISIBLE. Unfortunately for the values beginning with 'SCVS_' and 'SCMOD_', the code needed to remove the 'SC' was left out of gen_iface.py.

In the comments for #17807, the best solution was to generate and document values with consistent names for these values, but preserve the existing definitions undocumented and commented deprecated. (Unfortunately they're macros so they can't really be deprecated.)

This patch

  • updates gen_iface.py so that the SCVS_* and SCMOD_* entries to use the existing convention. There are actually already a set of values starting with wxSTC_MOD_* that are used in wxEVT_STC_MODIFIED, so I instead mapped the SCMOD_* to wxSTC_KEYMOD_*. If another prefix is preferred, I can change it.
  • copies the existing values stc.h.in but notes that they should be considered deprecated.
  • fixes some references with the incorrect name in the documentation.

Attachments (1)

stcenumetries.patch download (7.4 KB) - added by NewPagodi 4 years ago.

Download all attachments as: .zip

Change History (2)

Changed 4 years ago by NewPagodi

comment:1 Changed 4 years ago by Artur Wieczorek <artwik@…>

  • Owner set to Artur Wieczorek <artwik@…>
  • Resolution set to fixed
  • Status changed from new to closed

In ee609de19907085b670e1453997d628a6c115f4c/git-wxWidgets:

Fix names for some wxSTC constants

Generally, Scintilla constants which names beginning with 'SCXX' are mapped to wxSTC names by by stripping out the 'SC' before prepending 'wxSTC_', for example SCWS_INVISIBLE gets mapped to wxSTC_WS_INVISIBLE. Unfortunately, this common rule of mapping the names is not applied to the (legacy) names beginning with 'SCVS_' and 'SCMOD_'.
For the sake of consistency, also these names should conform to the common naming convention, so gen_iface.py is updated to generate conformant names for all affected prefixes. Legacy names are preserved for backward compatibility but commented deprecated and no longer referenced in the documentation.

Closes #17808.

Note: See TracTickets for help on using tickets.