Ignore:
Timestamp:
Jul 18, 1999, 12:39:52 PM (26 years ago)
Author:
sandervl
Message:

Lots of changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/oslibwin.cpp

    r324 r325  
    1 /* $Id: oslibwin.cpp,v 1.9 1999-07-17 18:30:51 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.10 1999-07-18 10:39:51 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    2222#include "oslibutil.h"
    2323#include "oslibmsg.h"
     24#include "oslibgdi.h"
    2425#include "pmwindow.h"
    2526
     
    4142{
    4243 HWND  hwndClient;
    43  RECTL rectl;
    4444
    4545  dprintf(("WinCreateWindow %x %x %x %s", hwndParent, dwWinStyle, dwFrameStyle, pszName));
     
    5353  if(dwFrameStyle) {
    5454        dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs
     55        if(pszName)
     56                dwFrameStyle |= FCF_TITLEBAR;
     57
    5558        *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
    5659                                       &dwFrameStyle, WIN32_STDCLASS,
    57                                        "", 0, 0, 0, &hwndClient) != 0;
     60                                       "", 0, 0, 0, &hwndClient);
    5861        if(*hwndFrame) {
    59                 if(pszName) {
    60                         WinSetWindowText(*hwndFrame, pszName);
    61                 }
     62                if(pszName) {
     63                        WinSetWindowText(*hwndFrame, pszName);
     64                }
    6265                return hwndClient;
    6366        }
     
    158161//******************************************************************************
    159162//******************************************************************************
    160 LONG OSLibWinQueryWindowTextLength(HWND hwnd)
    161 {
    162   return WinQueryWindowTextLength(hwnd);
    163 }
    164 //******************************************************************************
    165 //******************************************************************************
    166 LONG OSLibWinQueryWindowText(HWND hwnd,LONG lLength,char* pun)
    167 {
    168   return WinQueryWindowText(hwnd,lLength,pun);
    169 }
    170163//******************************************************************************
    171164//******************************************************************************
     
    179172                          LONG cy, ULONG fl)
    180173{
    181  RECTL rectl;
    182  HWND  hwndParent;
    183 
    184174  if(fl & SWP_MOVE) {
    185         y = MapOS2ToWin32Y(hwnd, y);
    186   }
     175        y = MapOS2ToWin32Y(hwnd, cy, y);
     176  }
     177  dprintf(("WinSetWindowPos %x %x %d %d %d %d %x", hwnd, hwndInsertBehind, x, y, cx, cy, fl));
    187178  return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
    188179}
     
    198189  if(rc == 0)
    199190        dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
    200   rc = WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl);
     191  rc = WinSetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, fl);
    201192  if(rc == 0)
    202193        dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
     
    211202//******************************************************************************
    212203//******************************************************************************
    213 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect)
    214 {
    215   return WinQueryUpdateRect(hwnd, (RECTL *)pRect);
     204BOOL OSLibWinQueryUpdateRect(HWND hwnd, PRECT pRect)
     205{
     206 BOOL rc;
     207 RECTLOS2 rectl;
     208
     209  rc = WinQueryUpdateRect(hwnd, (PRECTL)&rectl);
     210  if(rc) {
     211        MapOS2ToWin32Rectl(hwnd, &rectl, pRect);
     212  }
     213  return rc;
    216214}
    217215//******************************************************************************
     
    296294//******************************************************************************
    297295//******************************************************************************
    298 inline ULONG OS2TOWIN32POINT(RECTL *parent, RECTL *child, ULONG y)
    299 {
    300   return (parent->yTop - parent->yBottom - (child->yTop - child->yBottom) - y - 1);
    301 }
    302 //******************************************************************************
    303 //******************************************************************************
    304 ULONG MapOS2ToWin32Y(HWND hwndChild)
    305 {
    306  HWND  hwndParent;
    307  RECTL rectParent = {0}, rectChild = {0};
    308 
    309    WinQueryWindowRect(hwndChild, &rectChild);
    310    hwndParent = WinQueryWindow(hwndChild, QW_PARENT);
    311    WinQueryWindowRect(hwndParent, &rectParent);
    312    return OS2TOWIN32POINT(&rectParent, &rectChild, rectChild.yBottom);
    313 }
    314 //******************************************************************************
    315 //******************************************************************************
    316 ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG y)
    317 {
    318  HWND  hwndParent;
    319  RECTL rectParent = {0}, rectChild = {0};
    320 
    321    WinQueryWindowRect(hwndChild, &rectChild);
    322    hwndParent = WinQueryWindow(hwndChild, QW_PARENT);
    323    WinQueryWindowRect(hwndParent, &rectParent);
    324    return OS2TOWIN32POINT(&rectParent, &rectChild, y);
    325 }
    326 //******************************************************************************
    327 //******************************************************************************
    328 ULONG MapOS2ToWin32Y(PRECTL rectParent, PRECTL rectChild, ULONG y)
    329 {
    330    return OS2TOWIN32POINT(rectParent, rectChild, y);
    331 }
    332 //******************************************************************************
    333 //******************************************************************************
    334 ULONG MapOS2ToWin32Y(PRECTL rectParent, HWND hwndChild, ULONG y)
    335 {
    336  RECTL rectChild = {0};
    337 
    338    WinQueryWindowRect(hwndChild, &rectChild);
    339    return OS2TOWIN32POINT(rectParent, &rectChild, y);
    340 }
    341 //******************************************************************************
    342 //******************************************************************************
    343 ULONG MapOS2ToWin32Y(HWND hwndChild, PRECTL rectChild, ULONG y)
    344 {
    345  HWND  hwndParent;
    346  RECTL rectParent = {0};
    347 
    348    hwndParent = WinQueryWindow(hwndChild, QW_PARENT);
    349    WinQueryWindowRect(hwndParent, &rectParent);
    350    return OS2TOWIN32POINT(&rectParent, rectChild, y);
    351 }
    352 //******************************************************************************
    353 //******************************************************************************
     296LONG OSLibWinQueryWindowTextLength(HWND hwnd)
     297{
     298  return WinQueryWindowTextLength(hwnd);
     299}
     300//******************************************************************************
     301//******************************************************************************
     302LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz)
     303{
     304  return WinQueryWindowText(hwnd, length, lpsz);
     305}
     306//******************************************************************************
     307//******************************************************************************
     308BOOL OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz)
     309{
     310  return WinSetWindowText(hwnd, lpsz);
     311}
     312//******************************************************************************
     313//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.