Changeset 3153 for trunk/src/user32/windlgmsg.cpp
- Timestamp:
- Mar 18, 2000, 5:13:41 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.