changeset 2093:0c7de37977c8

Add a display of all features in dwtest using dw_debug(). Also update the readme to mention dw_feature_get/set().
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 11 Jun 2020 02:26:42 +0000
parents 95b9c7780f3f
children 8de0a767c0e5
files dwtest.c readme.txt
diffstat 2 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dwtest.c	Thu Jun 11 01:30:37 2020 +0000
+++ b/dwtest.c	Thu Jun 11 02:26:42 2020 +0000
@@ -1761,6 +1761,21 @@
     return FALSE;
 }
 
+/* Pretty list of features corresponding to the DWFEATURE enum in dw.h */
+char *DWFeatureList[] = {
+    "Supports the HTML Widget",
+    "Supports the DW_SIGNAL_HTML_RESULT callback",
+    "Supports custom window border sizes",
+    "Supports window frame transparency",
+    "Supports Dark Mode user interface",
+    "Supports auto completion in Multi-line Edit boxes",
+    "Supports word wrapping in Multi-line Edit boxes",
+    "Supports striped line display in container widgets",
+    "Supports Multiple Document Interface window frame",
+    "Supports status text area on notebook/tabbed controls",
+    "Supports sending system notifications",
+    NULL };
+
 /*
  * Let's demonstrate the functionality of this library. :)
  */
@@ -1777,6 +1792,21 @@
     ULONG notebookpage7;
     ULONG notebookpage8;
     ULONG notebookpage9;
+    DWFEATURE feat;
+
+    /* Test all the features and display the results */
+    for(feat=0;feat<DW_FEATURE_MAX && DWFeatureList[feat];feat++)
+    {
+        int result = dw_feature_get(feat);
+        char *status = "Unsupported";
+
+        if(result == 0)
+            status = "Disabled";
+        else if(result > 0)
+            status = "Enabled";
+
+        dw_debug("%s: %s (%d)", DWFeatureList[feat], status, result);
+    }
 
     /* Initialize the Dynamic Windows engine */
     dw_init(TRUE, argc, argv);
--- a/readme.txt	Thu Jun 11 01:30:37 2020 +0000
+++ b/readme.txt	Thu Jun 11 02:26:42 2020 +0000
@@ -60,6 +60,8 @@
 Changed to using winsock2 on Windows ending support for Win95 and NT 3.5.
 Added support for domain sockets on Windows 10 in the dwcompat sockpipe() macro.
     If compiled with Visual Studio 2017 or later, otherwise the old method is used.
+Added dw_feature_set/get() to test if certain features are available on the current
+    library and operating system combination at runtime or enabled/disable features.
 Fixed many small bugs, too numerous to list here.
 
 Dynamic Windows Documentation is available at: