Changeset 1307 for trunk/src


Ignore:
Timestamp:
Oct 15, 1999, 12:03:16 PM (26 years ago)
Author:
sandervl
Message:

GetWindow + EB's message bugfixes

Location:
trunk/src/user32
Files:
3 edited

Legend:

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

    r1067 r1307  
    1 /* $Id: oslibmsg.cpp,v 1.3 1999-09-26 22:24:28 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.4 1999-10-15 10:03:14 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    2626#include <wprocess.h>
    2727
     28typedef BOOL (EXPENTRY FNTRANS)(MSG *, QMSG *);
     29typedef FNTRANS *PFNTRANS;
     30
     31typedef struct
     32{
     33   ULONG   msgOS2;
     34   ULONG   msgWin32;
     35// PFNTRANS toOS2;
     36// PFNTRANS toWIN32;
     37} MSGTRANSTAB, *PMSGTRANSTAB;
     38
     39#define MAX_MSGTRANSTAB 12
     40MSGTRANSTAB MsgTransTab[MAX_MSGTRANSTAB] = {
     41   0x0000, 0x0000,  // WM_NULL,            WM_NULL
     42   0x0070, 0x0200,  // WM_MOUSEMOVE,       WM_MOUSEMOVE
     43   0x0071, 0x0201,  // WM_BUTTON1DOWN,     WM_LBUTTONDOWN
     44   0x0072, 0x0202,  // WM_BUTTON1UP,       WM_LBUTTONUP
     45   0x0073, 0x0203,  // WM_BUTTON1DBLCLK,   WM_LBUTTONDBLCLK
     46   0x0074, 0x0204,  // WM_BUTTON2DOWN,     WM_RBUTTONDOWN
     47   0x0075, 0x0205,  // WM_BUTTON2UP,       WM_RBUTTONUP
     48   0x0076, 0x0206,  // WM_BUTTON2DBLCLK,   WM_RBUTTONDBLCLK
     49   0x0077, 0x0207,  // WM_BUTTON3DOWN,     WM_MBUTTONDOWN
     50   0x0078, 0x0208,  // WM_BUTTON3UP,       WM_MBUTTONUP
     51   0x0079, 0x0209,  // WM_BUTTON3DBLCLK,   WM_MBUTTONDBLCLK
     52   0x020a, 0x020a,  // WM_???,             WM_???
     53};
     54
    2855QMSG *MsgThreadPtr = 0;
    2956
     
    4471void WinToOS2MsgTranslate(MSG *winMsg, QMSG *os2Msg, BOOL isUnicode)
    4572{
     73  int i;
     74
    4675  memcpy(os2Msg, winMsg, sizeof(MSG));
     76  os2Msg->hwnd = Win32Window::Win32ToOS2Handle(winMsg->hwnd);
    4777  os2Msg->reserved = 0;
     78  for(i=0;i<MAX_MSGTRANSTAB;i++)
     79  {
     80    if(MsgTransTab[i].msgWin32 == winMsg->message)
     81    {
     82      os2Msg->msg = MsgTransTab[i].msgOS2;
     83      break;
     84    }
     85  }
    4886}
    4987//******************************************************************************
     
    5189void OS2ToWinMsgTranslate(QMSG *os2Msg, MSG *winMsg, BOOL isUnicode)
    5290{
     91  int i;
     92
    5393  memcpy(winMsg, os2Msg, sizeof(MSG));
    5494  winMsg->hwnd = Win32Window::OS2ToWin32Handle(os2Msg->hwnd);
     95  for(i=0;i<MAX_MSGTRANSTAB;i++)
     96  {
     97    if(MsgTransTab[i].msgOS2 == os2Msg->msg)
     98    {
     99      winMsg->message = MsgTransTab[i].msgWin32;
     100      break;
     101    }
     102  }
    55103}
    56104//******************************************************************************
     
    68116        thdb->fMsgTranslated = TRUE;
    69117  }
    70  
     118
     119  for(int i=0;i<MAX_MSGTRANSTAB;i++)
     120  {
     121    if(MsgTransTab[i].msgWin32 == msg)
     122    {
     123      return MsgTransTab[i].msgOS2;
     124    }
     125  }
     126
    71127  return 0;
    72128}
  • trunk/src/user32/win32wbase.cpp

    r1299 r1307  
    1 /* $Id: win32wbase.cpp,v 1.43 1999-10-14 19:31:32 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.44 1999-10-15 10:03:15 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    22582258 ULONG         magic;
    22592259 ULONG         getcmd = 0;
    2260  HWND          hwndRelated;
     2260 HWND          hwndRelated, hwnd;
    22612261
    22622262    dprintf(("GetWindow %x %d NOT COMPLETE", getWindowHandle(), uCmd));
     2263    hwnd = OS2Hwnd;
    22632264    switch(uCmd)
    22642265    {
     
    22682269        case GW_HWNDFIRST:
    22692270            if(getParent()) {
     2271                    hwnd = getParent()->getOS2WindowHandle();
    22702272                    getcmd = QWOS_TOP; //top of child windows
    22712273            }
     
    22742276        case GW_HWNDLAST:
    22752277            if(getParent()) {
     2278                    hwnd = getParent()->getOS2WindowHandle();
    22762279                    getcmd = QWOS_BOTTOM; //bottom of child windows
    22772280            }
     
    22902293            else    return 0;
    22912294    }
    2292     hwndRelated = OSLibWinQueryWindow(OS2Hwnd, getcmd);
     2295    hwndRelated = OSLibWinQueryWindow(hwnd, getcmd);
    22932296    if(hwndRelated)
    22942297    {
     2298        win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32WNDPTR);
     2299        magic    = OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32PM_MAGIC);
     2300        if(CheckMagicDword(magic) && win32wnd)
     2301        {
     2302            return win32wnd->getWindowHandle();
     2303        }
     2304
     2305    hwndRelated = OSLibWinWindowFromID(hwndRelated, OSLIB_FID_CLIENT);
    22952306        win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32WNDPTR);
    22962307        magic    = OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32PM_MAGIC);
  • trunk/src/user32/window.cpp

    r1297 r1307  
    1 /* $Id: window.cpp,v 1.15 1999-10-14 18:27:59 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.16 1999-10-15 10:03:16 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    400400{
    401401  Win32BaseWindow *window;
     402  HWND rc;
    402403
    403404    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     
    407408        return 0;
    408409    }
    409     dprintf(("GetWindow %x %d", hwnd, uCmd));
    410     return window->GetWindow(uCmd);
     410    rc = window->GetWindow(uCmd);
     411    dprintf(("GetWindow %x %d returned %x", hwnd, uCmd, rc));
     412    return rc;
    411413}
    412414//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.