Ignore:
Timestamp:
Dec 26, 1999, 6:30:20 PM (26 years ago)
Author:
cbratschi
Message:

non-client fixes, DefWndProc enhancements, several other bugs fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/windlgmsg.cpp

    r1205 r2204  
    1 /* $Id: windlgmsg.cpp,v 1.2 1999-10-08 21:30:52 cbratschi Exp $ */
     1/* $Id: windlgmsg.cpp,v 1.3 1999-12-26 17:30:20 cbratschi Exp $ */
    22/*
    33 * Win32 dialog message APIs for OS/2
     
    1616#include <os2win.h>
    1717#include <misc.h>
     18#include <string.h>
     19#include <ctype.h>
    1820#include "win32wbase.h"
    1921#include "win32dlg.h"
     
    5557    return 0;
    5658}
    57 //TODO
    58 #if 0
    5959/***********************************************************************
    6060 *           DIALOG_IsAccelerator
     
    6464    HWND hwndControl = hwnd;
    6565    HWND hwndNext;
    66     WND *wndPtr;
     66    Win32BaseWindow *win32wnd;
    6767    BOOL RetVal = FALSE;
    6868    INT dlgCode;
     
    8282        do
    8383        {
    84             wndPtr = WIN_FindWndPtr( hwndControl );
    85             if ( (wndPtr != NULL) &&
    86                  ((wndPtr->dwStyle & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE) )
     84            win32wnd = Win32BaseWindow::GetWindowFromHandle(hwndControl);
     85            if ( (win32wnd != NULL) &&
     86                 ((win32wnd->getStyle() & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE) )
    8787            {
    88                 dlgCode = SendMessageA( hwndControl, WM_GETDLGCODE, 0, 0 );
    89                 if ( (dlgCode & (DLGC_BUTTON | DLGC_STATIC)) &&
    90                      (wndPtr->text!=NULL))
     88              dlgCode = SendMessageA( hwndControl, WM_GETDLGCODE, 0, 0 );
     89              if (dlgCode & (DLGC_BUTTON | DLGC_STATIC))
     90              {
     91                INT textLen = win32wnd->GetWindowTextLength();
     92
     93                if (textLen > 0)
    9194                {
    9295                    /* find the accelerator key */
    93                     LPSTR p = wndPtr->text - 2;
     96                    char* text;
     97                    LPSTR p;
     98
     99                    text = (char*)malloc(textLen+1);
     100                    win32wnd->GetWindowTextA(text,textLen);
     101                    p = text - 2;
    94102                    do
    95103                    {
     
    102110                    {
    103111                        if ((dlgCode & DLGC_STATIC) ||
    104                             (wndPtr->dwStyle & 0x0f) == BS_GROUPBOX )
     112                            (win32wnd->getStyle() & 0x0f) == BS_GROUPBOX )
    105113                        {
    106114                            /* set focus to the control */
     
    115123                            /* send command message as from the control */
    116124                            SendMessageA( hwndDlg, WM_COMMAND,
    117                                 MAKEWPARAM( LOWORD(wndPtr->wIDmenu),
     125                                MAKEWPARAM( LOWORD(win32wnd->getWindowId()),
    118126                                    BN_CLICKED ),
    119127                                (LPARAM)hwndControl );
     
    126134                        }
    127135                        RetVal = TRUE;
    128             WIN_ReleaseWndPtr(wndPtr);
     136                        free(text);
    129137                        break;
    130138                    }
     139                    free(text);
    131140                }
     141              }
    132142        hwndNext = GetWindow( hwndControl, GW_CHILD );
    133143            }
     
    136146        hwndNext = 0;
    137147        }
    138             WIN_ReleaseWndPtr(wndPtr);
    139148        if (!hwndNext)
    140149        {
     
    163172    return RetVal;
    164173}
    165 #endif
    166174/***********************************************************************
    167175 *           DIALOG_IsDialogMessage
     
    251259        /* drop through */
    252260
    253 //TODO:
    254 #if 0
    255261    case WM_SYSCHAR:
    256262        if (DIALOG_IsAccelerator( hwnd, hwndDlg, wParam ))
     
    260266        }
    261267        break;
    262 #endif
    263268    }
    264269
Note: See TracChangeset for help on using the changeset viewer.