Expand the range of WXK_ values that are excluded from OnChar.
Correct the position of the context menu. (SF# 921247) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26296 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2656,6 +2656,14 @@ void wxStyledTextCtrl::OnMouseMiddleUp(wxMouseEvent& evt) {
|
|||||||
void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) {
|
void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) {
|
||||||
wxPoint pt = evt.GetPosition();
|
wxPoint pt = evt.GetPosition();
|
||||||
ScreenToClient(&pt.x, &pt.y);
|
ScreenToClient(&pt.x, &pt.y);
|
||||||
|
/*
|
||||||
|
Show context menu at event point if it's within the window,
|
||||||
|
or at caret location if not
|
||||||
|
*/
|
||||||
|
wxHitTest ht = this->HitTest(pt);
|
||||||
|
if (ht != wxHT_WINDOW_INSIDE) {
|
||||||
|
pt = this->PointFromPosition(this->GetCurrentPos());
|
||||||
|
}
|
||||||
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2683,7 +2691,7 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) {
|
|||||||
// printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
|
// printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
|
||||||
// key, m_lastKeyDownConsumed, ctrl, alt, skip);
|
// key, m_lastKeyDownConsumed, ctrl, alt, skip);
|
||||||
|
|
||||||
if ( (key <= WXK_START || key > WXK_NUMPAD_DIVIDE) &&
|
if ( (key <= WXK_START || key > WXK_COMMAND) &&
|
||||||
!m_lastKeyDownConsumed && !skip) {
|
!m_lastKeyDownConsumed && !skip) {
|
||||||
m_swx->DoAddChar(key);
|
m_swx->DoAddChar(key);
|
||||||
return;
|
return;
|
||||||
|
@@ -465,6 +465,14 @@ void wxStyledTextCtrl::OnMouseMiddleUp(wxMouseEvent& evt) {
|
|||||||
void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) {
|
void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) {
|
||||||
wxPoint pt = evt.GetPosition();
|
wxPoint pt = evt.GetPosition();
|
||||||
ScreenToClient(&pt.x, &pt.y);
|
ScreenToClient(&pt.x, &pt.y);
|
||||||
|
/*
|
||||||
|
Show context menu at event point if it's within the window,
|
||||||
|
or at caret location if not
|
||||||
|
*/
|
||||||
|
wxHitTest ht = this->HitTest(pt);
|
||||||
|
if (ht != wxHT_WINDOW_INSIDE) {
|
||||||
|
pt = this->PointFromPosition(this->GetCurrentPos());
|
||||||
|
}
|
||||||
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,7 +500,7 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) {
|
|||||||
// printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
|
// printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
|
||||||
// key, m_lastKeyDownConsumed, ctrl, alt, skip);
|
// key, m_lastKeyDownConsumed, ctrl, alt, skip);
|
||||||
|
|
||||||
if ( (key <= WXK_START || key > WXK_NUMPAD_DIVIDE) &&
|
if ( (key <= WXK_START || key > WXK_COMMAND) &&
|
||||||
!m_lastKeyDownConsumed && !skip) {
|
!m_lastKeyDownConsumed && !skip) {
|
||||||
m_swx->DoAddChar(key);
|
m_swx->DoAddChar(key);
|
||||||
return;
|
return;
|
||||||
|
@@ -2656,6 +2656,14 @@ void wxStyledTextCtrl::OnMouseMiddleUp(wxMouseEvent& evt) {
|
|||||||
void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) {
|
void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) {
|
||||||
wxPoint pt = evt.GetPosition();
|
wxPoint pt = evt.GetPosition();
|
||||||
ScreenToClient(&pt.x, &pt.y);
|
ScreenToClient(&pt.x, &pt.y);
|
||||||
|
/*
|
||||||
|
Show context menu at event point if it's within the window,
|
||||||
|
or at caret location if not
|
||||||
|
*/
|
||||||
|
wxHitTest ht = this->HitTest(pt);
|
||||||
|
if (ht != wxHT_WINDOW_INSIDE) {
|
||||||
|
pt = this->PointFromPosition(this->GetCurrentPos());
|
||||||
|
}
|
||||||
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2683,7 +2691,7 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) {
|
|||||||
// printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
|
// printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
|
||||||
// key, m_lastKeyDownConsumed, ctrl, alt, skip);
|
// key, m_lastKeyDownConsumed, ctrl, alt, skip);
|
||||||
|
|
||||||
if ( (key <= WXK_START || key > WXK_NUMPAD_DIVIDE) &&
|
if ( (key <= WXK_START || key > WXK_COMMAND) &&
|
||||||
!m_lastKeyDownConsumed && !skip) {
|
!m_lastKeyDownConsumed && !skip) {
|
||||||
m_swx->DoAddChar(key);
|
m_swx->DoAddChar(key);
|
||||||
return;
|
return;
|
||||||
|
@@ -465,6 +465,14 @@ void wxStyledTextCtrl::OnMouseMiddleUp(wxMouseEvent& evt) {
|
|||||||
void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) {
|
void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) {
|
||||||
wxPoint pt = evt.GetPosition();
|
wxPoint pt = evt.GetPosition();
|
||||||
ScreenToClient(&pt.x, &pt.y);
|
ScreenToClient(&pt.x, &pt.y);
|
||||||
|
/*
|
||||||
|
Show context menu at event point if it's within the window,
|
||||||
|
or at caret location if not
|
||||||
|
*/
|
||||||
|
wxHitTest ht = this->HitTest(pt);
|
||||||
|
if (ht != wxHT_WINDOW_INSIDE) {
|
||||||
|
pt = this->PointFromPosition(this->GetCurrentPos());
|
||||||
|
}
|
||||||
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,7 +500,7 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) {
|
|||||||
// printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
|
// printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
|
||||||
// key, m_lastKeyDownConsumed, ctrl, alt, skip);
|
// key, m_lastKeyDownConsumed, ctrl, alt, skip);
|
||||||
|
|
||||||
if ( (key <= WXK_START || key > WXK_NUMPAD_DIVIDE) &&
|
if ( (key <= WXK_START || key > WXK_COMMAND) &&
|
||||||
!m_lastKeyDownConsumed && !skip) {
|
!m_lastKeyDownConsumed && !skip) {
|
||||||
m_swx->DoAddChar(key);
|
m_swx->DoAddChar(key);
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user