[master] 0b8eabd - Disable confusing debug info in clipboard viewer demo

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 0b8eabd - Disable confusing debug info in clipboard viewer demo "Albrecht Schlosser" 09:32 Nov 19 top right image
 
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 ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.