Changeset 1724 for trunk/src/user32/combo.cpp
- Timestamp:
- Nov 13, 1999, 5:42:43 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/combo.cpp
r1550 r1724 1 /* $Id: combo.cpp,v 1.1 1 1999-11-02 19:12:59 sandervlExp $ */1 /* $Id: combo.cpp,v 1.12 1999-11-13 16:42:41 cbratschi Exp $ */ 2 2 /* 3 3 * Combo controls … … 8 8 * FIXME: roll up in Netscape 3.01. 9 9 * 10 * WINE version: 99 092310 * WINE version: 991031 11 11 */ 12 12 … … 374 374 //SvL: Listbox size might have changed! 375 375 if(lphc->hWndLBox) 376 376 GetWindowRect(lphc->hWndLBox, lprLB); 377 377 378 378 /* … … 675 675 } 676 676 677 DrawFrameControl(hdc,&rectButton,DFC_SCROLL,buttonState); 677 DrawFrameControl(hdc,&rectButton,DFC_SCROLL,buttonState); 678 678 } 679 679 … … 688 688 RECT rectEdit) 689 689 { 690 INT 691 LPSTR 690 INT id, size = 0; 691 LPSTR pText = NULL; 692 692 693 693 if( lphc->wState & CBF_NOREDRAW ) return; … … 700 700 size = SendMessageA( lphc->hWndLBox, LB_GETTEXTLEN, id, 0); 701 701 if( (pText = (char*)HeapAlloc( GetProcessHeap(), 0, size + 1)) != NULL ) 702 703 704 pText[size] = '\0';/* just in case */705 702 { 703 SendMessageA( lphc->hWndLBox, LB_GETTEXT, (WPARAM)id, (LPARAM)pText ); 704 pText[size] = '\0'; /* just in case */ 705 } else return; 706 706 } 707 707 708 708 if( lphc->wState & CBF_EDIT ) 709 709 { 710 711 712 710 if( CB_HASSTRINGS(lphc) ) SetWindowTextA( lphc->hWndEdit, pText ? pText : "" ); 711 if( lphc->wState & CBF_FOCUSED ) 712 SendMessageA( lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1)); 713 713 } 714 714 else /* paint text field ourselves */ 715 715 { 716 UINT 717 HFONT 716 UINT itemState; 717 HFONT hPrevFont = (lphc->hFont) ? SelectObject(hdc, lphc->hFont) : 0; 718 718 719 719 /* … … 723 723 724 724 if ( (lphc->wState & CBF_FOCUSED) && 725 725 !(lphc->wState & CBF_DROPPED) ) 726 726 { 727 727 /* highlight */ … … 742 742 743 743 /* 744 745 746 747 744 * Save the current clip region. 745 * To retrieve the clip region, we need to create one "dummy" 746 * clip region. 747 */ 748 748 clipRegion = CreateRectRgnIndirect(&rectEdit); 749 749 750 750 if (GetClipRgn(hdc, clipRegion)!=1) 751 751 { 752 753 752 DeleteObject(clipRegion); 753 clipRegion=(HRGN)NULL; 754 754 } 755 755 756 756 if ( dwStyle & WS_DISABLED ) 757 758 759 dis.CtlType 760 dis.CtlID 761 dis.hwndItem 762 dis.itemAction 763 dis.itemID 764 dis.itemState 765 dis.hDC 766 dis.rcItem 767 dis.itemData 768 757 itemState |= ODS_DISABLED; 758 759 dis.CtlType = ODT_COMBOBOX; 760 dis.CtlID = GetWindowLongA(lphc->hwndself,GWL_ID); 761 dis.hwndItem = lphc->hwndself; 762 dis.itemAction = ODA_DRAWENTIRE; 763 dis.itemID = id; 764 dis.itemState = itemState; 765 dis.hDC = hdc; 766 dis.rcItem = rectEdit; 767 dis.itemData = SendMessageA( lphc->hWndLBox, LB_GETITEMDATA, 768 (WPARAM)id, 0 ); 769 769 770 770 /* 771 772 771 * Clip the DC and have the parent draw the item. 772 */ 773 773 IntersectClipRect(hdc, 774 775 774 rectEdit.left, rectEdit.top, 775 rectEdit.right, rectEdit.bottom); 776 776 777 777 SendMessageA(lphc->owner, WM_DRAWITEM, 778 778 GetWindowLongA(lphc->hwndself,GWL_ID), (LPARAM)&dis ); 779 779 780 780 /* 781 782 783 SelectClipRgn(hdc, clipRegion); 781 * Reset the clipping region. 782 */ 783 SelectClipRgn(hdc, clipRegion); 784 784 } 785 785 else 786 786 { 787 787 ExtTextOutA( hdc, 788 789 790 791 792 788 rectEdit.left + 1, 789 rectEdit.top + 1, 790 ETO_OPAQUE | ETO_CLIPPED, 791 &rectEdit, 792 pText ? pText : "" , size, NULL ); 793 793 794 794 if(lphc->wState & CBF_FOCUSED && !(lphc->wState & CBF_DROPPED)) 795 795 DrawFocusRect( hdc, &rectEdit ); 796 796 } 797 797 … … 800 800 } 801 801 if (pText) 802 802 HeapFree( GetProcessHeap(), 0, pText ); 803 803 } 804 804 … … 849 849 { 850 850 hBkgBrush = SendMessageA( lphc->owner, WM_CTLCOLORSTATIC, 851 851 hDC, lphc->hwndself ); 852 852 853 853 /* … … 863 863 { 864 864 hBkgBrush = SendMessageA( lphc->owner, WM_CTLCOLOREDIT, 865 865 hDC, lphc->hwndself ); 866 866 } 867 867 else 868 868 { 869 869 hBkgBrush = SendMessageA( lphc->owner, WM_CTLCOLORLISTBOX, 870 870 hDC, lphc->hwndself ); 871 871 } 872 872 } … … 1845 1845 case WM_PASTE: 1846 1846 case WM_COPY: 1847 if ( lphc->wState & CBF_EDIT)1847 if ((message == WM_GETTEXTLENGTH) && !(lphc->wState & CBF_EDIT)) 1848 1848 { 1849 lphc->wState |= CBF_NOEDITNOTIFY;1850 1851 return SendMessageA( lphc->hWndEdit, message, wParam, lParam);1849 int j = SendMessageA( lphc->hWndLBox, LB_GETCURSEL, 0, 0 ); 1850 if (j == -1) return 0; 1851 return SendMessageA( lphc->hWndLBox, LB_GETTEXTLEN, j, 0); 1852 1852 } 1853 return CB_ERR; 1853 else if( lphc->wState & CBF_EDIT ) 1854 { 1855 lphc->wState |= CBF_NOEDITNOTIFY; 1856 1857 return SendMessageA( lphc->hWndEdit, message, wParam, lParam ); 1858 } 1859 else return CB_ERR; 1854 1860 case WM_DRAWITEM: 1855 1861 case WM_DELETEITEM: … … 1862 1868 EnableWindow( lphc->hWndLBox, (BOOL)wParam ); 1863 1869 1864 1865 1870 /* Force the control to repaint when the enabled state changes. */ 1871 InvalidateRect(CB_HWND(lphc), NULL, TRUE); 1866 1872 return TRUE; 1867 1873 case WM_SETREDRAW:
Note:
See TracChangeset
for help on using the changeset viewer.