Mercurial > dwindows
diff win/dw.c @ 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 | ad3a32fd7008 |
children | 5c82413f82ae |
line wrap: on
line diff
--- 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.