changeset 1925:0448507827e6

Added dw_mle_set_auto_complete() stubs for OS/2 and Windows... Updates to support RichEdit 4.1 control on Windows if enabled. This should allow us to support auto complete in the future.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 20 Apr 2017 10:36:49 +0000
parents c47a04d83b90
children 3c60066cb16f
files mac/dw.m os2/dw.c os2/dw.def win/dw-mingw.def win/dw.c win/dw.def
diffstat 6 files changed, 37 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Thu Apr 20 09:57:15 2017 +0000
+++ b/mac/dw.m	Thu Apr 20 10:36:49 2017 +0000
@@ -2,7 +2,7 @@
  * Dynamic Windows:
  *          A GTK like implementation of the MacOS GUI using Cocoa
  *
- * (C) 2011-2016 Brian Smith <brian@dbsoft.org>
+ * (C) 2011-2017 Brian Smith <brian@dbsoft.org>
  * (C) 2011 Mark Hessling <mark@rexx.org>
  *
  * Requires 10.5 or later.
--- a/os2/dw.c	Thu Apr 20 09:57:15 2017 +0000
+++ b/os2/dw.c	Thu Apr 20 10:36:49 2017 +0000
@@ -2,7 +2,7 @@
  * Dynamic Windows:
  *          A GTK like implementation of the PM GUI
  *
- * (C) 2000-2012 Brian Smith <brian@dbsoft.org>
+ * (C) 2000-2017 Brian Smith <brian@dbsoft.org>
  * (C) 2003-2011 Mark Hessling <mark@rexx.org>
  * (C) 2000 Achim Hasenmueller <achimha@innotek.de>
  * (C) 2000 Peter Nielsen <peter@pmview.com>
@@ -8816,6 +8816,16 @@
 }
 
 /*
+ * Sets the word auto complete state of an MLE box.
+ * Parameters:
+ *          handle: Handle to the MLE.
+ *          state: Bitwise combination of DW_MLE_COMPLETE_TEXT/DASH/QUOTE
+ */
+void API dw_mle_set_auto_complete(HWND handle, int state)
+{
+}
+
+/*
  * Sets the current cursor position of an MLE box.
  * Parameters:
  *          handle: Handle to the MLE to be positioned.
--- a/os2/dw.def	Thu Apr 20 09:57:15 2017 +0000
+++ b/os2/dw.def	Thu Apr 20 10:36:49 2017 +0000
@@ -122,6 +122,7 @@
   dw_mle_search                          @180
   dw_mle_set_editable                    @181
   dw_mle_set_word_wrap                   @182
+  dw_mle_set_auto_complete               @183
 
   dw_spinbutton_new                      @190
   dw_spinbutton_set_pos                  @191
--- a/win/dw-mingw.def	Thu Apr 20 09:57:15 2017 +0000
+++ b/win/dw-mingw.def	Thu Apr 20 10:36:49 2017 +0000
@@ -121,6 +121,7 @@
   dw_mle_search                          @180
   dw_mle_set_editable                    @181
   dw_mle_set_word_wrap                   @182
+  dw_mle_set_auto_complete               @183
 
   dw_spinbutton_new                      @190
   dw_spinbutton_set_pos                  @191
--- a/win/dw.c	Thu Apr 20 09:57:15 2017 +0000
+++ b/win/dw.c	Thu Apr 20 10:36:49 2017 +0000
@@ -2,7 +2,7 @@
  * Dynamic Windows:
  *          A GTK like implementation of the Win32 GUI
  *
- * (C) 2000-2015 Brian Smith <brian@dbsoft.org>
+ * (C) 2000-2017 Brian Smith <brian@dbsoft.org>
  * (C) 2003-2011 Mark Hessling <mark@rexx.org>
  *
  */
@@ -223,6 +223,7 @@
  
 /* Needed for Rich Edit controls */
 HANDLE hrichedit = 0;
+HANDLE hmsftedit = 0;
 
 /*
  * MinGW Is missing a bunch of definitions
@@ -3985,9 +3986,12 @@
    }
 #endif
 #ifdef RICHEDIT
-   /* Attempt to load rich edit library */
-   if(!(hrichedit = LoadLibrary("riched20")))
-      hrichedit = LoadLibrary("riched32");
+   /* Attempt to load rich edit library: 4.1, 3/2.0 and 1.0 */
+   if(!(hmsftedit = LoadLibrary("msftedit")))
+   {
+      if(!(hrichedit = LoadLibrary("riched20")))
+         hrichedit = LoadLibrary("riched32");
+   }
 #endif      
    return 0;
 }
@@ -4620,7 +4624,8 @@
    }
    /* Entryfields and MLE */
    else if(_tcsnicmp(tmpbuf, EDITCLASSNAME, _tcslen(EDITCLASSNAME)+1) == 0 ||
-           _tcsnicmp(tmpbuf, RICHEDIT_CLASS, _tcslen(RICHEDIT_CLASS)+1) == 0)
+           _tcsnicmp(tmpbuf, RICHEDIT_CLASS, _tcslen(RICHEDIT_CLASS)+1) == 0 ||
+           _tcsnicmp(tmpbuf, MSFTEDIT_CLASS, _tcslen(MSFTEDIT_CLASS)+1) == 0)
    {
       LONG style = GetWindowLong(handle, GWL_STYLE);
       if((style & ES_MULTILINE))
@@ -5932,7 +5937,7 @@
 {
 
    HWND tmp = CreateWindowEx(WS_EX_CLIENTEDGE,
-                       hrichedit ? RICHEDIT_CLASS : EDITCLASSNAME,
+                       hmsftedit ? MSFTEDIT_CLASS : (hrichedit ? RICHEDIT_CLASS : EDITCLASSNAME),
                        NULL,
                        WS_VISIBLE | WS_BORDER |
                        WS_VSCROLL | ES_MULTILINE |
@@ -8389,7 +8394,7 @@
    else
       dw_window_set_style(handle, ES_AUTOHSCROLL, ES_AUTOHSCROLL);
    /* If it is a rich edit control use the rich edit message */
-   if(hrichedit)
+   if(hrichedit || hmsftedit)
    {
       if(state)
          SendMessage(handle, EM_SETOPTIONS, (WPARAM)ECOOP_AND, (LPARAM)~ECO_AUTOHSCROLL);
@@ -8399,6 +8404,16 @@
 }
 
 /*
+ * Sets the word auto complete state of an MLE box.
+ * Parameters:
+ *          handle: Handle to the MLE.
+ *          state: Bitwise combination of DW_MLE_COMPLETE_TEXT/DASH/QUOTE
+ */
+void API dw_mle_set_auto_complete(HWND handle, int state)
+{
+}
+
+/*
  * Sets the current cursor position of an MLE box.
  * Parameters:
  *          handle: Handle to the MLE to be positioned.
--- a/win/dw.def	Thu Apr 20 09:57:15 2017 +0000
+++ b/win/dw.def	Thu Apr 20 10:36:49 2017 +0000
@@ -121,6 +121,7 @@
   dw_mle_search                          @180
   dw_mle_set_editable                    @181
   dw_mle_set_word_wrap                   @182
+  dw_mle_set_auto_complete               @183
 
   dw_spinbutton_new                      @190
   dw_spinbutton_set_pos                  @191