Fixed some bugs in new code (CanPaste, GetSelection)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -747,8 +747,24 @@ bool wxTextCtrl::CanCut() const
|
|||||||
|
|
||||||
bool wxTextCtrl::CanPaste() const
|
bool wxTextCtrl::CanPaste() const
|
||||||
{
|
{
|
||||||
int dataFormat = 0; // 0 == any format
|
#if wxUSE_RICHEDIT
|
||||||
return (::SendMessage( (HWND) GetHWND(), EM_CANPASTE, (WPARAM) (UINT) dataFormat, 0) != 0);
|
if (m_isRich)
|
||||||
|
{
|
||||||
|
int dataFormat = 0; // 0 == any format
|
||||||
|
return (::SendMessage( (HWND) GetHWND(), EM_CANPASTE, (WPARAM) (UINT) dataFormat, 0) != 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!IsEditable())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
// Standard edit control: check for straight text on clipboard
|
||||||
|
bool isTextAvailable = FALSE;
|
||||||
|
if (::OpenClipboard((HWND) wxTheApp->GetTopWindow()->GetHWND()))
|
||||||
|
{
|
||||||
|
isTextAvailable = (::IsClipboardFormatAvailable(CF_TEXT) != 0);
|
||||||
|
::CloseClipboard();
|
||||||
|
}
|
||||||
|
return isTextAvailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Undo/redo
|
// Undo/redo
|
||||||
@@ -796,8 +812,8 @@ void wxTextCtrl::GetSelection(long* from, long* to) const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
DWORD dwStart, dwEnd;
|
DWORD dwStart, dwEnd;
|
||||||
WPARAM wParam = (WPARAM) (DWORD*) dwStart; // receives starting position
|
WPARAM wParam = (WPARAM) (DWORD*) & dwStart; // receives starting position
|
||||||
LPARAM lParam = (LPARAM) (DWORD*) dwEnd; // receives ending position
|
LPARAM lParam = (LPARAM) (DWORD*) & dwEnd; // receives ending position
|
||||||
|
|
||||||
::SendMessage((HWND) GetHWND(), EM_GETSEL, wParam, lParam);
|
::SendMessage((HWND) GetHWND(), EM_GETSEL, wParam, lParam);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user