Updated to Scintilla 1.54
Applied most of patch #806092 Added new wxSTC sample from Otto Wyss git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -475,7 +475,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
|
||||
buff[len] = 0;
|
||||
SendMsg(2049, markerNumber, (long)buff);
|
||||
delete [] buff;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Set a margin to be either numeric or symbolic.
|
||||
@@ -858,7 +858,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
|
||||
buff[len] = 0;
|
||||
SendMsg(2405, type, (long)buff);
|
||||
delete [] buff;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Clear all the registered images.
|
||||
@@ -1802,12 +1802,12 @@ bool wxStyledTextCtrl::GetMouseDownCaptures() {
|
||||
}
|
||||
|
||||
// Sets the cursor to one of the SC_CURSOR* values.
|
||||
void wxStyledTextCtrl::SetCursor(int cursorType) {
|
||||
void wxStyledTextCtrl::SetSTCCursor(int cursorType) {
|
||||
SendMsg(2386, cursorType, 0);
|
||||
}
|
||||
|
||||
// Get cursor type.
|
||||
int wxStyledTextCtrl::GetCursor() {
|
||||
int wxStyledTextCtrl::GetSTCCursor() {
|
||||
return SendMsg(2387, 0, 0);
|
||||
}
|
||||
|
||||
@@ -2115,11 +2115,11 @@ bool wxStyledTextCtrl::SaveFile(const wxString& filename)
|
||||
if (!file.IsOpened())
|
||||
return FALSE;
|
||||
|
||||
bool success = file.Write(GetText());
|
||||
bool success = file.Write(GetText(), *wxConvCurrent);
|
||||
|
||||
if (success)
|
||||
if (success) {
|
||||
SetSavePoint();
|
||||
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -2131,13 +2131,23 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
||||
if (file.IsOpened())
|
||||
{
|
||||
wxString contents;
|
||||
#if wxUSE_UNICODE
|
||||
wxMemoryBuffer buffer;
|
||||
#else
|
||||
wxString buffer;
|
||||
#endif
|
||||
|
||||
off_t len = file.Length();
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
wxChar *buf = contents.GetWriteBuf(len);
|
||||
success = (file.Read(buf, len) == len);
|
||||
contents.UngetWriteBuf();
|
||||
void *bufptr = buffer.GetWriteBuf(len);
|
||||
success = (file.Read(bufptr, len) == len);
|
||||
buffer.UngetWriteBuf(len);
|
||||
#if wxUSE_UNICODE
|
||||
contents = wxString(buffer, *wxConvCurrent);
|
||||
#else
|
||||
contents = buffer;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
success = true; // empty file is ok
|
||||
@@ -2157,7 +2167,7 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
||||
//----------------------------------------------------------------------
|
||||
// Event handlers
|
||||
|
||||
void wxStyledTextCtrl::OnPaint(wxPaintEvent& evt) {
|
||||
void wxStyledTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(evt)) {
|
||||
wxPaintDC dc(this);
|
||||
m_swx->DoPaint(&dc, GetUpdateRegion().GetBox());
|
||||
}
|
||||
@@ -2179,7 +2189,7 @@ void wxStyledTextCtrl::OnScroll(wxScrollEvent& evt) {
|
||||
}
|
||||
}
|
||||
|
||||
void wxStyledTextCtrl::OnSize(wxSizeEvent& evt) {
|
||||
void wxStyledTextCtrl::OnSize(wxSizeEvent& WXUNUSED(evt)) {
|
||||
wxSize sz = GetClientSize();
|
||||
m_swx->DoSize(sz.x, sz.y);
|
||||
}
|
||||
@@ -2257,9 +2267,10 @@ void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) {
|
||||
int key = evt.GetKeyCode();
|
||||
bool shift = evt.ShiftDown(),
|
||||
ctrl = evt.ControlDown(),
|
||||
alt = evt.AltDown();
|
||||
alt = evt.AltDown(),
|
||||
meta = evt.MetaDown();
|
||||
|
||||
int processed = m_swx->DoKeyDown(key, shift, ctrl, alt, &m_lastKeyDownConsumed);
|
||||
int processed = m_swx->DoKeyDown(key, shift, ctrl, alt, meta, &m_lastKeyDownConsumed);
|
||||
|
||||
// printf("KeyDn key:%d shift:%d ctrl:%d alt:%d processed:%d consumed:%d\n",
|
||||
// key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
|
||||
@@ -2269,22 +2280,22 @@ void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) {
|
||||
}
|
||||
|
||||
|
||||
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
|
||||
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& WXUNUSED(evt)) {
|
||||
m_swx->DoLoseFocus();
|
||||
}
|
||||
|
||||
|
||||
void wxStyledTextCtrl::OnGainFocus(wxFocusEvent& evt) {
|
||||
void wxStyledTextCtrl::OnGainFocus(wxFocusEvent& WXUNUSED(evt)) {
|
||||
m_swx->DoGainFocus();
|
||||
}
|
||||
|
||||
|
||||
void wxStyledTextCtrl::OnSysColourChanged(wxSysColourChangedEvent& evt) {
|
||||
void wxStyledTextCtrl::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(evt)) {
|
||||
m_swx->DoSysColourChange();
|
||||
}
|
||||
|
||||
|
||||
void wxStyledTextCtrl::OnEraseBackground(wxEraseEvent& evt) {
|
||||
void wxStyledTextCtrl::OnEraseBackground(wxEraseEvent& WXUNUSED(evt)) {
|
||||
// do nothing to help avoid flashing
|
||||
}
|
||||
|
||||
@@ -2295,7 +2306,7 @@ void wxStyledTextCtrl::OnMenu(wxCommandEvent& evt) {
|
||||
}
|
||||
|
||||
|
||||
void wxStyledTextCtrl::OnListBox(wxCommandEvent& evt) {
|
||||
void wxStyledTextCtrl::OnListBox(wxCommandEvent& WXUNUSED(evt)) {
|
||||
m_swx->DoOnListBox();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user