Ignore:
Timestamp:
Jul 14, 1999, 11:05:59 PM (26 years ago)
Author:
cbratschi
Message:

several bugs fixed, RegisterClass works, CreateWindow on the way

File:
1 edited

Legend:

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

    r300 r304  
    1 /* $Id: oslibwin.cpp,v 1.1 1999-07-14 08:35:35 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.2 1999-07-14 21:05:58 cbratschi Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    2424  if(hwndParent == OSLIB_HWND_DESKTOP)
    2525  {
    26         hwndParent = HWND_DESKTOP;
     26        hwndParent = HWND_DESKTOP;
    2727  }
    2828
     
    4040
    4141  if(hwndParent == 0) {
    42         hwndParent = HWND_DESKTOP;
     42        hwndParent = HWND_DESKTOP;
    4343  }
    4444  if(WinQueryWindowRect(hwndParent, &rectl) == 0) {
    45         y = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, y);
     45        y = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, y);
    4646  }
    4747  if(dwFrameStyle) {
    48         dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs
    49         hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
    50                                        &dwFrameStyle, WIN32_STDCLASS,
     48        dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs
     49        hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
     50                                       &dwFrameStyle, WIN32_STDCLASS,
    5151                                       "", 0, 0, 0, &hwndClient) != 0;
    52         if(hwndFrame) {
    53                 if(pszName) {
    54                         WinSetWindowText(hwndFrame, pszName);
    55                 }
    56                 WinSetWindowPos(hwndFrame, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 
    57                                 x, y, cx, cy, SWP_SIZE | SWP_MOVE);
     52        if(hwndFrame) {
     53                if(pszName) {
     54                        WinSetWindowText(hwndFrame, pszName);
     55                }
     56                WinSetWindowPos(hwndFrame, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP,
     57                                x, y, cx, cy, SWP_SIZE | SWP_MOVE);
    5858
    59                 return hwndFrame;
    60         }
    61         return 0;
     59                return hwndFrame;
     60        }
     61        return 0;
    6262  }
    63   else  return WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, x, y, cx, cy,
     63  else  return WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, x, y, cx, cy,
    6464                               Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL,
    6565                               NULL);
     
    7474  /* Window styles */
    7575  if(dwStyle & WINWS_MINIMIZE)
    76         *OSWinStyle |= WS_MINIMIZED;
     76        *OSWinStyle |= WS_MINIMIZED;
    7777  if(dwStyle & WINWS_VISIBLE)
    78         *OSWinStyle |= WS_VISIBLE;
     78        *OSWinStyle |= WS_VISIBLE;
    7979  if(dwStyle & WINWS_DISABLED)
    80         *OSWinStyle |= WS_DISABLED;
     80        *OSWinStyle |= WS_DISABLED;
    8181  if(dwStyle & WINWS_CLIPSIBLINGS)
    82         *OSWinStyle |= WS_CLIPSIBLINGS;
     82        *OSWinStyle |= WS_CLIPSIBLINGS;
    8383  if(dwStyle & WINWS_CLIPCHILDREN)
    84         *OSWinStyle |= WS_CLIPCHILDREN;
     84        *OSWinStyle |= WS_CLIPCHILDREN;
    8585  if(dwStyle & WINWS_MAXIMIZE)
    86         *OSWinStyle |= WS_MAXIMIZED;
     86        *OSWinStyle |= WS_MAXIMIZED;
    8787  if(dwStyle & WINWS_GROUP)
    88         *OSWinStyle |= WS_GROUP;
     88        *OSWinStyle |= WS_GROUP;
    8989  if(dwStyle & WINWS_TABSTOP)
    90         *OSWinStyle |= WS_TABSTOP;
     90        *OSWinStyle |= WS_TABSTOP;
    9191
    9292  if(dwStyle & WINWS_CAPTION)
    93         *OSFrameStyle |= FCF_TITLEBAR;
     93        *OSFrameStyle |= FCF_TITLEBAR;
    9494  if(dwStyle & WINWS_BORDER)
    95         *OSFrameStyle |= FCF_BORDER;
     95        *OSFrameStyle |= FCF_BORDER;
    9696  if(dwStyle & WINWS_DLGFRAME)
    97         *OSFrameStyle |= FCF_DLGBORDER;
     97        *OSFrameStyle |= FCF_DLGBORDER;
    9898  if(dwStyle & WINWS_VSCROLL)
    99         *OSFrameStyle |= FCF_VERTSCROLL;
     99        *OSFrameStyle |= FCF_VERTSCROLL;
    100100  if(dwStyle & WINWS_HSCROLL)
    101         *OSFrameStyle |= FCF_HORZSCROLL;
     101        *OSFrameStyle |= FCF_HORZSCROLL;
    102102  if(dwStyle & WINWS_SYSMENU)
    103         *OSFrameStyle |= FCF_SYSMENU;
     103        *OSFrameStyle |= FCF_SYSMENU;
    104104  if(dwStyle & WINWS_THICKFRAME)
    105         *OSFrameStyle |= FCF_SIZEBORDER;        //??
     105        *OSFrameStyle |= FCF_SIZEBORDER;        //??
    106106  if(dwStyle & WINWS_MINIMIZEBOX)
    107         *OSFrameStyle |= FCF_MINBUTTON;
     107        *OSFrameStyle |= FCF_MINBUTTON;
    108108  if(dwStyle & WINWS_MAXIMIZEBOX)
    109         *OSFrameStyle |= FCF_MAXBUTTON;
     109        *OSFrameStyle |= FCF_MAXBUTTON;
    110110
    111111  return TRUE;
     
    115115BOOL OSLibWinSetWindowULong(HWND hwnd, ULONG offset, ULONG value)
    116116{
    117   return WinSetWindowULong(hwnd, offset, value) == 0;
     117  return WinSetWindowULong(hwnd, offset, value);
    118118}
    119119//******************************************************************************
     
    121121ULONG OSLibWinGetWindowULong(HWND hwnd, ULONG offset)
    122122{
    123   return WinGetWindowULong(hwnd, offset);
     123  return WinQueryWindowULong(hwnd, offset);
    124124}
    125125//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.