Add a test for wxEVT_CONTEXT_MENU to the text sample.
Log a message if this message is received, which shows that it currently isn't for the control with wxTE_RICH style under MSW.
This commit is contained in:
@@ -84,6 +84,7 @@ public:
|
||||
void OnTextPaste(wxClipboardTextEvent & event);
|
||||
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnContextMenu(wxContextMenuEvent& event);
|
||||
|
||||
void OnSetFocus(wxFocusEvent& event);
|
||||
void OnKillFocus(wxFocusEvent& event);
|
||||
@@ -573,6 +574,7 @@ wxBEGIN_EVENT_TABLE(MyTextCtrl, wxTextCtrl)
|
||||
EVT_TEXT_PASTE(wxID_ANY, MyTextCtrl::OnTextPaste)
|
||||
|
||||
EVT_MOUSE_EVENTS(MyTextCtrl::OnMouseEvent)
|
||||
EVT_CONTEXT_MENU(MyTextCtrl::OnContextMenu)
|
||||
|
||||
EVT_SET_FOCUS(MyTextCtrl::OnSetFocus)
|
||||
EVT_KILL_FOCUS(MyTextCtrl::OnKillFocus)
|
||||
@@ -816,6 +818,17 @@ void MyTextCtrl::OnMouseEvent(wxMouseEvent& ev)
|
||||
//else: we're not interested in mouse move events
|
||||
}
|
||||
|
||||
void MyTextCtrl::OnContextMenu(wxContextMenuEvent& ev)
|
||||
{
|
||||
ev.Skip();
|
||||
|
||||
if ( !ms_logMouse )
|
||||
return;
|
||||
|
||||
const wxPoint pos = ev.GetPosition();
|
||||
wxLogMessage("Context menu event at (%d, %d)", pos.x, pos.y);
|
||||
}
|
||||
|
||||
void MyTextCtrl::OnSetFocus(wxFocusEvent& event)
|
||||
{
|
||||
if ( ms_logFocus )
|
||||
|
Reference in New Issue
Block a user