From e68cafaf946a8cc2987beb3c2724eed5e5917ef7 Mon Sep 17 00:00:00 2001 From: New Pagodi Date: Thu, 16 Feb 2017 18:18:13 +0100 Subject: [PATCH] Remove references to never generated wxSTC events EVT_STC_KEY and EVT_STC_URIDROPPED events are never generated so there is no need to reference them in the code and documentation. For backwards compatibility reasons their declarations are not entirely removed but marked as deprecated. Closes #17688. --- docs/changes.txt | 1 + include/wx/stc/stc.h | 10 ++++++---- interface/wx/stc/stc.h | 14 ++++++++++---- src/stc/stc.cpp | 9 --------- src/stc/stc.cpp.in | 9 --------- src/stc/stc.h.in | 6 ++++-- src/stc/stc.interface.h.in | 14 ++++++++++---- 7 files changed, 31 insertions(+), 32 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 98640eef7d..022746fe37 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -124,6 +124,7 @@ All (GUI): - Refactor code in wxQuantize() for MSVC to avoid crash. - Fix drawing rotated and/or underlined text on wxPostScriptDC. - Support multiline strings in wxPostScriptDC::DrawText(), DrawRotatedText(). +- Deprecate wxEVT_STC_KEY and wxEVT_STC_URIDROPPED events (NewPagodi). wxGTK: diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index e9154eb10d..19d551c7e5 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -5543,7 +5543,8 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, wxStyledTextEven wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, wxStyledTextEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_KEY, wxStyledTextEvent ); +wxDEPRECATED_MSG( "Don't handle wxEVT_STC_KEY. It's never generated." ) \ + wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_KEY, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, wxStyledTextEvent ); @@ -5552,7 +5553,8 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, wxStyledTextEv wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, wxStyledTextEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, wxStyledTextEvent ); +wxDEPRECATED_MSG( "Don't handle wxEVT_STC_URIDROPPED. It's never generated." ) \ + wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, wxStyledTextEvent ); @@ -5581,7 +5583,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGIN_RIGHT_CLICK, wxStyle wxEVT_STC_SAVEPOINTREACHED, wxEVT_STC_SAVEPOINTLEFT, wxEVT_STC_ROMODIFYATTEMPT, - wxEVT_STC_KEY, + wxEVT_STC_KEY, // deprecated wxEVT_STC_DOUBLECLICK, wxEVT_STC_UPDATEUI, wxEVT_STC_MODIFIED, @@ -5590,7 +5592,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGIN_RIGHT_CLICK, wxStyle wxEVT_STC_NEEDSHOWN, wxEVT_STC_PAINTED, wxEVT_STC_USERLISTSELECTION, - wxEVT_STC_URIDROPPED, + wxEVT_STC_URIDROPPED, // deprecated wxEVT_STC_DWELLSTART, wxEVT_STC_DWELLEND, wxEVT_STC_START_DRAG, diff --git a/interface/wx/stc/stc.h b/interface/wx/stc/stc.h index ebe222c5a9..3b11959430 100644 --- a/interface/wx/stc/stc.h +++ b/interface/wx/stc/stc.h @@ -2780,8 +2780,6 @@ TOWRITE @event{EVT_STC_ROMODIFYATTEMPT(id, fn)} TOWRITE - @event{EVT_STC_KEY(id, fn)} - TOWRITE @event{EVT_STC_DOUBLECLICK(id, fn)} TOWRITE @event{EVT_STC_UPDATEUI(id, fn)} @@ -2798,8 +2796,6 @@ TOWRITE @event{EVT_STC_USERLISTSELECTION(id, fn)} TOWRITE - @event{EVT_STC_URIDROPPED(id, fn)} - TOWRITE @event{EVT_STC_DWELLSTART(id, fn)} TOWRITE @event{EVT_STC_DWELLEND(id, fn)} @@ -2848,6 +2844,16 @@ @endEventTable + Most of the scintilla notifications are mapped to a similarly named + wxStyledTextEvent. However a few of the notifications would only offer + information available in other wxWidgets event types, and in those cases a + corresponding wxStyledTextEvent is not defined. Currently, the + @c wxEVT_KEY_DOWN event is used instead of the SCN_KEY notification. The + regular wxWidgets drag and drop functionality can be used instead of the + SCN_URIDROPPED notification. The @c wxEVT_SET_FOCUS event is used instead + of the SCN_FOCUSIN notification. And the @c wxEVT_KILL_FOCUS event is used + instead of the SCN_FOCUSOUT notification. + @library{wxstc} @category{stc} diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 197c5f3a8b..16b84a7b77 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -5476,10 +5476,6 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) { evt.SetEventType(wxEVT_STC_ROMODIFYATTEMPT); break; - case SCN_KEY: - evt.SetEventType(wxEVT_STC_KEY); - break; - case SCN_DOUBLECLICK: evt.SetEventType(wxEVT_STC_DOUBLECLICK); evt.SetLine(scn.line); @@ -5532,11 +5528,6 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) { evt.SetListCompletionMethod(scn.listCompletionMethod); break; - case SCN_URIDROPPED: - evt.SetEventType(wxEVT_STC_URIDROPPED); - SetEventText(evt, scn.text, strlen(scn.text)); - break; - case SCN_DWELLSTART: evt.SetEventType(wxEVT_STC_DWELLSTART); evt.SetX(scn.x); diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index a3de94cc41..d1413d1f2a 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -1048,10 +1048,6 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) { evt.SetEventType(wxEVT_STC_ROMODIFYATTEMPT); break; - case SCN_KEY: - evt.SetEventType(wxEVT_STC_KEY); - break; - case SCN_DOUBLECLICK: evt.SetEventType(wxEVT_STC_DOUBLECLICK); evt.SetLine(scn.line); @@ -1104,11 +1100,6 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) { evt.SetListCompletionMethod(scn.listCompletionMethod); break; - case SCN_URIDROPPED: - evt.SetEventType(wxEVT_STC_URIDROPPED); - SetEventText(evt, scn.text, strlen(scn.text)); - break; - case SCN_DWELLSTART: evt.SetEventType(wxEVT_STC_DWELLSTART); evt.SetX(scn.x); diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index c9bb0959c8..6e4d4c32ba 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -665,7 +665,8 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, wxStyledTextEven wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, wxStyledTextEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_KEY, wxStyledTextEvent ); +wxDEPRECATED_MSG( "Don't handle wxEVT_STC_KEY. It's never generated." ) \ + wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_KEY, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, wxStyledTextEvent ); @@ -674,7 +675,8 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, wxStyledTextEv wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, wxStyledTextEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, wxStyledTextEvent ); +wxDEPRECATED_MSG( "Don't handle wxEVT_STC_URIDROPPED. It's never generated." ) \ + wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, wxStyledTextEvent ); diff --git a/src/stc/stc.interface.h.in b/src/stc/stc.interface.h.in index c82c4a399b..4eab3eb758 100644 --- a/src/stc/stc.interface.h.in +++ b/src/stc/stc.interface.h.in @@ -58,8 +58,6 @@ TOWRITE @event{EVT_STC_ROMODIFYATTEMPT(id, fn)} TOWRITE - @event{EVT_STC_KEY(id, fn)} - TOWRITE @event{EVT_STC_DOUBLECLICK(id, fn)} TOWRITE @event{EVT_STC_UPDATEUI(id, fn)} @@ -76,8 +74,6 @@ TOWRITE @event{EVT_STC_USERLISTSELECTION(id, fn)} TOWRITE - @event{EVT_STC_URIDROPPED(id, fn)} - TOWRITE @event{EVT_STC_DWELLSTART(id, fn)} TOWRITE @event{EVT_STC_DWELLEND(id, fn)} @@ -126,6 +122,16 @@ @endEventTable + Most of the scintilla notifications are mapped to a similarly named + wxStyledTextEvent. However a few of the notifications would only offer + information available in other wxWidgets event types, and in those cases a + corresponding wxStyledTextEvent is not defined. Currently, the + @c wxEVT_KEY_DOWN event is used instead of the SCN_KEY notification. The + regular wxWidgets drag and drop functionality can be used instead of the + SCN_URIDROPPED notification. The @c wxEVT_SET_FOCUS event is used instead + of the SCN_FOCUSIN notification. And the @c wxEVT_KILL_FOCUS event is used + instead of the SCN_FOCUSOUT notification. + @library{wxstc} @category{stc}