- Timestamp:
- Feb 25, 2003, 3:37:05 PM (23 years ago)
- Location:
- trunk/src/riched32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/riched32/makefile
r9410 r9857 1 # $Id: makefile,v 1. 9 2002-11-15 19:34:36sandervl Exp $1 # $Id: makefile,v 1.10 2003-02-25 14:37:05 sandervl Exp $ 2 2 3 3 # … … 40 40 $(ODIN32_LIB)/kernel32.lib \ 41 41 $(ODIN32_LIB)/user32.lib \ 42 $(ODIN32_LIB)/gdi32.lib \ 42 43 $(ODIN32_LIB)/$(ODINCRT).lib \ 43 44 OS2386.LIB \ -
trunk/src/riched32/richedit.c
r9641 r9857 52 52 hwnd, (UINT)wParam, (UINT)lParam) 53 53 54 #ifdef __WIN32OS2__ 55 #define RICHEDIT_WND_PROP "RICHEDIT_PROP" 56 57 #endif 54 58 55 59 /*********************************************************************** … … 110 114 LONG style = 0; 111 115 116 #ifdef __WIN32OS2__ 117 HWND hwndEdit; 118 HWND hwndParent; 119 char* rtfBuffer; 120 HANDLE hProp = 0; 121 int rtfBufferSize; 122 123 CHARRANGE *cr; 124 #else 112 125 static HWND hwndEdit; 113 126 static HWND hwndParent; … … 117 130 CHARRANGE *cr; 118 131 TRACE("previous hwndEdit: %p hwndParent %p\n",hwndEdit,hwndParent); 132 #endif 119 133 hwndEdit = GetWindow(hwnd,GW_CHILD); 120 134 TRACE("uMsg: 0x%x hwnd: %p hwndEdit: %p\n",uMsg,hwnd,hwndEdit); … … 143 157 144 158 SetWindowLongA(hwnd,GWL_STYLE, newstyle); 159 #ifdef __WIN32OS2__ 160 { 161 CHARFORMAT2A *pcf; 162 163 hProp = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, sizeof(CHARFORMAT2A)); 164 SetPropA(hwnd, RICHEDIT_WND_PROP, hProp); 165 pcf = (CHARFORMAT2A *)GlobalLock(hProp); 166 if(pcf) { 167 pcf->cbSize = sizeof(CHARFORMAT2A); 168 GlobalUnlock(hProp); 169 } 170 } 171 #endif 145 172 return 0 ; 146 173 … … 400 427 401 428 case EM_SETBKGNDCOLOR: 429 #ifdef __WIN32OS2__ 430 { 431 CHARFORMAT2A *pcf; 432 433 hProp = GetPropA(hwnd, RICHEDIT_WND_PROP); 434 pcf = (CHARFORMAT2A *)GlobalLock(hProp); 435 if(pcf) 436 { 437 pcf->dwMask |= CFM_BACKCOLOR; 438 pcf->crBackColor = (wParam) ? GetSysColor(COLOR_BACKGROUND) : (COLORREF)lParam; 439 440 //Destroy old brush if present 441 if(pcf->dwReserved) DeleteObject(pcf->dwReserved); 442 443 //Create a brush that we return in WM_CTLCOLORSTATIC 444 pcf->dwReserved = (DWORD)CreateSolidBrush(pcf->crBackColor); 445 446 dprintf(("Set background color to %x brush %x", pcf->crBackColor, pcf->dwReserved)); 447 448 GlobalUnlock(hProp); 449 } 450 } 451 #endif 402 452 DPRINTF_EDIT_MSG32("EM_SETBKGNDCOLOR Ignored"); 403 453 return 0; 404 454 405 455 case EM_SETCHARFORMAT: 456 #ifdef __WIN32OS2__ 457 { 458 CHARFORMAT2A *pnewcf = (CHARFORMAT2A *)lParam; 459 CHARFORMAT2A *pcf; 460 461 hProp = GetPropA(hwnd, RICHEDIT_WND_PROP); 462 pcf = (CHARFORMAT2A *)GlobalLock(hProp); 463 if(pcf && pnewcf && pnewcf->cbSize >= sizeof(CHARFORMATA)) 464 { 465 if((pnewcf->dwMask & CFM_COLOR) && !(pnewcf->dwEffects & CFE_AUTOCOLOR)) { 466 pcf->dwMask |= CFM_COLOR; 467 pcf->crTextColor = pnewcf->crTextColor; 468 dprintf(("Set text color to %x", pcf->crTextColor)); 469 } 470 if(pnewcf->cbSize == sizeof(CHARFORMAT2A)) 471 { 472 if((pnewcf->dwMask & CFM_BACKCOLOR) && !(pnewcf->dwEffects & CFE_AUTOBACKCOLOR)) 473 { 474 pcf->dwMask |= CFM_BACKCOLOR; 475 pcf->crBackColor = pnewcf->crBackColor; 476 477 //Destroy old brush if present 478 if(pcf->dwReserved) DeleteObject(pcf->dwReserved); 479 480 //Create a brush that we return in WM_CTLCOLORSTATIC 481 pcf->dwReserved = (DWORD)CreateSolidBrush(pcf->crBackColor); 482 483 dprintf(("Set background color to %x brush %x", pcf->crBackColor, pcf->dwReserved)); 484 } 485 } 486 } 487 488 if(pcf) GlobalUnlock(hProp); 489 } 490 #else 406 491 DPRINTF_EDIT_MSG32("EM_SETCHARFORMAT Ignored"); 492 #endif 407 493 return 0; 408 494 … … 657 743 return DefWindowProcA( hwnd,uMsg,wParam,lParam); 658 744 case WM_DESTROY: 745 #ifdef __WIN32OS2__ 746 { 747 CHARFORMAT2A *pcf; 748 749 hProp = GetPropA(hwnd, RICHEDIT_WND_PROP); 750 pcf = (CHARFORMAT2A *)GlobalLock(hProp); 751 if(pcf) { 752 //Destroy old brush if present 753 if(pcf->dwReserved) DeleteObject(pcf->dwReserved); 754 GlobalUnlock(hProp); 755 } 756 757 if(hProp) GlobalFree(hProp); 758 RemovePropA(hwnd, RICHEDIT_WND_PROP); 759 } 760 #endif 659 761 DPRINTF_EDIT_MSG32("WM_DESTROY Passed to default"); 660 762 return DefWindowProcA( hwnd,uMsg,wParam,lParam); … … 672 774 DPRINTF_EDIT_MSG32("WM_INITIALUPDATE Passed to default"); 673 775 return DefWindowProcA( hwnd,uMsg,wParam,lParam); */ 776 #ifndef __WIN32OS2__ 674 777 case WM_CTLCOLOREDIT: 675 778 DPRINTF_EDIT_MSG32("WM_CTLCOLOREDIT Passed to default"); 676 779 return DefWindowProcA( hwnd,uMsg,wParam,lParam); 780 #endif 677 781 case WM_SETCURSOR: 678 782 DPRINTF_EDIT_MSG32("WM_SETCURSOR Passed to default"); … … 700 804 return DefWindowProcA( hwnd,uMsg,wParam,lParam); 701 805 case WM_CTLCOLORSTATIC: 806 #ifdef __WIN32OS2__ 807 case WM_CTLCOLOREDIT: 808 { 809 CHARFORMAT2A *pcf; 810 HBRUSH hBrush = 0; 811 HDC hdc = (HDC)wParam; 812 813 hProp = GetPropA(hwnd, RICHEDIT_WND_PROP); 814 pcf = (CHARFORMAT2A *)GlobalLock(hProp); 815 if(pcf) 816 { 817 if(pcf->dwMask & CFM_BACKCOLOR) { 818 SetBkColor(hdc, pcf->crBackColor); 819 hBrush = pcf->dwReserved; 820 } 821 if(pcf->dwMask & CFM_COLOR) { 822 SetTextColor(hdc, pcf->crTextColor); 823 } 824 } 825 if(pcf) GlobalUnlock(hProp); 826 827 if(hBrush) return hBrush; 828 } 829 #endif 702 830 DPRINTF_EDIT_MSG32("WM_CTLCOLORSTATIC Passed to default"); 703 831 return DefWindowProcA( hwnd,uMsg,wParam,lParam);
Note:
See TracChangeset
for help on using the changeset viewer.