X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4e7c2aa5822f9a6e97d8d7848b95ea2eadcd98b..f8a3e080aaf03010044191b373d27c2e17cbd7d9:/src/msw/clipbrd.cpp diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 8ee3cc7593..bd37c1ba56 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -10,7 +10,6 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation #pragma implementation "clipbrd.h" #endif @@ -25,9 +24,11 @@ #include "wx/setup.h" #endif -#if USE_CLIPBOARD +#if wxUSE_CLIPBOARD #ifndef WX_PRECOMP +#include "wx/object.h" +#include "wx/event.h" #include "wx/app.h" #include "wx/frame.h" #include "wx/bitmap.h" @@ -86,7 +87,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) { switch (dataFormat) { - case wxCF_BITMAP: + case wxDF_BITMAP: { wxBitmap *wxBM = (wxBitmap *)obj; @@ -119,9 +120,9 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) return success; break; } - case wxCF_DIB: + case wxDF_DIB: { -#if USE_IMAGE_LOADING_IN_MSW +#if wxUSE_IMAGE_LOADING_IN_MSW HBITMAP hBitmap=(HBITMAP) ((wxBitmap *)obj)->GetHBITMAP(); HANDLE hDIB=BitmapToDIB(hBitmap,NULL); // NULL==uses system palette bool success = (::SetClipboardData(CF_DIB,hDIB) != 0); @@ -131,8 +132,8 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) return success; break; } -#if USE_METAFILE - case wxCF_METAFILE: +#if wxUSE_METAFILE + case wxDF_METAFILE: { wxMetaFile *wxMF = (wxMetaFile *)obj; HANDLE data = GlobalAlloc(GHND, sizeof(METAFILEPICT) + 1); @@ -161,9 +162,9 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) return FALSE; break; } - case wxCF_OEMTEXT: - dataFormat = wxCF_TEXT; - case wxCF_TEXT: + case wxDF_OEMTEXT: + dataFormat = wxDF_TEXT; + case wxDF_TEXT: width = strlen((char *)obj) + 1; height = 1; default: @@ -203,7 +204,7 @@ wxObject *wxGetClipboardData(int dataFormat, long *len) { switch (dataFormat) { - case wxCF_BITMAP: + case wxDF_BITMAP: { BITMAP bm; HBITMAP hBitmap = (HBITMAP) GetClipboardData(CF_BITMAP); @@ -248,19 +249,19 @@ wxObject *wxGetClipboardData(int dataFormat, long *len) return (wxObject *)wxBM; break; } - case wxCF_METAFILE: + case wxDF_METAFILE: case CF_SYLK: case CF_DIF: case CF_TIFF: case CF_PALETTE: - case wxCF_DIB: + case wxDF_DIB: { return FALSE; break; } - case wxCF_OEMTEXT: - dataFormat = wxCF_TEXT; - case wxCF_TEXT: + case wxDF_OEMTEXT: + dataFormat = wxDF_TEXT; + case wxDF_TEXT: default: { HANDLE hGlobalMemory = GetClipboardData(dataFormat); @@ -342,8 +343,8 @@ wxClipboard::~wxClipboard() static int FormatStringToID(char *str) { if (!strcmp(str, "TEXT")) - return wxCF_TEXT; - + return wxDF_TEXT; + return wxRegisterClipboardFormat(str); } @@ -407,7 +408,7 @@ void wxClipboard::SetClipboardString(char *str, long time) cbString = str; if (wxOpenClipboard()) { - if (!wxSetClipboardData(wxCF_TEXT, (wxObject *)str)) + if (!wxSetClipboardData(wxDF_TEXT, (wxObject *)str)) got_selection = FALSE; else got_selection = wxCloseClipboard(); @@ -461,5 +462,5 @@ char *wxClipboard::GetClipboardData(char *format, long *length, long time) } -#endif // USE_CLIPBOARD +#endif // wxUSE_CLIPBOARD