Clipboard usage fixes inspired by Tinderbox logs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
8afd90d57c
commit
caf448e3e1
@ -826,6 +826,8 @@ bool wxHtmlWindow::CopySelection(ClipboardType t)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#else
|
||||
wxUnusedVar(t);
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
|
||||
return false;
|
||||
@ -1027,6 +1029,8 @@ void wxHtmlWindow::OnMouseDown(wxMouseEvent& event)
|
||||
CaptureMouse();
|
||||
}
|
||||
}
|
||||
#else
|
||||
wxUnusedVar(event);
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
}
|
||||
|
||||
|
@ -574,7 +574,7 @@ bool wxComboBox::CanUndo() const
|
||||
{
|
||||
if (!IsEditable())
|
||||
return false;
|
||||
|
||||
|
||||
HWND hEditWnd = (HWND) GetEditHWND() ;
|
||||
if ( hEditWnd )
|
||||
return ::SendMessage(hEditWnd, EM_CANUNDO, 0, 0) != 0;
|
||||
@ -586,7 +586,7 @@ bool wxComboBox::CanRedo() const
|
||||
{
|
||||
if (!IsEditable())
|
||||
return false;
|
||||
|
||||
|
||||
HWND hEditWnd = (HWND) GetEditHWND() ;
|
||||
if ( hEditWnd )
|
||||
return ::SendMessage(hEditWnd, EM_CANUNDO, 0, 0) != 0;
|
||||
@ -697,6 +697,10 @@ void wxComboBox::Replace(long from, long to, const wxString& value)
|
||||
|
||||
// Paste into edit control
|
||||
SendMessage(GetHwnd(), WM_PASTE, (WPARAM)0, (LPARAM)0L);
|
||||
#else
|
||||
wxUnusedVar(from);
|
||||
wxUnusedVar(to);
|
||||
wxUnusedVar(value);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ void wxEnhMetaFile::Free()
|
||||
bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound)
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, _T("can't play invalid enhanced metafile") );
|
||||
wxCHECK_MSG( dc, FALSE, _T("invalid wxDC in wxEnhMetaFile::Play") );
|
||||
wxCHECK_MSG( dc, false, _T("invalid wxDC in wxEnhMetaFile::Play") );
|
||||
|
||||
RECT rect;
|
||||
if ( rectBound )
|
||||
@ -180,8 +180,8 @@ wxSize wxEnhMetaFile::GetSize() const
|
||||
|
||||
bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height))
|
||||
{
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
wxCHECK_MSG( m_hMF, FALSE, _T("can't copy invalid metafile to clipboard") );
|
||||
#if wxUSE_DRAG_AND_DROP && wxUSE_CLIPBOARD
|
||||
wxCHECK_MSG( m_hMF, false, _T("can't copy invalid metafile to clipboard") );
|
||||
|
||||
return wxTheClipboard->AddData(new wxEnhMetaFileDataObject(*this));
|
||||
#else // !wxUSE_DRAG_AND_DROP
|
||||
@ -318,7 +318,7 @@ bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf)
|
||||
|
||||
// first get the buffer size and alloc memory
|
||||
size_t size = ::GetWinMetaFileBits(hEMF, 0, NULL, MM_ANISOTROPIC, hdc);
|
||||
wxCHECK_MSG( size, FALSE, _T("GetWinMetaFileBits() failed") );
|
||||
wxCHECK_MSG( size, false, _T("GetWinMetaFileBits() failed") );
|
||||
|
||||
BYTE *bits = (BYTE *)malloc(size);
|
||||
|
||||
@ -366,7 +366,7 @@ bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format,
|
||||
{
|
||||
hEMF = *(HENHMETAFILE *)buf;
|
||||
|
||||
wxCHECK_MSG( hEMF, FALSE, _T("pasting invalid enh metafile") );
|
||||
wxCHECK_MSG( hEMF, false, _T("pasting invalid enh metafile") );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -377,7 +377,7 @@ bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format,
|
||||
|
||||
// first get the buffer size
|
||||
size_t size = ::GetMetaFileBitsEx(mfpict->hMF, 0, NULL);
|
||||
wxCHECK_MSG( size, FALSE, _T("GetMetaFileBitsEx() failed") );
|
||||
wxCHECK_MSG( size, false, _T("GetMetaFileBitsEx() failed") );
|
||||
|
||||
// then get metafile bits
|
||||
BYTE *bits = (BYTE *)malloc(size);
|
||||
@ -441,7 +441,7 @@ bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len),
|
||||
{
|
||||
HENHMETAFILE hEMF = *(HENHMETAFILE *)buf;
|
||||
|
||||
wxCHECK_MSG( hEMF, FALSE, _T("pasting invalid enh metafile") );
|
||||
wxCHECK_MSG( hEMF, false, _T("pasting invalid enh metafile") );
|
||||
m_metafile.SetHENHMETAFILE((WXHANDLE)hEMF);
|
||||
|
||||
return true;
|
||||
|
@ -421,7 +421,9 @@ void ctMainFrame::OnUpdateDisable(wxUpdateUIEvent& event)
|
||||
IMPLEMENT_CLASS(ctOutputWindow, wxPanel)
|
||||
|
||||
BEGIN_EVENT_TABLE(ctOutputWindow, wxPanel)
|
||||
#if wxUSE_CLIPBOARD
|
||||
EVT_BUTTON(wxID_COPY, ctOutputWindow::OnCopyToClipboard)
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
EVT_BUTTON(wxID_SAVE, ctOutputWindow::OnSaveText)
|
||||
EVT_BUTTON(ctID_REGENERATE, ctOutputWindow::OnRegenerate)
|
||||
EVT_UPDATE_UI(wxID_SAVE, ctOutputWindow::OnUpdateSaveText)
|
||||
@ -471,6 +473,7 @@ void ctOutputWindow::CreateWindows()
|
||||
SetSizer( item0 );
|
||||
}
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
/// Copies the text to the clipboard.
|
||||
void ctOutputWindow::OnCopyToClipboard(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
@ -506,6 +509,7 @@ void ctOutputWindow::OnCopyToClipboard(wxCommandEvent& WXUNUSED(event))
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
|
||||
/// Sets the code in the text control.
|
||||
void ctOutputWindow::SetText(const wxString& text)
|
||||
|
@ -184,7 +184,9 @@ public:
|
||||
void CreateWindows();
|
||||
|
||||
/// Copies the text to the clipboard.
|
||||
#if wxUSE_CLIPBOARD
|
||||
void OnCopyToClipboard(wxCommandEvent& event);
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
void OnUpdateCopy(wxUpdateUIEvent& event);
|
||||
|
||||
/// Regenerates setup.h/configure command
|
||||
|
Loading…
Reference in New Issue
Block a user