|
|
commit 0b8eabd184ac71b778c9fab3c6161b65b616f1f5
Author: Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Fri Nov 19 18:29:34 2021 +0100
Commit: Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Fri Nov 19 18:29:34 2021 +0100
Disable confusing debug info in clipboard viewer demo
Windows only, depends now on macro DEBUG_CLIPBOARD_DATA.
test/clipboard.cxx | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git test/clipboard.cxx test/clipboard.cxx
index 5807c55..ae517b9 100644
--- test/clipboard.cxx
+++ test/clipboard.cxx
@@ -28,9 +28,12 @@
#include <stdio.h>
-#ifdef _WIN32
+// optional: display extra technical info about clipboard content if defined
+// #define DEBUG_CLIPBOARD_DATA
+
+#if defined(_WIN32) && defined(DEBUG_CLIPBOARD_DATA)
#include <windows.h>
-#endif // _WIN32
+#endif // _WIN32 && DEBUG_CLIPBOARD_DATA
/* Displays and follows the content of the clipboard with either image or text data
*/
@@ -93,8 +96,12 @@ public:
return 1;
char title[300];
sprintf(title, "%dx%d", cl_img->w(), cl_img->h()); // display the image original size
-#ifdef _WIN32
- OpenClipboard(NULL); // display extra technical info about clipboard content
+
+ // optional: display extra technical info about clipboard content
+
+#if defined(_WIN32) && defined(DEBUG_CLIPBOARD_DATA)
+
+ OpenClipboard(NULL); //
char *p = title + strlen(title);
int format = EnumClipboardFormats(0);
if (format && format < CF_MAX) {
@@ -117,7 +124,9 @@ public:
(int)lpBI->bmiHeader.biClrUsed);
}
CloseClipboard();
-#endif
+
+#endif // _WIN32 && DEBUG_CLIPBOARD_DATA
+
Fl_Image *oldimg = image_box->image();
delete oldimg;
if (cl_img->w() > image_box->w() || cl_img->h() > image_box->h())
[ Direct Link to Message ] | |
|
| |