Mercurial > dwindows
comparison 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 |
comparison
equal
deleted
inserted
replaced
1924:c47a04d83b90 | 1925:0448507827e6 |
---|---|
1 /* | 1 /* |
2 * Dynamic Windows: | 2 * Dynamic Windows: |
3 * A GTK like implementation of the Win32 GUI | 3 * A GTK like implementation of the Win32 GUI |
4 * | 4 * |
5 * (C) 2000-2015 Brian Smith <brian@dbsoft.org> | 5 * (C) 2000-2017 Brian Smith <brian@dbsoft.org> |
6 * (C) 2003-2011 Mark Hessling <mark@rexx.org> | 6 * (C) 2003-2011 Mark Hessling <mark@rexx.org> |
7 * | 7 * |
8 */ | 8 */ |
9 | 9 |
10 #ifdef AEROGLASS | 10 #ifdef AEROGLASS |
221 HRESULT (WINAPI *_SetWindowTheme)(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList) = 0; | 221 HRESULT (WINAPI *_SetWindowTheme)(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList) = 0; |
222 HANDLE huxtheme = 0; | 222 HANDLE huxtheme = 0; |
223 | 223 |
224 /* Needed for Rich Edit controls */ | 224 /* Needed for Rich Edit controls */ |
225 HANDLE hrichedit = 0; | 225 HANDLE hrichedit = 0; |
226 HANDLE hmsftedit = 0; | |
226 | 227 |
227 /* | 228 /* |
228 * MinGW Is missing a bunch of definitions | 229 * MinGW Is missing a bunch of definitions |
229 * so #define them here... | 230 * so #define them here... |
230 */ | 231 */ |
3983 FreeLibrary(hdwm); | 3984 FreeLibrary(hdwm); |
3984 hdwm = 0; | 3985 hdwm = 0; |
3985 } | 3986 } |
3986 #endif | 3987 #endif |
3987 #ifdef RICHEDIT | 3988 #ifdef RICHEDIT |
3988 /* Attempt to load rich edit library */ | 3989 /* Attempt to load rich edit library: 4.1, 3/2.0 and 1.0 */ |
3989 if(!(hrichedit = LoadLibrary("riched20"))) | 3990 if(!(hmsftedit = LoadLibrary("msftedit"))) |
3990 hrichedit = LoadLibrary("riched32"); | 3991 { |
3992 if(!(hrichedit = LoadLibrary("riched20"))) | |
3993 hrichedit = LoadLibrary("riched32"); | |
3994 } | |
3991 #endif | 3995 #endif |
3992 return 0; | 3996 return 0; |
3993 } | 3997 } |
3994 | 3998 |
3995 static int _dw_main_running = FALSE; | 3999 static int _dw_main_running = FALSE; |
4618 if(thisheight > _DW_SCROLLED_MAX_HEIGHT) | 4622 if(thisheight > _DW_SCROLLED_MAX_HEIGHT) |
4619 thisheight = _DW_SCROLLED_MAX_HEIGHT; | 4623 thisheight = _DW_SCROLLED_MAX_HEIGHT; |
4620 } | 4624 } |
4621 /* Entryfields and MLE */ | 4625 /* Entryfields and MLE */ |
4622 else if(_tcsnicmp(tmpbuf, EDITCLASSNAME, _tcslen(EDITCLASSNAME)+1) == 0 || | 4626 else if(_tcsnicmp(tmpbuf, EDITCLASSNAME, _tcslen(EDITCLASSNAME)+1) == 0 || |
4623 _tcsnicmp(tmpbuf, RICHEDIT_CLASS, _tcslen(RICHEDIT_CLASS)+1) == 0) | 4627 _tcsnicmp(tmpbuf, RICHEDIT_CLASS, _tcslen(RICHEDIT_CLASS)+1) == 0 || |
4628 _tcsnicmp(tmpbuf, MSFTEDIT_CLASS, _tcslen(MSFTEDIT_CLASS)+1) == 0) | |
4624 { | 4629 { |
4625 LONG style = GetWindowLong(handle, GWL_STYLE); | 4630 LONG style = GetWindowLong(handle, GWL_STYLE); |
4626 if((style & ES_MULTILINE)) | 4631 if((style & ES_MULTILINE)) |
4627 { | 4632 { |
4628 unsigned long bytes; | 4633 unsigned long bytes; |
5930 */ | 5935 */ |
5931 HWND API dw_mle_new(ULONG id) | 5936 HWND API dw_mle_new(ULONG id) |
5932 { | 5937 { |
5933 | 5938 |
5934 HWND tmp = CreateWindowEx(WS_EX_CLIENTEDGE, | 5939 HWND tmp = CreateWindowEx(WS_EX_CLIENTEDGE, |
5935 hrichedit ? RICHEDIT_CLASS : EDITCLASSNAME, | 5940 hmsftedit ? MSFTEDIT_CLASS : (hrichedit ? RICHEDIT_CLASS : EDITCLASSNAME), |
5936 NULL, | 5941 NULL, |
5937 WS_VISIBLE | WS_BORDER | | 5942 WS_VISIBLE | WS_BORDER | |
5938 WS_VSCROLL | ES_MULTILINE | | 5943 WS_VSCROLL | ES_MULTILINE | |
5939 ES_WANTRETURN | WS_CHILD | | 5944 ES_WANTRETURN | WS_CHILD | |
5940 WS_CLIPCHILDREN, | 5945 WS_CLIPCHILDREN, |
8387 if(state) | 8392 if(state) |
8388 dw_window_set_style(handle, 0, ES_AUTOHSCROLL); | 8393 dw_window_set_style(handle, 0, ES_AUTOHSCROLL); |
8389 else | 8394 else |
8390 dw_window_set_style(handle, ES_AUTOHSCROLL, ES_AUTOHSCROLL); | 8395 dw_window_set_style(handle, ES_AUTOHSCROLL, ES_AUTOHSCROLL); |
8391 /* If it is a rich edit control use the rich edit message */ | 8396 /* If it is a rich edit control use the rich edit message */ |
8392 if(hrichedit) | 8397 if(hrichedit || hmsftedit) |
8393 { | 8398 { |
8394 if(state) | 8399 if(state) |
8395 SendMessage(handle, EM_SETOPTIONS, (WPARAM)ECOOP_AND, (LPARAM)~ECO_AUTOHSCROLL); | 8400 SendMessage(handle, EM_SETOPTIONS, (WPARAM)ECOOP_AND, (LPARAM)~ECO_AUTOHSCROLL); |
8396 else | 8401 else |
8397 SendMessage(handle, EM_SETOPTIONS, (WPARAM)ECOOP_OR, (LPARAM)ECO_AUTOHSCROLL); | 8402 SendMessage(handle, EM_SETOPTIONS, (WPARAM)ECOOP_OR, (LPARAM)ECO_AUTOHSCROLL); |
8398 } | 8403 } |
8404 } | |
8405 | |
8406 /* | |
8407 * Sets the word auto complete state of an MLE box. | |
8408 * Parameters: | |
8409 * handle: Handle to the MLE. | |
8410 * state: Bitwise combination of DW_MLE_COMPLETE_TEXT/DASH/QUOTE | |
8411 */ | |
8412 void API dw_mle_set_auto_complete(HWND handle, int state) | |
8413 { | |
8399 } | 8414 } |
8400 | 8415 |
8401 /* | 8416 /* |
8402 * Sets the current cursor position of an MLE box. | 8417 * Sets the current cursor position of an MLE box. |
8403 * Parameters: | 8418 * Parameters: |