Ignore:
Timestamp:
Mar 18, 2000, 5:13:41 PM (25 years ago)
Author:
cbratschi
Message:

merged with Corel 20000317, small icon

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 sandervl Exp $ */
     1/* $Id: windlgmsg.cpp,v 1.7 2000-03-18 16:13:41 cbratschi Exp $ */
    22/*
    33 * Win32 dialog message APIs for OS/2
     
    55 * Copyright 1999 Sander van Leeuwen (OS/2 port & adaption)
    66 *
    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))
    89 *
    910 * Copyright 1993, 1994, 1996 Alexandre Julliard
     
    2122#include "win32dlg.h"
    2223
    23 #define DBG_LOCALLOG    DBG_windlgmsg
     24#define DBG_LOCALLOG    DBG_windlgmsg
    2425#include "dbglocal.h"
    2526
     
    176177}
    177178/***********************************************************************
     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 */
     187static 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/***********************************************************************
    178208 *           DIALOG_IsDialogMessage
    179209 */
    180 static BOOL DIALOG_IsDialogMessage( HWND hwnd, HWND hwndDlg,
    181                                     UINT message, WPARAM wParam,
    182                                     LPARAM lParam, BOOL *translate,
    183                                     BOOL *dispatch, INT dlgCode )
     210static BOOL DIALOG_IsDialogMessage( HWND hwndDlg, BOOL *translate, BOOL *dispatch, INT dlgCode, LPMSG msg )
    184211{
    185212    *translate = *dispatch = FALSE;
    186213
    187     if (message == WM_PAINT)
     214    if (msg->message == WM_PAINT)
    188215    {
    189216        /* Apparently, we have to handle this one as well */
     
    193220
    194221      /* Only the key messages get special processing */
    195     if ((message != WM_KEYDOWN) &&
    196         (message != WM_SYSCHAR) &&
    197         (message != WM_CHAR))
     222    if ((msg->message != WM_KEYDOWN) &&
     223        (msg->message != WM_SYSCHAR) &&
     224        (msg->message != WM_CHAR))
    198225        return FALSE;
    199226
     
    204231    }
    205232
    206     switch(message)
     233    hwndDlg = DIALOG_FindMsgDestination(hwndDlg);
     234
     235    switch(msg->message)
    207236    {
    208237    case WM_KEYDOWN:
    209         switch(wParam)
     238        switch(msg->wParam)
    210239        {
    211240        case VK_TAB:
     
    224253            if (!(dlgCode & DLGC_WANTARROWS))
    225254            {
    226                 BOOL fPrevious = (wParam == VK_LEFT || wParam == VK_UP);
     255                BOOL fPrevious = (msg->wParam == VK_LEFT || msg->wParam == VK_UP);
    227256                HWND hwndNext =
    228257                    GetNextDlgGroupItem (hwndDlg, GetFocus(), fPrevious );
     
    252281
    253282                }
    254             }
    255             return TRUE;
     283
     284                return TRUE;
     285            }
    256286        }
    257287        *translate = TRUE;
     
    263293
    264294    case WM_SYSCHAR:
    265         if (DIALOG_IsAccelerator( hwnd, hwndDlg, wParam ))
     295        if (DIALOG_IsAccelerator( msg->hwnd, hwndDlg, msg->wParam ))
    266296        {
    267297            /* don't translate or dispatch */
     
    287317
    288318    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);
    292320    if (translate) TranslateMessage( msg );
    293321    if (dispatch) DispatchMessageA( msg );
     
    306334
    307335    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);
    311337    if (translate) TranslateMessage( msg );
    312338    if (dispatch) DispatchMessageW( msg );
Note: See TracChangeset for help on using the changeset viewer.