comparison win/dw.c @ 2240:7f6939857cca

Win: Added dw_window_set_color() support for Rich Edit based MLE controls. Added foreground and background color comboboxes and callbacks to dwtest.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 18 Jan 2021 23:43:54 +0000
parents 3e9c5bff0a57
children 703023e1a644
comparison
equal deleted inserted replaced
2239:95ad22a4da2d 2240:7f6939857cca
5850 { 5850 {
5851 thisbox->cinfo.fore = fore; 5851 thisbox->cinfo.fore = fore;
5852 thisbox->cinfo.back = back; 5852 thisbox->cinfo.back = back;
5853 } 5853 }
5854 } 5854 }
5855 #ifdef RICHEDIT
5856 else if (_tcsnicmp(tmpbuf, RICHEDIT_CLASS, _tcslen(RICHEDIT_CLASS)+1) == 0 ||
5857 _tcsnicmp(tmpbuf, MSFTEDIT_CLASS, _tcslen(MSFTEDIT_CLASS)+1) == 0)
5858 {
5859 ULONG _fore = _internal_color(fore);
5860 ULONG _back = _internal_color(back);
5861 CHARFORMAT cf;
5862
5863 SendMessage(handle, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf);
5864 cf.cbSize = sizeof(cf);
5865 cf.dwMask = CFM_COLOR;
5866 cf.dwEffects = 0;
5867 cf.crTextColor = RGB(DW_RED_VALUE(_fore), DW_GREEN_VALUE(_fore), DW_BLUE_VALUE(_fore));
5868 SendMessage(handle, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf);
5869
5870 SendMessage(handle, EM_SETBKGNDCOLOR, (back == DW_CLR_DEFAULT || back == DW_RGB_TRANSPARENT) ? 1 : 0,
5871 RGB(DW_RED_VALUE(_back), DW_GREEN_VALUE(_back), DW_BLUE_VALUE(_back)));
5872 }
5873 #endif
5855 5874
5856 if(cinfo || (cinfo = _dw_window_new_cinfo(handle, TRUE))) 5875 if(cinfo || (cinfo = _dw_window_new_cinfo(handle, TRUE)))
5857 { 5876 {
5858 cinfo->fore = fore; 5877 cinfo->fore = fore;
5859 cinfo->back = back; 5878 cinfo->back = back;