- Timestamp:
- Mar 18, 2000, 5:13:41 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/button.cpp
r2804 r3153 1 /* $Id: button.cpp,v 1.3 3 2000-02-16 14:34:03 sandervlExp $ */1 /* $Id: button.cpp,v 1.34 2000-03-18 16:13:25 cbratschi Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 7 7 * Copyright (c) 1999 Christoph Bratschi 8 8 * 9 * WINE version: 20000130 9 * Corel version: 20000317 10 * (WINE version: 20000130) 10 11 * 11 12 * Status: complete … … 21 22 #include "initterm.h" 22 23 23 #define DBG_LOCALLOG 24 #define DBG_LOCALLOG DBG_button 24 25 #include "dbglocal.h" 25 26 … … 485 486 HANDLE oldHbitmap = infoPtr->hImage; 486 487 487 if ((dwStyle & BS_BITMAP) || (dwStyle & BS_ICON)) infoPtr->hImage = (HANDLE)lParam; 488 if ((dwStyle & BS_BITMAP) || (dwStyle & BS_ICON)) 489 { 490 infoPtr->hImage = (HANDLE)lParam; 491 InvalidateRect(hwnd,NULL,FALSE); 492 } 488 493 489 494 return oldHbitmap; -
trunk/src/user32/combo.cpp
r3108 r3153 1 /* $Id: combo.cpp,v 1.2 7 2000-03-14 15:00:58 sandervlExp $ */1 /* $Id: combo.cpp,v 1.28 2000-03-18 16:13:26 cbratschi Exp $ */ 2 2 /* 3 3 * Combo controls … … 8 8 * FIXME: roll up in Netscape 3.01. 9 9 * 10 * Corel version: 20000 21210 * Corel version: 20000317 11 11 * (WINE version: 991212) 12 12 * … … 31 31 #endif 32 32 33 #define DBG_LOCALLOG 33 #define DBG_LOCALLOG DBG_combo 34 34 #include "dbglocal.h" 35 35 … … 1015 1015 if( idx >= 0 ) 1016 1016 { 1017 SendMessageA( lphc->hWndLBox, LB_SETTOPINDEX, (WPARAM)idx, 0 ); 1017 /* the LB_SETCARETINDEX message should scroll the list box if required 1018 and sending LB_SETTOPINDEX can generate annoying behaviors */ 1018 1019 /* probably superfluous but Windows sends this too */ 1019 1020 SendMessageA( lphc->hWndLBox, LB_SETCARETINDEX, (WPARAM)idx, 0 ); … … 1150 1151 RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN ); 1151 1152 1152 ShowWindow( lphc->hWndLBox, SW_SHOWNA ); 1153 EnableWindow( lphc->hWndLBox, TRUE ); 1154 ShowWindow( lphc->hWndLBox, SW_SHOW); 1155 1153 1156 } 1154 1157 … … 1385 1388 1386 1389 case (EN_UPDATE >> 8): 1387 //SvL: Don't send updates either. (Realplayer 7 infinite loops) 1390 //SvL: Don't send updates either. (Realplayer 7 infinite loops) 1391 //CB: note: EN_UPDATE changes in Corel 20000317 1388 1392 /* 1389 1393 * In some circumstances (when the selection of the combobox … … 1399 1403 else 1400 1404 { 1401 1402 1405 CB_NOTIFY( lphc, CBN_EDITUPDATE ); 1406 } 1403 1407 break; 1404 1408 … … 1904 1908 { 1905 1909 LPHEADCOMBO lphc = (LPHEADCOMBO)GetInfoPtr(hwnd); 1910 INT CurSel = SendMessageA( lphc->hWndLBox, LB_GETCURSEL, 0, 0 ); 1906 1911 INT index = SendMessageA(lphc->hWndLBox,LB_SELECTSTRING,wParam,lParam); 1907 1912 … … 1909 1914 { 1910 1915 if( lphc->wState & CBF_EDIT ) 1911 CBUpdateEdit( lphc, index ); 1912 else 1913 InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE); 1916 { 1917 if (CurSel != index) 1918 CBUpdateEdit( lphc, index ); 1919 } else 1920 InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE); 1914 1921 } 1915 1922 -
trunk/src/user32/edit.cpp
r3028 r3153 1 /* $Id: edit.cpp,v 1.3 7 2000-03-06 22:39:03 sandervlExp $ */1 /* $Id: edit.cpp,v 1.38 2000-03-18 16:13:26 cbratschi Exp $ */ 2 2 /* 3 3 * Edit control … … 9 9 * Copyright 1999 Christoph Bratschi 10 10 * 11 * Corel version: 20000 21212 * WINE version: 99121211 * Corel version: 20000317 12 * (WINE version: 991212) 13 13 * 14 14 * Status: complete … … 590 590 case WM_GETDLGCODE: 591 591 //DPRINTF_EDIT_MSG32("WM_GETDLGCODE"); 592 result = (es->style & ES_MULTILINE) ? 593 DLGC_WANTALLKEYS | DLGC_HASSETSEL | DLGC_WANTCHARS | DLGC_WANTARROWS : 594 DLGC_HASSETSEL | DLGC_WANTCHARS | DLGC_WANTARROWS; 595 break; 592 result = DLGC_HASSETSEL | DLGC_WANTCHARS | DLGC_WANTARROWS; 593 if (es->style & ES_WANTRETURN) 594 { 595 LPMSG msg = (LPMSG)lParam; 596 if (msg && (msg->message == WM_KEYDOWN) && (msg->wParam == VK_RETURN)) 597 result |= DLGC_WANTMESSAGE; 598 } 599 break; 596 600 597 601 case WM_CHAR: … … 1259 1263 HLOCAL hNew32; 1260 1264 1261 if (size <= es->buffer_size)1262 return TRUE;1263 1265 if (size > es->buffer_limit) { 1264 1266 EDIT_NOTIFY_PARENT(hwnd, EN_MAXTEXT); 1265 1267 return FALSE; 1266 1268 } 1269 if (size <= es->buffer_size) 1270 return TRUE; 1267 1271 size = ((size / GROWLENGTH) + 1) * GROWLENGTH; 1268 1272 if (size > es->buffer_limit) … … 2222 2226 nyoff = MAX(0, es->y_offset + dy); 2223 2227 2224 //SvL: If nyoff > nr lines in control -> last line in control 2228 //SvL: If nyoff > nr lines in control -> last line in control 2225 2229 // window should show last line of control 2226 2230 // Wine code shows last line at the top of the control 2227 2231 // (Quake 3 startup edit control shows the problem) 2228 2232 if (nyoff >= es->line_count) { 2229 2230 nyoff = es->y_offset;//no need to scroll2231 2232 2233 if(es->line_count <= vlc) { 2234 nyoff = es->y_offset; //no need to scroll 2235 } 2236 else nyoff = es->line_count - vlc - 1; 2233 2237 } 2234 2238 dy = (es->y_offset - nyoff) * es->line_height; … … 4039 4043 while processing WM_SETTEXT */ 4040 4044 EDIT_NOTIFY_PARENT(hwnd, EN_CHANGE); 4041 es->flags &= EF_UPDATE;4045 es->flags &= ~EF_UPDATE; 4042 4046 } 4043 4047 } -
trunk/src/user32/listbox.cpp
r3144 r3153 1 /* $Id: listbox.cpp,v 1.2 3 2000-03-17 17:12:07cbratschi Exp $ */1 /* $Id: listbox.cpp,v 1.24 2000-03-18 16:13:30 cbratschi Exp $ */ 2 2 /* 3 3 * Listbox controls … … 6 6 * Copyright 1999 Christoph Bratschi (ported from WINE) 7 7 * 8 * Corel version: 20000 2129 * WINE version: 9912128 * Corel version: 20000317 9 * (WINE version: 991212) 10 10 * 11 11 * Status: ??? … … 26 26 #include "dbglocal.h" 27 27 28 /* Unimplemented yet:28 /* bugs: 29 29 - LBS_NOSEL 30 30 - LBS_USETABSTOPS … … 34 34 - VK_LINEDOWN -> bottom most item not always visible 35 35 - performance not optimized 36 - ownerdraw is broken -> toolbar customize dialog 37 - first item selection mark not redrawn on new selection 36 38 */ 37 39 … … 340 342 descr->width = rect.right - rect.left; 341 343 descr->height = rect.bottom - rect.top; 342 if (!(descr->style & LBS_NOINTEGRALHEIGHT) && ! IS_OWNERDRAW(descr))344 if (!(descr->style & LBS_NOINTEGRALHEIGHT) && !(descr->style & LBS_OWNERDRAWVARIABLE)) 343 345 { 344 346 if ((descr->height > descr->item_height) && … … 480 482 { 481 483 DRAWITEMSTRUCT dis; 482 UINT 484 UINT id = (descr->lphc) ? ID_CB_LISTBOX : GetWindowLongA(hwnd,GWL_ID); 483 485 484 486 if (!item) … … 879 881 INT i, col_pos = descr->page_size - 1; 880 882 RECT rect; 883 RECT focusRect = {-1, -1, -1, -1}; 881 884 HFONT oldFont = 0; 882 885 HBRUSH hbrush, oldBrush = 0; 883 886 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 887 INT focusItem; 884 888 885 889 SetRect( &rect, 0, 0, descr->width, descr->height ); … … 910 914 } 911 915 916 /* Paint all the item, regarding the selection 917 Focus state will be painted after */ 918 focusItem = descr->focus_item; 919 descr->focus_item = -1; 920 912 921 for (i = descr->top_item; i < descr->nb_items; i++) 913 922 { … … 917 926 rect.bottom = rect.top + descr->items[i].height; 918 927 928 if (i == focusItem) 929 { 930 /* keep the focus rect, to paint the focus item after */ 931 focusRect.left = rect.left; 932 focusRect.right = rect.right; 933 focusRect.top = rect.top; 934 focusRect.bottom = rect.bottom; 935 } 919 936 LISTBOX_DrawItem( hwnd, descr, hdc, &rect, i, ODA_DRAWENTIRE ); 920 937 rect.top = rect.bottom; … … 946 963 } 947 964 } 965 966 /* Paint the focus item now */ 967 descr->focus_item = focusItem; 968 if (focusRect.top != focusRect.bottom) 969 LISTBOX_DrawItem( hwnd, descr, hdc, &focusRect, descr->focus_item, ODA_FOCUS ); 948 970 949 971 if (!IS_OWNERDRAW(descr)) … … 1285 1307 BOOL fully_visible ) 1286 1308 { 1287 LISTBOX_SetCaretIndex( hwnd, descr, index, fully_visible ); 1309 INT oldfocus = descr->focus_item; 1310 1311 if ((index < 0) || (index >= descr->nb_items) || (oldfocus == index)) 1312 return; 1313 1314 /* Important, repaint need ot be done in this order if 1315 you want to mimic Windows behavior: 1316 1. Remove the focus and paint the item 1317 2. Remove the selection and paint the item(s) 1318 3. Set the selection and repaint the item(s) 1319 4. Set the focus to 'index' and repaint the item */ 1320 1321 /* 1. remove the focus and repaint the item */ 1322 descr->focus_item = -1; 1323 if ((oldfocus != -1) && descr->caret_on && (descr->in_focus)) 1324 LISTBOX_RepaintItem( hwnd, descr, oldfocus, ODA_FOCUS ); 1325 1326 /* 2. then turn off the previous selection */ 1327 /* 3. repaint the new selected item */ 1288 1328 if (descr->style & LBS_EXTENDEDSEL) 1289 1329 { 1290 1330 if (descr->anchor_item != -1) 1291 1331 { 1292 INT first = MIN( descr->focus_item, descr->anchor_item );1293 INT last = MAX( descr->focus_item, descr->anchor_item );1332 INT first = MIN( index, descr->anchor_item ); 1333 INT last = MAX( index, descr->anchor_item ); 1294 1334 if (first > 0) 1295 1335 LISTBOX_SelectItemRange( hwnd, descr, 0, first - 1, FALSE ); … … 1303 1343 LISTBOX_SetSelection( hwnd, descr, index, TRUE, FALSE ); 1304 1344 } 1345 1346 /* 4. repaint the new item with the focus */ 1347 descr->focus_item = index; 1348 LISTBOX_MakeItemVisible( hwnd, descr, index, fully_visible ); 1349 if (descr->caret_on && (descr->in_focus)) 1350 LISTBOX_RepaintItem( hwnd, descr, index, ODA_FOCUS ); 1305 1351 } 1306 1352 -
trunk/src/user32/menu.cpp
r2852 r3153 1 /* $Id: menu.cpp,v 1.1 8 2000-02-21 17:25:28cbratschi Exp $*/1 /* $Id: menu.cpp,v 1.19 2000-03-18 16:13:34 cbratschi Exp $*/ 2 2 /* 3 3 * Menu functions … … 9 9 * Copyright 1999 Christoph Bratschi 10 10 * 11 * Corel version: 20000 21212 * WINE version: 2000013011 * Corel version: 20000317 12 * (WINE version: 20000130) 13 13 * 14 14 * Status: ??? … … 614 614 615 615 if (((*hmenu)==0xffff) || (!(menu = MENU_GetMenu(*hmenu)))) return NULL; 616 if (!menu) return NULL; 616 617 if (wFlags & MF_BYPOSITION) 617 618 { … … 1630 1631 SetWindowPos( menu->hWnd, HWND_TOP, 0, 0, 0, 0, 1631 1632 SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE ); 1633 EnableWindow(menu->hWnd,TRUE); 1632 1634 UpdateWindow( menu->hWnd ); 1633 1635 return TRUE; … … 2370 2372 MENUITEM *item; 2371 2373 2372 2374 MENU_SwitchTracking( pmt, hPtMenu, id ); 2373 2375 2374 2376 … … 2376 2378 Test to see if we are trying to popup a submenu or not. 2377 2379 If we aren't, don't change the current menu pointer 2378 2380 and return. 2379 2381 */ 2380 2382 if (!(menu = (POPUPMENU *)MENU_GetMenu( hPtMenu ))) 2381 2383 { 2382 2384 pmt->hCurrentMenu = hPtMenu; 2383 2385 return TRUE; 2384 2386 } 2385 2387 … … 2388 2390 { 2389 2391 pmt->hCurrentMenu = hPtMenu; 2390 2392 return TRUE; 2391 2393 } 2392 2394 … … 2396 2398 { 2397 2399 pmt->hCurrentMenu = hPtMenu; 2398 2400 return TRUE; 2399 2401 } 2400 2402 2401 2402 /* 2403 If we made it this far, we want to pop up a submenu. Before we pop it up, 2404 we want a slight delay. This is implemented by remembering the ID of the menu 2405 where the mouse is currently positioned, and setting up a timer. When the 2406 timer fires (handled in MENU_TrackMenu() ), if the mouse is over the same 2407 submenu item, we popup it up. Otherwise, we do nothing. 2403 /* Check to see if we are trying to popup a toplevel menu or a 2404 submenu. Only the submenu has a delay. 2408 2405 */ 2409 KillTimer (pmt->hOwnerWnd, SUBMENU_POPUP_TIMERID); /* Just in case another timer was set up and not fired yet... */ 2410 if ( (SetTimer (pmt->hOwnerWnd, SUBMENU_POPUP_TIMERID, POPUP_MENU_DELAY, NULL)) != SUBMENU_POPUP_TIMERID) 2406 if (uSubPWndLevel) 2411 2407 { 2412 /* 2413 For some reason the timer wasn't set up properly... Revert to old 2414 functionality. 2415 */ 2416 2417 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hPtMenu, FALSE, wFlags,&pmt->pt); 2408 /* 2409 If we made it here, we want to pop up a submenu. Before we pop it up, 2410 we want a slight delay. This is implemented by remembering the ID of the menu 2411 where the mouse is currently positioned, and setting up a timer. When the 2412 timer fires (handled in MENU_TrackMenu() ), if the mouse is over the same 2413 submenu item, we popup it up. Otherwise, we do nothing. 2414 */ 2415 KillTimer (pmt->hOwnerWnd, SUBMENU_POPUP_TIMERID); /* Just in case another timer was set up and not fired yet... */ 2416 if ( (SetTimer (pmt->hOwnerWnd, SUBMENU_POPUP_TIMERID, POPUP_MENU_DELAY, NULL)) != SUBMENU_POPUP_TIMERID) 2417 { 2418 /* 2419 For some reason the timer wasn't set up properly... Revert to old 2420 functionality. 2421 */ 2422 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,hPtMenu,FALSE,wFlags,&pmt->pt); 2423 return TRUE; 2424 } 2425 } else 2426 { 2427 /* We are trying to popup a top level menu... so no delay */ 2428 2429 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hPtMenu, FALSE, wFlags,&pmt->pt); 2418 2430 return TRUE; 2419 }2431 } 2420 2432 2421 2433 mouseOverMenuID = id; … … 2695 2707 MTRACKER mt; 2696 2708 BOOL enterIdleSent = FALSE; 2709 BOOL bSysMenu; 2697 2710 2698 2711 mt.trackFlags = 0; … … 2709 2722 fEndMenu = FALSE; 2710 2723 if (!(menu = MENU_GetMenu(hmenu))) return FALSE; 2724 2725 bSysMenu = IS_SYSTEM_MENU(menu); 2711 2726 2712 2727 if (wFlags & TPM_BUTTONDOWN) … … 2754 2769 case WM_RBUTTONDOWN: 2755 2770 if (!(wFlags & TPM_RIGHTBUTTON)) break; 2756 /* fall through */2771 goto buttondown; 2757 2772 case WM_LBUTTONDBLCLK: 2773 if (bSysMenu && (hmenu == mt.hTopMenu)) 2774 { 2775 fEndMenu = TRUE; 2776 break; 2777 } 2778 /* fall through */ 2758 2779 case WM_LBUTTONDOWN: 2759 2780 /* If the message belongs to the menu, removes it from the queue */ 2760 2781 /* Else, end menu tracking */ 2782 2783 buttondown: 2784 /* Forcing mouse popup NOW - Ensure timer doesn't popup menu also */ 2785 mouseOverMenuID = -1; 2761 2786 fRemove = MENU_ButtonDown( &mt, hmenu, wFlags ); 2762 2787 fEndMenu = !fRemove; … … 2770 2795 if (hmenu) 2771 2796 { 2797 /* Forcing mouse popup NOW - Ensure timer doesn't popup menu also */ 2798 mouseOverMenuID = -1; 2772 2799 executedMenuId = MENU_ButtonUp( &mt, hmenu, wFlags); 2773 2800 … … 2791 2818 } /* switch(msg.message) - mouse */ 2792 2819 } 2793 2794 2795 2820 else if (msg.message == WM_TIMER) 2821 { 2822 UINT id = -1; 2796 2823 POPUPMENU *ptmenu = NULL; 2797 2824 2798 2825 if (isTimerSet) 2799 2826 { 2800 2827 /* 2801 2802 2803 2804 2805 2806 2828 If we get here, an attempt was made to pop up a submenu. 2829 (See MENU_MouseMove() ) 2830 */ 2831 2832 /* Get the ID of the menu item the mouse is over now. */ 2833 if( hmenu ) 2807 2834 { 2808 2835 ptmenu = (POPUPMENU *)MENU_GetMenu( hmenu ); … … 2811 2838 else 2812 2839 MENU_FindItemByCoords( ptmenu, mt.pt, &id ); 2840 2841 /* If it is over the same item that set up the timer originally .... */ 2842 if (mouseOverMenuID != -1 && mouseOverMenuID == id) 2843 { 2844 /* .... Pop up the menu */ 2845 mt.hCurrentMenu = MENU_ShowSubPopup(mt.hOwnerWnd, hmenu, FALSE, wFlags,&mt.pt); 2846 } 2813 2847 } 2814 2815 /* If it is over the same item that set up the timer 2816 originally .... */ 2817 if (mouseOverMenuID == id) 2818 { 2819 /* .... Pop up the menu */ 2820 mt.hCurrentMenu = MENU_ShowSubPopup(mt.hOwnerWnd, hmenu, FALSE, wFlags,&mt.pt); 2821 } 2822 2823 /* Reset the timer so it doesn't fire again. (So we are ready for the next 2824 attempt to popup a submenu... ) */ 2825 KillTimer (mt.hOwnerWnd, 100); 2826 isTimerSet = FALSE; 2827 } 2828 } 2848 2849 /* Reset the timer so it doesn't fire again. (So we are ready for the next 2850 attempt to popup a submenu... ) */ 2851 KillTimer(mt.hOwnerWnd,SUBMENU_POPUP_TIMERID); 2852 isTimerSet = FALSE; 2853 } 2854 } 2829 2855 else if ((msg.message >= WM_KEYFIRST) && (msg.message <= WM_KEYLAST)) 2830 2856 { … … 2866 2892 break; 2867 2893 2868 2869 2870 2871 2872 2873 2874 2875 else 2876 2877 2878 2879 2880 2881 2882 2883 2894 case VK_F1: 2895 { 2896 HELPINFO hi; 2897 hi.cbSize = sizeof(HELPINFO); 2898 hi.iContextType = HELPINFO_MENUITEM; 2899 if (menu->FocusedItem == NO_SELECTED_ITEM) 2900 hi.iCtrlId = 0; 2901 else 2902 hi.iCtrlId = menu->items[menu->FocusedItem].wID; 2903 hi.hItemHandle = hmenu; 2904 hi.dwContextId = menu->dwContextHelpID; 2905 hi.MousePos = msg.pt; 2906 //TRACE_(winhelp)("Sending HELPINFO_MENUITEM to 0x%08x\n", hwnd); 2907 SendMessageA(hwnd, WM_HELP, 0, (LPARAM)&hi); 2908 break; 2909 } 2884 2910 2885 2911 default: … … 2929 2955 } /* switch(msg.message) - kbd */ 2930 2956 } 2957 else if (msg.message == WM_SYSCOMMAND) 2958 { 2959 /* The user clicked on the system menu/button */ 2960 fEndMenu = TRUE; 2961 break; 2962 } 2931 2963 else 2932 2964 { -
trunk/src/user32/msgbox.c
r2804 r3153 1 /* $Id: msgbox.c,v 1. 2 2000-02-16 14:34:24 sandervlExp $ */1 /* $Id: msgbox.c,v 1.3 2000-03-18 16:13:37 cbratschi Exp $ */ 2 2 /* 3 3 * Message boxes (based on Wine code) … … 5 5 * Copyright 1995 Bernd Schmidt 6 6 * 7 * Corel WINE version: 20000317 7 8 * 8 9 */ … … 14 15 #include <heapstring.h> 15 16 16 #define DBG_LOCALLOG 17 #define DBG_LOCALLOG DBG_msgbox 17 18 #include "dbglocal.h" 18 19 … … 31 32 LPCSTR lpszText; 32 33 char buf[256]; 33 34 //// if (TWEAK_WineLook >= WIN95_LOOK) { 35 NONCLIENTMETRICSA nclm; 36 //// INT i; 37 nclm.cbSize = sizeof(NONCLIENTMETRICSA); 38 SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); 39 hFont = CreateFontIndirectA (&nclm.lfMessageFont); 40 /* set button font */ 41 for (i=1; i < 8; i++) 42 SendDlgItemMessageA (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0); 43 /* set text font */ 44 SendDlgItemMessageA (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0); 45 //// } 34 NONCLIENTMETRICSA nclm; 35 BOOL hasIcon = TRUE; 36 37 nclm.cbSize = sizeof(NONCLIENTMETRICSA); 38 SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); 39 hFont = CreateFontIndirectA (&nclm.lfMessageFont); 40 /* set button font */ 41 for (i=1; i < 8; i++) 42 SendDlgItemMessageA (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0); 43 /* set text font */ 44 SendDlgItemMessageA (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0); 45 46 46 if (HIWORD(lpmb->lpszCaption)) { 47 47 SetWindowTextA(hwnd, lpmb->lpszCaption); 48 48 } else { 49 49 if (LoadStringA(lpmb->hInstance, LOWORD(lpmb->lpszCaption), buf, sizeof(buf))) 50 50 SetWindowTextA(hwnd, buf); 51 51 } 52 52 if (HIWORD(lpmb->lpszText)) { … … 55 55 lpszText = buf; 56 56 if (!LoadStringA(lpmb->hInstance, LOWORD(lpmb->lpszText), buf, sizeof(buf))) 57 *buf = 0;/* FIXME ?? */57 *buf = 0; /* FIXME ?? */ 58 58 } 59 59 SetWindowTextA(GetDlgItem(hwnd, MSGBOX_IDTEXT), lpszText); … … 62 62 switch(lpmb->dwStyle & MB_TYPEMASK) { 63 63 case MB_OK: 64 65 64 ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE); 65 /* fall through */ 66 66 case MB_OKCANCEL: 67 68 69 70 71 72 67 ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE); 68 ShowWindow(GetDlgItem(hwnd, IDRETRY), SW_HIDE); 69 ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE); 70 ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE); 71 ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE); 72 break; 73 73 case MB_ABORTRETRYIGNORE: 74 75 76 77 78 74 ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE); 75 ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE); 76 ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE); 77 ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE); 78 break; 79 79 case MB_YESNO: 80 81 80 ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE); 81 /* fall through */ 82 82 case MB_YESNOCANCEL: 83 84 85 86 87 83 ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE); 84 ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE); 85 ShowWindow(GetDlgItem(hwnd, IDRETRY), SW_HIDE); 86 ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE); 87 break; 88 88 case MB_RETRYCANCEL: 89 90 91 92 93 94 89 ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE); 90 ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE); 91 ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE); 92 ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE); 93 ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE); 94 break; 95 95 } 96 96 /* Set the icon */ 97 97 switch(lpmb->dwStyle & MB_ICONMASK) { 98 98 case MB_ICONEXCLAMATION: 99 100 101 99 SendDlgItemMessageA(hwnd, stc1, STM_SETICON, 100 (WPARAM)LoadIconA(0, IDI_EXCLAMATIONA), 0); 101 break; 102 102 case MB_ICONQUESTION: 103 104 105 103 SendDlgItemMessageA(hwnd, stc1, STM_SETICON, 104 (WPARAM)LoadIconA(0, IDI_QUESTIONA), 0); 105 break; 106 106 case MB_ICONASTERISK: 107 108 109 107 SendDlgItemMessageA(hwnd, stc1, STM_SETICON, 108 (WPARAM)LoadIconA(0, IDI_ASTERISKA), 0); 109 break; 110 110 case MB_ICONHAND: 111 SendDlgItemMessageA(hwnd, stc1, STM_SETICON, 112 (WPARAM)LoadIconA(0, IDI_HANDA), 0); 113 break; 111 114 default: 112 SendDlgItemMessageA(hwnd, stc1, STM_SETICON, 113 (WPARAM)LoadIconA(0, IDI_HANDA), 0); 114 break; 115 } 116 115 /* By default, Windows 95/98/NT do not associate an icon to message boxes. 116 * So wine should do the same. 117 */ 118 hasIcon = FALSE; 119 ShowWindow(GetDlgItem(hwnd,stc1),SW_HIDE); 120 break; 121 } 122 117 123 /* Position everything */ 118 124 GetWindowRect(hwnd, &rect); … … 122 128 borheight -= rect.bottom - rect.top; 123 129 borwidth -= rect.right - rect.left; 124 130 125 131 /* Get the icon height */ 126 GetWindowRect(GetDlgItem(hwnd, MSGBOX_IDICON), &rect); 127 MapWindowPoints(0, hwnd, (LPPOINT)&rect, 2); 128 iheight = rect.bottom - rect.top; 129 ileft = rect.left; 130 iwidth = rect.right - ileft; 131 132 if (hasIcon) 133 { 134 GetWindowRect(GetDlgItem(hwnd, MSGBOX_IDICON), &rect); 135 MapWindowPoints(0, hwnd, (LPPOINT)&rect, 2); 136 iheight = rect.bottom - rect.top; 137 ileft = rect.left; 138 iwidth = rect.right - ileft; 139 } else 140 { 141 iheight = 0; 142 ileft = 0; 143 iwidth = 0; 144 } 145 132 146 hdc = GetDC(hwnd); 133 147 if (hFont) 134 135 148 hPrevFont = SelectObject(hdc, hFont); 149 136 150 /* Get the number of visible buttons and their size */ 137 151 bh = bw = 1; /* Minimum button sizes */ 138 152 for (buttons = 0, i = 1; i < 8; i++) 139 153 { 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 154 hItem = GetDlgItem(hwnd, i); 155 if (GetWindowLongA(hItem, GWL_STYLE) & WS_VISIBLE) 156 { 157 char buttonText[1024]; 158 int w, h; 159 buttons++; 160 if (GetWindowTextA(hItem, buttonText, sizeof buttonText)) 161 { 162 DrawTextA( hdc, buttonText, -1, &rect, DT_LEFT | DT_EXPANDTABS | DT_CALCRECT); 163 h = rect.bottom - rect.top; 164 w = rect.right - rect.left; 165 if (h > bh) bh = h; 166 if (w > bw) bw = w ; 167 } 168 } 155 169 } 156 170 bw = MAX(bw, bh * 2); … … 159 173 bw = bw * 2; 160 174 bspace = bw/3; /* Space between buttons */ 161 175 162 176 /* Get the text size */ 163 177 GetClientRect(GetDlgItem(hwnd, MSGBOX_IDTEXT), &rect); 164 178 rect.top = rect.left = rect.bottom = 0; 165 179 DrawTextA( hdc, lpszText, -1, &rect, 166 180 DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK | DT_CALCRECT); 167 181 /* Min text width corresponds to space for the buttons */ 168 182 tleft = 2 * ileft + iwidth; 169 183 twidth = MAX((bw + bspace) * buttons + bspace - tleft, rect.right); 170 184 theight = rect.bottom; 171 185 172 186 if (hFont) 173 187 SelectObject(hdc, hPrevFont); 174 188 ReleaseDC(hItem, hdc); 175 189 176 190 tiheight = 16 + MAX(iheight, theight); 177 191 wwidth = tleft + twidth + ileft + borwidth; 178 192 wheight = 8 + tiheight + bh + borheight; 179 193 180 194 /* Resize the window */ 181 195 SetWindowPos(hwnd, 0, 0, 0, wwidth, wheight, 182 183 196 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW); 197 184 198 /* Position the icon */ 185 199 SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDICON), 0, ileft, (tiheight - iheight) / 2, 0, 0, 186 187 200 SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW); 201 188 202 /* Position the text */ 189 203 SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDTEXT), 0, tleft, (tiheight - theight) / 2, twidth, theight, 190 191 204 SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW); 205 192 206 /* Position the buttons */ 193 207 bpos = (wwidth - (bw + bspace) * buttons + bspace) / 2; 194 208 for (buttons = i = 0; i < 7; i++) { 195 196 197 198 199 200 201 202 203 204 205 209 /* some arithmetic to get the right order for YesNoCancel windows */ 210 hItem = GetDlgItem(hwnd, (i + 5) % 7 + 1); 211 if (GetWindowLongA(hItem, GWL_STYLE) & WS_VISIBLE) { 212 if (buttons++ == ((lpmb->dwStyle & MB_DEFMASK) >> 8)) { 213 SetFocus(hItem); 214 SendMessageA( hItem, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE ); 215 } 216 SetWindowPos(hItem, 0, bpos, tiheight, bw, bh, 217 SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW); 218 bpos += bw + bspace; 219 } 206 220 } 207 221 return hFont; … … 216 230 static LRESULT CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message, 217 231 WPARAM wParam, LPARAM lParam ) 218 { 232 { 219 233 static HFONT hFont; 220 234 switch(message) { … … 222 236 hFont = MSGBOX_OnInit(hwnd, (LPMSGBOXPARAMSA)lParam); 223 237 return 0; 224 238 225 239 case WM_COMMAND: 226 240 switch (wParam) … … 235 249 EndDialog(hwnd, wParam); 236 250 if (hFont) 237 251 DeleteObject(hFont); 238 252 break; 239 253 } … … 287 301 LPSTR textA = HEAP_strdupWtoA( GetProcessHeap(), 0, text ); 288 302 INT ret; 289 303 290 304 ret = MessageBoxA( hwnd, textA, titleA, type ); 291 305 HeapFree( GetProcessHeap(), 0, titleA ); … … 333 347 return DialogBoxIndirectParamA( msgbox->hInstance, lpTemplate, 334 348 msgbox->hwndOwner, (DLGPROC)MSGBOX_DlgProc, 335 349 (LPARAM)msgbox ); 336 350 } 337 351 … … 341 355 INT WINAPI MessageBoxIndirectW( LPMSGBOXPARAMSW msgbox ) 342 356 { 343 MSGBOXPARAMSA 357 MSGBOXPARAMSA msgboxa; 344 358 345 359 memcpy(&msgboxa,msgbox,sizeof(msgboxa)); 346 if (msgbox->lpszCaption) 360 if (msgbox->lpszCaption) 347 361 lstrcpyWtoA((LPSTR)msgboxa.lpszCaption,msgbox->lpszCaption); 348 if (msgbox->lpszText) 362 if (msgbox->lpszText) 349 363 lstrcpyWtoA((LPSTR)msgboxa.lpszText,msgbox->lpszText); 350 364 351 365 return MessageBoxIndirectA(&msgboxa); 366 } 367 368 /************************************************************************** 369 * FatalAppExit32A (KERNEL32.108) 370 */ 371 void WINAPI FatalAppExitA( UINT action, LPCSTR str ) 372 { 373 //WARN("AppExit\n"); 374 MessageBoxA( 0, str, NULL, MB_SYSTEMMODAL | MB_OK ); 375 ExitProcess(0); 376 } 377 378 379 /************************************************************************** 380 * FatalAppExit32W (KERNEL32.109) 381 */ 382 void WINAPI FatalAppExitW( UINT action, LPCWSTR str ) 383 { 384 //WARN("AppExit\n"); 385 MessageBoxW( 0, str, NULL, MB_SYSTEMMODAL | MB_OK ); 386 ExitProcess(0); 352 387 } 353 388 -
trunk/src/user32/static.cpp
r2852 r3153 1 /* $Id: static.cpp,v 1.1 8 2000-02-21 17:25:29cbratschi Exp $ */1 /* $Id: static.cpp,v 1.19 2000-03-18 16:13:37 cbratschi Exp $ */ 2 2 /* 3 3 * Static control … … 7 7 * Copyright David W. Metcalfe, 1993 8 8 * 9 * Corel version: 20000 21210 * WINE version: 9909239 * Corel version: 20000317 10 * (WINE version: 990923) 11 11 * 12 12 * Status: complete … … 336 336 337 337 InvalidateRect(hwnd,NULL,FALSE); 338 UpdateWindow(hwnd);339 338 340 339 return TRUE; … … 726 725 if (!(hMemDC = CreateCompatibleDC( hdc ))) return; 727 726 728 729 730 731 732 733 727 GetObjectA(infoPtr->hIcon, sizeof(bm), &bm); 728 oldbitmap = SelectObject(hMemDC, infoPtr->hIcon); 729 730 // Paint the image in center area 731 if(dwStyle & SS_CENTERIMAGE) 732 { 734 733 SIZE szbm; 735 734 SIZE szdc; … … 765 764 } 766 765 767 768 766 SelectObject(hMemDC, oldbitmap); 767 DeleteDC(hMemDC); 769 768 } 770 769 } -
trunk/src/user32/win32class.cpp
r2860 r3153 1 /* $Id: win32class.cpp,v 1.1 5 2000-02-22 19:15:20 sandervlExp $ */1 /* $Id: win32class.cpp,v 1.16 2000-03-18 16:13:37 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 25 25 #include <win\winproc.h> 26 26 27 #define DBG_LOCALLOG 27 #define DBG_LOCALLOG DBG_win32class 28 28 #include "dbglocal.h" 29 29 … … 63 63 AsciiToUnicode(classNameA, classNameW); 64 64 } 65 66 65 classAtom = 0; 66 //SvL: If a system control has already be registered, use that atom instead 67 67 // of creating a new one 68 69 70 71 68 if(wndclass->style & CS_GLOBALCLASS) { 69 classAtom = GlobalFindAtomA(classNameA); 70 } 71 if(!classAtom) classAtom = GlobalAddAtomA(classNameA); 72 72 } 73 73 else { … … 77 77 } 78 78 if(!(wndclass->style & CS_GLOBALCLASS)) { 79 79 processId = GetCurrentProcess(); 80 80 } 81 81 menuNameA = 0; … … 100 100 } 101 101 else dprintf(("USER32: wndclass->lpszMenuName %X\n", menuNameA)); 102 dprintf(("USER32: wndclass->hIconSm %X\n", wndclass->hIconSm)); 102 103 103 104 nrExtraClassWords = wndclass->cbClsExtra; … … 362 363 case GCL_HICON: 363 364 return hIcon; 365 case GCL_HICONSM: 366 return hIconSm; 364 367 case GCL_HMODULE: 365 368 return hInstance; … … 428 431 hIcon = lNewVal; 429 432 break; 433 case GCL_HICONSM: 434 rc = hIconSm; 435 hIconSm = lNewVal; 436 break; 430 437 case GCL_HMODULE: 431 438 rc = hInstance; -
trunk/src/user32/win32class.h
r2834 r3153 1 /* $Id: win32class.h,v 1.1 0 2000-02-20 18:28:34cbratschi Exp $ */1 /* $Id: win32class.h,v 1.11 2000-03-18 16:13:38 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 45 45 46 46 HICON getIcon() { return hIcon; }; 47 HICON getIconSm() { return hIconSm; }; 47 48 HCURSOR getCursor() { return hCursor; }; 48 49 … … 87 88 PCHAR classNameA; 88 89 WCHAR *classNameW; 89 HICON hIconSm; 90 HICON hIconSm; //GCW_HICONSM 90 91 HDC hdcClass; 91 92 -
trunk/src/user32/win32wbase.cpp
r3144 r3153 1 /* $Id: win32wbase.cpp,v 1.17 3 2000-03-17 17:12:08 cbratschi Exp $ */1 /* $Id: win32wbase.cpp,v 1.174 2000-03-18 16:13:38 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 253 253 return FALSE; 254 254 } 255 /* Windows does this for overlapped windows 256 * (I don't know about other styles.) */ 257 if (cs->hwndParent == GetDesktopWindow() && (!(cs->style & WS_CHILD) || (cs->style & WS_POPUP))) 258 { 259 cs->hwndParent = 0; 260 } 255 261 } 256 262 else … … 927 933 if(fClick) 928 934 { 929 HWND hwndTop;935 HWND hwndTop; 930 936 931 937 /* Activate the window if needed */ … … 945 951 && (hwndTop != GetForegroundWindow()) ) 946 952 { 953 Win32BaseWindow *win32top = Win32BaseWindow::GetWindowFromHandle(hwndTop); 954 947 955 //SvL: Calling OSLibSetActiveWindow(hwndTop); causes focus problems 948 OSLibWinSetFocus(getOS2FrameWindowHandle());956 if (win32top) OSLibWinSetFocus(win32top->getOS2FrameWindowHandle()); 949 957 } 950 958 } … … 1659 1667 { 1660 1668 LRESULT result = 0; 1661 if (!windowClass) return result; 1669 1662 1670 /* Set the appropriate icon members in the window structure. */ 1663 1671 if (wParam == ICON_SMALL) … … 1673 1681 { 1674 1682 hIcon = (HICON)lParam; 1675 OSLibWinSetIcon(OS2HwndFrame,hIcon); 1683 if ((dwStyle & WS_CAPTION) == WS_CAPTION) 1684 OSLibWinSetIcon(OS2HwndFrame,hIcon); 1676 1685 } 1677 1686 } 1687 if ((Msg == WM_SETICON) && ((dwStyle & WS_CAPTION) == WS_CAPTION)) 1688 HandleNCPaint((HRGN)1); 1689 1678 1690 return result; 1679 1691 } … … 1950 1962 window = parentwindow; 1951 1963 } 1964 } 1965 //****************************************************************************** 1966 // Returns the big or small icon for the window, falling back to the 1967 // class as windows does. 1968 //****************************************************************************** 1969 HICON Win32BaseWindow::IconForWindow(WPARAM fType) 1970 { 1971 HICON hWndIcon; 1972 1973 if (fType == ICON_BIG) 1974 { 1975 if (hIcon) hWndIcon = hIcon; 1976 else if (windowClass && windowClass->getIcon()) hWndIcon = windowClass->getIcon(); 1977 else if (!(dwStyle & DS_MODALFRAME)) 1978 hWndIcon = LoadImageA(0,MAKEINTRESOURCEA(OIC_ODINICON),IMAGE_ICON,0,0,LR_DEFAULTCOLOR); 1979 else hWndIcon = 0; 1980 } else 1981 { 1982 if (hIconSm) hWndIcon = hIconSm; 1983 else if (hIcon) hWndIcon = hIcon; 1984 else if (windowClass && windowClass->getIconSm()) hWndIcon = windowClass->getIconSm(); 1985 else if (windowClass && windowClass->getIcon()) hWndIcon = windowClass->getIcon(); 1986 else if (!(dwStyle & DS_MODALFRAME)) 1987 hWndIcon = LoadImageA(0,MAKEINTRESOURCEA(OIC_ODINICON),IMAGE_ICON,0,0,LR_DEFAULTCOLOR); 1988 else hWndIcon = 0; 1989 } 1990 1991 return hWndIcon; 1952 1992 } 1953 1993 //****************************************************************************** … … 2700 2740 return value; 2701 2741 2702 value &= ~ (WS_VISIBLE | WS_CHILD); /* Some bits can't be changed this way (WINE) */2742 value &= ~WS_CHILD; /* Some bits can't be changed this way (WINE) */ 2703 2743 ss.styleOld = getStyle(); 2704 ss.styleNew = value | (ss.styleOld & (WS_VISIBLE | WS_CHILD));2744 ss.styleNew = value | (ss.styleOld & WS_CHILD); 2705 2745 dprintf(("SetWindowLong GWL_STYLE %x old %x new style %x", getWindowHandle(), ss.styleOld, ss.styleNew)); 2706 2746 SendInternalMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss); -
trunk/src/user32/win32wbase.h
r3127 r3153 1 /* $Id: win32wbase.h,v 1. 89 2000-03-16 19:19:11 sandervlExp $ */1 /* $Id: win32wbase.h,v 1.90 2000-03-18 16:13:39 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 192 192 HMENU GetSysMenu() { return hSysMenu; } 193 193 194 HICON GetIcon() { return hIcon; } 195 HICON GetSmallIcon() { return hIconSm; } 194 HICON IconForWindow(WPARAM fType); 196 195 197 196 void SetWindowRegion(HRGN hRegion) { hWindowRegion = hRegion; }; … … 442 441 filler:31; 443 442 public: 444 VOID setEraseBkgnd (BOOL erase) 445 BOOL needsEraseBkgnd() 443 VOID setEraseBkgnd (BOOL erase) { EraseBkgndFlag = erase; } 444 BOOL needsEraseBkgnd() { return EraseBkgndFlag; } 446 445 }; 447 446 -
trunk/src/user32/win32wbasenonclient.cpp
r2956 r3153 1 /* $Id: win32wbasenonclient.cpp,v 1.1 6 2000-03-01 13:30:06 sandervlExp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.17 2000-03-18 16:13:39 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 490 490 { 491 491 /* Check if there is an user icon */ 492 HICON hSysIcon = hIconSm; 493 if(!hSysIcon) hSysIcon = (HICON) GetClassLongA(Win32Hwnd,GCL_HICONSM); 494 495 /* If there is an icon associated with the window OR */ 496 /* If there is no hIcon specified and this is not a modal dialog, */ 497 /* there is a system menu icon. */ 498 if((hSysIcon != 0) || (!(dwStyle & DS_MODALFRAME))) 492 if (IconForWindow(ICON_SMALL)) 499 493 rect.left += GetSystemMetrics(SM_CYCAPTION) - 1; 500 494 } … … 644 638 else r = *rect; 645 639 646 hSysIcon = hIconSm; 647 648 /* if no small icon and no large icon, use class small icon */ 649 if (!hSysIcon && !hIcon) 650 hSysIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM); 651 652 /* otherwise use the large icon */ 653 if (!hSysIcon) hSysIcon = hIcon; 654 655 /* if all else fails, use the application icon. */ 656 if(!hSysIcon) hSysIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON); 657 658 /* If there is no hIcon specified or this is not a modal dialog, */ 659 /* get the default one. */ 660 if(hSysIcon == 0) 661 if (!(dwStyle & DS_MODALFRAME)) 662 hSysIcon = LoadImageA(0, MAKEINTRESOURCEA(OIC_ODINICON), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); 640 hSysIcon = IconForWindow(ICON_SMALL); 641 663 642 //CB: todo: add icons (including Odin icon) to user32.rc 664 643 if (hSysIcon) … … 1406 1385 1407 1386 if (!win32wnd) return 0; 1408 1409 /* Get small icon. */ 1410 HICON hAppIcon = win32wnd->GetSmallIcon(); 1411 1412 /* if no small icon and no large icon, use class small icon */ 1413 if (!hAppIcon && !win32wnd->GetIcon()) 1414 hAppIcon = (HICON) GetClassLongA(hwnd, GCL_HICONSM); 1415 1416 /* otherwise use the large icon it */ 1417 if (!hAppIcon) hAppIcon = win32wnd->GetIcon(); 1418 1419 /* if all else fails, use the application icon. */ 1420 if(!hAppIcon) hAppIcon = (HICON) GetClassLongA(hwnd, GCL_HICON); 1421 1422 DrawIconEx (hdc, pt.x, pt.y, hAppIcon, GetSystemMetrics(SM_CXSMICON), 1387 1388 DrawIconEx (hdc, pt.x, pt.y, win32wnd->IconForWindow(ICON_SMALL), 1389 GetSystemMetrics(SM_CXSMICON), 1423 1390 GetSystemMetrics(SM_CYSMICON), 0, 0, DI_NORMAL); 1424 1391 } -
trunk/src/user32/win32wmdiclient.cpp
r2852 r3153 1 /* $Id: win32wmdiclient.cpp,v 1.2 5 2000-02-21 17:25:32cbratschi Exp $ */1 /* $Id: win32wmdiclient.cpp,v 1.26 2000-03-18 16:13:40 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 6 6 * Copyright 1999 Daniela Engert (dani@ngrt.de) 7 7 * 8 * Parts based on Wine (windows\mdi.c) (990815) 8 * Parts based on Corel WINE (window\mdi.c: 20000317) 9 * (Parts based on Wine (windows\mdi.c) (990815)) 9 10 * 10 11 * Copyright 1994, Bob Amstadt … … 857 858 // In Win 95 look, the system menu is replaced by the child icon 858 859 859 /* Find small icon */ 860 HICON hIcon = child->GetSmallIcon(); 861 862 /* If no small icon or overwridden large icon, use class small icon.. */ 863 if (!hIcon && !child->GetIcon()) 864 hIcon = GetClassLongA(child->getWindowHandle(),GCL_HICONSM); 865 866 /* Use large icon */ 867 if (!hIcon) hIcon = child->GetIcon(); 868 869 /* If all else fails, use large class icon. */ 870 if (!hIcon) hIcon = GetClassLongA(child->getWindowHandle(),GCL_HICON); 860 /* Find icon */ 861 HICON hIcon = child->IconForWindow(ICON_SMALL); 871 862 872 863 if (hIcon) -
trunk/src/user32/windlgmsg.cpp
r2803 r3153 1 /* $Id: windlgmsg.cpp,v 1. 6 2000-02-16 14:28:25 sandervlExp $ */1 /* $Id: windlgmsg.cpp,v 1.7 2000-03-18 16:13:41 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 dialog message APIs for OS/2 … … 5 5 * Copyright 1999 Sander van Leeuwen (OS/2 port & adaption) 6 6 * 7 * Based on Wine code (990815: window\dialog.c) 7 * Based on Corel WINE code (20000317: window\dialog.c) 8 * (Based on Wine code (990815: window\dialog.c)) 8 9 * 9 10 * Copyright 1993, 1994, 1996 Alexandre Julliard … … 21 22 #include "win32dlg.h" 22 23 23 #define DBG_LOCALLOG 24 #define DBG_LOCALLOG DBG_windlgmsg 24 25 #include "dbglocal.h" 25 26 … … 176 177 } 177 178 /*********************************************************************** 179 * DIALOG_FindMsgDestination 180 * 181 * The messages that IsDialogMessage send may not go to the dialog 182 * calling IsDialogMessage if that dialog is a child, and it has the 183 * DS_CONTROL style set. 184 * We propagate up until we hit a that does not have DS_CONTROL, or 185 * whose parent is not a dialog. 186 */ 187 static HWND DIALOG_FindMsgDestination( HWND hwndDlg ) 188 { 189 while (GetWindowLongA(hwndDlg, GWL_STYLE) & DS_CONTROL) 190 { 191 Win32BaseWindow *pParent; 192 HWND hParent = GetParent(hwndDlg); 193 if (!hParent) break; 194 195 pParent = Win32BaseWindow::GetWindowFromHandle(hParent); 196 if (!pParent) break; 197 198 if (!pParent->IsDialog()) 199 break; 200 201 hwndDlg = hParent; 202 } 203 204 return hwndDlg; 205 } 206 207 /*********************************************************************** 178 208 * DIALOG_IsDialogMessage 179 209 */ 180 static BOOL DIALOG_IsDialogMessage( HWND hwnd, HWND hwndDlg, 181 UINT message, WPARAM wParam, 182 LPARAM lParam, BOOL *translate, 183 BOOL *dispatch, INT dlgCode ) 210 static BOOL DIALOG_IsDialogMessage( HWND hwndDlg, BOOL *translate, BOOL *dispatch, INT dlgCode, LPMSG msg ) 184 211 { 185 212 *translate = *dispatch = FALSE; 186 213 187 if (m essage == WM_PAINT)214 if (msg->message == WM_PAINT) 188 215 { 189 216 /* Apparently, we have to handle this one as well */ … … 193 220 194 221 /* Only the key messages get special processing */ 195 if ((m essage != WM_KEYDOWN) &&196 (m essage != WM_SYSCHAR) &&197 (m essage != WM_CHAR))222 if ((msg->message != WM_KEYDOWN) && 223 (msg->message != WM_SYSCHAR) && 224 (msg->message != WM_CHAR)) 198 225 return FALSE; 199 226 … … 204 231 } 205 232 206 switch(message) 233 hwndDlg = DIALOG_FindMsgDestination(hwndDlg); 234 235 switch(msg->message) 207 236 { 208 237 case WM_KEYDOWN: 209 switch( wParam)238 switch(msg->wParam) 210 239 { 211 240 case VK_TAB: … … 224 253 if (!(dlgCode & DLGC_WANTARROWS)) 225 254 { 226 BOOL fPrevious = ( wParam == VK_LEFT ||wParam == VK_UP);255 BOOL fPrevious = (msg->wParam == VK_LEFT || msg->wParam == VK_UP); 227 256 HWND hwndNext = 228 257 GetNextDlgGroupItem (hwndDlg, GetFocus(), fPrevious ); … … 252 281 253 282 } 254 } 255 return TRUE; 283 284 return TRUE; 285 } 256 286 } 257 287 *translate = TRUE; … … 263 293 264 294 case WM_SYSCHAR: 265 if (DIALOG_IsAccelerator( hwnd, hwndDlg,wParam ))295 if (DIALOG_IsAccelerator( msg->hwnd, hwndDlg, msg->wParam )) 266 296 { 267 297 /* don't translate or dispatch */ … … 287 317 288 318 dlgCode = SendMessageA( msg->hwnd, WM_GETDLGCODE, 0, (LPARAM)msg); 289 ret = DIALOG_IsDialogMessage( msg->hwnd, hwndDlg, msg->message, 290 msg->wParam, msg->lParam, 291 &translate, &dispatch, dlgCode ); 319 ret = DIALOG_IsDialogMessage(hwndDlg,&translate,&dispatch,dlgCode,msg); 292 320 if (translate) TranslateMessage( msg ); 293 321 if (dispatch) DispatchMessageA( msg ); … … 306 334 307 335 dlgCode = SendMessageW( msg->hwnd, WM_GETDLGCODE, 0, (LPARAM)msg); 308 ret = DIALOG_IsDialogMessage( msg->hwnd, hwndDlg, msg->message, 309 msg->wParam, msg->lParam, 310 &translate, &dispatch, dlgCode ); 336 ret = DIALOG_IsDialogMessage(hwndDlg,&translate,&dispatch,dlgCode,msg); 311 337 if (translate) TranslateMessage( msg ); 312 338 if (dispatch) DispatchMessageW( msg );
Note:
See TracChangeset
for help on using the changeset viewer.