+
+void MyTextCtrl::OnTextCut(wxClipboardTextEvent& event)
+{
+ LogClipEvent(_T("cut to"), event);
+}
+
+void MyTextCtrl::OnTextCopy(wxClipboardTextEvent& event)
+{
+ LogClipEvent(_T("copied to"), event);
+}
+
+void MyTextCtrl::OnTextPaste(wxClipboardTextEvent& event)
+{
+ LogClipEvent(_T("pasted from"), event);
+}
+
+void MyTextCtrl::LogClipEvent(const wxChar *what, wxClipboardTextEvent& event)
+{
+ wxFrame *frame = wxDynamicCast(wxGetTopLevelParent(this), wxFrame);
+ wxCHECK_RET( frame, _T("no parent frame?") );
+
+ const bool veto = frame->GetMenuBar()->IsChecked(TEXT_CLIPBOARD_VETO);
+ if ( !veto )
+ event.Skip();
+
+ if ( ms_logClip )
+ {
+ wxLogMessage(_T("Text %s%s the clipboard."),
+ veto ? _T("not ") : _T(""), what);
+ }
+}
+
+