X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4370573a4513753d4ea559270b0fef797471f4dd..b075a3bbfd9ea0cd175456109981d1042730029c:/src/stc/stc.cpp diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 506493658e..a362eaf491 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -98,7 +98,7 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent, long style, const wxString& name) : wxControl(parent, id, pos, size, - style | wxVSCROLL | wxHSCROLL | wxWANTS_CHARS, + style | wxVSCROLL | wxHSCROLL | wxWANTS_CHARS | wxCLIP_CHILDREN, wxDefaultValidator, name) { m_swx = new ScintillaWX(this); @@ -119,6 +119,10 @@ long wxStyledTextCtrl::SendMsg(int msg, long wp, long lp) { } +#ifdef MAKELONG +#undef MAKELONG +#endif + #define MAKELONG(a, b) ((a) | ((b) << 16)) @@ -1478,6 +1482,17 @@ wxPoint wxStyledTextCtrl::PointFromPosition(int pos) { } +// Scroll enough to make the given line visible +void wxStyledTextCtrl::ScrollToLine(int line) { + m_swx->DoScrollToLine(line); +} + + +// Scroll enough to make the given column visible +void wxStyledTextCtrl::ScrollToColumn(int column) { + m_swx->DoScrollToColumn(column); +} + //---------------------------------------------------------------------- // Event handlers @@ -1524,16 +1539,38 @@ void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) { m_swx->DoContextMenu(Point(pt.x, pt.y)); } + void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { long key = evt.KeyCode(); - if ((key > WXK_ESCAPE) && - (key != WXK_DELETE) && (key < 255) && - !evt.ControlDown() && !evt.AltDown()) { - - m_swx->DoAddChar(key); - } - else { - evt.Skip(); + switch (key) { + // Special handling for charcters that must be typed with AltGr down on + // foreign keyboards. (Comes to us as Ctrl+Alt, and so would get + // filtered out by the default case below.) + // + // There should be a better way to do this... + // + case '\\': + case '|': + case '@': + case '#': + case '¬': + case '[': + case ']': + case '{': + case '}': + case '?': + m_swx->DoAddChar(key); + break; + + default: + if ((key > WXK_ESCAPE) && (key != WXK_DELETE) && (key < 255) && + !evt.ControlDown() && !evt.AltDown()) { + + m_swx->DoAddChar(key); + } + else { + evt.Skip(); + } } } @@ -1546,6 +1583,7 @@ void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) { evt.Skip(); } + void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) { m_swx->DoLoseFocus(); }