From 1bd1d102fd2a4592da8ac6178d74168c4c342e7e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 4 Oct 1999 22:55:47 +0000 Subject: [PATCH] use BMPs and npt PNGs under MSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3830 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/dnd/dnd.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index b8cc40a8c3..c5159b9905 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -295,11 +295,11 @@ void DnDFrame::OnClipboardHasText(wxCommandEvent& WXUNUSED(event)) if ( !wxTheClipboard->IsSupported( wxDF_TEXT ) ) { - wxLogMessage( _T("No text is on the clipboard") ); + wxLogMessage( _T("No text on the clipboard") ); } else { - wxLogMessage( _T("There is text is on the clipboard") ); + wxLogMessage( _T("There is text on the clipboard") ); } wxTheClipboard->Close(); @@ -316,11 +316,11 @@ void DnDFrame::OnClipboardHasBitmap(wxCommandEvent& WXUNUSED(event)) if ( !wxTheClipboard->IsSupported( wxDF_BITMAP ) ) { - wxLogMessage( _T("No bitmap is on the clipboard") ); + wxLogMessage( _T("No bitmap on the clipboard") ); } else { - wxLogMessage( _T("A bitmap is on the clipboard") ); + wxLogMessage( _T("There is a bitmap on the clipboard") ); } wxTheClipboard->Close(); @@ -435,7 +435,12 @@ DnDFrame::~DnDFrame() void DnDFrame::OnCopyBitmap(wxCommandEvent& WXUNUSED(event)) { + // PNG support is not always compiled in under Windows, so use BMP there +#ifdef __WXMSW__ + wxFileDialog dialog(this, "Open a BMP file", "", "", "BMP files (*.bmp)|*.bmp", 0); +#else wxFileDialog dialog(this, "Open a PNG file", "", "", "PNG files (*.png)|*.png", 0); +#endif if (dialog.ShowModal() != wxID_OK) { @@ -456,7 +461,13 @@ void DnDFrame::OnCopyBitmap(wxCommandEvent& WXUNUSED(event)) } wxImage image; - image.LoadFile( dialog.GetPath(), wxBITMAP_TYPE_PNG ); + image.LoadFile( dialog.GetPath(), +#ifdef __WXMSW__ + wxBITMAP_TYPE_BMP +#else + wxBITMAP_TYPE_PNG +#endif + ); if (!image.Ok()) { wxLogMessage( _T("Invalid image file...") ); -- 2.45.2