added clipboard events (wxEVT_COMMAND_TEXT_COPY/CUT/PASTE) and implemented them for wxMSW

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-05-12 15:21:41 +00:00
parent 6905dfe91d
commit 78c9181500
10 changed files with 253 additions and 2 deletions

View File

@@ -258,10 +258,49 @@ BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
EVT_SET_FOCUS(wxTextCtrl::OnSetFocus)
END_EVENT_TABLE()
// ----------------------------------------------------------------------------
// function prototypes
// ----------------------------------------------------------------------------
LRESULT APIENTRY _EXPORT wxTextCtrlWndProc(HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam);
// ---------------------------------------------------------------------------
// global vars
// ---------------------------------------------------------------------------
// the pointer to standard text control wnd proc
static WNDPROC gs_wndprocEdit = (WNDPROC)NULL;
// ============================================================================
// implementation
// ============================================================================
// ----------------------------------------------------------------------------
// wnd proc for subclassed edit control
// ----------------------------------------------------------------------------
LRESULT APIENTRY _EXPORT wxTextCtrlWndProc(HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam)
{
wxWindow *win = wxFindWinFromHandle((WXHWND)hWnd);
switch ( message )
{
case WM_CUT:
case WM_COPY:
case WM_PASTE:
if( win->HandleClipboardEvent( message ) )
return 0;
break;
}
return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
}
// ----------------------------------------------------------------------------
// creation
// ----------------------------------------------------------------------------
@@ -479,6 +518,9 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
}
#endif // wxUSE_RICHEDIT
gs_wndprocEdit = wxSetWindowProc((HWND)GetHwnd(),
wxTextCtrlWndProc);
return true;
}