X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..dc1c4b62139143b546a78f1aeebbafa1e58fc6e9:/src/msw/clipbrd.cpp diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index af48db1a5a..0c92cfc8e2 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -86,13 +86,13 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) { switch (dataFormat) { - case wxCF_BITMAP: + case wxDF_BITMAP: { wxBitmap *wxBM = (wxBitmap *)obj; HDC hdcMem = CreateCompatibleDC(NULL); HDC hdcSrc = CreateCompatibleDC(NULL); - HBITMAP old = ::SelectObject(hdcSrc, (HBITMAP) wxBM->GetHBITMAP()); + HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, (HBITMAP) wxBM->GetHBITMAP()); HBITMAP hBitmap = CreateCompatibleBitmap(hdcSrc, wxBM->GetWidth(), wxBM->GetHeight()); if (!hBitmap) @@ -102,7 +102,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) DeleteDC(hdcSrc); return FALSE; } - HBITMAP old1 = SelectObject(hdcMem, hBitmap); + HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hBitmap); BitBlt(hdcMem, 0, 0, wxBM->GetWidth(), wxBM->GetHeight(), hdcSrc, 0, 0, SRCCOPY); @@ -119,7 +119,7 @@ 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 HBITMAP hBitmap=(HBITMAP) ((wxBitmap *)obj)->GetHBITMAP(); @@ -132,7 +132,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) break; } #if USE_METAFILE - case wxCF_METAFILE: + case wxDF_METAFILE: { wxMetaFile *wxMF = (wxMetaFile *)obj; HANDLE data = GlobalAlloc(GHND, sizeof(METAFILEPICT) + 1); @@ -145,7 +145,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) mf->mm = wxMF->GetWindowsMappingMode(); mf->xExt = width; mf->yExt = height; - mf->hMF = (HANDLE) wxMF->GetHMETAFILE(); + mf->hMF = (HMETAFILE) wxMF->GetHMETAFILE(); GlobalUnlock(data); wxMF->SetHMETAFILE((WXHANDLE) NULL); @@ -161,9 +161,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,17 +203,17 @@ wxObject *wxGetClipboardData(int dataFormat, long *len) { switch (dataFormat) { - case wxCF_BITMAP: + case wxDF_BITMAP: { BITMAP bm; - HBITMAP hBitmap = GetClipboardData(CF_BITMAP); + HBITMAP hBitmap = (HBITMAP) GetClipboardData(CF_BITMAP); if (!hBitmap) return NULL; HDC hdcMem = CreateCompatibleDC(NULL); HDC hdcSrc = CreateCompatibleDC(NULL); - HBITMAP old = ::SelectObject(hdcSrc, hBitmap); + HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, hBitmap); GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm); HBITMAP hNewBitmap = CreateBitmapIndirect(&bm); @@ -226,7 +226,7 @@ wxObject *wxGetClipboardData(int dataFormat, long *len) return NULL; } - HBITMAP old1 = SelectObject(hdcMem, hNewBitmap); + HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hNewBitmap); BitBlt(hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, hdcSrc, 0, 0, SRCCOPY); @@ -248,19 +248,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 +342,8 @@ wxClipboard::~wxClipboard() static int FormatStringToID(char *str) { if (!strcmp(str, "TEXT")) - return wxCF_TEXT; - + return wxDF_TEXT; + return wxRegisterClipboardFormat(str); } @@ -407,7 +407,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();