From 0d8ab7638d3be0eeb3f6c9efb1e0386bdb025d22 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 8 Aug 2000 19:19:49 +0000 Subject: [PATCH] more minor fixes, stabalizations, etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7979 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/stc/stc.h | 1 + contrib/src/stc/PlatWX.cpp | 1 + contrib/src/stc/stc.cpp | 18 +++++++++++------- include/wx/stc/stc.h | 1 + src/stc/PlatWX.cpp | 1 + src/stc/stc.cpp | 18 +++++++++++------- 6 files changed, 26 insertions(+), 14 deletions(-) diff --git a/contrib/include/wx/stc/stc.h b/contrib/include/wx/stc/stc.h index d5925f19be..2202c2dcc1 100644 --- a/contrib/include/wx/stc/stc.h +++ b/contrib/include/wx/stc/stc.h @@ -237,6 +237,7 @@ public: wxSTC_UndoType GetUndoCollection(); void BeginUndoAction(); void EndUndoAction(); + void SetSavePoint(); // Selection and information diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index 5045e6d506..83b554fd29 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -464,6 +464,7 @@ ListBox::~ListBox() { void ListBox::Create(Window &parent, int ctrlID) { id = new wxListBox(parent.id, ctrlID, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE | wxLB_SORT); + ((wxListBox*)id)->Show(FALSE); } void ListBox::Clear() { diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index aa7bf8dd98..8298bd1f58 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -333,6 +333,9 @@ void wxStyledTextCtrl::EndUndoAction() { } +void wxStyledTextCtrl::SetSavePoint() { + SendMsg(SCI_SETSAVEPOINT); +} //---------------------------------------------------------------------- @@ -356,10 +359,11 @@ wxString wxStyledTextCtrl::GetSelectedText() { GetSelection(&start, &end); int len = end - start; - char* buff = text.GetWriteBuf(len); - - SendMsg(EM_GETSELTEXT, 0, (long)buff); - text.UngetWriteBuf(); + if (len > 0) { + char* buff = text.GetWriteBuf(len); + SendMsg(EM_GETSELTEXT, 0, (long)buff); + text.UngetWriteBuf(); + } return text; } @@ -1049,7 +1053,7 @@ void wxStyledTextCtrl::MarkerDeleteAll(int markerNumber) { int wxStyledTextCtrl::MarkerGet(int line) { - return SendMsg(SCI_MARKERGET); + return SendMsg(SCI_MARKERGET, line); } @@ -1059,7 +1063,7 @@ int wxStyledTextCtrl::MarkerGetNextLine(int lineStart, int markerMask) { int wxStyledTextCtrl::MarkerGetPrevLine(int lineStart, int markerMask) { -// return SendMsg(SCI_MARKERPREV, lineStart, markerMask); +// TODO return SendMsg(SCI_MARKERPREV, lineStart, markerMask); return 0; } @@ -1140,7 +1144,7 @@ char wxStyledTextCtrl::AutoCompGetSeparator() { void wxStyledTextCtrl::AutoCompSelect(const wxString& stringtoselect) { - SendMsg(SCI_AUTOCSELECT, (long)stringtoselect.c_str()); + SendMsg(SCI_AUTOCSELECT, 0, (long)stringtoselect.c_str()); } diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index d5925f19be..2202c2dcc1 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -237,6 +237,7 @@ public: wxSTC_UndoType GetUndoCollection(); void BeginUndoAction(); void EndUndoAction(); + void SetSavePoint(); // Selection and information diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 5045e6d506..83b554fd29 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -464,6 +464,7 @@ ListBox::~ListBox() { void ListBox::Create(Window &parent, int ctrlID) { id = new wxListBox(parent.id, ctrlID, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE | wxLB_SORT); + ((wxListBox*)id)->Show(FALSE); } void ListBox::Clear() { diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index aa7bf8dd98..8298bd1f58 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -333,6 +333,9 @@ void wxStyledTextCtrl::EndUndoAction() { } +void wxStyledTextCtrl::SetSavePoint() { + SendMsg(SCI_SETSAVEPOINT); +} //---------------------------------------------------------------------- @@ -356,10 +359,11 @@ wxString wxStyledTextCtrl::GetSelectedText() { GetSelection(&start, &end); int len = end - start; - char* buff = text.GetWriteBuf(len); - - SendMsg(EM_GETSELTEXT, 0, (long)buff); - text.UngetWriteBuf(); + if (len > 0) { + char* buff = text.GetWriteBuf(len); + SendMsg(EM_GETSELTEXT, 0, (long)buff); + text.UngetWriteBuf(); + } return text; } @@ -1049,7 +1053,7 @@ void wxStyledTextCtrl::MarkerDeleteAll(int markerNumber) { int wxStyledTextCtrl::MarkerGet(int line) { - return SendMsg(SCI_MARKERGET); + return SendMsg(SCI_MARKERGET, line); } @@ -1059,7 +1063,7 @@ int wxStyledTextCtrl::MarkerGetNextLine(int lineStart, int markerMask) { int wxStyledTextCtrl::MarkerGetPrevLine(int lineStart, int markerMask) { -// return SendMsg(SCI_MARKERPREV, lineStart, markerMask); +// TODO return SendMsg(SCI_MARKERPREV, lineStart, markerMask); return 0; } @@ -1140,7 +1144,7 @@ char wxStyledTextCtrl::AutoCompGetSeparator() { void wxStyledTextCtrl::AutoCompSelect(const wxString& stringtoselect) { - SendMsg(SCI_AUTOCSELECT, (long)stringtoselect.c_str()); + SendMsg(SCI_AUTOCSELECT, 0, (long)stringtoselect.c_str()); }