From a8f9e1f310bcb74b957f13cae8703139b4565bb9 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 3 Jul 2000 21:59:29 +0000 Subject: [PATCH] fixed bug for garbage text in NotifyParent Added method to set modification event mask git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/stc/stc.h | 4 ++++ contrib/src/stc/stc.cpp | 15 ++++++++++++++- include/wx/stc/stc.h | 4 ++++ src/stc/stc.cpp | 15 ++++++++++++++- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/contrib/include/wx/stc/stc.h b/contrib/include/wx/stc/stc.h index 5ba166a5ae..d5925f19be 100644 --- a/contrib/include/wx/stc/stc.h +++ b/contrib/include/wx/stc/stc.h @@ -487,6 +487,10 @@ public: void SetKeywords(int keywordSet, const wxString& keywordList); + // Event mask for Modified Event + void SetModEventMask(int mask); + //int GetModEventMask(); + #ifndef SWIG private: // Event handlers diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index 2ef9c3079b..aa7bf8dd98 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -1397,6 +1397,18 @@ void wxStyledTextCtrl::SetKeywords(int keywordSet, const wxString& keywordLi +//---------------------------------------------------------------------- +// Event mask for Modified Event + +void wxStyledTextCtrl::SetModEventMask(int mask) { + SendMsg(SCI_SETMODEVENTMASK, mask); +} + + +//int wxStyledTextCtrl::GetModEventMask() { +// return SendMsg(SCI_GETMODEVENTMASK); +//} + //---------------------------------------------------------------------- // Event handlers @@ -1549,7 +1561,8 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) { evt.SetModifiers(scn.modifiers); if (eventType == wxEVT_STC_MODIFIED) { evt.SetModificationType(scn.modificationType); - evt.SetText(scn.text); + if (scn.text) + evt.SetText(wxString(scn.text, scn.length)); evt.SetLength(scn.length); evt.SetLinesAdded(scn.linesAdded); evt.SetLine(scn.line); diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 5ba166a5ae..d5925f19be 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -487,6 +487,10 @@ public: void SetKeywords(int keywordSet, const wxString& keywordList); + // Event mask for Modified Event + void SetModEventMask(int mask); + //int GetModEventMask(); + #ifndef SWIG private: // Event handlers diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 2ef9c3079b..aa7bf8dd98 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -1397,6 +1397,18 @@ void wxStyledTextCtrl::SetKeywords(int keywordSet, const wxString& keywordLi +//---------------------------------------------------------------------- +// Event mask for Modified Event + +void wxStyledTextCtrl::SetModEventMask(int mask) { + SendMsg(SCI_SETMODEVENTMASK, mask); +} + + +//int wxStyledTextCtrl::GetModEventMask() { +// return SendMsg(SCI_GETMODEVENTMASK); +//} + //---------------------------------------------------------------------- // Event handlers @@ -1549,7 +1561,8 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) { evt.SetModifiers(scn.modifiers); if (eventType == wxEVT_STC_MODIFIED) { evt.SetModificationType(scn.modificationType); - evt.SetText(scn.text); + if (scn.text) + evt.SetText(wxString(scn.text, scn.length)); evt.SetLength(scn.length); evt.SetLinesAdded(scn.linesAdded); evt.SetLine(scn.line);