X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/451c5cc7b9e72f6231085056e91bcd53612e54bb..a4353f07c6b37712634d4b2d86527b647a08044f:/src/stc/stc.cpp diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 463780dd0f..1a8aca13cc 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -197,7 +197,7 @@ int wxStyledTextCtrl::GetLength() { // Returns the character byte at the position int wxStyledTextCtrl::GetCharAt(int pos) { - return SendMsg(2007, pos, 0); + return (unsigned char)SendMsg(2007, pos, 0); } // Returns the position of the caret @@ -212,7 +212,7 @@ int wxStyledTextCtrl::GetAnchor() { // Returns the style byte at the position int wxStyledTextCtrl::GetStyleAt(int pos) { - return SendMsg(2010, pos, 0); + return (unsigned char)SendMsg(2010, pos, 0); } // Redoes the next action on the undo history @@ -946,16 +946,13 @@ int wxStyledTextCtrl::GetPrintColourMode() { // Find some text in the document. int wxStyledTextCtrl::FindText(int minPos, int maxPos, - const wxString& text, - bool caseSensitive, bool wholeWord) { + const wxString& text, + int flags) { TextToFind ft; - int flags = 0; - - flags |= caseSensitive ? SCFIND_MATCHCASE : 0; - flags |= wholeWord ? SCFIND_WHOLEWORD : 0; ft.chrg.cpMin = minPos; ft.chrg.cpMax = maxPos; - ft.lpstrText = (char*)(const char*)wx2stc(text); + wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text); + ft.lpstrText = (char*)(const char*)buf; return SendMsg(2150, flags, (long)&ft); } @@ -1568,12 +1565,12 @@ void* wxStyledTextCtrl::CreateDocument() { // Extend life of document. void wxStyledTextCtrl::AddRefDocument(void* docPointer) { - SendMsg(2376, (long)docPointer); + SendMsg(2376, 0, (long)docPointer); } // Release a reference to the document, deleting document if it fades to black. void wxStyledTextCtrl::ReleaseDocument(void* docPointer) { - SendMsg(2377, (long)docPointer); + SendMsg(2377, 0, (long)docPointer); } // Get which document modification events are sent to the container. @@ -1877,10 +1874,10 @@ void wxStyledTextCtrl::OnScroll(wxScrollEvent& evt) { void wxStyledTextCtrl::OnSize(wxSizeEvent& evt) { wxSize sz = GetClientSize(); m_swx->DoSize(sz.x, sz.y); - Refresh(FALSE); } void wxStyledTextCtrl::OnMouseLeftDown(wxMouseEvent& evt) { + SetFocus(); wxPoint pt = evt.GetPosition(); m_swx->DoButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(), evt.ShiftDown(), evt.ControlDown(), evt.AltDown()); @@ -1915,7 +1912,8 @@ void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) { m_swx->DoMouseWheel(evt.GetWheelRotation(), evt.GetWheelDelta(), evt.GetLinesPerAction(), - evt.ControlDown()); + evt.ControlDown(), + evt.IsPageScroll()); } @@ -1930,8 +1928,8 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { bool alt = evt.AltDown(); bool skip = ((ctrl || alt) && ! (ctrl && alt)); - printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n", - key, m_lastKeyDownConsumed, ctrl, alt, skip); +// printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n", +// key, m_lastKeyDownConsumed, ctrl, alt, skip); if (key <= WXK_START && /*key >= 32 &&*/ !m_lastKeyDownConsumed && !skip) { m_swx->DoAddChar(key); @@ -1949,8 +1947,8 @@ void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) { int processed = m_swx->DoKeyDown(key, shift, ctrl, alt, &m_lastKeyDownConsumed); - printf("KeyDn key:%d shift:%d ctrl:%d alt:%d processed:%d consumed:%d\n", - key, shift, ctrl, alt, processed, m_lastKeyDownConsumed); +// printf("KeyDn key:%d shift:%d ctrl:%d alt:%d processed:%d consumed:%d\n", +// key, shift, ctrl, alt, processed, m_lastKeyDownConsumed); if (!processed && !m_lastKeyDownConsumed) evt.Skip(); @@ -2134,7 +2132,9 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id) m_x = 0; m_y = 0; m_dragAllowMove = FALSE; +#if wxUSE_DRAG_AND_DROP m_dragResult = wxDragNone; +#endif } bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; } @@ -2168,7 +2168,9 @@ wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent& event): m_dragText = event.m_dragText; m_dragAllowMove =event.m_dragAllowMove; +#if wxUSE_DRAG_AND_DROP m_dragResult = event.m_dragResult; +#endif } //----------------------------------------------------------------------