Changeset 2185
- Timestamp:
- Dec 21, 1999, 6:03:46 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/user32/button.cpp ¶
r2160 r2185 1 /* $Id: button.cpp,v 1.2 3 1999-12-20 16:45:16cbratschi Exp $ */1 /* $Id: button.cpp,v 1.24 1999-12-21 17:03:42 cbratschi Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 7 7 * Copyright (c) 1999 Christoph Bratschi 8 8 * 9 * WINE version: 991 0319 * WINE version: 991212 10 10 * 11 11 * Status: complete … … 156 156 infoPtr->state = BUTTON_UNCHECKED; 157 157 infoPtr->hFont = 0; 158 infoPtr->hImage = NULL;158 infoPtr->hImage = 0; 159 159 SetInfoPtr(hwnd,(DWORD)infoPtr); 160 160 … … 349 349 if (wParam == VK_SPACE) 350 350 { 351 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 352 351 353 SendMessageA(hwnd,BM_SETSTATE,TRUE,0); 352 SetFocus(hwnd); 353 SetCapture(hwnd); 354 infoPtr->state |= BUTTON_BTNPRESSED; 354 355 } 355 356 … … 364 365 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 365 366 366 ReleaseCapture(); 367 if (!(infoPtr->state & BUTTON_BTNPRESSED)) return 0; 368 infoPtr->state &= BUTTON_NSTATES; 367 369 if (!(infoPtr->state & BUTTON_HIGHLIGHTED)) return 0; 368 370 SendMessageA(hwnd,BM_SETSTATE,FALSE,0); … … 383 385 } 384 386 BUTTON_SendNotify(hwnd,BN_CLICKED); 385 } else if (wParam != VK_TAB) ReleaseCapture();387 } 386 388 387 389 return 0; … … 490 492 return (HICON)infoPtr->hImage; 491 493 default: 492 return NULL;494 return (HICON)0; 493 495 } 494 496 } … … 784 786 } 785 787 if ( ((dwStyle & BS_ICON) || (dwStyle & BS_BITMAP) ) && 786 (infoPtr->hImage != NULL) )788 (infoPtr->hImage != 0) ) 787 789 { 788 790 int yOffset, xOffset; … … 831 833 if(xOffset < 0 || yOffset < 0) 832 834 { 833 HRGN hBitmapRgn = NULL;835 HRGN hBitmapRgn = 0; 834 836 hBitmapRgn = CreateRectRgn( 835 837 rc.left + xBorderOffset, rc.top +yBorderOffset, … … 868 870 if(xOffset < 0 || yOffset < 0) 869 871 { 870 SelectClipRgn(hDC, NULL);872 SelectClipRgn(hDC, 0); 871 873 } 872 874 } … … 916 918 * instead of a radion button. 917 919 */ 918 if (infoPtr->hImage !=NULL)920 if (infoPtr->hImage != 0) 919 921 { 920 922 BOOL bHighLighted = ((infoPtr->state & BUTTON_HIGHLIGHTED) || -
TabularUnified trunk/src/user32/combo.cpp ¶
r1828 r2185 1 /* $Id: combo.cpp,v 1. 19 1999-11-24 18:21:35cbratschi Exp $ */1 /* $Id: combo.cpp,v 1.20 1999-12-21 17:03:43 cbratschi Exp $ */ 2 2 /* 3 3 * Combo controls … … 8 8 * FIXME: roll up in Netscape 3.01. 9 9 * 10 * WINE version: 991 03110 * WINE version: 991212 11 11 * 12 12 * Status: in progress … … 115 115 116 116 return DefWindowProcA(hwnd,WM_NCDESTROY,wParam,lParam); 117 }118 119 /***********************************************************************120 * CBForceDummyResize121 *122 * The dummy resize is used for listboxes that have a popup to trigger123 * a re-arranging of the contents of the combobox and the recalculation124 * of the size of the "real" control window.125 */126 static void CBForceDummyResize(127 LPHEADCOMBO lphc)128 {129 RECT windowRect;130 131 GetWindowRect(CB_HWND(lphc), &windowRect);132 133 /*134 * We have to be careful, resizing a combobox also has the meaning that the135 * dropped rect will be resized. In this case, we want to trigger a resize136 * to recalculate layout but we don't want to change the dropped rectangle137 * So, we add the size of the dropped rectangle to the size of the control.138 * this will cancel-out in the processing of the WM_WINDOWPOSCHANGING139 * message.140 */141 SetWindowPos( CB_HWND(lphc),142 (HWND)NULL,143 0, 0,144 windowRect.right - windowRect.left,145 windowRect.bottom - windowRect.top +146 lphc->droppedRect.bottom - lphc->droppedRect.top,147 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );148 117 } 149 118 … … 255 224 } 256 225 226 /*********************************************************************** 227 * CBForceDummyResize 228 * 229 * The dummy resize is used for listboxes that have a popup to trigger 230 * a re-arranging of the contents of the combobox and the recalculation 231 * of the size of the "real" control window. 232 */ 233 static void CBForceDummyResize( 234 LPHEADCOMBO lphc) 235 { 236 RECT windowRect; 237 int newComboHeight; 238 239 newComboHeight = CBGetTextAreaHeight(CB_HWND(lphc),lphc) + 2*COMBO_YBORDERSIZE(); 240 241 GetWindowRect(CB_HWND(lphc), &windowRect); 242 243 /* 244 * We have to be careful, resizing a combobox also has the meaning that the 245 * dropped rect will be resized. In this case, we want to trigger a resize 246 * to recalculate layout but we don't want to change the dropped rectangle 247 * So, we pass the height of text area of control as the height. 248 * this will cancel-out in the processing of the WM_WINDOWPOSCHANGING 249 * message. 250 */ 251 SetWindowPos( CB_HWND(lphc), 252 (HWND)0, 253 0, 0, 254 windowRect.right - windowRect.left, 255 newComboHeight, 256 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); 257 } 257 258 258 259 /*********************************************************************** … … 958 959 static INT CBUpdateLBox( LPHEADCOMBO lphc ) 959 960 { 960 INT length, idx , ret;961 INT length, idx; 961 962 LPSTR pText = NULL; 962 963 963 idx = ret =LB_ERR;964 idx = LB_ERR; 964 965 length = CB_GETEDITTEXTLENGTH( lphc ); 965 966 … … 975 976 idx = SendMessageA( lphc->hWndLBox, LB_FINDSTRING, 976 977 (WPARAM)(-1), (LPARAM)pText ); 977 if( idx == LB_ERR ) idx = 0; /* select first item */978 else ret = idx;979 978 HeapFree( GetProcessHeap(), 0, pText ); 980 979 } 981 982 /* select entry */983 984 SendMessageA( lphc->hWndLBox, LB_SETCURSEL, (WPARAM)idx, 0 );985 980 986 981 if( idx >= 0 ) … … 990 985 SendMessageA( lphc->hWndLBox, LB_SETCARETINDEX, (WPARAM)idx, 0 ); 991 986 } 992 return ret;987 return idx; 993 988 } 994 989 … … 1004 999 1005 1000 //TRACE("\t %i\n", index ); 1006 1007 if( index == -1 )1008 {1009 length = CB_GETEDITTEXTLENGTH( lphc );1010 if( length )1011 {1012 pText = (LPSTR) HeapAlloc( GetProcessHeap(), 0, length + 1);1013 if(pText)1014 {1015 GetWindowTextA( lphc->hWndEdit, pText, length + 1 );1016 index = SendMessageA( lphc->hWndLBox, LB_FINDSTRING,1017 (WPARAM)(-1), (LPARAM)pText );1018 HeapFree( GetProcessHeap(), 0, pText );1019 }1020 }1021 }1022 1001 1023 1002 if( index >= 0 ) /* got an entry */ … … 1031 1010 SendMessageA( lphc->hWndLBox, LB_GETTEXT, 1032 1011 (WPARAM)index, (LPARAM)pText ); 1033 1034 lphc->wState |= CBF_NOEDITNOTIFY;1035 1036 SendMessageA( lphc->hWndEdit, WM_SETTEXT, 0, (LPARAM)pText );1037 SendMessageA( lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1) );1038 HeapFree( GetProcessHeap(), 0, pText );1039 1012 } 1040 1013 } 1041 1014 } 1015 lphc->wState |= CBF_NOEDITNOTIFY; 1016 1017 SendMessageA( lphc->hWndEdit, WM_SETTEXT, 0, pText ? (LPARAM)pText : (LPARAM)"" ); 1018 1019 if( pText ) 1020 HeapFree( GetProcessHeap(), 0, pText ); 1042 1021 } 1043 1022 … … 1145 1124 RECT rect; 1146 1125 1147 /*1148 * It seems useful to send the WM_LBUTTONUP with (-1,-1) when cancelling1149 * and with (0,0) (anywhere in the listbox) when Oking.1150 */1151 SendMessageA( lphc->hWndLBox, WM_LBUTTONUP, 0, ok ? (LPARAM)0 : (LPARAM)(-1) );1152 1153 1126 lphc->wState &= ~CBF_DROPPED; 1154 1127 ShowWindow( lphc->hWndLBox, SW_HIDE ); … … 1157 1130 ReleaseCapture(); 1158 1131 } 1159 1160 1132 1161 1133 if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) … … 1233 1205 SendMessageA( lphc->hWndLBox, LB_CARETON, 0, 0 ); 1234 1206 1235 if( lphc->wState & CBF_EDIT )1236 SendMessageA( lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1) );1237 1207 lphc->wState |= CBF_FOCUSED; 1208 1238 1209 if( !(lphc->wState & CBF_EDIT) ) 1239 {1240 1210 InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE); 1241 }1242 1211 1243 1212 CB_NOTIFY( lphc, CBN_SETFOCUS ); … … 1264 1233 if( lphc->wState & CBF_FOCUSED ) 1265 1234 { 1266 SendMessageA( lphc->hwndself, WM_LBUTTONUP, 0, (LPARAM)(-1) );1267 1268 1235 CBRollUp( lphc, FALSE, TRUE ); 1269 1236 if( IsWindow( lphc->hwndself ) ) … … 1275 1242 1276 1243 /* redraw text */ 1277 if( lphc->wState & CBF_EDIT ) 1278 SendMessageA( lphc->hWndEdit, EM_SETSEL, (WPARAM)(-1), 0 ); 1279 else 1280 { 1244 if( !(lphc->wState & CBF_EDIT) ) 1281 1245 InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE); 1282 }1283 1246 1284 1247 CB_NOTIFY( lphc, CBN_KILLFOCUS ); … … 1320 1283 // CB_HWND(lphc), lphc->hWndEdit ); 1321 1284 1322 if( !(lphc->wState & CBF_FOCUSED) )COMBO_EditSetFocus(lphc);1285 COMBO_EditSetFocus(lphc); 1323 1286 break; 1324 1287 … … 1391 1354 else lphc->wState &= ~CBF_NOROLLUP; 1392 1355 1356 if( lphc->wState & CBF_EDIT ) 1357 { 1358 INT index = SendMessageA(lphc->hWndLBox, LB_GETCURSEL, 0, 0); 1359 CBUpdateEdit( lphc, index ); 1360 /* select text in edit, as Windows does */ 1361 SendMessageA( lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1) ); 1362 } 1363 else 1364 InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE); 1365 1393 1366 CB_NOTIFY( lphc, CBN_SELCHANGE ); 1394 InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE);1395 1367 /* fall through */ 1396 1368 … … 2053 2025 { 2054 2026 /* no LBN_SELCHANGE in this case, update manually */ 2055 InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE); 2027 if( lphc->wState & CBF_EDIT ) 2028 CBUpdateEdit( lphc, (INT)wParam ); 2029 else 2030 InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE); 2031 2056 2032 lphc->wState &= ~CBF_SELCHANGE; 2057 2033 } -
TabularUnified trunk/src/user32/edit.cpp ¶
r2093 r2185 1 /* $Id: edit.cpp,v 1.2 3 1999-12-16 16:53:56cbratschi Exp $ */1 /* $Id: edit.cpp,v 1.24 1999-12-21 17:03:43 cbratschi Exp $ */ 2 2 /* 3 3 * Edit control … … 9 9 * Copyright 1999 Christoph Bratschi 10 10 * 11 * WINE version: 991 03111 * WINE version: 991212 12 12 * 13 13 * Status: complete … … 2395 2395 EDIT_EM_ScrollCaret(hwnd, es); 2396 2396 2397 EDIT_NOTIFY_PARENT(hwnd,EN_UPDATE); 2397 2398 /* FIXME: really inefficient */ 2398 2399 EDIT_Refresh(hwnd,es); … … 3643 3644 BOOL rev = es->bEnableState && ((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL)); 3644 3645 3645 if (es->flags & EF_UPDATE) EDIT_NOTIFY_PARENT(hwnd, EN_UPDATE);3646 3647 3646 HideCaret(hwnd); 3648 3647 … … 3892 3891 EDIT_EM_ScrollCaret(hwnd, es); 3893 3892 EDIT_UpdateScrollBars(hwnd,es,TRUE,TRUE); 3893 if (es->flags & EF_UPDATE) EDIT_NOTIFY_PARENT(hwnd,EN_UPDATE); 3894 3894 } 3895 3895 -
TabularUnified trunk/src/user32/listbox.cpp ¶
r2165 r2185 1 /* $Id: listbox.cpp,v 1.1 4 1999-12-20 19:10:54 cbratschi Exp $ */1 /* $Id: listbox.cpp,v 1.15 1999-12-21 17:03:44 cbratschi Exp $ */ 2 2 /* 3 3 * Listbox controls … … 6 6 * Copyright 1999 Christoph Bratschi (ported from WINE) 7 7 * 8 * WINE version: 991 0318 * WINE version: 991212 9 9 */ 10 10 … … 23 23 * - Unicode 24 24 * - Locale handling 25 * - real WM_SETREDRAW support + for all other controls26 bug: LISTBOX_InvalidateItems -> always redraw!27 25 */ 28 26 … … 959 957 RECT rect; 960 958 959 if (descr->style & LBS_NOREDRAW) return; 960 961 961 if (LISTBOX_GetItemRect( hwnd, descr, index, &rect ) == 1) 962 962 { … … 1232 1232 if (index != -1) descr->items[index].selected = TRUE; 1233 1233 descr->selected_item = index; 1234 if (oldsel != -1) LISTBOX_RepaintItem( hwnd, descr, oldsel, ODA_SELECT);1234 if (oldsel != -1) LISTBOX_RepaintItem( hwnd, descr, oldsel, 0); 1235 1235 if (index != -1) LISTBOX_RepaintItem( hwnd, descr, index, ODA_SELECT ); 1236 1236 if (send_notify && descr->nb_items) SEND_NOTIFICATION( hwnd, descr, … … 1750 1750 LISTBOX_SetCaretIndex( hwnd, descr, index, FALSE ); 1751 1751 LISTBOX_SetSelection( hwnd, descr, index, 1752 !descr->items[index].selected, FALSE ); 1752 !descr->items[index].selected, 1753 (descr->style & LBS_NOTIFY) != 0 ); 1753 1754 } 1754 1755 else LISTBOX_MoveCaret( hwnd, descr, index, FALSE ); … … 1759 1760 LISTBOX_SetSelection( hwnd, descr, index, 1760 1761 (!(descr->style & LBS_MULTIPLESEL) || 1761 !descr->items[index].selected), FALSE ); 1762 !descr->items[index].selected), 1763 (descr->style & LBS_NOTIFY) != 0 ); 1762 1764 } 1763 1765 } -
TabularUnified trunk/src/user32/win32wmdichild.cpp ¶
r2114 r2185 1 /* $Id: win32wmdichild.cpp,v 1.1 5 1999-12-18 16:31:51cbratschi Exp $ */1 /* $Id: win32wmdichild.cpp,v 1.16 1999-12-21 17:03:45 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 MDI Child Window Class for OS/2 … … 197 197 client->setActiveChild(this); 198 198 199 #if 0 200 MDI_AugmentFrameMenu( ci, clientWnd->parent, hwnd); 201 #endif 199 client->augmentFrameMenu(this); 200 202 201 client->updateFrameText(MDI_REPAINTFRAME, NULL ); 203 202 } … … 402 401 { 403 402 client->setMaximizedChild(newchild); 404 #if 0 405 MDI_AugmentFrameMenu( ci, w->parent, newchild->getWindowHandle());406 #endif 403 404 client->augmentFrameMenu(newchild); 405 407 406 client->updateFrameText(MDI_REPAINTFRAME, NULL ); 408 407 } -
TabularUnified trunk/src/user32/win32wmdiclient.cpp ¶
r2114 r2185 1 /* $Id: win32wmdiclient.cpp,v 1.1 6 1999-12-18 16:31:51cbratschi Exp $ */1 /* $Id: win32wmdiclient.cpp,v 1.17 1999-12-21 17:03:45 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 573 573 { 574 574 ::SetMenu(hwndFrame, hmenuFrame); 575 #if 0 576 if ( ci->hwndChildMaximized)577 MDI_AugmentFrameMenu(ci, w->parent, ci->hwndChildMaximized);578 #endif 575 576 if (maximizedChild) 577 augmentFrameMenu(maximizedChild); 578 579 579 return oldFrameMenu; 580 580 } … … 824 824 return TRUE; 825 825 } 826 #if 0 826 827 827 /* ----------------------- Frame window ---------------------------- */ 828 828 … … 830 830 * MDI_AugmentFrameMenu 831 831 */ 832 BOOL Win32MDIClientWindow::augmentFrameMenu(HWND hChild ) 833 { 832 BOOL Win32MDIClientWindow::augmentFrameMenu(Win32MDIChildWindow *child) 833 { 834 /* 834 835 WND* child = WIN_FindWndPtr(hChild); 835 836 HMENU hSysPopup = 0; … … 843 844 WIN_ReleaseWndPtr(child); 844 845 845 / * create a copy of sysmenu popup and insert it into frame menu bar */846 // create a copy of sysmenu popup and insert it into frame menu bar 846 847 847 848 if (!(hSysPopup = LoadMenuA(GetModuleHandleA("USER32"), "SYSMENU"))) 848 849 return 0; 849 850 850 TRACE("\tgot popup %04x in sysmenu %04x\n",851 hSysPopup, child->hSysMenu);851 //TRACE("\tgot popup %04x in sysmenu %04x\n", 852 // hSysPopup, child->hSysMenu); 852 853 853 854 AppendMenuA(frame->wIDmenu,MF_HELP | MF_BITMAP, … … 856 857 SC_RESTORE, (LPSTR)(DWORD)HBMMENU_MBAR_RESTORE ); 857 858 858 / * In Win 95 look, the system menu is replaced by the child icon */859 // In Win 95 look, the system menu is replaced by the child icon 859 860 860 861 if(TWEAK_WineLook > WIN31_LOOK) … … 900 901 } 901 902 902 / * The close button is only present in Win 95 look */903 // The close button is only present in Win 95 look 903 904 if(TWEAK_WineLook > WIN31_LOOK) 904 905 { … … 912 913 SetMenuDefaultItem(hSysPopup, SC_CLOSE, FALSE); 913 914 914 / * redraw menu */915 // redraw menu 915 916 DrawMenuBar(frame->hwndSelf); 916 917 */ 917 918 return 1; 918 919 } … … 921 922 * MDI_RestoreFrameMenu 922 923 */ 923 static BOOL MDI_RestoreFrameMenu( WND *frameWnd, HWND hChild ) 924 { 924 BOOL Win32MDIClientWindow::restoreFrameMenu(Win32MDIChildWindow *child) 925 { 926 /* 925 927 MENUITEMINFOA menuInfo; 926 928 INT nItems = GetMenuItemCount(frameWnd->wIDmenu) - 1; … … 936 938 * as it is in win95, we have to delete the bitmap. 937 939 */ 940 /* 938 941 menuInfo.cbSize = sizeof(MENUITEMINFOA); 939 942 menuInfo.fMask = MIIM_DATA | MIIM_TYPE; … … 955 958 if(TWEAK_WineLook > WIN31_LOOK) 956 959 { 957 / * close */960 // close 958 961 DeleteMenu(frameWnd->wIDmenu,GetMenuItemCount(frameWnd->wIDmenu) - 1,MF_BYPOSITION); 959 962 } 960 / * restore */963 // restore 961 964 DeleteMenu(frameWnd->wIDmenu,GetMenuItemCount(frameWnd->wIDmenu) - 1,MF_BYPOSITION); 962 / * minimize */965 // minimize 963 966 DeleteMenu(frameWnd->wIDmenu,GetMenuItemCount(frameWnd->wIDmenu) - 1,MF_BYPOSITION); 964 967 965 968 DrawMenuBar(frameWnd->hwndSelf); 966 969 */ 967 970 return 1; 968 971 } 969 #endif970 972 971 973 /*********************************************************************** -
TabularUnified trunk/src/user32/win32wmdiclient.h ¶
r2099 r2185 1 /* $Id: win32wmdiclient.h,v 1. 5 1999-12-17 17:18:04cbratschi Exp $ */1 /* $Id: win32wmdiclient.h,v 1.6 1999-12-21 17:03:46 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 70 70 BOOL cascade(UINT fuCascade); 71 71 BOOL tile(UINT fuTile); 72 BOOL augmentFrameMenu(Win32MDIChildWindow *child); 73 BOOL restoreFrameMenu(Win32MDIChildWindow *child); 72 74 73 75 private:
Note:
See TracChangeset
for help on using the changeset viewer.