From: Robin Dunn Date: Fri, 30 Nov 2001 02:16:27 +0000 (+0000) Subject: Another blind attempt to fix AltGr issues in wxSTC, and a context menu X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ddf2da08b5d1beb45caea2c5368c66a8a9bf5878 Another blind attempt to fix AltGr issues in wxSTC, and a context menu fix for wxGTK. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/contrib/include/wx/stc/stc.h b/contrib/include/wx/stc/stc.h index 49effbce94..804e4baba5 100644 --- a/contrib/include/wx/stc/stc.h +++ b/contrib/include/wx/stc/stc.h @@ -1615,6 +1615,7 @@ private: void OnMouseLeftDown(wxMouseEvent& evt); void OnMouseMove(wxMouseEvent& evt); void OnMouseLeftUp(wxMouseEvent& evt); + void OnMouseRightUp(wxMouseEvent& evt); void OnContextMenu(wxContextMenuEvent& evt); void OnMouseWheel(wxMouseEvent& evt); void OnChar(wxKeyEvent& evt); diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index 4435d6db06..003d4e4800 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -112,7 +112,11 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl) #endif EVT_MOTION (wxStyledTextCtrl::OnMouseMove) EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp) +#ifdef __WXGTK__ + EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp) +#else EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu) +#endif EVT_MOUSEWHEEL (wxStyledTextCtrl::OnMouseWheel) EVT_CHAR (wxStyledTextCtrl::OnChar) EVT_KEY_DOWN (wxStyledTextCtrl::OnKeyDown) @@ -1837,6 +1841,12 @@ void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent& evt) { } +void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) { + wxPoint pt = evt.GetPosition(); + m_swx->DoContextMenu(Point(pt.x, pt.y)); +} + + void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) { wxPoint pt = evt.GetPosition(); ScreenToClient(&pt.x, &pt.y); @@ -1869,7 +1879,7 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { bool alt = evt.AltDown(); bool skip = ((ctrl || alt) && ! (ctrl && alt)); - if (key <= 0xff && !iscntrl(key) && !m_lastKeyDownConsumed && !skip) { + if (key <= 0xff && key >= 32 && !m_lastKeyDownConsumed && !skip) { m_swx->DoAddChar(key); return; } diff --git a/contrib/src/stc/stc.cpp.in b/contrib/src/stc/stc.cpp.in index eff7ed2936..f58188408a 100644 --- a/contrib/src/stc/stc.cpp.in +++ b/contrib/src/stc/stc.cpp.in @@ -112,7 +112,11 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl) #endif EVT_MOTION (wxStyledTextCtrl::OnMouseMove) EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp) +#ifdef __WXGTK__ + EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp) +#else EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu) +#endif EVT_MOUSEWHEEL (wxStyledTextCtrl::OnMouseWheel) EVT_CHAR (wxStyledTextCtrl::OnChar) EVT_KEY_DOWN (wxStyledTextCtrl::OnKeyDown) @@ -381,6 +385,12 @@ void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent& evt) { } +void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) { + wxPoint pt = evt.GetPosition(); + m_swx->DoContextMenu(Point(pt.x, pt.y)); +} + + void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) { wxPoint pt = evt.GetPosition(); ScreenToClient(&pt.x, &pt.y); @@ -413,7 +423,7 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { bool alt = evt.AltDown(); bool skip = ((ctrl || alt) && ! (ctrl && alt)); - if (key <= 0xff && !iscntrl(key) && !m_lastKeyDownConsumed && !skip) { + if (key <= 0xff && key >= 32 && !m_lastKeyDownConsumed && !skip) { m_swx->DoAddChar(key); return; } diff --git a/contrib/src/stc/stc.h.in b/contrib/src/stc/stc.h.in index e49b8ce97d..6a84dc5acb 100644 --- a/contrib/src/stc/stc.h.in +++ b/contrib/src/stc/stc.h.in @@ -169,6 +169,7 @@ private: void OnMouseLeftDown(wxMouseEvent& evt); void OnMouseMove(wxMouseEvent& evt); void OnMouseLeftUp(wxMouseEvent& evt); + void OnMouseRightUp(wxMouseEvent& evt); void OnContextMenu(wxContextMenuEvent& evt); void OnMouseWheel(wxMouseEvent& evt); void OnChar(wxKeyEvent& evt); diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 49effbce94..804e4baba5 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -1615,6 +1615,7 @@ private: void OnMouseLeftDown(wxMouseEvent& evt); void OnMouseMove(wxMouseEvent& evt); void OnMouseLeftUp(wxMouseEvent& evt); + void OnMouseRightUp(wxMouseEvent& evt); void OnContextMenu(wxContextMenuEvent& evt); void OnMouseWheel(wxMouseEvent& evt); void OnChar(wxKeyEvent& evt); diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 4435d6db06..003d4e4800 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -112,7 +112,11 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl) #endif EVT_MOTION (wxStyledTextCtrl::OnMouseMove) EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp) +#ifdef __WXGTK__ + EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp) +#else EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu) +#endif EVT_MOUSEWHEEL (wxStyledTextCtrl::OnMouseWheel) EVT_CHAR (wxStyledTextCtrl::OnChar) EVT_KEY_DOWN (wxStyledTextCtrl::OnKeyDown) @@ -1837,6 +1841,12 @@ void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent& evt) { } +void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) { + wxPoint pt = evt.GetPosition(); + m_swx->DoContextMenu(Point(pt.x, pt.y)); +} + + void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) { wxPoint pt = evt.GetPosition(); ScreenToClient(&pt.x, &pt.y); @@ -1869,7 +1879,7 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { bool alt = evt.AltDown(); bool skip = ((ctrl || alt) && ! (ctrl && alt)); - if (key <= 0xff && !iscntrl(key) && !m_lastKeyDownConsumed && !skip) { + if (key <= 0xff && key >= 32 && !m_lastKeyDownConsumed && !skip) { m_swx->DoAddChar(key); return; } diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index eff7ed2936..f58188408a 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -112,7 +112,11 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl) #endif EVT_MOTION (wxStyledTextCtrl::OnMouseMove) EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp) +#ifdef __WXGTK__ + EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp) +#else EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu) +#endif EVT_MOUSEWHEEL (wxStyledTextCtrl::OnMouseWheel) EVT_CHAR (wxStyledTextCtrl::OnChar) EVT_KEY_DOWN (wxStyledTextCtrl::OnKeyDown) @@ -381,6 +385,12 @@ void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent& evt) { } +void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) { + wxPoint pt = evt.GetPosition(); + m_swx->DoContextMenu(Point(pt.x, pt.y)); +} + + void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) { wxPoint pt = evt.GetPosition(); ScreenToClient(&pt.x, &pt.y); @@ -413,7 +423,7 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { bool alt = evt.AltDown(); bool skip = ((ctrl || alt) && ! (ctrl && alt)); - if (key <= 0xff && !iscntrl(key) && !m_lastKeyDownConsumed && !skip) { + if (key <= 0xff && key >= 32 && !m_lastKeyDownConsumed && !skip) { m_swx->DoAddChar(key); return; } diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index e49b8ce97d..6a84dc5acb 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -169,6 +169,7 @@ private: void OnMouseLeftDown(wxMouseEvent& evt); void OnMouseMove(wxMouseEvent& evt); void OnMouseLeftUp(wxMouseEvent& evt); + void OnMouseRightUp(wxMouseEvent& evt); void OnContextMenu(wxContextMenuEvent& evt); void OnMouseWheel(wxMouseEvent& evt); void OnChar(wxKeyEvent& evt);